github.com/covergates/covergates@v0.2.2-0.20201009050117-42ef8a19fb95/web/tests/e2e/page-objects/homepage.js (about) 1 /** 2 * A Nightwatch page object. The page object name is the filename. 3 * 4 * Example usage: 5 * browser.page.homepage.navigate() 6 * 7 * For more information on working with page objects see: 8 * https://nightwatchjs.org/guide/working-with-page-objects/ 9 * 10 */ 11 12 module.exports = { 13 url: '/', 14 commands: [], 15 16 // A page object can have elements 17 elements: { 18 appContainer: '#app' 19 }, 20 21 // Or a page objects can also have sections 22 sections: { 23 app: { 24 selector: '#app', 25 26 elements: { 27 logo: 'img' 28 }, 29 30 // - a page object section can also have sub-sections 31 // - elements or sub-sections located here are retrieved using the "app" section as the base 32 sections: { 33 headline: { 34 selector: 'h1' 35 }, 36 37 welcome: { 38 // the equivalent css selector for the "welcome" sub-section would be: 39 // '#app div.hello' 40 selector: 'div.hello', 41 42 elements: { 43 cliPluginLinks: { 44 selector: 'ul', 45 index: 0 46 } 47 } 48 } 49 } 50 } 51 } 52 };