Skip to content

Commit

Permalink
fix flaky x-pack/test/stack_functional_integration APM smoke test (#1…
Browse files Browse the repository at this point in the history
…17250)

* waitUntilLoadingHasFinished() and wait for table caption to be set

* just formatting change to make eslint happy
  • Loading branch information
Lee Drengenberg authored Nov 3, 2021
1 parent 9c1feba commit 80349ec
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,32 @@ export default function ({ getService, getPageObjects }) {
describe('APM smoke test', function ampsmokeTest() {
const browser = getService('browser');
const testSubjects = getService('testSubjects');
const PageObjects = getPageObjects(['common', 'timePicker']);
const PageObjects = getPageObjects(['common', 'timePicker', 'header']);
const find = getService('find');
const log = getService('log');
const retry = getService('retry');

before(async () => {
await browser.setWindowSize(1400, 1400);
await PageObjects.common.navigateToApp('apm');
await PageObjects.header.waitUntilLoadingHasFinished();
await PageObjects.timePicker.setCommonlyUsedTime('Last_1 year');
await PageObjects.header.waitUntilLoadingHasFinished();
});

it('can navigate to APM app', async () => {
await testSubjects.existOrFail('apmMainContainer', {
timeout: 10000,
});
// wait for this last change on the page;
// <caption class="euiScreenReaderOnly euiTableCaption">This table contains 1 rows out of 1 rows; Page 1 of 1.</caption>
// but "<caption class="euiScreenReaderOnly euiTableCaption">" always exists so we have to wait until there's text
await retry.waitForWithTimeout('The APM table has a caption', 5000, async () => {
return (await (await find.byCssSelector('caption')).getAttribute('innerHTML')).includes(
'This table contains '
);
});

await find.clickByDisplayedLinkText('apm-a-rum-test-e2e-general-usecase');
log.debug('### apm smoke test passed');
await find.clickByLinkText('general-usecase-initial-p-load');
Expand Down

0 comments on commit 80349ec

Please sign in to comment.