I would like to know if it is possible to call a protractor test inside another protractor. For exemple :
it('should go on edit profile', function() {
browser.get('http://localhost:9100/#/');
browser.setLocation('profile');
browser.getCurrentUrl().then(function(actualUrl) {
if (actualUrl.indexOf("/login") > 0) {
require('../login/login.js');
// call test of login.js ???
}
});
});
Thanks for yours answers ! :)
The accepted most convenient way is to reuse code through page objects, just wrap the shared functionality in a function like I explain at https://stackoverflow.com/a/24046016/511069
Regarding what to do after require is related to NodeJS modules, see for example var AngularPage = require('../pages/angular.page.js'); at thoughtworks blog post on the topic.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With