Skip to content

Commit

Permalink
update edit text xpath to be read from any level
Browse files Browse the repository at this point in the history
  • Loading branch information
jostnes committed May 12, 2022
1 parent 58d9e90 commit 92ffc5e
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -545,10 +545,9 @@ class EditorPage {

async getNumberOfParagraphBlocks() {
const paragraphBlockLocator = isAndroid()
? `//android.view.ViewGroup[contains(@content-desc, "Paragraph Block. Row")]/android.widget.EditText`
? `//android.view.ViewGroup[contains(@content-desc, "Paragraph Block. Row")]//android.widget.EditText`
: `(//XCUIElementTypeButton[contains(@name, "Paragraph Block. Row")])`;

await waitForVisible( this.driver, paragraphBlockLocator );
const locator = await this.driver.elementsByXPath(
paragraphBlockLocator
);
Expand Down Expand Up @@ -594,7 +593,7 @@ class EditorPage {
: `//XCUIElementTypeButton[contains(@name, "List")]//XCUIElementTypeTextView`;

const listBlockTextLocator = isAndroid()
? `//android.view.ViewGroup[contains(@content-desc, "List Block. Row ${ position }")]/android.widget.EditText`
? `//android.view.ViewGroup[contains(@content-desc, "List Block. Row ${ position }")]//android.widget.EditText`
: listBlockTextLocatorIOS;

return await waitForVisible( this.driver, listBlockTextLocator );
Expand Down

0 comments on commit 92ffc5e

Please sign in to comment.