-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[RNMobile] Audio block UI test (#28674)
* Added audio block test data to support UI tests. * Added the audio block to the blockNames used to add blocks * Added two UI tests for the Audio Block. * bumped audio block id to see if the full test suite on iOS will pass. * isAndroid is not a variable, it is a property so that was corrected. * inverted the expected assertion content for the File and Audio block. * Updated the id of the media item that is returned from the test WP Media
- Loading branch information
1 parent
66d46b3
commit 702c76e
Showing
5 changed files
with
44 additions
and
4 deletions.
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
packages/react-native-editor/__device-tests__/gutenberg-editor-audio.test.js
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,34 @@ | ||
/** | ||
* Internal dependencies | ||
*/ | ||
import { blockNames } from './pages/editor-page'; | ||
import testData from './helpers/test-data'; | ||
import { isAndroid } from './helpers/utils'; | ||
|
||
describe( 'Gutenberg Editor Audio Block tests', () => { | ||
it( 'should be able to add an audio block', async () => { | ||
await editorPage.addNewBlock( blockNames.audio ); | ||
const block = await editorPage.getFirstBlockVisible(); | ||
await expect( block ).toBeTruthy(); | ||
} ); | ||
|
||
it( 'should add an audio file to the block', async () => { | ||
const block = await editorPage.getFirstBlockVisible(); | ||
|
||
block.click(); | ||
|
||
if ( isAndroid() ) { | ||
await editorPage.driver.sleep( 5000 ); | ||
} else { | ||
await editorPage.driver.sleep( 1000 ); | ||
} | ||
|
||
await editorPage.chooseMediaLibrary(); | ||
|
||
const html = await editorPage.getHtmlContent(); | ||
|
||
expect( html.toLowerCase() ).toBe( | ||
testData.audioBlockPlaceholder.toLowerCase() | ||
); | ||
} ); | ||
} ); |
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