Skip to content

Commit

Permalink
Add waitUntilLoadingHasFinished in failing tests (#205485)
Browse files Browse the repository at this point in the history
Fixes: #205535
Fixes: #205514
Fixes: #205498
Fixes: #205464
Fixes: #205456
Fixes: #205453
Fixes: #205450
Fixes: #205412
Fixes: #205410
Fixes: #205401
Fixes: #205400
Fixes: #205399
Fixes: #205350
Fixes: #205349
Fixes: #205316
Fixes: #205288
Fixes: #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.
  • Loading branch information
SoniaSanzV authored Jan 8, 2025
1 parent 5c13e90 commit bcdf942
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 @@ -199,6 +199,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 @@ -246,11 +247,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 @@ -263,11 +261,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 @@ -281,16 +276,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 @@ -303,8 +296,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 @@ -314,9 +307,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 bcdf942

Please sign in to comment.