From 0856f1ba17f4291dddae90b24efb3f9bbdf851f3 Mon Sep 17 00:00:00 2001 From: fdiazq~ Date: Mon, 30 Sep 2024 20:49:07 -0700 Subject: [PATCH 1/3] Reduced height of TIP chip --- .../pages/ChallengeInviteFriends/ChallengeInviteFriends.jsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/js/common/pages/ChallengeInviteFriends/ChallengeInviteFriends.jsx b/src/js/common/pages/ChallengeInviteFriends/ChallengeInviteFriends.jsx index b635813cd..7b895de4b 100644 --- a/src/js/common/pages/ChallengeInviteFriends/ChallengeInviteFriends.jsx +++ b/src/js/common/pages/ChallengeInviteFriends/ChallengeInviteFriends.jsx @@ -233,6 +233,7 @@ const InvitedFriendsWrapper = styled('div')` const StyledChip = styled(Chip)` background-color: ${DesignTokenColors.confirmation700}; color: ${DesignTokenColors.whiteUI}; + height: 20px; `; export default withStyles(commonMuiStyles)(ChallengeInviteFriends); From 1e55aa9810bd2f803e361d488387e3add041f709 Mon Sep 17 00:00:00 2001 From: fdiazq~ Date: Tue, 1 Oct 2024 22:53:34 -0700 Subject: [PATCH 2/3] Added vertical and horizontal centering to text --- .../pages/ChallengeInviteFriends/ChallengeInviteFriends.jsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/js/common/pages/ChallengeInviteFriends/ChallengeInviteFriends.jsx b/src/js/common/pages/ChallengeInviteFriends/ChallengeInviteFriends.jsx index 7b895de4b..14d092724 100644 --- a/src/js/common/pages/ChallengeInviteFriends/ChallengeInviteFriends.jsx +++ b/src/js/common/pages/ChallengeInviteFriends/ChallengeInviteFriends.jsx @@ -234,6 +234,8 @@ const StyledChip = styled(Chip)` background-color: ${DesignTokenColors.confirmation700}; color: ${DesignTokenColors.whiteUI}; height: 20px; + align-items: center; + justify-content: center; `; export default withStyles(commonMuiStyles)(ChallengeInviteFriends); From 03cc7fbc10a247cbf2d974f29e6d22c862dd1bdc Mon Sep 17 00:00:00 2001 From: fdiazq~ Date: Wed, 2 Oct 2024 06:37:49 -0700 Subject: [PATCH 3/3] Added additional test case to top navigation header bar --- .../page_objects/topnavigation.js | 9 +++++++++ .../specs/TopNavigation.js | 18 ++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/tests/browserstack_automation/page_objects/topnavigation.js b/tests/browserstack_automation/page_objects/topnavigation.js index 76a67ce1f..0351e6f9a 100644 --- a/tests/browserstack_automation/page_objects/topnavigation.js +++ b/tests/browserstack_automation/page_objects/topnavigation.js @@ -16,6 +16,10 @@ class TopNavigation extends Page { return $('#candidatesTabHeaderBar'); } + get getChallengesTabLocator () { + return $('#challengesTabHeaderBar'); + } + get getDonateTabLocator () { return $('#donateTabHeaderBar'); } @@ -32,6 +36,11 @@ class TopNavigation extends Page { await this.getCandidatesTabLocator.findAndClick(); } + async toggleChallengesTab () { + await this.getChallengesTabLocator.findAndClick(); + } + + async toggleDonateTab () { await this.getDonateTabLocator.findAndClick(); } diff --git a/tests/browserstack_automation/specs/TopNavigation.js b/tests/browserstack_automation/specs/TopNavigation.js index e985b26d2..302fb3d74 100644 --- a/tests/browserstack_automation/specs/TopNavigation.js +++ b/tests/browserstack_automation/specs/TopNavigation.js @@ -143,4 +143,22 @@ describe('TopNavigation', () => { // await driver.switchWindow('Democracy Squads - WeVote'); // await expect(driver).not.toHaveUrl(expect.stringContaining('ready')); // }); + + // TopNavigation_011 + it('openChallengesTab', async () => { + await ReadyPage.load(); + await driver.pause(waitTime); + await TopNavigation.toggleChallengesTab(); + await driver.waitUntil(async () => { + // Add condition to check for the expected URL + const currentUrl = await driver.getUrl(); + console.log(currentUrl); + return currentUrl.includes('challenges'); + }, { + timeout: 10000, + timeoutMsg: 'Expected URL to contain "challenges" not found, timeout after 10000ms', + }); + await driver.pause(waitTime); + await expect(driver).not.toHaveUrl(expect.stringContaining('ready')); + }); });