Skip to content

Commit

Permalink
Investigate flaky add new visualization test (elastic#15506)
Browse files Browse the repository at this point in the history
* try to repro

* try 30 times

* some clean up and extra tests

Don’t see how this should help, but switch to using data-test-subj and
add a wait until loading line.

Still, I don’t see that it would actually help.

Also it took 50 test run to hit it once, so doubling the amount of
times the test suite runs to improve chances of hitting it.

* Throw the function in a retry

Unfortunately it’s probably not worth investigating why the click
sometimes fails, given how rare it is and that it’s only reproducible
in the test environment.

* Remove extra test loops

* remove skip and check multiple times again

* Fix issue with flaky field toggle selection

* forgot await

* More stabilizations

* Stabilize by disabling toast auto hides on all dashboard tests

* avoid all the retries to see if disabling toast auto hides was what was messing everything up

* remove comment that is no longer relevant

* Remove extra tests
  • Loading branch information
stacey-gammon authored Dec 18, 2017
1 parent f4ed330 commit 74c3ddf
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 7 deletions.
5 changes: 4 additions & 1 deletion src/ui/public/partials/paginated_selectable_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@
</button>
<ul class="li-striped list-group list-group-menu">
<li class="list-group-item list-group-menu-item" ng-repeat="hit in page">
<a ng-show="userMakeUrl" kbn-href="{{ makeUrl(hit) }}">
<a
data-test-subj="paginatedListItem-{{accessor(hit)}}"
ng-show="userMakeUrl"
kbn-href="{{ makeUrl(hit) }}">
<span>{{ accessor(hit) }}</span>
</a>

Expand Down
4 changes: 1 addition & 3 deletions test/functional/apps/dashboard/_dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,9 +239,7 @@ export default function ({ getService, getPageObjects }) {
});
});


// Re-endable once https://github.com/elastic/kibana/issues/15504 is fixed.
describe.skip('add new visualization link', () => {
describe('add new visualization link', () => {
it('adds a new visualization', async () => {
await PageObjects.dashboard.clickEdit();
await PageObjects.dashboard.clickAddVisualization();
Expand Down
1 change: 1 addition & 0 deletions test/functional/apps/dashboard/_dashboard_queries.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export default function ({ getService, getPageObjects }) {
await PageObjects.header.waitUntilLoadingHasFinished();

await PageObjects.visualize.saveVisualization(PIE_CHART_VIS_NAME);
await PageObjects.header.clickToastOK();

await PageObjects.header.clickDashboard();

Expand Down
2 changes: 2 additions & 0 deletions test/functional/apps/dashboard/_dashboard_state.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@ export default function ({ getService, getPageObjects }) {
await PageObjects.visualize.clickMapZoomIn();

await PageObjects.visualize.saveVisualization('Visualization TileMap');
await PageObjects.header.clickToastOK();

await PageObjects.header.clickDashboard();

await testSubjects.moveMouseTo('dashboardPanel');
Expand Down
4 changes: 3 additions & 1 deletion test/functional/page_objects/dashboard_page.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export function DashboardPageProvider({ getService, getPageObjects }) {
'defaultIndex': 'logstash-*'
});

await kibanaServer.uiSettings.disableToastAutohide();
await PageObjects.common.navigateToApp('dashboard');
}

Expand Down Expand Up @@ -143,7 +144,8 @@ export function DashboardPageProvider({ getService, getPageObjects }) {

async clickFilterButton() {
log.debug('Clicking filter button');
return await testSubjects.click('querySubmitButton');
await testSubjects.click('querySubmitButton');
await PageObjects.header.waitUntilLoadingHasFinished();
}

async clickClone() {
Expand Down
5 changes: 3 additions & 2 deletions test/functional/page_objects/visualize_page.js
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,9 @@ export function VisualizePageProvider({ getService, getPageObjects }) {
await find.clickByCssSelector('button[data-test-subj="toggleEditor"]');
}

async clickNewSearch() {
await find.clickByCssSelector('.list-group-item a');
async clickNewSearch(indexPattern = 'logstash-*') {
await testSubjects.click(`paginatedListItem-${indexPattern}`);
await PageObjects.header.waitUntilLoadingHasFinished();
}

async setValue(newValue) {
Expand Down

0 comments on commit 74c3ddf

Please sign in to comment.