Skip to content

Commit

Permalink
[Cases] Fix attach lens to case serverless tests (elastic#181253)
Browse files Browse the repository at this point in the history
## Summary

Fixes: elastic#180295,
elastic#180219

Flaky test runner:
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/5937,
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/5938

### Checklist

Delete any items that are not applicable to this PR.

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed

### For maintainers

- [x] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit 06297c0)
  • Loading branch information
cnasikas committed May 13, 2024
1 parent 3782351 commit 593d09e
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 14 deletions.
Expand Up @@ -21,9 +21,9 @@ export default ({ getPageObject, getService }: FtrProviderContext) => {
const svlCases = getService('svlCases');
const find = getService('find');
const toasts = getService('toasts');
const retry = getService('retry');

// FLAKY: https://github.com/elastic/kibana/issues/180219
describe.skip('Cases persistable attachments', function () {
describe('Cases persistable attachments', function () {
describe('lens visualization', () => {
before(async () => {
await svlCommonPage.login();
Expand Down Expand Up @@ -59,17 +59,27 @@ export default ({ getPageObject, getService }: FtrProviderContext) => {
await testSubjects.click('embeddablePanelToggleMenuIcon');
await testSubjects.click('embeddablePanelMore-mainMenu');
await testSubjects.click('embeddablePanelAction-embeddable_addToExistingCase');
await testSubjects.click('cases-table-add-case-filter-bar');

await testSubjects.existOrFail('create-case-flyout');
await retry.waitFor('wait for the modal to open', async () => {
return (
(await testSubjects.exists('all-cases-modal')) &&
(await testSubjects.exists('cases-table-add-case-filter-bar'))
);
});

await testSubjects.setValue('input', caseTitle);
await retry.waitFor('wait for the flyout to open', async () => {
if (await testSubjects.exists('cases-table-add-case-filter-bar')) {
await testSubjects.click('cases-table-add-case-filter-bar');
}

return testSubjects.exists('create-case-flyout');
});

await testSubjects.setValue('input', caseTitle);
await testSubjects.setValue('euiMarkdownEditorTextArea', 'test description');

// verify that solution picker is not visible
await testSubjects.missingOrFail('caseOwnerSelector');

await testSubjects.click('create-case-submit');

await cases.common.expectToasterToContain(`${caseTitle} has been updated`);
Expand All @@ -84,7 +94,9 @@ export default ({ getPageObject, getService }: FtrProviderContext) => {
const title = await find.byCssSelector('[data-test-subj="editable-title-header-value"]');
expect(await title.getVisibleText()).toEqual(caseTitle);

await testSubjects.existOrFail('comment-persistableState-.lens');
await retry.waitFor('wait for the visualization to exist', async () => {
return testSubjects.exists('comment-persistableState-.lens');
});
});

it('adds lens visualization to an existing case from dashboard', async () => {
Expand Down
Expand Up @@ -21,8 +21,7 @@ export default ({ getPageObject, getService }: FtrProviderContext) => {
const header = getPageObject('header');
const toasts = getService('toasts');

// FLAKY: https://github.com/elastic/kibana/issues/180295
describe.skip('Cases persistable attachments', () => {
describe('Cases persistable attachments', () => {
describe('lens visualization', () => {
before(async () => {
await svlCommonPage.login();
Expand Down Expand Up @@ -52,17 +51,27 @@ export default ({ getPageObject, getService }: FtrProviderContext) => {
await testSubjects.click('embeddablePanelToggleMenuIcon');
await testSubjects.click('embeddablePanelMore-mainMenu');
await testSubjects.click('embeddablePanelAction-embeddable_addToExistingCase');
await testSubjects.click('cases-table-add-case-filter-bar');

await testSubjects.existOrFail('create-case-flyout');
await retry.waitFor('wait for the modal to open', async () => {
return (
(await testSubjects.exists('all-cases-modal')) &&
(await testSubjects.exists('cases-table-add-case-filter-bar'))
);
});

await testSubjects.setValue('input', caseTitle);
await retry.waitFor('wait for the flyout to open', async () => {
if (await testSubjects.exists('cases-table-add-case-filter-bar')) {
await testSubjects.click('cases-table-add-case-filter-bar');
}

return testSubjects.exists('create-case-flyout');
});

await testSubjects.setValue('input', caseTitle);
await testSubjects.setValue('euiMarkdownEditorTextArea', 'test description');

// verify that solution picker is not visible
await testSubjects.missingOrFail('caseOwnerSelector');

await testSubjects.click('create-case-submit');

await cases.common.expectToasterToContain(`${caseTitle} has been updated`);
Expand All @@ -77,7 +86,9 @@ export default ({ getPageObject, getService }: FtrProviderContext) => {
const title = await find.byCssSelector('[data-test-subj="editable-title-header-value"]');
expect(await title.getVisibleText()).toEqual(caseTitle);

await testSubjects.existOrFail('comment-persistableState-.lens');
await retry.waitFor('wait for the visualization to exist', async () => {
return testSubjects.exists('comment-persistableState-.lens');
});
});

it('adds lens visualization to an existing case from dashboard', async () => {
Expand Down

0 comments on commit 593d09e

Please sign in to comment.