responsive_image_grid/tests/e2e/specs/test-with-pageobjects.js

37 lines
1.1 KiB
JavaScript
Raw Normal View History

2020-06-25 23:29:05 +02:00
////////////////////////////////////////////////////////////////
// For authoring Nightwatch tests, see
// https://nightwatchjs.org/guide
//
// For more information on working with page objects see:
// https://nightwatchjs.org/guide/working-with-page-objects/
////////////////////////////////////////////////////////////////
module.exports = {
2020-06-25 23:31:51 +02:00
beforeEach: (browser) => browser.init(),
2020-06-25 23:29:05 +02:00
2020-06-25 23:31:51 +02:00
'e2e tests using page objects': (browser) => {
const homepage = browser.page.homepage()
homepage.waitForElementVisible('@appContainer')
2020-06-25 23:29:05 +02:00
2020-06-25 23:31:51 +02:00
const app = homepage.section.app
app.assert.elementCount('@logo', 1)
app.expect.section('@welcome').to.be.visible
2020-06-25 23:29:05 +02:00
app.expect
2020-06-25 23:31:51 +02:00
.section('@headline')
.text.to.match(/^Welcome to Your Vue\.js (.*)App$/)
2020-06-25 23:29:05 +02:00
2020-06-25 23:31:51 +02:00
browser.end()
2020-06-25 23:29:05 +02:00
},
2020-06-25 23:31:51 +02:00
'verify if string "e2e-nightwatch" is within the cli plugin links': (
browser
) => {
const homepage = browser.page.homepage()
const welcomeSection = homepage.section.app.section.welcome
2020-06-25 23:29:05 +02:00
welcomeSection.expect
2020-06-25 23:31:51 +02:00
.element('@cliPluginLinks')
.text.to.contain('e2e-nightwatch')
2020-06-25 23:29:05 +02:00
}
2020-06-25 23:31:51 +02:00
}