Investigate fix for flaky clone test (#15503) (#15550)

* First, run the test suite in question 20s to see how flaky it is and if it can be semi reliably repro'ed

* Use testSubjects instead of click by link test.

* spaces in data-test-subj selectors messes this up

* Passed sufficient number of times, remove extra test runs
This commit is contained in:
Stacey Gammon 2017-12-12 12:21:28 -05:00 committed by GitHub
parent 25bf57af62
commit 7ef2bc3a79
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 8 additions and 9 deletions

View file

@ -184,6 +184,7 @@
<tr
ng-repeat="item in listingController.pageOfItems track by item.id"
class="kuiTableRow"
data-test-subj="dashboardListingRow"
>
<td class="kuiTableRowCell kuiTableRowCell--checkBox" ng-if="!listingController.hideWriteControls">
<div class="kuiTableRowCell__liner">
@ -202,7 +203,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 }}

View file

@ -57,7 +57,7 @@ export default function ({ getService, 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

@ -35,7 +35,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);

View file

@ -3,7 +3,6 @@ export default function ({ getService, loadTestFile }) {
describe('dashboard app', function () {
before(() => remote.setWindowSize(1200, 900));
loadTestFile(require.resolve('./_bwc_shared_urls'));
loadTestFile(require.resolve('./_dashboard_queries'));
loadTestFile(require.resolve('./_dashboard_grid'));

View file

@ -354,8 +354,8 @@ export function DashboardPageProvider({ getService, getPageObjects }) {
});
}
async clickDashboardByLinkText(dashName) {
await find.clickByLinkText(dashName);
async selectDashboard(dashName) {
await testSubjects.click(`dashboardListingTitleLink-${dashName.split(' ').join('-')}`);
}
async clearSearchValue() {
@ -391,7 +391,7 @@ export function DashboardPageProvider({ getService, getPageObjects }) {
}
async getCountOfDashboardsInListingTable() {
const dashboardTitles = await testSubjects.findAll('dashboardListingTitleLink');
const dashboardTitles = await testSubjects.findAll('dashboardListingRow');
return dashboardTitles.length;
}
@ -410,7 +410,7 @@ export function DashboardPageProvider({ getService, getPageObjects }) {
await retry.try(async () => {
await this.searchForDashboardWithName(dashName);
await this.clickDashboardByLinkText(dashName);
await this.selectDashboard(dashName);
await PageObjects.header.waitUntilLoadingHasFinished();
const onDashboardLandingPage = await this.onDashboardLandingPage();
@ -435,7 +435,6 @@ export function DashboardPageProvider({ getService, getPageObjects }) {
return await testSubjects.findAll('dashboardPanel');
}
async getPanelDimensions() {
const panels = await find.allByCssSelector('.react-grid-item'); // These are gridster-defined elements and classes
async function getPanelDimensions(panel) {