Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SECURITY_SOLUTION] rely on table in test for endpoint list kql bar #79402

Merged
merged 7 commits into from
Oct 5, 2020
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
],
];

// Failing: See https://github.com/elastic/kibana/issues/77278
describe.skip('endpoint list', function () {
describe('endpoint list', function () {
this.tags('ciGroup7');
const sleep = (ms = 100) => new Promise((resolve) => setTimeout(resolve, ms));

Expand Down Expand Up @@ -219,8 +218,11 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
await deleteAllDocsFromMetadataCurrentIndex(getService);
});
it('for the kql query: na, table shows an empty list', async () => {
await testSubjects.setValue('adminSearchBar', 'na');
await (await testSubjects.find('querySubmitButton')).click();
const adminSearchBar = await testSubjects.find('adminSearchBar');
await adminSearchBar.clearValueWithKeyboard();
await adminSearchBar.type('na');
const querySubmitButton = await testSubjects.find('querySubmitButton');
await querySubmitButton.click();
const expectedDataFromQuery = [
[
'Hostname',
Expand All @@ -240,18 +242,14 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
const tableData = await pageObjects.endpointPageUtils.tableData('endpointListTable');
expect(tableData).to.eql(expectedDataFromQuery);
});

it('for the kql query: HostDetails.Endpoint.policy.applied.id : "C2A9093E-E289-4C0A-AA44-8C32A414FA7A", table shows 2 items', async () => {
await testSubjects.setValue('adminSearchBar', ' ');
await (await testSubjects.find('querySubmitButton')).click();

const endpointListTableTotal = await testSubjects.getVisibleText('endpointListTableTotal');

await testSubjects.setValue(
'adminSearchBar',
const adminSearchBar = await testSubjects.find('adminSearchBar');
await adminSearchBar.clearValueWithKeyboard();
await adminSearchBar.type(
'HostDetails.Endpoint.policy.applied.id : "C2A9093E-E289-4C0A-AA44-8C32A414FA7A" '
);
await (await testSubjects.find('querySubmitButton')).click();
const querySubmitButton = await testSubjects.find('querySubmitButton');
await querySubmitButton.click();
const expectedDataFromQuery = [
[
'Hostname',
Expand Down Expand Up @@ -287,11 +285,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
'',
],
];

await pageObjects.endpoint.waitForVisibleTextToChange(
'endpointListTableTotal',
endpointListTableTotal
);
await pageObjects.endpoint.waitForTableToHaveData('endpointListTable');
const tableData = await pageObjects.endpointPageUtils.tableData('endpointListTable');
expect(tableData).to.eql(expectedDataFromQuery);
});
Expand Down