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

[Endpoint] [Tests] fixes #57946 flaky endpoint policy list test #58348

Merged
merged 12 commits into from
Mar 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions x-pack/test/functional/apps/endpoint/policy_list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
const testSubjects = getService('testSubjects');

// FLAKY: https://github.com/elastic/kibana/issues/57946
describe.skip('Endpoint Policy List', function() {
describe('Endpoint Policy List', function() {
this.tags(['ciGroup7']);
before(async () => {
await pageObjects.common.navigateToUrlWithBrowserHistory('endpoint', '/policy');
await pageObjects.endpoint.waitForTableToHaveData('policyTable');
});

it('loads the Policy List Page', async () => {
Expand All @@ -26,7 +27,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
});
it('shows policy count total', async () => {
const policyTotal = await testSubjects.getVisibleText('policyTotalCount');
expect(policyTotal).to.equal('0 Policies');
expect(policyTotal).to.equal('100 Policies');
charlie-pichette marked this conversation as resolved.
Show resolved Hide resolved
});
it('includes policy list table', async () => {
await testSubjects.existOrFail('policyTable');
Expand Down
9 changes: 9 additions & 0 deletions x-pack/test/functional/page_objects/endpoint_page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { FtrProviderContext } from '../ftr_provider_context';

export function EndpointPageProvider({ getService }: FtrProviderContext) {
const testSubjects = getService('testSubjects');
const retry = getService('retry');

return {
/**
Expand Down Expand Up @@ -58,5 +59,13 @@ export function EndpointPageProvider({ getService }: FtrProviderContext) {
)
);
},

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used the Cheerio service to pull data from a table in my pagination test. I had to use this in conjunction with dataTestSubjects. 👍


async waitForTableToHaveData(dataTestSubj: string) {
await retry.waitForWithTimeout('table to have data', 2000, async () => {
const tableData = await this.getEndpointAppTableData(dataTestSubj);
if (tableData[1][0] === 'No items found') return false;
return true;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit - I'm wondering if the 'No items found' will always be in that part of the table.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it is always part of the endpoint management tables.

});
},
};
}