From 4970beb6f82e7278872cc2b550cfa081ea7ea24e Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Mon, 9 Oct 2023 15:47:02 -0400 Subject: [PATCH 1/4] test: Update getSearchBlockTextElement query Update syntax for WebdriverIO, which is a part of the Appium 2 upgrade. --- .../react-native-editor/__device-tests__/pages/editor-page.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 d102a7620a672a..61c5d60a44398c 100644 --- a/packages/react-native-editor/__device-tests__/pages/editor-page.js +++ b/packages/react-native-editor/__device-tests__/pages/editor-page.js @@ -843,7 +843,7 @@ class EditorPage { // ============================= async getSearchBlockTextElement( testID ) { - const child = await this.driver.elementByAccessibilityId( testID ); + const child = await this.driver.$( `~${ testID }` ); if ( isAndroid() ) { // Get the child EditText element of the ViewGroup returned by From 02fa83dc680de16540b24dd3a2ad4e38131defbc Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Mon, 9 Oct 2023 15:49:00 -0400 Subject: [PATCH 2/4] test: Update waitForElementToBeDisplayedByXPath query Update syntax for WebdriverIO, which is a part of the Appium 2 upgrade. --- .../__device-tests__/pages/editor-page.js | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 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 61c5d60a44398c..a4bed6c55c3b24 100644 --- a/packages/react-native-editor/__device-tests__/pages/editor-page.js +++ b/packages/react-native-editor/__device-tests__/pages/editor-page.js @@ -1,9 +1,3 @@ -/** - * External dependencies - */ -// eslint-disable-next-line import/no-extraneous-dependencies -const wd = null; // TODO: Replace this - /** * Internal dependencies */ @@ -989,11 +983,14 @@ class EditorPage { } async waitForElementToBeDisplayedByXPath( id, timeout = 2000 ) { - return await this.driver.waitForElementByXPath( - id, - wd.asserters.isDisplayed, - timeout - ); + const element = await this.driver.$( `${ id }` ); + + if ( element ) { + return element; + } + + await element.waitForDisplayed( { timeout } ); + return element; } } From 102390ac6dc32de1ea7ece47aba882f9bcd27e49 Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Mon, 9 Oct 2023 16:07:55 -0400 Subject: [PATCH 3/4] test: Update verifySearchElementText query Update syntax for WebdriverIO, which is a part of the Appium 2 upgrade. --- .../__device-tests__/gutenberg-editor-search.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-native-editor/__device-tests__/gutenberg-editor-search.test.js b/packages/react-native-editor/__device-tests__/gutenberg-editor-search.test.js index 95082777711b33..6aea27dab063a2 100644 --- a/packages/react-native-editor/__device-tests__/gutenberg-editor-search.test.js +++ b/packages/react-native-editor/__device-tests__/gutenberg-editor-search.test.js @@ -151,7 +151,7 @@ const verifySearchElementText = async ( testId, expected ) => { if ( isAndroid() ) { const input = await editorPage.getSearchBlockTextElement( testId ); - const inputValue = await input.text(); + const inputValue = await input.getText(); actual = inputValue.trim(); } else { actual = await editorPage.getHtmlContent(); From 3cd860cc4760c2da9dafac75363a6822c2349e94 Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Mon, 9 Oct 2023 16:08:25 -0400 Subject: [PATCH 4/4] test: Update getSearchBlockTextElement query Update syntax for WebdriverIO, which is a part of the Appium 2 upgrade. --- .../react-native-editor/__device-tests__/pages/editor-page.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 a4bed6c55c3b24..b4a433d5c1ab9f 100644 --- a/packages/react-native-editor/__device-tests__/pages/editor-page.js +++ b/packages/react-native-editor/__device-tests__/pages/editor-page.js @@ -842,7 +842,7 @@ class EditorPage { if ( isAndroid() ) { // Get the child EditText element of the ViewGroup returned by // elementByAccessibilityId. - return await child.elementByClassName( 'android.widget.EditText' ); + return await child.$( 'android.widget.EditText' ); } return child;