From 40615cfe9c0d0fb829019810dc1e1eca4f2dd2ef Mon Sep 17 00:00:00 2001 From: Stas L Date: Wed, 1 Nov 2023 23:32:19 -0400 Subject: [PATCH] Code refactoring after WV-140 bug report was fixed --- .../page_objects/privacy.page.js | 10 +++++++++- .../specs/PrivacyPage.js | 19 +++++++++++++++---- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/tests/browserstack_automation/page_objects/privacy.page.js b/tests/browserstack_automation/page_objects/privacy.page.js index b9fb29d35..6ad95e2f7 100644 --- a/tests/browserstack_automation/page_objects/privacy.page.js +++ b/tests/browserstack_automation/page_objects/privacy.page.js @@ -32,7 +32,7 @@ class PrivacyPage extends Page { return $('#weVoteContactUsPage'); } - get findYourPrivacyAndDataLink () { + get deleteYourAccountLink () { return $('.u-link-color'); } @@ -56,6 +56,14 @@ class PrivacyPage extends Page { return $$('//a[text() = "info@WeVote.US"]'); } + get deleteYourAccountButton () { + return $('.DeleteYourAccountButtonInnerWrapper-sc-qu6md9-2'); + } + + get cancelOfDeleteYourAccountButton () { + return $('.DeleteYourAccountButtonInnerCancelWrapper-sc-qu6md9-1'); + } + async getTextFromEmailLinks() { const selectorToGetElements = '//a[text() = "info@WeVote.US"]'; let arrOfElements = []; diff --git a/tests/browserstack_automation/specs/PrivacyPage.js b/tests/browserstack_automation/specs/PrivacyPage.js index 810373366..27921f35f 100644 --- a/tests/browserstack_automation/specs/PrivacyPage.js +++ b/tests/browserstack_automation/specs/PrivacyPage.js @@ -34,12 +34,23 @@ describe('Privacy Page', () => { }); // Privacy_005 - it('verifyYourPrivacyAndDataLink', async () => { + it('verifyDeleteYourAccountLink', async () => { await ReadyPage.load(); await ReadyPage.findPrivacyLink.click(); - await PrivacyPage.findYourPrivacyAndDataLink.click(); - await driver.switchWindow('https://quality.wevote.us/settings/yourdata'); - await expect(driver).toHaveTitle('Your Privacy & Data - We Vote'); + await PrivacyPage.deleteYourAccountLink.click(); + await PrivacyPage.deleteYourAccountButton.click(); + await driver.pause(3000); + await expect(driver).toHaveTitle('Ready to Vote? - We Vote'); + }); + + // Privacy_005_2 + it('verifyCancelButtonOfDeleteYourAccountLink', async () => { + await ReadyPage.load(); + await ReadyPage.findPrivacyLink.click(); + await PrivacyPage.deleteYourAccountLink.click(); + await expect(PrivacyPage.deleteYourAccountLink).not.toBeDisplayed(); + await PrivacyPage.cancelOfDeleteYourAccountButton.click(); + await expect(PrivacyPage.deleteYourAccountLink).toBeDisplayed(); }); // Privacy_006