Skip to content

Commit

Permalink
Merge pull request #3766 from StanislavLiv/Stas_fix_WV_140
Browse files Browse the repository at this point in the history
Code refactoring after WV-140 bug report was fixed
  • Loading branch information
DaleMcGrew authored Nov 3, 2023
2 parents fc1c191 + 40615cf commit 36f9e9a
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 5 deletions.
10 changes: 9 additions & 1 deletion tests/browserstack_automation/page_objects/privacy.page.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class PrivacyPage extends Page {
return $('#weVoteContactUsPage');
}

get findYourPrivacyAndDataLink () {
get deleteYourAccountLink () {
return $('.u-link-color');
}

Expand All @@ -56,6 +56,14 @@ class PrivacyPage extends Page {
return $$('//a[text() = "[email protected]"]');
}

get deleteYourAccountButton () {
return $('.DeleteYourAccountButtonInnerWrapper-sc-qu6md9-2');
}

get cancelOfDeleteYourAccountButton () {
return $('.DeleteYourAccountButtonInnerCancelWrapper-sc-qu6md9-1');
}

async getTextFromEmailLinks() {
const selectorToGetElements = '//a[text() = "[email protected]"]';
let arrOfElements = [];
Expand Down
19 changes: 15 additions & 4 deletions tests/browserstack_automation/specs/PrivacyPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 36f9e9a

Please sign in to comment.