Skip to content

Commit

Permalink
fix skipped test test/accessibility/apps/dashboard·ts - Dashboard cre…
Browse files Browse the repository at this point in the history
…ate dashboard button #111233 (#112872)

* test if 2s sleep fixes flakey test

* switch from sleep to retry.waitFor

* remove .only, add comments to config file about sample data add/remove

Co-authored-by: Kibana Machine <[email protected]>
  • Loading branch information
Lee Drengenberg and kibanamachine authored Sep 28, 2021
1 parent 3dcfd44 commit 200d035
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion test/accessibility/apps/dashboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const testSubjects = getService('testSubjects');
const listingTable = getService('listingTable');

describe.skip('Dashboard', () => {
describe('Dashboard', () => {
const dashboardName = 'Dashboard Listing A11y';
const clonedDashboardName = 'Dashboard Listing A11y Copy';

Expand Down
12 changes: 8 additions & 4 deletions test/accessibility/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,19 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) {
...functionalConfig.getAll(),

testFiles: [
require.resolve('./apps/discover'),
// these 5 tests all load addSampleDataSet('flights')
// only the last test does removeSampleDataSet('flights')
require.resolve('./apps/dashboard'),
require.resolve('./apps/dashboard_panel'),
require.resolve('./apps/filter_panel'),
require.resolve('./apps/home'),
require.resolve('./apps/kibana_overview'),

// next tests don't use sample data
require.resolve('./apps/discover'),
require.resolve('./apps/visualize'),
require.resolve('./apps/management'),
require.resolve('./apps/console'),
require.resolve('./apps/home'),
require.resolve('./apps/filter_panel'),
require.resolve('./apps/kibana_overview'),
],
pageObjects,
services,
Expand Down
7 changes: 5 additions & 2 deletions test/functional/page_objects/home_page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,11 @@ export class HomePageObject extends FtrService {
async addSampleDataSet(id: string) {
const isInstalled = await this.isSampleDataSetInstalled(id);
if (!isInstalled) {
await this.testSubjects.click(`addSampleDataSet${id}`);
await this._waitForSampleDataLoadingAction(id);
await this.retry.waitFor('wait until sample data is installed', async () => {
await this.testSubjects.click(`addSampleDataSet${id}`);
await this._waitForSampleDataLoadingAction(id);
return await this.isSampleDataSetInstalled(id);
});
}
}

Expand Down

0 comments on commit 200d035

Please sign in to comment.