Skip to content

Commit

Permalink
Merge pull request #4103 from wevote/Charanya_WebApp_Oct09-2024
Browse files Browse the repository at this point in the history
Changes with respect to WV-421 First Pass of How it works Page Automa…
  • Loading branch information
DaleMcGrew authored Oct 10, 2024
2 parents caf5498 + e5c1edb commit 4741754
Show file tree
Hide file tree
Showing 4 changed files with 334 additions and 65 deletions.
8 changes: 8 additions & 0 deletions tests/browserstack_automation/capabilities/testData.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
MOBILE_NUMBER: '808-935-8555',
MOBILE_VERIFICATION: '123456',
EMAIL_NEGATIVE_SCENARIO: '[email protected]',
INVALID_MOBILE_NUMBER: '808-935-855',
INVALID_EMAIL_ADDRESS: 'wevote@wevote',
UNVERIFIED_PHONE_NUMBER: '808-935-8554'
};
1 change: 1 addition & 0 deletions tests/browserstack_automation/config/wdio.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ module.exports.config = {
'../specs/ReadyPage.js',
'../specs/TermsPage.js',
'../specs/TopNavigation.js',
'../specs/HowItWorks.js',
],
capabilities,
commonCapabilities: {
Expand Down
140 changes: 135 additions & 5 deletions tests/browserstack_automation/page_objects/howitworks.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,145 @@
import { $ } from '@wdio/globals';
import Page from './page';

class HowItWorks extends Page {

get howItWorksTitle () {
return $('div>h3[class~="gNNNpX"]');
}

class HowItWorks extends Page {
get FirstModalbutton () {
return $('(//div[@p = "How WeVote works"])');
get findNextButtonHowItWorksWindow () {
return $('.kMeOcV');
}

get findBackButtonHowItWorksWindow () {
return $('//button[text() = "Back"]');
}

get getTitleSignUpPopUp () {
return $('.u-f3');
}

get getStartedButton () {
return $('.cqTvJR>button');
}

get enterVoterEmailAddressTextBox () {
return $('#enterVoterEmailAddress');
}

get cancelEmailButton () {
return $('#cancelEmailButton');
}

get cancelMobilePhoneNumberButton(){
return $('#cancelVoterPhoneSendSMS')
}

get enterMobilePhoneNumber() {
return $('#enterVoterPhone');
}

get enterSignInWithApple() {
return $('#appleLogo');
}

get enterSignInWithTwitter () {
return $('.csbvaL');
}

get cancelTwitterSignin(){
return $('#cancel')
}

get gotoWeVoteBallotGuide() {
return $('*=homepage')
}

get enterSendVerificationCode() {
return $('#desktopSmsSendCode')
}

get enterSendEmailVerificationCode() {
return $('#voterEmailAddressEntrySendCode')
}

get enterVerifyButton(){
return $('#emailVerifyButton')
}

get enterProfileAvatar(){
return $('#profileAvatarHeaderBar')
}

get phoneNumberHelperText(){
return $('#enterVoterPhone-helper-text')
}

get emailAddressHelperText() {
return $('#enterVoterEmailAddress-helper-text')
}

get backArrow() {
return $('#emailVerificationBackButton')
}

get deleteIcon() {
return $('svg[data-testid="DeleteIcon"]')
}

get alertMessage() {
return $('.MuiAlert-message')
}

async enterDigit(num){
if (num === 0) {
return $('#digit1')
}else if (num === 1) {
return $('#digit2')
} else if (num === 2) {
return $('#digit3')
} else if (num === 3) {
return $('#digit4')
} else if (num == 4) {
return $('#digit5')
} else{
return $('#digit6')
}

}

async clickButton(element){
await element.findAndClick()
}

async scrollToView(element) {
await element.scrollIntoView()
}

async clickNextButtonFourTimes () {
for (let i = 1; i <= 4; i++) {
await this.findNextButtonHowItWorksWindow.click();
}
}

async clickBackButtonFourTimes () {
for (let i = 1; i <= 4; i++) {
await this.findBackButtonHowItWorksWindow.click();
}
}

get modalTitle () {
return $('.3Title-sc-1rpx53i-1 iavXrP');
async checkTitleOfHowItWorksWindow (num) {
if (num === 1) {
return '1. Choose your interests';
}else if (num === 2) {
return '2. Follow organizations and people you trust';
} else if (num === 3) {
return '3. See who endorsed each choice on your ballot';
} else if (num === 4) {
return '4. Complete your ballot with confidence';
} else {
return '5. Share with friends who could use a guide';
}
}
}

Expand Down
Loading

0 comments on commit 4741754

Please sign in to comment.