Answer the question
In order to leave comments, you need to log in
How to use loops in nightwatch.js?
There is such a function in pageObject
this.openFilmPage = function () {
browser.waitForElementVisible("div[class='pg'", 1000);
for (var i = 0; i < 4; i += 1) {
console.log('Итерация № ' + i);
browser.waitForElementVisible("div[class='app'] > div[class='pg'] > div[class='home carousel'] > div[class='home-lst carousel-lst'] > div[class*='home-lst-itm nav-itm']:nth-of-type(" + i + ") > div[class='badge badge-currency']", 100, function (result) {
if (result.value) {
return browser;
console.log('Платный фильм обнаружен');
} else {
return browser;
console.log('Платный фильм отсутствует');
}
});
} return browser;
}
'TC67 Переход на страницу платного фильма': function (browser) {
browser
.page.App().open()
.page.App().openFilmPage()
.end();
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question