[Happy Path] Fix checking application readiness in HappyPath test (#14381)

7.20.x
Sergey Skorik 2019-09-02 16:26:34 +03:00 committed by GitHub
parent 3cc77bc453
commit f2ad4fb9da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 5 deletions

View File

@ -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);
}