Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code refactoring after WV-140 bug report was fixed #3766

Merged
merged 1 commit into from
Nov 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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