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

[Discover] Unskip update data view test #176508

Merged
merged 6 commits into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const es = getService('es');
const PageObjects = getPageObjects(['settings', 'common', 'header']);

// FLAKY: https://github.com/elastic/kibana/issues/174066
describe.skip('creating and deleting default data view', function describeIndexTests() {
describe('creating and deleting default data view', function describeIndexTests() {
before(async function () {
await esArchiver.emptyKibanaIndex();
await esArchiver.loadIfNeeded(
Expand Down
16 changes: 12 additions & 4 deletions test/functional/page_objects/settings_page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,14 +215,14 @@ export class SettingsPageObject extends FtrService {
}

async getSaveDataViewButtonActive() {
await this.retry.try(async () => {
expect(
await this.retry.waitFor('active save button', async () => {
return (
(
await this.find.allByCssSelector(
'[data-test-subj="saveIndexPatternButton"]:not(.euiButton-isDisabled)'
)
).length
).to.be(1);
).length === 1
);
});
return await this.testSubjects.find('saveIndexPatternButton');
}
Expand Down Expand Up @@ -615,7 +615,13 @@ export class SettingsPageObject extends FtrService {
await this.clickEditIndexButton();
await this.header.waitUntilLoadingHasFinished();

let hasSubmittedTheForm = false;

await this.retry.try(async () => {
if (hasSubmittedTheForm && !(await this.testSubjects.exists('indexPatternEditorFlyout'))) {
// the flyout got closed
return;
}
if (dataViewName) {
await this.setNameField(dataViewName);
}
Expand All @@ -627,6 +633,8 @@ export class SettingsPageObject extends FtrService {
const indexPatternSaveBtn = await this.getSaveIndexPatternButton();
await indexPatternSaveBtn.click();

hasSubmittedTheForm = true;

const form = await this.testSubjects.findAll('indexPatternEditorForm');
const hasValidationErrors =
form.length !== 0 && (await form[0].getAttribute('data-validation-error')) === '1';
Expand Down