From d1de6d6bbbae6391135699d9f026764a5862b666 Mon Sep 17 00:00:00 2001 From: Stas L Date: Wed, 1 Nov 2023 01:50:07 -0400 Subject: [PATCH] Code refactoring after WV-143 bug report was fixed --- tests/browserstack_automation/page_objects/terms.page.js | 7 +++---- tests/browserstack_automation/specs/ReadyPage.js | 2 +- tests/browserstack_automation/specs/TermsPage.js | 8 ++++++++ 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/tests/browserstack_automation/page_objects/terms.page.js b/tests/browserstack_automation/page_objects/terms.page.js index e443b0cdc..889b21215 100644 --- a/tests/browserstack_automation/page_objects/terms.page.js +++ b/tests/browserstack_automation/page_objects/terms.page.js @@ -12,10 +12,9 @@ class TermsPage extends Page { await super.rerender(); } -// Terms_001 -- link not clickable. BUG REPORT # WV-142 -// get getGitHubLink () { -// return $('???'); -// } + get getGitHubLink () { + return $('#wevoteGitHub'); + } get getPrivacyLinkElement () { return $('#privacyPolicy'); diff --git a/tests/browserstack_automation/specs/ReadyPage.js b/tests/browserstack_automation/specs/ReadyPage.js index 0d0193d95..1050cd1bd 100644 --- a/tests/browserstack_automation/specs/ReadyPage.js +++ b/tests/browserstack_automation/specs/ReadyPage.js @@ -75,7 +75,7 @@ describe('ReadyPage', () => { it('verifyPrivacyLinkRedirected', async () => { await ReadyPage.load(); await ReadyPage.findPrivacyLink.click(); - await expect(driver).toHaveUrlContaining('more/privacy'); + await expect(driver).toHaveUrlContaining('/privacy'); await expect(PrivacyPage.pageContentTitleText).toHaveText('WeVote.US Privacy Policy'); }); diff --git a/tests/browserstack_automation/specs/TermsPage.js b/tests/browserstack_automation/specs/TermsPage.js index 9e50c4f89..92749552c 100644 --- a/tests/browserstack_automation/specs/TermsPage.js +++ b/tests/browserstack_automation/specs/TermsPage.js @@ -4,6 +4,14 @@ import PrivacyPage from '../page_objects/privacy.page'; import TermsPage from '../page_objects/terms.page'; describe('TermsPage', () => { + // Terms_001 + it.only ('verifyGitHubLinkRedirected', async () => { + await ReadyPage.load(); + await ReadyPage.getTermsLinkElement.findAndClick();; + await TermsPage.getGitHubLink.click(); + driver.switchWindow('https://github.com/WeVote'); + await expect(driver).toHaveTitle('We Vote ยท GitHub'); + }); //Terms_002 it('verifyPrivacyPolicyLinkRedirected', async () => {