github.com/covergates/covergates@v0.2.2-0.20201009050117-42ef8a19fb95/web/tests/e2e/specs/test-with-pageobjects.js (about) 1 /// ///////////////////////////////////////////////////////////// 2 // For authoring Nightwatch tests, see 3 // https://nightwatchjs.org/guide 4 // 5 // For more information on working with page objects see: 6 // https://nightwatchjs.org/guide/working-with-page-objects/ 7 /// ///////////////////////////////////////////////////////////// 8 9 module.exports = { 10 beforeEach: (browser) => browser.init(), 11 12 'e2e tests using page objects': (browser) => { 13 const homepage = browser.page.homepage(); 14 homepage.waitForElementVisible('@appContainer'); 15 16 const app = homepage.section.app; 17 app.assert.elementCount('@logo', 1); 18 app.expect.section('@welcome').to.be.visible; 19 app.expect.section('@headline').text.to.match(/^Welcome to Your Vue\.js (.*)App$/); 20 21 browser.end(); 22 }, 23 24 'verify if string "e2e-nightwatch" is within the cli plugin links': (browser) => { 25 const homepage = browser.page.homepage(); 26 const welcomeSection = homepage.section.app.section.welcome; 27 28 welcomeSection.expect.element('@cliPluginLinks').text.to.contain('e2e-nightwatch'); 29 } 30 };