-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
e2e test rework #173
e2e test rework #173
Changes from all commits
1f699de
4645da0
d18d16c
2fd3230
ebf141e
84ea290
b76e01f
ed1c2d4
0bdc33a
b7fd13e
fa8eb9b
4d0b467
e22c1ed
4946324
48ec59c
6d10f8a
1b50e7d
c4a66f4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
e2e | ||
lib | ||
example/dist |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
16.20.0 | ||
18.19.0 |
This file was deleted.
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'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In a similar way, a DSL around validating outputs could also be useful. I think having separate test setup, execution and validation snippets can be useful, which I think it where this is going. Ideally we're not verifying directly via logs, but collected output with post-execution validation (along with a more defined interface for the collected output) could work well. |
||
}); | ||
|
||
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); | ||
}); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In a future pass, maybe something like a fluent DSL would be useful here. We could likely achieve similar readability, without the need to parse. Would also make it simpler to extend for more nuanced cases.