From 050f4d8a2659ca093fd5d4c5d42f6b23a5f56a8b Mon Sep 17 00:00:00 2001 From: Vladimir D Date: Thu, 13 Feb 2025 18:21:36 +0400 Subject: [PATCH] tests updated --- test/test.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/test/test.js b/test/test.js index 41aa4c3..279b1b7 100644 --- a/test/test.js +++ b/test/test.js @@ -111,8 +111,10 @@ describe('Application life cycle test', function () { await browser.findElement(By.xpath('//input[@label="Confirm password"]')).sendKeys(PASSWORD); await browser.findElement(By.xpath('//input[@value="Register"]')).click(); - await waitForElement(By.xpath('//h1[text()="You\'re in"]')); - await browser.findElement(By.xpath('//div[@role="button" and text()="Skip"]')).click(); + await waitForElement(By.xpath('//h1[text()="You\'re in"] | //h1[contains(., "Welcome")]')); + if (await browser.findElements(By.xpath('//div[@role="button" and text()="Skip"]')).then(found => !!found.length)) { + await browser.findElement(By.xpath('//div[@role="button" and text()="Skip"]')).click(); + } await waitForElement(By.xpath(`//h1[contains(., "Welcome")]`)); } @@ -144,22 +146,20 @@ describe('Application life cycle test', function () { await waitForElement(By.xpath('//div[text()="Proceed with reset" or text()="Reset all"]')); if (await browser.findElements(By.xpath('//div[text()="Reset all"]')).then(found => !!found.length)) { - await browser.findElement(By.xpath('//div[text()="Reset all"]')).click(); } await waitForElement(By.xpath('//div[text()="Proceed with reset"]')); await browser.findElement(By.xpath('//div[text()="Proceed with reset"]')).click(); - await waitForElement(By.xpath('//button[text()="Continue"]')); - await browser.findElement(By.xpath('//button[text()="Continue"]')).click(); + await waitForElement(By.xpath('//button[@class="mx_Dialog_primary" and text()="Continue"]')); + await browser.findElement(By.xpath('//button[@class="mx_Dialog_primary" and text()="Continue"]')).click(); await waitForElement(By.xpath('//div[text()="Copy"]')); await browser.findElement(By.xpath('//div[text()="Copy"]')).click(); - await waitForElement(By.xpath('//button[text()="Continue"]')); - await browser.findElement(By.xpath('//button[text()="Continue"]')).click(); - + await waitForElement(By.xpath('//button[@class="mx_Dialog_primary" and text()="Continue"]')); + await browser.findElement(By.xpath('//button[@class="mx_Dialog_primary" and text()="Continue"]')).click(); await waitForElement(By.xpath('//button[text()="Done"] | //div[text()="Single Sign On"]')); if (await browser.findElements(By.xpath('//div[text()="Single Sign On"]')).then(found => !!found.length)) {