Skip to content

Commit

Permalink
[ML] Transforms: Fix flaky wizard functional tests. (elastic#141209)
Browse files Browse the repository at this point in the history
This replaces clickWhenNotDisabledWithoutRetry with clickWhenNotDisabled to stabilize tests.

(cherry picked from commit d078d81)
  • Loading branch information
walterra committed Sep 22, 2022
1 parent ab7b02d commit 363a4c4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ export default function ({ getService }: FtrProviderContext) {
const esArchiver = getService('esArchiver');
const transform = getService('transform');

// Failing: See https://github.com/elastic/kibana/issues/139781
describe.skip('creation_index_pattern', function () {
describe('creation_index_pattern', function () {
before(async () => {
await esArchiver.loadIfNeeded('x-pack/test/functional/es_archives/ml/ecommerce');
await transform.testResources.createIndexPatternIfNeeded('ft_ecommerce', 'order_date');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export function TransformSourceSelectionProvider({ getService }: FtrProviderCont
async selectSource(sourceName: string) {
await this.filterSourceSelection(sourceName);
await retry.tryForTime(30 * 1000, async () => {
await testSubjects.clickWhenNotDisabledWithoutRetry(`savedObjectTitle${sourceName}`);
await testSubjects.clickWhenNotDisabled(`savedObjectTitle${sourceName}`);
await testSubjects.existOrFail('transformPageCreateTransform', { timeout: 10 * 1000 });
});
},
Expand Down
8 changes: 4 additions & 4 deletions x-pack/test/functional/services/transform/wizard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export function TransformWizardProvider({ getService, getPageObjects }: FtrProvi
return {
async clickNextButton() {
await testSubjects.existOrFail('transformWizardNavButtonNext');
await testSubjects.clickWhenNotDisabledWithoutRetry('transformWizardNavButtonNext');
await testSubjects.clickWhenNotDisabled('transformWizardNavButtonNext');
},

async assertDefineStepActive() {
Expand Down Expand Up @@ -317,7 +317,7 @@ export function TransformWizardProvider({ getService, getPageObjects }: FtrProvi
const subj = 'transformAdvancedRuntimeMappingsEditorSwitch';
if ((await this.getRuntimeMappingsEditorSwitchCheckedState()) !== toggle) {
await retry.tryForTime(5 * 1000, async () => {
await testSubjects.clickWhenNotDisabledWithoutRetry(subj);
await testSubjects.clickWhenNotDisabled(subj);
await this.assertRuntimeMappingsEditorSwitchCheckState(toggle);
});
}
Expand Down Expand Up @@ -355,7 +355,7 @@ export function TransformWizardProvider({ getService, getPageObjects }: FtrProvi
async applyRuntimeMappings() {
const subj = 'transformRuntimeMappingsApplyButton';
await testSubjects.existOrFail(subj);
await testSubjects.clickWhenNotDisabledWithoutRetry(subj);
await testSubjects.clickWhenNotDisabled(subj);
const isEnabled = await testSubjects.isEnabled(subj);
expect(isEnabled).to.eql(
false,
Expand Down Expand Up @@ -560,7 +560,7 @@ export function TransformWizardProvider({ getService, getPageObjects }: FtrProvi
break;
}
}
await testSubjects.clickWhenNotDisabledWithoutRetry('transformApplyAggChanges');
await testSubjects.clickWhenNotDisabled('transformApplyAggChanges');
await testSubjects.missingOrFail(`transformAggPopoverForm_${expectedLabel}`);
},

Expand Down

0 comments on commit 363a4c4

Please sign in to comment.