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

WV-944-FAQ Page:Fix Automation Failure Due to Removal of FAQ Element on Ready Page #4234

Closed
wants to merge 2 commits into from
Closed
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
50 changes: 25 additions & 25 deletions tests/browserstack_automation/config/wdio.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ try {
// Run `npm run wdio:setup`
}

const capabilities = [...browserCapabilities, ...mobileCapabilities];

//const capabilities = [...browserCapabilities, ...mobileCapabilities];
const capabilities =[...browserCapabilities];
const date = new Date();

const dateForDisplay = date.toDateString();
Expand All @@ -37,37 +37,37 @@ module.exports.config = {
],
],
specs: [
'../specs/DiscussPage.js',
// '../specs/DiscussPage.js',
'../specs/FAQPage.js',
'../specs/PrivacyPage.js',
'../specs/ReadyPage.js',
'../specs/TermsPage.js',
'../specs/TopNavigation.js',
'../specs/TopicsPage.js',
'../specs/HowItWorks.js',
'../specs/FooterLinks.js',
'../specs/SignInPage.js',
// '../specs/PrivacyPage.js',
// '../specs/ReadyPage.js',
// '../specs/TermsPage.js',
// '../specs/TopNavigation.js',
// '../specs/TopicsPage.js',
// '../specs/HowItWorks.js',
// '../specs/FooterLinks.js',
// '../specs/SignInPage.js',

'../specs/BallotPage.js',
'../specs/CandidatesPage.js',
// '../specs/BallotPage.js',
// '../specs/CandidatesPage.js',

'../specs/WhosRunningForOffice.js',
// '../specs/WhosRunningForOffice.js',

],

capabilities,
commonCapabilities: {
'bstack:options': {
buildName,
debug: 'true',
// geoLocation is only available under Enterprise plans
// geoLocation: 'US-CA',
// gpsLocation is only available under Paid plans
// Oakland, CA, USA
gpsLocation: '37.804363,-122.271111',
maskCommands: 'setValues, getValues, setCookies, getCookies',
video: 'true',
},
// 'bstack:options': {
// buildName,
// debug: 'true',
// // geoLocation is only available under Enterprise plans
// // geoLocation: 'US-CA',
// // gpsLocation is only available under Paid plans
// // Oakland, CA, USA
// gpsLocation: '37.804363,-122.271111',
// maskCommands: 'setValues, getValues, setCookies, getCookies',
// video: 'true',
// },
},
maxInstances: 1,
exclude: [],
Expand Down
74 changes: 39 additions & 35 deletions tests/browserstack_automation/page_objects/faq.page.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,53 +2,57 @@ import { $, $$, driver } from '@wdio/globals';
import Page from './page';

class FAQPage extends Page {
constructor () {
constructor() {
super().title = 'FAQ - WeVote';
}

async load () {
async load() {
await super.open('/more/faq');
await super.maximizeWindow();
await super.rerender();
}

get getFAQPageTitleElement () {
get getFAQPageTitleElement() {
return $('.kkIyuQ');
}

get getTwitterIconElement () {
get getTwitterIconElement() {
return $('#wevoteTwitter');
}

get getFacebookIconElement () {
get getFacebookIconElement() {
return $('#wevoteFacebook');
}

get getInstagramIconElement () {
get getInstagramIconElement() {
return $('#wevoteInstagram');
}

get getWeVoteElementFromInstagram () {
get getWeVoteElementFromInstagram() {
return $('//h2[contains(text(), "wevote")]');
}

get getEmailIconElement () {
get getEmailIconElement() {
return $('#eepurl');
}

get getGitHubIconElement () {
get getAboutLinkElement() {
return $('//a[text() = "About & FAQ"]');
}

get getGitHubIconElement() {
return $$('//a[@href = "https://github.com/WeVote"]');
}

get getBlogIconElement () {
get getBlogIconElement() {
return $('#wevoteBlog');
}

get getValueLinkElement () {
get getValueLinkElement() {
return $$('//a[@id = "helpSiteValues"]');
}

async clickValueLink () {
async clickValueLink() {
const selectorToGetValueElements = '//a[@id = "helpSiteValues"]';
const arrOfElements = [];
for (let i = 1; i <= $$(selectorToGetValueElements).length; i++) {
Expand All @@ -63,20 +67,20 @@ class FAQPage extends Page {
return arrOfElements;
}

get getWeVoteEducationWebsiteElement () {
get getWeVoteEducationWebsiteElement() {
return $('#weVoteEducationWebsite');
}

get getWeVoteUSAWebsiteElement () {
get getWeVoteUSAWebsiteElement() {
return $('#weVoteUSAWebsite');
}

get getWeVoteVolunteerElements () {
get getWeVoteVolunteerElements() {
return $$('//a[@href = "https://wevote.applytojob.com/apply"]');
}

async clickVolunteerOpeningsLinks () {
//const selectorToGetElements = '//a[@href = "https://wevote.applytojob.com/apply"]';
async clickVolunteerOpeningsLinks() {
// const selectorToGetElements = '//a[@href = "https://wevote.applytojob.com/apply"]';
const selectorToGetElements = await this.getWeVoteVolunteerElements;

const arrOfElements = [];
Expand All @@ -85,52 +89,52 @@ class FAQPage extends Page {
driver.switchWindow('https://wevote.applytojob.com/apply');
const textFromElement = driver.getTitle();
arrOfElements.push(textFromElement);
// driver.switchWindow('https://quality.wevote.us/more/faq');
// driver.switchWindow('https://quality.wevote.us/more/faq');
}
return arrOfElements;
}

get getAboutPageTitleElement () {
get getAboutPageTitleElement() {
return $('#weVoteAboutUsPage');
}

get getWeVoteContactUsFormElement () {
get getWeVoteContactUsFormElement() {
return $('#weVoteContactUsPage');
}

get getWeVoteIPhoneLinkElement () {
get getWeVoteIPhoneLinkElement() {
return $('#weVoteIPhone');
}

get getWeVoteAndroidLinkElement () {
get getWeVoteAndroidLinkElement() {
return $('#weVoteAndroid');
}

get getPleaseDonateElement () {
get getPleaseDonateElement() {
return $('[href="/donate"]');
}

get getVolunteerElement () {
get getVolunteerElement() {
return $('#idealistOpenPositions');
}

get getLetsGetStartedElement () {
get getLetsGetStartedElement() {
return $('//a[contains(text(), "get started!")]');
}

async waitForURL(expectedURL){
driver.waitUntil(async()=>{
await driver.switchWindow(expectedURL);
const currenturl= await driver.getUrl();
return currenturl=== expectedURL;
},{
async waitForURL(expectedURL) {
driver.waitUntil(async () => {
await driver.switchWindow(expectedURL);
const currenturl = await driver.getUrl();
return currenturl === expectedURL;
}, {
timeout: 10000,
timeoutMsg: 'Expected URL not found'
timeoutMsg: 'Expected URL not found',

});
}
});
}

async clickGitHubIconAndLinks () {
async clickGitHubIconAndLinks() {
const selectorToGetElements = '//a[@href = "https://github.com/WeVote"]';
const arrOfElements = [];
for (let i = 1; i <= $$(selectorToGetElements).length; i++) {
Expand Down
Loading