From ff802a4e727bf2610dde6feb01bdf71b3ca6e0f1 Mon Sep 17 00:00:00 2001 From: Gerardo Date: Fri, 6 Oct 2023 12:46:33 +0200 Subject: [PATCH] EditorPage - Migrate initializeEditor to WebdriverIO --- .../__device-tests__/pages/editor-page.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/react-native-editor/__device-tests__/pages/editor-page.js b/packages/react-native-editor/__device-tests__/pages/editor-page.js index 4dcfb2bd2a3e4e..4d4993afc3d33b 100644 --- a/packages/react-native-editor/__device-tests__/pages/editor-page.js +++ b/packages/react-native-editor/__device-tests__/pages/editor-page.js @@ -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 = @@ -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 ); @@ -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 ];