Wait for context menu to appear in functional tests (#36163)

This commit is contained in:
Sonja Krause-Harder 2019-05-09 12:44:14 +02:00 committed by GitHub
parent 6f0fc73bd6
commit de8743ff91
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 1 deletions

View file

@ -123,7 +123,7 @@ export const NodeContextMenu = injectUICapabilities(
button={children}
panelPaddingSize="none"
>
<EuiContextMenu initialPanelId={0} panels={panels} />
<EuiContextMenu initialPanelId={0} panels={panels} data-test-subj="nodeContextMenu" />
</EuiPopover>
);
}

View file

@ -16,6 +16,7 @@ export default function({ getPageObjects, getService }: KibanaFunctionalTestDefa
const testSubjects = getService('testSubjects');
const appsMenu = getService('appsMenu');
const globalNav = getService('globalNav');
const retry = getService('retry');
describe('infrastructure security', () => {
describe('global infrastructure all privileges', () => {
@ -105,10 +106,12 @@ export default function({ getPageObjects, getService }: KibanaFunctionalTestDefa
});
it(`does not show link to view logs`, async () => {
await retry.waitFor('context menu', () => testSubjects.exists('nodeContextMenu'));
await testSubjects.missingOrFail('viewLogsContextMenuItem');
});
it(`does not show link to view apm traces`, async () => {
await retry.waitFor('context menu', () => testSubjects.exists('nodeContextMenu'));
await testSubjects.missingOrFail('viewApmTracesContextMenuItem');
});
});
@ -218,10 +221,12 @@ export default function({ getPageObjects, getService }: KibanaFunctionalTestDefa
});
it(`does not show link to view logs`, async () => {
await retry.waitFor('context menu', () => testSubjects.exists('nodeContextMenu'));
await testSubjects.missingOrFail('viewLogsContextMenuItem');
});
it(`does not show link to view apm traces`, async () => {
await retry.waitFor('context menu', () => testSubjects.exists('nodeContextMenu'));
await testSubjects.missingOrFail('viewApmTracesContextMenuItem');
});
});
@ -303,6 +308,7 @@ export default function({ getPageObjects, getService }: KibanaFunctionalTestDefa
await PageObjects.infraHome.goToTime(DATE_WITH_DATA);
await testSubjects.existOrFail('waffleMap');
await testSubjects.click('nodeContainer');
await retry.waitFor('context menu', () => testSubjects.exists('nodeContextMenu'));
await testSubjects.click('viewLogsContextMenuItem');
await testSubjects.existOrFail('infraLogsPage');
});
@ -368,6 +374,7 @@ export default function({ getPageObjects, getService }: KibanaFunctionalTestDefa
await PageObjects.infraHome.goToTime(DATE_WITH_DATA);
await testSubjects.existOrFail('waffleMap');
await testSubjects.click('nodeContainer');
await retry.waitFor('context menu', () => testSubjects.exists('nodeContextMenu'));
await testSubjects.click('viewApmTracesContextMenuItem');
await testSubjects.existOrFail('apmMainContainer');
});

View file

@ -17,6 +17,7 @@ export default function({ getPageObjects, getService }: KibanaFunctionalTestDefa
const PageObjects = getPageObjects(['common', 'infraHome', 'security', 'spaceSelector']);
const testSubjects = getService('testSubjects');
const appsMenu = getService('appsMenu');
const retry = getService('retry');
describe('infrastructure spaces', () => {
before(async () => {
@ -70,10 +71,12 @@ export default function({ getPageObjects, getService }: KibanaFunctionalTestDefa
});
it(`shows link to view logs`, async () => {
await retry.waitFor('context menu', () => testSubjects.exists('nodeContextMenu'));
await testSubjects.existOrFail('viewLogsContextMenuItem');
});
it(`shows link to view apm traces`, async () => {
await retry.waitFor('context menu', () => testSubjects.exists('nodeContextMenu'));
await testSubjects.existOrFail('viewApmTracesContextMenuItem');
});
});
@ -187,10 +190,12 @@ export default function({ getPageObjects, getService }: KibanaFunctionalTestDefa
});
it(`doesn't show link to view logs`, async () => {
await retry.waitFor('context menu', () => testSubjects.exists('nodeContextMenu'));
await testSubjects.missingOrFail('viewLogsContextMenuItem');
});
it(`shows link to view apm traces`, async () => {
await retry.waitFor('context menu', () => testSubjects.exists('nodeContextMenu'));
await testSubjects.existOrFail('viewApmTracesContextMenuItem');
});
});
@ -228,10 +233,12 @@ export default function({ getPageObjects, getService }: KibanaFunctionalTestDefa
});
it(`shows link to view logs`, async () => {
await retry.waitFor('context menu', () => testSubjects.exists('nodeContextMenu'));
await testSubjects.existOrFail('viewLogsContextMenuItem');
});
it(`doesn't show link to view apm traces`, async () => {
await retry.waitFor('context menu', () => testSubjects.exists('nodeContextMenu'));
await testSubjects.missingOrFail('viewApmTracesContextMenuItem');
});
});