Skip to content

Commit

Permalink
Fix flaky
Browse files Browse the repository at this point in the history
  • Loading branch information
cnasikas committed Jun 27, 2023
1 parent 0d52d79 commit abaead4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
11 changes: 11 additions & 0 deletions x-pack/test/functional/services/cases/single_case_view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,17 @@ export function CasesSingleViewServiceProvider({ getService, getPageObject }: Ft
});
},

async addComment(comment: string) {
const addCommentElement = await find.byCssSelector(
'[data-test-subj="add-comment"] textarea.euiMarkdownEditorTextArea'
);

await addCommentElement.focus();
await addCommentElement.type(comment);

await this.submitComment();
},

async addVisualizationToNewComment(visName: string) {
// open saved object finder
const addCommentElement = await testSubjects.find('add-comment');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,9 @@ export default ({ getPageObject, getService }: FtrProviderContext) => {
});

it('shows unsaved comment message when page is refreshed', async () => {
await cases.singleCase.addComment('my comment');
await header.waitUntilLoadingHasFinished();

await testSubjects.click('property-actions-user-action-ellipses');

await header.waitUntilLoadingHasFinished();
Expand All @@ -319,7 +322,9 @@ export default ({ getPageObject, getService }: FtrProviderContext) => {

await header.waitUntilLoadingHasFinished();

await testSubjects.existOrFail('user-action-comment-unsaved-draft');
retry.tryForTime(2000, async () => {
await testSubjects.existOrFail('user-action-comment-unsaved-draft');
});
});

it('shows unsaved description message when page is refreshed', async () => {
Expand Down

0 comments on commit abaead4

Please sign in to comment.