[5.6] test/fix flaky clone test (#15808)

* Investigate fix for flaky clone test

* fix missed merged conflict
This commit is contained in:
Nathan Reese 2018-01-02 15:24:14 -07:00 committed by GitHub
parent feacd6deaa
commit d773efb7cc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 18 additions and 13 deletions

View file

@ -160,6 +160,7 @@
<tr
ng-repeat="item in listingController.pageOfItems track by item.id"
class="kuiTableRow"
data-test-subj="dashboardListingRow"
>
<td class="kuiTableRowCell kuiTableRowCell--checkBox">
<div class="kuiTableRowCell__liner">
@ -177,7 +178,7 @@
<div class="kuiTableRowCell__liner">
<a
class="kuiLink"
data-test-subj="dashboardListingTitleLink"
data-test-subj="dashboardListingTitleLink-{{item.title.split(' ').join('-')}}"
ng-href="{{ listingController.getUrlForItem(item) }}"
>
{{ item.title }}
@ -190,7 +191,6 @@
</div>
</td>
</tr>
</tbody>
</table>

View file

@ -56,7 +56,7 @@ export default function ({ getPageObjects }) {
it('Does not warn when you save an existing dashboard with the title it already has, and that title is a duplicate',
async function () {
await PageObjects.dashboard.clickDashboardByLinkText(dashboardName);
await PageObjects.dashboard.selectDashboard(dashboardName);
await PageObjects.header.isGlobalLoadingIndicatorHidden();
await PageObjects.dashboard.clickEdit();
await PageObjects.dashboard.saveDashboard(dashboardName);

View file

@ -41,7 +41,7 @@ export default function ({ getService, getPageObjects }) {
it('existing dashboard opens in view mode', async function () {
await PageObjects.dashboard.gotoDashboardLandingPage();
await PageObjects.dashboard.clickDashboardByLinkText(dashboardName);
await PageObjects.dashboard.selectDashboard(dashboardName);
const inViewMode = await PageObjects.dashboard.getIsInViewMode();
expect(inViewMode).to.equal(true);
@ -50,7 +50,7 @@ export default function ({ getService, getPageObjects }) {
describe('panel edit controls', function () {
it('are hidden in view mode', async function () {
await PageObjects.dashboard.gotoDashboardLandingPage();
await PageObjects.dashboard.clickDashboardByLinkText(dashboardName);
await PageObjects.dashboard.selectDashboard(dashboardName);
const editLinkExists = await testSubjects.exists('dashboardPanelEditLink');
const moveExists = await testSubjects.exists('dashboardPanelMoveIcon');

View file

@ -266,10 +266,8 @@ export function DashboardPageProvider({ getService, getPageObjects }) {
});
}
clickDashboardByLinkText(dashName) {
return getRemote()
.findByLinkText(dashName)
.click();
async selectDashboard(dashName) {
await testSubjects.click(`dashboardListingTitleLink-${dashName.split(' ').join('-')}`);
}
async clearSearchValue() {
@ -300,7 +298,7 @@ export function DashboardPageProvider({ getService, getPageObjects }) {
}
async getCountOfDashboardsInListingTable() {
const dashboardTitles = await testSubjects.findAll('dashboardListingTitleLink');
const dashboardTitles = await testSubjects.findAll('dashboardListingRow');
return dashboardTitles.length;
}
@ -317,9 +315,16 @@ export function DashboardPageProvider({ getService, getPageObjects }) {
async loadSavedDashboard(dashName) {
log.debug(`Load Saved Dashboard ${dashName}`);
await this.searchForDashboardWithName(dashName);
await this.clickDashboardByLinkText(dashName);
return PageObjects.header.waitUntilLoadingHasFinished();
await retry.try(async () => {
await this.searchForDashboardWithName(dashName);
await this.selectDashboard(dashName);
await PageObjects.header.waitUntilLoadingHasFinished();
const onDashboardLandingPage = await this.onDashboardLandingPage();
if (onDashboardLandingPage) {
throw new Error('Failed to open the dashboard up');
}
});
}
getPanelTitles() {