-
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
Conversation
avozicov
commented
Jul 18, 2017
- Implemented POMs for:
- api-page
- contact-page
- demo-modal
- footer
- header
- home-page
- quick-links
- social-links
- Refactored all tests scripts to use page objects described in "pages" directory
- Added new script for "Social Links" validation
- Added new script for "API page" content assert
- Fixed const names to provide more context of selectors and actions
test/e2e/tests/assertApiPage.e2e.js
Outdated
const apiPage = new ApiPage(); | ||
|
||
fixture`Check valid content is displayed on "API" page` | ||
.page`https://www-stage.adtechmedia.io/api/`; |
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 a config.js
like this: config.www_base_host
// config.js
export default {
www_base_host: process.env.WWW_BASE_HOST || 'https://www-test.adtechmedia.io',
}
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
test/e2e/tests/assertFooter.e2e.js
Outdated
|
||
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 comment
The 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 comment
The reason will be displayed to describe this comment to others. Learn more.
I got it, thank you.
Latest status: Fixed
.typeText(requestDemoPage.demoFormEmailField, '[email protected]') | ||
.typeText(requestDemoPage.demoFormNamelField, 'Test User') | ||
.click(requestDemoPage.demoFormSubmitButton, { speed: 0.5 }); | ||
.typeText(requestDemoForm.demoFormEmailField, '[email protected]') |
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.
Please use http://chancejs.com library for generating random test data
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
selectorTimeout: 5000, | ||
visibilityCheck: true, | ||
}).visible).ok() | ||
.expect(Selector(requestDemoPage.demoFormResponseText).innerText).eql('\nThank you for the interest in AdTechMedia WordPress Plugin\nPlease check your inbox to schedule your demo.\n'); | ||
.expect(Selector(requestDemoForm.demoFormResponseText).innerText).eql('\nThank you for the interest in AdTechMedia WordPress Plugin\nPlease check your inbox to schedule your demo.\n'); |
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 .contains
instead of . eql
to avoid spaces matching
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
Please update recink.yml from project root to use the tests and dependencies |