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

[SIEM] Improves toggle column Cypress tests execution time #54475

Merged
merged 6 commits into from
Jan 16, 2020

Conversation

MadameSheema
Copy link
Member

Summary

Improves toggle column Cypress tests execution time from 102s to 53s.

@elasticmachine
Copy link
Contributor

Pinging @elastic/siem (Team:SIEM)


export const CLOSE_TIMELINE_BTN = '[data-test-subj="close-timeline"]';

export const CLOSE_PROVIDER_BADGE_BTN = '[data-test-subj="closeProviderBadge"]';
Copy link
Contributor

Choose a reason for hiding this comment

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

Per the discussion in #54463, this should be:

export const CLOSE_PROVIDER_BADGE_BTN = 'button[title="Remove Data Provider"]';

@@ -68,24 +73,24 @@ describe('toggle column in timeline', () => {
cy.get(`[data-test-subj="timeline"] [data-test-subj="header-text-${idField}"]`).should('exist');
});

it('adds the _id field to the timeline via drag and drop', () => {
it('adds the _index field to the timeline via drag and drop', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

It appears this change was necessary because the _id column, which was added in a previous test, is not cleared by clearTimeline(), per the screenshot below:

_id_field_in_timeline

The Fields Browser Reset Fields button restores all default fields in the timeline, and there's an example of this feature being tested in the it('resets all fields in the timeline when Reset Fields is clicked') test, in x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/fields_browser/fields_browser.spec.ts, but rather than adding this as an additional step in clearTimeline(), I think a slightly more bulletproof implementation of clearTimeline() would be to invoke the Create New Timeline menu item shown in the screenshot below, which will reset all of the state currently cleared by clearTimeline(), plus much more, including the column state:

create_new_timeline

Please consider replacing the implementation of clearTimeline() to use Create New Timeline, and reverting the changes to this test.

@MadameSheema
Copy link
Member Author

@elasticmachine merge upstream

Copy link
Contributor

@andrew-goldstein andrew-goldstein left a comment

Choose a reason for hiding this comment

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

🙏 works great locally
LGTM

@MadameSheema
Copy link
Member Author

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

History

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

@MadameSheema MadameSheema merged commit 8a07023 into elastic:master Jan 16, 2020
@MadameSheema MadameSheema deleted the toggle-column-refactor branch January 16, 2020 11:31
MadameSheema added a commit to MadameSheema/kibana that referenced this pull request Jan 16, 2020
…4475)

* refactor

* replaces 'clearTimeline' for 'createNewTimeline'

* fixes typecheck issue

Co-authored-by: Elastic Machine <[email protected]>
MadameSheema added a commit to MadameSheema/kibana that referenced this pull request Jan 16, 2020
…4475)

* refactor

* replaces 'clearTimeline' for 'createNewTimeline'

* fixes typecheck issue

Co-authored-by: Elastic Machine <[email protected]>
MadameSheema added a commit that referenced this pull request Jan 16, 2020
…55027)

* refactor

* replaces 'clearTimeline' for 'createNewTimeline'

* fixes typecheck issue

Co-authored-by: Elastic Machine <[email protected]>

Co-authored-by: Elastic Machine <[email protected]>
MadameSheema added a commit that referenced this pull request Jan 16, 2020
…55028)

* refactor

* replaces 'clearTimeline' for 'createNewTimeline'

* fixes typecheck issue

Co-authored-by: Elastic Machine <[email protected]>

Co-authored-by: Elastic Machine <[email protected]>
jkelastic pushed a commit to jkelastic/kibana that referenced this pull request Jan 17, 2020
…4475)

* refactor

* replaces 'clearTimeline' for 'createNewTimeline'

* fixes typecheck issue

Co-authored-by: Elastic Machine <[email protected]>
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:SIEM v7.6.0 v7.7.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants