test(docs-infra): make smoke tests more robust (#26649)

PR Close #26649
This commit is contained in:
George Kalpakas 2018-10-23 21:34:57 +03:00 committed by Matias Niemelä
parent f6991dec3b
commit 72f3d99920
1 changed files with 6 additions and 0 deletions

View File

@ -29,6 +29,8 @@ describe(browser.baseUrl, () => {
Object.keys(textPerUrl).forEach(url => { Object.keys(textPerUrl).forEach(url => {
it(`should show the page at '${url}'`, () => { it(`should show the page at '${url}'`, () => {
page.goTo(url); page.goTo(url);
browser.wait(() => page.getDocViewerText(), 5000); // Wait for the document to be loaded.
expect(page.getDocViewerText()).toContain(textPerUrl[url]); expect(page.getDocViewerText()).toContain(textPerUrl[url]);
}); });
}); });
@ -47,6 +49,8 @@ describe(browser.baseUrl, () => {
Object.keys(textPerUrl).forEach(url => { Object.keys(textPerUrl).forEach(url => {
it(`should show the page at '${url}'`, () => { it(`should show the page at '${url}'`, () => {
page.goTo(url); page.goTo(url);
browser.wait(() => page.getDocViewerText(), 5000); // Wait for the document to be loaded.
expect(page.getDocViewerText()).toContain(textPerUrl[url]); expect(page.getDocViewerText()).toContain(textPerUrl[url]);
}); });
}); });
@ -68,6 +72,8 @@ describe(browser.baseUrl, () => {
Object.keys(textPerUrl).forEach(url => { Object.keys(textPerUrl).forEach(url => {
it(`should show the page at '${url}'`, () => { it(`should show the page at '${url}'`, () => {
page.goTo(url); page.goTo(url);
browser.wait(() => page.getDocViewerText(), 5000); // Wait for the document to be loaded.
expect(page.getDocViewerText()).toContain(textPerUrl[url]); expect(page.getDocViewerText()).toContain(textPerUrl[url]);
}); });
}); });