-
Notifications
You must be signed in to change notification settings - Fork 0
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
Global e2e tests refactoring and improvement #283
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { Selector } from 'testcafe'; | ||
|
||
export default class apiPage { | ||
constructor() { | ||
this.apiPageCaseStudies = Selector('.flex-item-4:nth-child(1)'); | ||
this.pageElementApiDocs = Selector('.flex-item-4:nth-child(2)'); | ||
this.pageElementUserGuide = Selector('.flex-item-4:nth-child(3)'); | ||
} | ||
}; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,15 @@ | ||
import { Selector } from 'testcafe'; | ||
|
||
export default class topMenu { | ||
export default class header { | ||
constructor() { | ||
this.logoImage = Selector('.logo-cont'); | ||
this.challengesTopMenuLink = Selector('.clearfix > li:nth-child(1) > a'); | ||
this.solutionsTopMenuLink = Selector('.clearfix > li:nth-child(2) > a'); | ||
this.apiTopMenuLink = Selector('.clearfix > li:nth-child(3) > a'); | ||
this.teamTopMenuLink = Selector('.clearfix > li:nth-child(4) > a'); | ||
this.contactTopMenuLink = Selector('.clearfix > li:nth-child(5) > a'); | ||
this.blogTopMenuLink = Selector('.clearfix > li:nth-child(6) > a'); | ||
this.requestDemoTopMenuItem = Selector('.custom-menu-link > a'); | ||
this.topMenuRequestDemoModal = Selector('.modal__trigger'); | ||
} | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { Selector } from 'testcafe'; | ||
|
||
export default class homePage { | ||
constructor() { | ||
this.homeRequestDemoModal = Selector('.modal__trigger'); | ||
this.homeRequestDemoModalClose = Selector('.close-btn'); | ||
this.homeWatchNowModal = Selector('.video-show'); | ||
this.homeWatchNowModalClose = Selector('.video-close'); | ||
} | ||
}; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { Selector } from 'testcafe'; | ||
|
||
export default class socialLinks { | ||
constructor() { | ||
this.wordpressLink = Selector('.wordpress'); | ||
this.drupalLink = Selector('.drupal'); | ||
this.githubLink = Selector('.github'); | ||
this.linkedinLink = Selector('.linkedin'); | ||
this.twitterLink = Selector('.twitter'); | ||
this.facebookLink = Selector('.facebook'); | ||
this.youtubeLink = Selector('.youtube'); | ||
} | ||
}; | ||
|
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { Selector } from 'testcafe'; | ||
import ApiPage from '../pages/api-page.po'; | ||
|
||
const apiPage = new ApiPage(); | ||
|
||
fixture`Check valid content is displayed on "API" page` | ||
.page`https://www-stage.adtechmedia.io/api/`; | ||
|
||
test('Assert "Case Studies" content is displayed on "API" page', async t => { | ||
await t | ||
.resizeWindow(1920, 1080) | ||
.expect(apiPage.apiPageCaseStudies.with({ | ||
selectorTimeout: 5000, | ||
visibilityCheck: true, | ||
}).visible).ok() | ||
.expect(apiPage.apiPageCaseStudies.innerText).eql('\nWant to learn about what you can achieve by integrating with our APIs? The possibilities are endless, but you can find just a few examples\n MORE\n') | ||
}); | ||
|
||
test('Assert "API-Docs" content is displayed on "API" page', async t => { | ||
await t | ||
.expect(apiPage.pageElementApiDocs.with({ | ||
selectorTimeout: 5000, | ||
visibilityCheck: true, | ||
}).visible).ok() | ||
.expect(apiPage.pageElementApiDocs.innerText).eql('\nSee what APIs we have on offer, including extensive documentation. Sign in to manage your subscriptions, see your current usage, get your API Key, and test against our live API.\n MORE\n'); | ||
}); | ||
|
||
test('Assert "User-Guide" content is displayed on "API" page', async t => { | ||
await t | ||
.expect(apiPage.pageElementUserGuide.with({ | ||
selectorTimeout: 5000, | ||
visibilityCheck: true, | ||
}).visible).ok() | ||
.expect(apiPage.pageElementUserGuide.innerText).eql('\nReady to get started? This is the place that answers all your questions. We\'ll have you up and running in no time. Let\'s get started!\n MORE\n'); | ||
}); |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { Selector } from 'testcafe'; | ||
import FooterLinks from '../pages/footer.po'; | ||
|
||
const footerLinks = new FooterLinks(); | ||
|
||
fixture`Check valid content and links are displayed on website footer` | ||
.page`https://www-stage.adtechmedia.io/`; | ||
|
||
test('Check "Mitoc Group" link is displayed on the page footer', async t => { | ||
await t | ||
.resizeWindow(1920, 1080) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Try setting default window size from config (see nighmare docs) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I got it, thank you. Latest status: Fixed |
||
.expect(footerLinks.company.exists).ok() | ||
.expect(footerLinks.company.innerText).eql('Mitoc Group'); | ||
}); | ||
|
||
test('Check "Terms of Use" link is displayed on the page footer', async t => { | ||
await t | ||
.resizeWindow(1920, 1080) | ||
.expect(footerLinks.termsOfUse.exists).ok() | ||
.expect(footerLinks.termsOfUse.innerText).eql('Terms of Use'); | ||
}); | ||
|
||
test('Check "Privacy Policy" link is displayed on the page footer', async t => { | ||
await t | ||
.resizeWindow(1920, 1080) | ||
.expect(footerLinks.privacyPolicy.exists).ok() | ||
.expect(footerLinks.privacyPolicy.innerText).eql('Privacy Policy'); | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import { Selector } from 'testcafe'; | ||
import Header from '../pages/header.po'; | ||
|
||
const header = new Header(); | ||
|
||
fixture`Check valid content is displayed on website header` | ||
.page`https://www-stage.adtechmedia.io/`; | ||
|
||
test('Check "CHALLENGES" top-menu link is displayed on website header', async t => { | ||
await t | ||
.resizeWindow(1920, 1080) | ||
.expect(header.challengesTopMenuLink.exists).ok() | ||
.expect(header.challengesTopMenuLink.innerText).eql('CHALLENGES'); | ||
}); | ||
|
||
test('Check "Logo" image is displayed on website header', async t => { | ||
await t | ||
.resizeWindow(1920, 1080) | ||
.expect(header.logoImage.exists).ok(); | ||
}); | ||
|
||
test('Check "SOLUTIONS" top-menu link is displayed on website header', async t => { | ||
await t | ||
.resizeWindow(1920, 1080) | ||
.expect(header.solutionsTopMenuLink.exists).ok() | ||
.expect(header.solutionsTopMenuLink.innerText).eql('SOLUTIONS'); | ||
}); | ||
|
||
test('Check "API" top-menu link is displayed on website header', async t => { | ||
await t | ||
.resizeWindow(1920, 1080) | ||
.expect(header.apiTopMenuLink.exists).ok() | ||
.expect(header.apiTopMenuLink.innerText).eql('API'); | ||
}); | ||
|
||
test('Check "TEAM" top-menu link is displayed on website header', async t => { | ||
await t | ||
.resizeWindow(1920, 1080) | ||
.expect(header.teamTopMenuLink.exists).ok() | ||
.expect(header.teamTopMenuLink.innerText).eql('TEAM'); | ||
}); | ||
|
||
test('Check "CONTACT" top-menu link is displayed on website header', async t => { | ||
await t | ||
.resizeWindow(1920, 1080) | ||
.expect(header.contactTopMenuLink.exists).ok() | ||
.expect(header.contactTopMenuLink.innerText).eql('CONTACT'); | ||
}); | ||
|
||
test('Check "BLOG" top-menu link is displayed on website header', async t => { | ||
await t | ||
.resizeWindow(1920, 1080) | ||
.expect(header.blogTopMenuLink.exists).ok() | ||
.expect(header.blogTopMenuLink.innerText).eql('BLOG'); | ||
}); | ||
|
||
test('Check "Request a Demo" modal is displayed on website header', async t => { | ||
await t | ||
.resizeWindow(1920, 1080) | ||
.expect(header.topMenuRequestDemoModal.exists).ok(); | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { Selector } from 'testcafe'; | ||
import HomePage from '../pages/home-page.po'; | ||
|
||
const homePage = new HomePage(); | ||
|
||
fixture`Check valid content is displayed on "Home" page` | ||
.page`https://www-stage.adtechmedia.io/`; | ||
|
||
test('Check "Request a Demo" modal is displayed on "Home" page and can be opened by the click', async t => { | ||
await t | ||
.resizeWindow(1920, 1080) | ||
.expect(homePage.homeRequestDemoModal.exists).ok(); | ||
|
||
await t | ||
.hover(homePage.homeRequestDemoModal) | ||
.click(homePage.homeRequestDemoModal, { speed: 0.5 }) | ||
.click(homePage.homeRequestDemoModalClose, { speed: 0.5 }); | ||
}); | ||
|
||
test('Check "Watch now" modal is displayed on "Home" page and can be opened by the click', async t => { | ||
await t | ||
.resizeWindow(1920, 1080) | ||
.expect(homePage.homeWatchNowModal.exists).ok(); | ||
|
||
await t | ||
.hover(homePage.homeWatchNowModal) | ||
.click(homePage.homeWatchNowModal, { speed: 0.5 }) | ||
.click(homePage.homeWatchNowModalClose, { speed: 0.5 }); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use base host (e.g.
https://www-stage.adtechmedia.io
) from aconfig.js
like this:config.www_base_host
You can run tests like
WWW_BASE_HOST='https://www-stage.adtechmedia.io' recink run e2e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got it, thank you.
Latest status: Fixed