Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ML] Functional tests - stabilize import job test #111929

Merged
merged 3 commits into from
Sep 13, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 25 additions & 3 deletions x-pack/test/functional/services/ml/stack_management_jobs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export function MachineLearningStackManagementJobsProvider(
},

async executeSync() {
await testSubjects.click('mlJobMgmtSyncFlyoutSyncButton', 2000);
await testSubjects.clickWhenNotDisabled('mlJobMgmtSyncFlyoutSyncButton', { timeout: 5000 });

// check and close success toast
const resultToast = await toasts.getToastElement(1);
Expand Down Expand Up @@ -285,7 +285,18 @@ export function MachineLearningStackManagementJobsProvider(
},

async importJobs() {
await testSubjects.click('mlJobMgmtImportImportButton', 1000);
await testSubjects.clickWhenNotDisabled('mlJobMgmtImportImportButton', { timeout: 5000 });

// check and close success toast
const resultToast = await toasts.getToastElement(1);
const titleElement = await testSubjects.findDescendant('euiToastHeader', resultToast);
const title: string = await titleElement.getVisibleText();
expect(title).to.match(/^\d+ job[s]? successfully imported$/);

const dismissButton = await testSubjects.findDescendant('toastCloseButton', resultToast);
await dismissButton.click();

// check that the flyout is closed
await testSubjects.missingOrFail('mlJobMgmtImportJobsFlyout', { timeout: 60 * 1000 });
},

Expand Down Expand Up @@ -340,7 +351,18 @@ export function MachineLearningStackManagementJobsProvider(
},

async selectExportJobs() {
await testSubjects.click('mlJobMgmtExportExportButton');
await testSubjects.clickWhenNotDisabled('mlJobMgmtExportExportButton', { timeout: 5000 });

// check and close success toast
const resultToast = await toasts.getToastElement(1);
const titleElement = await testSubjects.findDescendant('euiToastHeader', resultToast);
const title: string = await titleElement.getVisibleText();
expect(title).to.match(/^Your file is downloading in the background$/);

const dismissButton = await testSubjects.findDescendant('toastCloseButton', resultToast);
await dismissButton.click();

// check that the flyout is closed
await testSubjects.missingOrFail('mlJobMgmtExportJobsFlyout', { timeout: 60 * 1000 });
},

Expand Down