Skip to content

Commit

Permalink
EditorPage - Migrate initializeEditor to WebdriverIO
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerardo committed Oct 6, 2023
1 parent f9c55ef commit ff802a4
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ class EditorPage {
await launchApp( this.driver, { initialData, rawStyles, rawFeatures } );

// Stores initial values from the editor for different helpers.
const addButton =
await this.driver.elementsByAccessibilityId( ADD_BLOCK_ID );
const addButton = await this.driver.$$( `~${ ADD_BLOCK_ID }` );

if ( addButton.length !== 0 ) {
this.initialValues.addButtonLocation =
Expand Down Expand Up @@ -230,7 +229,7 @@ class EditorPage {
// renders blocks, it won't need to scroll down as it would find
// the block right away.
async scrollAndReturnElementByAccessibilityId( id ) {
const elements = await this.driver.elementsByAccessibilityId( id );
const elements = await this.driver.$$( `~${ id }` );

if ( elements.length === 0 ) {
await swipeUp( this.driver, undefined, 100, 1 );
Expand All @@ -240,7 +239,7 @@ class EditorPage {
}

async getLastElementByXPath( accessibilityLabel ) {
const elements = await this.driver.elementsByXPath(
const elements = await this.driver.$$(
`//*[contains(@${ this.accessibilityIdXPathAttrib }, "${ accessibilityLabel }")]`
);
return elements[ elements.length - 1 ];
Expand Down

0 comments on commit ff802a4

Please sign in to comment.