Skip to content

Commit

Permalink
Add waitUntilLoadingHasFinished in failing tests (elastic#205485)
Browse files Browse the repository at this point in the history
Fixes: elastic#205535
Fixes: elastic#205514
Fixes: elastic#205498
Fixes: elastic#205464
Fixes: elastic#205456
Fixes: elastic#205453
Fixes: elastic#205450
Fixes: elastic#205412
Fixes: elastic#205410
Fixes: elastic#205401
Fixes: elastic#205400
Fixes: elastic#205399
Fixes: elastic#205350
Fixes: elastic#205349
Fixes: elastic#205316
Fixes: elastic#205288
Fixes: elastic#205287

## Summary
It seems that the step tabs are not loading fast enough for the tests to
find the expected element in a [bunch of
test](https://github.com/elastic/kibana/issues?q=is%3Aopen%20label%3A%22Team%3AKibana%20Management%22%20label%3A%22failed-test%22%20created%3A%3E%40today-1w%20).
This PR attempt to fix it. It also adds the
`data-test-subj="indexModeValue"` tag in `TabSummary` that was missing.

(cherry picked from commit bcdf942)
  • Loading branch information
SoniaSanzV committed Jan 8, 2025
1 parent 1384ced commit 8e6292c
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 51 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ export const TabSummary: React.FunctionComponent<Props> = ({ templateDetails })
defaultMessage="Index mode"
/>
</EuiDescriptionListTitle>
<EuiDescriptionListDescription>
<EuiDescriptionListDescription data-test-subj="indexModeValue">
{indexModeLabels[indexMode]}
</EuiDescriptionListDescription>
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {

// Click update template
await pageObjects.indexManagement.clickNextButton();
await pageObjects.header.waitUntilLoadingHasFinished();

// Verify index mode and close detail tab
expect(await testSubjects.getVisibleText('indexModeValue')).to.be(indexModeName);
Expand Down Expand Up @@ -322,11 +323,8 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {

await changeIndexMode('index_mode_logsdb');
// Navigate to the last step of the wizard
await testSubjects.click('nextButton');
await testSubjects.click('nextButton');
await testSubjects.click('nextButton');
await testSubjects.click('nextButton');
await testSubjects.click('nextButton');
await testSubjects.click('formWizardStep-5');
await pageObjects.header.waitUntilLoadingHasFinished();

await verifyModeHasBeenChanged(INDEX_MODE.LOGSDB);
});
Expand All @@ -339,11 +337,8 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {

await changeIndexMode('index_mode_standard');
// Navigate to the last step of the wizard
await testSubjects.click('nextButton');
await testSubjects.click('nextButton');
await testSubjects.click('nextButton');
await testSubjects.click('nextButton');
await testSubjects.click('nextButton');
await testSubjects.click('formWizardStep-5');
await pageObjects.header.waitUntilLoadingHasFinished();

await verifyModeHasBeenChanged(INDEX_MODE.STANDARD);
});
Expand All @@ -357,16 +352,15 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {

await changeIndexMode('index_mode_logsdb');

await testSubjects.click('nextButton');
await testSubjects.click('nextButton');
await testSubjects.click('formWizardStep-2');
await pageObjects.header.waitUntilLoadingHasFinished();
// Modify Index settings
await testSubjects.setValue('kibanaCodeEditor', '{}', {
clearWithKeyboard: true,
});
// Navigate to the last step of the wizard
await testSubjects.click('nextButton');
await testSubjects.click('nextButton');
await testSubjects.click('nextButton');
await testSubjects.click('formWizardStep-5');
await pageObjects.header.waitUntilLoadingHasFinished();

await verifyModeHasBeenChanged(INDEX_MODE.LOGSDB);
});
Expand All @@ -379,8 +373,8 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {

await changeIndexMode('index_mode_time_series');

await testSubjects.click('nextButton');
await testSubjects.click('nextButton');
await testSubjects.click('formWizardStep-2');
await pageObjects.header.waitUntilLoadingHasFinished();
// Modify Index settings
await testSubjects.setValue(
'kibanaCodeEditor',
Expand All @@ -390,9 +384,8 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
}
);
// Navigate to the last step of the wizard
await testSubjects.click('nextButton');
await testSubjects.click('nextButton');
await testSubjects.click('nextButton');
await testSubjects.click('formWizardStep-5');
await pageObjects.header.waitUntilLoadingHasFinished();

