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

[SecuritySolution] Move manual test cases to Cypress #100730

Merged
merged 43 commits into from
Jun 21, 2021

Conversation

angorayc
Copy link
Contributor

@angorayc angorayc commented May 26, 2021

Summary

#100539

This PR is to move the manual tests scenarios to Cypress test.

@angorayc
Copy link
Contributor Author

@elasticmachine merge upstream

@angorayc angorayc added release_note:skip Skip the PR/issue when compiling release notes Team:Threat Hunting Security Solution Threat Hunting Team v7.14.0 labels May 28, 2021
@angorayc
Copy link
Contributor Author

angorayc commented Jun 1, 2021

@elasticmachine merge upstream

@angorayc angorayc marked this pull request as ready for review June 1, 2021 14:26
@angorayc angorayc requested a review from a team as a code owner June 1, 2021 14:26
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-threat-hunting (Team:Threat Hunting)

@angorayc
Copy link
Contributor Author

angorayc commented Jun 1, 2021

@elasticmachine merge upstream

cy.get(TIMELINE_COLLAPSED_ITEMS_BTN).first().click();
cy.get(TIMELINE_CREATE_TEMPLATE_FROM_TIMELINE_BTN).click({ force: true });

cy.wait('@timeline').then(({ request }) => {
Copy link
Member

Choose a reason for hiding this comment

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

Is there any reason why we are asserting the BE responses instead of checking on the UI that the template is there?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As this involves opening up a modal on client side, I'm not sure if this would cause flakiness.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But ok, I've added an additional check to see if timeline modal shows up.


it('should update timeline after adding eql', () => {
cy.wait('@timeline').then(({ response }) => {
expect(response!.body.data.persistTimeline.timeline.eqlOptions).to.haveOwnProperty(
Copy link
Member

Choose a reason for hiding this comment

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

Is there any reason why we are asserting the BE responses instead of checking on the UI?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As on UI it just updates the timeline and refetches events, but I couldn't guarantee that matching events always exist, so I just check it updates timeline.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll check the total events count appears under the table as well.


cy.wait('@timeline').then(({ request }) => {
expect(request.body.timeline).to.haveOwnProperty('description', timeline.description);
expect(request.body.timeline.kqlQuery.filterQuery.kuery).to.haveOwnProperty(
Copy link
Member

Choose a reason for hiding this comment

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

Is there any reason why we are asserting the BE responses instead of checking on the UI?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll check the UI and make sure timeline's modal appears.

@angorayc
Copy link
Contributor Author

angorayc commented Jun 3, 2021

@elasticmachine merge upstream

@MadameSheema
Copy link
Member

@elasticmachine merge upstream

@MadameSheema
Copy link
Member

@elasticmachine merge upstream

@MadameSheema
Copy link
Member

@elasticmachine merge upstream

Copy link
Member

@MadameSheema MadameSheema left a comment

Choose a reason for hiding this comment

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

There are some pieces of code that probably can be refactored. But right now it makes more sense to have this merged to have more coverage on our automation side.

Lots of thanks for the work done here :)

@angorayc
Copy link
Contributor Author

@elasticmachine merge upstream

@angorayc
Copy link
Contributor Author

@elasticmachine merge upstream

@angorayc
Copy link
Contributor Author

@elasticmachine merge upstream

@angorayc
Copy link
Contributor Author

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
securitySolution 6.9MB 6.9MB +534.0B

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@angorayc angorayc merged commit 62eece5 into elastic:master Jun 21, 2021
angorayc added a commit to angorayc/kibana that referenced this pull request Jun 21, 2021
* add scenarios 1-3

* add tests for toggle full screen

* add tests for timeline pagination

* add tests for timeline correlation tab

* fix cypress tests

* add data-test-subj for timeline tabs content

* fix up

* fix flaky tests

* fix mark as favorite scenario

* fix flaky test

* fix flaky test

* fix flaky test

* refactors 'can be marked as favourite' test

* fixes test

* fixes typecheck issue

* refactors the pipe

* little fix

* mark as favourite refactor

* removes code that causes the flakiness

* apply the fix for 7.13 branch

* fix timeline api call

* fix timeline api call

* fix timeline api call

* fix syntax

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Gloria Hornero <snootchie.boochies@gmail.com>
angorayc added a commit that referenced this pull request Jun 21, 2021
* add scenarios 1-3

* add tests for toggle full screen

* add tests for timeline pagination

* add tests for timeline correlation tab

* fix cypress tests

* add data-test-subj for timeline tabs content

* fix up

* fix flaky tests

* fix mark as favorite scenario

* fix flaky test

* fix flaky test

* fix flaky test

* refactors 'can be marked as favourite' test

* fixes test

* fixes typecheck issue

* refactors the pipe

* little fix

* mark as favourite refactor

* removes code that causes the flakiness

* apply the fix for 7.13 branch

* fix timeline api call

* fix timeline api call

* fix timeline api call

* fix syntax

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Gloria Hornero <snootchie.boochies@gmail.com>

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Gloria Hornero <snootchie.boochies@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:skip Skip the PR/issue when compiling release notes Team:Threat Hunting Security Solution Threat Hunting Team v7.14.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants