-
-
Save mattdhorstman/ea24ddb70b80a52591b7e8fa909ff66b to your computer and use it in GitHub Desktop.
Protractor async/await
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Given('test', async () => { | |
let nav = element.all(by.css('.nav-title')); | |
console.log(`Length: ${await nav.count()}`); //correct output | |
for (let i = 0; i < (await nav.count()); i++) { | |
console.log(`Nav${i}: ${await nav.get(i).getText()}`); //correct output | |
} | |
let staticIpNav = element(by.cssContainingText('.nav-title', 'STATIC-IP')); | |
await staticIpNav.click(); | |
console.log('after click'); //correct output | |
console.log('before let'); //correct output | |
let reportsNav = element.all(by.css('.nav-item')); | |
console.log(`Length: ${await reportsNav.count()}`); // no ouput | |
for (let i = 0; i < (await reportsNav.count()); i++) { | |
console.log(`Nav${i}: ${await reportsNav.get(i).getText()}`); // no output | |
} | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment