responsive_image_grid/tests/e2e/page-objects/homepage.js

53 lines
1.1 KiB
JavaScript
Raw Normal View History

2020-06-25 23:29:05 +02:00
/**
* A Nightwatch page object. The page object name is the filename.
*
* Example usage:
* browser.page.homepage.navigate()
*
* 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
url: '/',
2020-06-25 23:29:05 +02:00
commands: [],
// A page object can have elements
elements: {
2020-06-25 23:31:51 +02:00
appContainer: '#app'
2020-06-25 23:29:05 +02:00
},
// Or a page objects can also have sections
sections: {
app: {
2020-06-25 23:31:51 +02:00
selector: '#app',
2020-06-25 23:29:05 +02:00
elements: {
2020-06-25 23:31:51 +02:00
logo: 'img'
2020-06-25 23:29:05 +02:00
},
// - a page object section can also have sub-sections
// - elements or sub-sections located here are retrieved using the "app" section as the base
sections: {
headline: {
2020-06-25 23:31:51 +02:00
selector: 'h1'
2020-06-25 23:29:05 +02:00
},
welcome: {
// the equivalent css selector for the "welcome" sub-section would be:
// '#app div.hello'
2020-06-25 23:31:51 +02:00
selector: 'div.hello',
2020-06-25 23:29:05 +02:00
elements: {
cliPluginLinks: {
2020-06-25 23:31:51 +02:00
selector: 'ul',
2020-06-25 23:29:05 +02:00
index: 0
}
}
}
}
}
}
2020-06-25 23:31:51 +02:00
}