-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[Cases] Add e2e tests for category #160149
Conversation
Pinging @elastic/response-ops (Team:ResponseOps) |
Pinging @elastic/response-ops-cases (Feature:Cases) |
…-ref HEAD~1..HEAD --fix'
await testSubjects.click('category-remove-button'); | ||
|
||
// validate user action | ||
await find.byCssSelector('[data-test-subj*="category-delete-action"]'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose we could also look to see if the text exists that states that no category exists.
…kibana into category-e2e-test
@@ -16,6 +16,6 @@ describe('Category viewer ', () => { | |||
it('renders category', () => { | |||
render(<CategoryViewer category={sampleCategory} />); | |||
|
|||
expect(screen.getByText(sampleCategory)).toBeInTheDocument(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the difference between the getByText
and toHaveTextContent
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getByText
will return true even if the text exists but is not set in category field, however it could give correct result if we check with particular test subject's text content.
x-pack/plugins/cases/public/components/category/category_viewer_component.tsx
Outdated
Show resolved
Hide resolved
x-pack/test/functional_with_es_ssl/apps/cases/group1/view_case.ts
Outdated
Show resolved
Hide resolved
}); | ||
|
||
it('deletes a category from a case', async () => { | ||
await testSubjects.click('category-remove-button'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should validate in the begging of the test that the category exists like await testSubjects.existOrFail('category-' + category);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, Janki for this! Can you add a test where we filter the cases by category correctly in the cases table?
💚 Build Succeeded
Metrics [docs]Async chunks
Unknown metric groupsESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: |
Summary
Added functional tests for the category.
Flaky test runner:
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/2444
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/2475