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

Add waitUntilLoadingHasFinished in failing tests #205485

Merged
merged 10 commits into from
Jan 8, 2025
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">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this test subject used somewhere?

Copy link
Contributor Author

@SoniaSanzV SoniaSanzV Jan 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it is used. So I don't know why they were passing when I was running them locally 🫠

{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
Loading