Skip to content

Commit

Permalink
e2e test rework (#173)
Browse files Browse the repository at this point in the history
  • Loading branch information
dawhitla authored Feb 16, 2024
1 parent 162f87b commit 61df02f
Show file tree
Hide file tree
Showing 21 changed files with 1,298 additions and 725 deletions.
2 changes: 1 addition & 1 deletion .detoxrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"testRunner": {
"$0": "jest",
"args": {
"config": "e2e/jest.config.js"
"config": "e2e/jest.config.ts"
}
},
"apps": {
Expand Down
1 change: 0 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
e2e
lib
example/dist
37 changes: 19 additions & 18 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ jobs:
setup:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
node_modules
example/ios/Pods
example/ios/build
example/node_modules
key: ${{ runner.os }}-setup-cache-2
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
Expand All @@ -28,16 +28,16 @@ jobs:
runs-on: macos-latest
needs: setup
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
node_modules
example/ios/Pods
example/ios/build
example/node_modules
key: ${{ runner.os }}-setup-cache-2
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
Expand All @@ -49,16 +49,16 @@ jobs:
runs-on: macos-latest
needs: setup
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
node_modules
example/ios/Pods
example/ios/build
example/node_modules
key: ${{ runner.os }}-setup-cache-2
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
Expand All @@ -68,16 +68,16 @@ jobs:
runs-on: macos-latest
needs: [lint, test]
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
node_modules
example/ios/Pods
example/ios/build
example/node_modules
key: ${{ runner.os }}-setup-cache-2
- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: |
example/ios/build
Expand All @@ -91,7 +91,7 @@ jobs:
HOMEBREW_NO_AUTO_UPDATE: 1
HOMEBREW_NO_INSTALL_CLEANUP: 1

- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
Expand All @@ -105,16 +105,16 @@ jobs:
runs-on: macos-latest
needs: [lint, test]
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
node_modules
example/ios/Pods
example/ios/build
example/node_modules
key: ${{ runner.os }}-setup-cache-2
- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: |
android/build
Expand Down Expand Up @@ -144,17 +144,18 @@ jobs:
$ANDROID_HOME/platform-tools/adb devices
echo "emulator started"
- uses: actions/setup-java@v3
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '11'
cache: gradle

- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'

- run: yarn add [email protected] -D
- run: yarn e2e:build:android:release
- run: yarn e2e:test:android:release

Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16.20.0
18.19.0
57 changes: 0 additions & 57 deletions e2e/advancedPlayer.e2e.js

This file was deleted.

55 changes: 55 additions & 0 deletions e2e/basicProps.e2e.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/* eslint-env detox/detox, jest/globals */
import {
afterAllTestPlan,
beforeAllTestPlan,
waitForClearLogs,
waitForTestPlan,
waitForLogLabel,
waitForTap,
} from './testPlan';

describe('Basic Props', () => {
beforeAll(beforeAllTestPlan);
afterAll(afterAllTestPlan);

it('paused controls playback state', async () => {
await waitForTestPlan(`
inputs:
- paused: true
events:
- onPlayerStateChange
`);
await waitForTap(by.id('paused'));
await waitForLogLabel('onPlayerStateChange ::: Playing');
});

it('paused controls playback state', async () => {
await waitForTestPlan(`
inputs:
- paused: false
events:
- onPlayerStateChange
`);
await waitForLogLabel('onPlayerStateChange ::: Playing');
await waitForTap(by.id('paused'));
await waitForLogLabel('onPlayerStateChange ::: Idle');
});

it('autoMaxQuality controls highest quality picked on auto', async () => {
await waitForTestPlan(`
inputs:
- autoMaxQuality
events:
- onQualityChange
`);
await waitForLogLabel('onQualityChange ::: name ::: 720p', 24);
await waitForClearLogs();
// bump down
await waitForTap(by.id('autoMaxQuality:480p'));
await waitForLogLabel('onQualityChange ::: name ::: 480p', 24);
await waitForClearLogs();
// back to max
await waitForTap(by.id('autoMaxQuality:720p'));
await waitForLogLabel('onQualityChange ::: name ::: 720p', 24);
});
});
Loading

0 comments on commit 61df02f

Please sign in to comment.