module.exports = {
url: 'http://google.com', //added to make test actually work
sections: {
menu: {
selector: '#gb',
elements: {
mail: {
selector: 'a[href="mail"]'
},
images: {
selector: 'a[href="imghp"]'
}
},
sections: {
apps: {
selector: 'div.gb_uc', //had to update this selector
elements: {
myAccount: {
selector: '#gb192'
},
googlePlus: {
selector: '#gb119'
}
}
}
}
}
}
};module.exports = {
'Test': function (client) {
var google = client.page.google(); //added to make test actually work
google.navigate();
google.expect.section('@menu').to.be.visible;
var menuSection = google.section.menu;
var appSection = menuSection.section.apps;
menuSection.click('@appSection'); //Commented this out, and test 'runs' but fails on following
//appSection expects. Also changed it to client.click('div.gb_uc')
//with similar results, except the menu does open in the browser.
appSection.expect.element('@myAccount').to.be.visible;
appSection.expect.element('@googlePlus').to.be.visible;
client.end();
}
};>>nightwatch tests/googlePageSection.js
Starting selenium server... started - PID: 58806
[Google Page Section] Test Suite
====================================
Running: Test
✖ Error: appSection was not found in "menu". Available elements: mail,images
at Object.module.exports.Test (/Users/MYUSER/nightwatch/tests/googlePageSection.js:8:17)
FAILED: 1 errors (16ms)
_________________________________________________
TEST FAILURE: 1 error during execution, 0 assertions failed, 0 passed. (230ms)
✖ googlePageSection
- Test (16ms)
Error while running [Google Page Section / Test]:
Error: appSection was not found in "menu". Available elements: mail,images
at Object.module.exports.Test (/Users/MYUSER/nightwatch/tests/googlePageSection.js:8:17)Thanks!