Skip to content

Commit

Permalink
[Happy Path] Fix checking application readiness in HappyPath test (#1…
Browse files Browse the repository at this point in the history
  • Loading branch information
SkorikSergey authored Sep 2, 2019
1 parent 3cc77bc commit f2ad4fb
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions e2e/pageobjects/ide/Ide.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,19 +245,17 @@ export class Ide {

async waitApllicationIsReady(url: string,
timeout: number = TestConstants.TS_SELENIUM_DEFAULT_TIMEOUT) {
let res = await axios.get(url);

await this.driverHelper.getDriver().wait(async () => {
try {
res = await axios.get(url);
const res = await axios.get(url);
if (res.status === 200) {
console.log('Application is ready for use. App url:');
return true;
}
} catch (error) {
console.log('Application is not yet ready for use');
await this.driverHelper.wait(TestConstants.TS_SELENIUM_DEFAULT_POLLING);
}

await this.driverHelper.wait(TestConstants.TS_SELENIUM_DEFAULT_POLLING);
}, timeout);
}

Expand Down

0 comments on commit f2ad4fb

Please sign in to comment.