await verifyModeHasBeenChanged(INDEX_MODE.TIME_SERIES);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,8 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
await testSubjects.click('show-filters-button');
await testSubjects.click('filter-option-h');
// Navigate to the last step of the wizard
await testSubjects.click('nextButton');
await testSubjects.click('nextButton');
await testSubjects.click('nextButton');
await testSubjects.click('nextButton');
await testSubjects.click('nextButton');
await testSubjects.click('formWizardStep-5');
await pageObjects.header.waitUntilLoadingHasFinished();

expect(await testSubjects.getVisibleText('lifecycleValue')).to.be('7 hours');

Expand All @@ -71,11 +68,8 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
await testSubjects.click('index_mode_logsdb');

// Navigate to the last step of the wizard
await testSubjects.click('nextButton');
await testSubjects.click('nextButton');
await testSubjects.click('nextButton');
await testSubjects.click('nextButton');
await testSubjects.click('nextButton');
await testSubjects.click('formWizardStep-5');
await pageObjects.header.waitUntilLoadingHasFinished();

expect(await testSubjects.exists('indexModeTitle')).to.be(true);
expect(await testSubjects.getVisibleText('indexModeValue')).to.be('LogsDB');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {

// Click update template
await pageObjects.indexManagement.clickNextButton();
await pageObjects.header.waitUntilLoadingHasFinished();

// Verify index mode and close detail tab
expect(await testSubjects.getVisibleText('indexModeValue')).to.be(indexModeName);
Expand Down Expand Up @@ -245,11 +246,8 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {

await changeIndexMode('index_mode_logsdb');
// Navigate to the last step of the wizard
await testSubjects.click('nextButton');
await testSubjects.click('nextButton');
await testSubjects.click('nextButton');
await testSubjects.click('nextButton');
await testSubjects.click('nextButton');
await testSubjects.click('formWizardStep-5');
await pageObjects.header.waitUntilLoadingHasFinished();

await verifyModeHasBeenChanged(INDEX_MODE.LOGSDB);
});
Expand All @@ -262,11 +260,8 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {

await changeIndexMode('index_mode_standard');
// Navigate to the last step of the wizard
await testSubjects.click('nextButton');
await testSubjects.click('nextButton');
await testSubjects.click('nextButton');
await testSubjects.click('nextButton');
await testSubjects.click('nextButton');
await testSubjects.click('formWizardStep-5');
await pageObjects.header.waitUntilLoadingHasFinished();

await verifyModeHasBeenChanged(INDEX_MODE.STANDARD);
});
Expand All @@ -280,16 +275,14 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {

await changeIndexMode('index_mode_logsdb');

await testSubjects.click('nextButton');
await testSubjects.click('nextButton');
await testSubjects.click('formWizardStep-2');
await pageObjects.header.waitUntilLoadingHasFinished();
// Modify Index settings
await testSubjects.setValue('kibanaCodeEditor', '{}', {
clearWithKeyboard: true,
});
// Navigate to the last step of the wizard
await testSubjects.click('nextButton');
await testSubjects.click('nextButton');
await testSubjects.click('nextButton');
await testSubjects.click('formWizardStep-5');

await verifyModeHasBeenChanged(INDEX_MODE.LOGSDB);
});
Expand All @@ -302,8 +295,8 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {

await changeIndexMode('index_mode_time_series');

await testSubjects.click('nextButton');
await testSubjects.click('nextButton');
await testSubjects.click('formWizardStep-2');
await pageObjects.header.waitUntilLoadingHasFinished();
// Modify Index settings
await testSubjects.setValue(
'kibanaCodeEditor',
Expand All @@ -313,9 +306,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
}
);
// Navigate to the last step of the wizard
await testSubjects.click('nextButton');
await testSubjects.click('nextButton');
await testSubjects.click('nextButton');
await testSubjects.click('formWizardStep-5');

await verifyModeHasBeenChanged(INDEX_MODE.TIME_SERIES);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,12 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {

// Click form summary step and then the submit button
await testSubjects.click('formWizardStep-5');
await pageObjects.header.waitUntilLoadingHasFinished();
expect(await testSubjects.getVisibleText('indexModeValue')).to.be('LogsDB');

// Click update template
await pageObjects.indexManagement.clickNextButton();
await pageObjects.header.waitUntilLoadingHasFinished();

// Close detail tab
expect(await testSubjects.getVisibleText('indexModeValue')).to.be('LogsDB');
Expand Down

0 comments on commit 8e6292c

Please sign in to comment.