Skip to content

Commit

Permalink
Mobile - E2E test - Update code to use the new navigateUp helper (#50736
Browse files Browse the repository at this point in the history
)

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

* Mobile - E2E helpers - Update navigateUp helper to include recursive option with a false default value

* Mobile - E2E Helpers - Rename navigateUp to moveBlockSelectionUp with toRoot as options param

* Mobile - E2E test - Update usage of navigateUp to new moveBlockSelectionUp name
  • Loading branch information
Gerardo Pacheco authored May 18, 2023
1 parent 0146b37 commit 714d1f0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
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

0 comments on commit 714d1f0

Please sign in to comment.