Skip to content
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

Mobile - E2E test - Update code to use the new navigateUp helper #50736

Merged
merged 4 commits into from
May 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,7 @@ onlyOniOS( 'Gutenberg Editor Cover Block test', () => {
expect( coverBlock ).toBeTruthy();

// Navigate upwards to select parent block
const navigateUpElement =
await editorPage.waitForElementToBeDisplayedById( 'Navigate Up' );
await navigateUpElement.click();
await editorPage.moveBlockSelectionUp();
await editorPage.removeBlockAtPosition( blockNames.cover );
} );

Expand All @@ -150,9 +148,7 @@ onlyOniOS( 'Gutenberg Editor Cover Block test', () => {
);
await coverBlock.click();
// Navigate upwards to select parent block
const navigateUpElement =
await editorPage.waitForElementToBeDisplayedById( 'Navigate Up' );
await navigateUpElement.click();
await editorPage.moveBlockSelectionUp();

await editorPage.openBlockSettings();
await editorPage.clickAddMediaFromCoverBlock();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ class EditorPage {
await toolBarButton.click();
}

async navigateUp() {
async moveBlockSelectionUp( options = { toRoot: false } ) {
let navigateUpElements = [];
do {
await this.driver.sleep( 2000 );
Expand All @@ -509,6 +509,9 @@ class EditorPage {
if ( navigateUpElements.length > 0 ) {
await navigateUpElements[ 0 ].click();
}
if ( ! options.toRoot ) {
break;
}
} while ( navigateUpElements.length > 0 );
}

Expand Down