forked from henninghall/react-native-date-picker
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Henning Hall
committed
Feb 5, 2020
1 parent
e6654a5
commit 30b3bb3
Showing
52 changed files
with
12,340 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
name: "Android: build & test" | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
build_and_test: | ||
name: Build & test | ||
runs-on: macos-latest | ||
timeout-minutes: 30 | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v1 | ||
with: | ||
fetch-depth: 1 | ||
|
||
- name: Node | ||
uses: actions/setup-node@v1 | ||
|
||
- name: Use specific Java version for sdkmanager to work | ||
uses: joschi/setup-jdk@v1 | ||
with: | ||
java-version: 'openjdk8' | ||
architecture: 'x64' | ||
|
||
- name: Download Android Emulator Image | ||
run: | | ||
echo "y" | $ANDROID_HOME/tools/bin/sdkmanager --install "system-images;android-29;google_apis;x86" | ||
echo "no" | $ANDROID_HOME/tools/bin/avdmanager create avd --force --name emu --device "Nexus 5X" -k 'system-images;android-29;google_apis;x86' | ||
$ANDROID_HOME/emulator/emulator -list-avds | ||
- name: Install npm dependencies | ||
working-directory: ./examples/detox | ||
run: | | ||
yarn install --frozen-lockfile | ||
- name: Build | ||
working-directory: ./examples/detox | ||
run: | | ||
yarn build:android-ci | ||
- name: Start android emulator | ||
working-directory: ./examples/detox | ||
continue-on-error: true | ||
run: | | ||
echo "Starting emulator" | ||
nohup $ANDROID_HOME/emulator/emulator -avd emu -no-audio -no-snapshot -no-window & | ||
$ANDROID_HOME/platform-tools/adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed | tr -d '\r') ]]; do sleep 1; done; input keyevent 82' | ||
$ANDROID_HOME/platform-tools/adb devices | ||
echo "Emulator started" | ||
- name: Run tests | ||
working-directory: ./examples/detox | ||
run: yarn start & yarn test:android-ci | ||
|
||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v1 | ||
if: failure() | ||
with: | ||
name: Failing tests | ||
path: ./examples/detox/artifacts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
rootProject.name = 'DetoxRNExample' | ||
include ':react-native-date-picker' | ||
project(':react-native-date-picker').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-date-picker/android') | ||
project(':react-native-date-picker').projectDir = new File(rootProject.projectDir, '../../../android') | ||
|
||
include ':app' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
--recursive | ||
--timeout 300000 | ||
--bail | ||
--file e2e/init.js | ||
--slow 30000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
const { scrollWheel, expectDate } = require("../../utils") | ||
|
||
|
||
describe('Hour wheel', () => { | ||
|
||
before(async () => { | ||
await device.reloadReactNative() | ||
await element(by.text('Advanced')).tap() | ||
}) | ||
|
||
it('should have 24 hours', async () => { | ||
await scroll3HoursAndExpect("2000-01-01 03:00:00") | ||
await scroll3HoursAndExpect("2000-01-01 06:00:00") | ||
await scroll3HoursAndExpect("2000-01-01 09:00:00") | ||
await scroll3HoursAndExpect("2000-01-01 12:00:00") | ||
await scroll3HoursAndExpect("2000-01-01 15:00:00") | ||
await scroll3HoursAndExpect("2000-01-01 18:00:00") | ||
await scroll3HoursAndExpect("2000-01-01 21:00:00") | ||
await scroll3HoursAndExpect("2000-01-01 00:00:00") | ||
}) | ||
|
||
const scroll3HoursAndExpect = async (date) => { | ||
await scrollWheel(1, 3) | ||
await expectDate(date) | ||
} | ||
|
||
}) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
const { setMode } = require("../../utils") | ||
|
||
describe('Modes - 24h', () => { | ||
|
||
before(async () => { | ||
await device.reloadReactNative() | ||
await element(by.text('Advanced')).tap() | ||
}) | ||
|
||
it('datetime', async () => { | ||
await setMode("datetime") | ||
|
||
await expect(element(by.id('day'))).toBeVisible() | ||
await expect(element(by.id('minutes'))).toBeVisible() | ||
await expect(element(by.id('hour'))).toBeVisible() | ||
|
||
await expect(element(by.id('ampm'))).toNotExist() | ||
await expect(element(by.id('month'))).toNotExist() | ||
await expect(element(by.id('date'))).toNotExist() | ||
await expect(element(by.id('year'))).toNotExist() | ||
}) | ||
|
||
it('date', async () => { | ||
await setMode("date") | ||
|
||
await expect(element(by.id('month'))).toBeVisible() | ||
await expect(element(by.id('date'))).toBeVisible() | ||
await expect(element(by.id('year'))).toBeVisible() | ||
|
||
await expect(element(by.id('day'))).toNotExist() | ||
await expect(element(by.id('minutes'))).toNotExist() | ||
await expect(element(by.id('hour'))).toNotExist() | ||
await expect(element(by.id('ampm'))).toNotExist() | ||
}) | ||
|
||
it('time', async () => { | ||
await setMode("time") | ||
|
||
await expect(element(by.id('minutes'))).toBeVisible() | ||
await expect(element(by.id('hour'))).toBeVisible() | ||
|
||
await expect(element(by.id('ampm'))).toNotExist() | ||
await expect(element(by.id('day'))).toNotExist() | ||
await expect(element(by.id('month'))).toNotExist() | ||
await expect(element(by.id('date'))).toNotExist() | ||
await expect(element(by.id('year'))).toNotExist() | ||
}) | ||
|
||
}) |
Oops, something went wrong.