-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
[RNMobile] Audio and File block test click delay on iOS too #39381
[RNMobile] Audio and File block test click delay on iOS too #39381
Conversation
Size Change: +57 B (0%) Total Size: 1.16 MB
ℹ️ View Unchanged
|
packages/react-native-editor/__device-tests__/gutenberg-editor-audio.test.js
Outdated
Show resolved
Hide resolved
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.
LGTM 🎊 ! I checked the E2E tests for Audio and File blocks locally, and both passed 🟢 .
As a side note, while testing the E2E tests, I found one of the potential causes of the random failures we often experience in GB-mobile repository. In both tests of Audio and File blocks, looks like the second test case relies on the results of the first one, specifically, it tries to query a block added in the previous test. Since Jest doesn't guarantee that test cases are run in order, it's not recommended to follow this practice. Each test case should be run isolated from the rest and should work.
gutenberg/packages/react-native-editor/__device-tests__/gutenberg-editor-audio.test.js
Lines 9 to 20 in 7d39bec
it( 'should be able to add an audio block', async () => { | |
await editorPage.addNewBlock( blockNames.audio ); | |
await editorPage.driver.sleep( 1000 ); | |
await editorPage.closePicker(); | |
const block = await editorPage.getFirstBlockVisible(); | |
await expect( block ).toBeTruthy(); | |
} ); | |
it( 'should add an audio file to the block', async () => { | |
const block = await editorPage.getFirstBlockVisible(); |
gutenberg/packages/react-native-editor/__device-tests__/gutenberg-editor-file-@canary.test.js
Lines 9 to 20 in 7d39bec
it( 'should be able to add a file block', async () => { | |
await editorPage.addNewBlock( blockNames.file ); | |
await editorPage.driver.sleep( 1000 ); | |
await editorPage.closePicker(); | |
const block = await editorPage.getFirstBlockVisible(); | |
await expect( block ).toBeTruthy(); | |
} ); | |
it( 'should add a file to the block', async () => { | |
const block = await editorPage.getFirstBlockVisible(); |
Ah, good point. I wasn't going to deal with this in this PR but we might as well do it. WDYT about consolidating the 2 tests into one? Not ideal to have a test do more things but, I feel like for a UI test it's not that bad (unless the test becomes more flaky). EDIT: we discussed it in Slack and it's fine to go ahead with consolidating. |
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.
Just added a couple of comments regarding the test description after the consolidation, apart from that, the PR looks great to me 🎊 .
packages/react-native-editor/__device-tests__/gutenberg-editor-file-@canary.test.js
Outdated
Show resolved
Hide resolved
packages/react-native-editor/__device-tests__/gutenberg-editor-audio.test.js
Outdated
Show resolved
Hide resolved
…s#39381) * Audio block click delay on iOS too * Same treatment to the file block * Introduce a waitForMediaLibrary tests helper * Use waitForMediaLibrary in audio and file tests * Consolidate the 2 audio tests into 1 * Consolidate the 2 file tests into 1 * Add some inline comments on the audio, file tests * More accurate test description
What?
This PR updates a native mobile UI test to wait a bit longer on iOS for the media picker popup to appear.
Related PRs
Why?
Looks like the audio block test can be flaky and judging from the video of the failed test, the media picker popup (that harbors the "WordPress Media Library" option under test) can take a while to appear.
While developing this PR, the similar File block test failed so, this PR applies the same treatment to that test well.
How?
This PR brings the delay up to the 5secs from 1sec, matching the one for Android.
Testing Instructions
No particular test instructions. UI tests should be green still.