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

[Security Solution] Refactor Cypress tests navigation utilities #166201

Merged
merged 18 commits into from Sep 22, 2023

Conversation

maximpn
Copy link
Contributor

@maximpn maximpn commented Sep 11, 2023

Relates to: #153645

Summary

This PR makes refactoring of navigation utilities and constants to make it transparent and be able to specify correct ownership later on.

Motivation

Engineers need to add new tests and maintain the older ones. Base building blocks of this are constants and utility functions in particular URL constants and visit() and visitWithoutDataRange() functions. It turned out a simple visit() helper function also passes timerange as a query param while only some tests need it. Having it as a base utility function (as the name suggests) it also gets used in the new code while visitWithoutDateRange() should be preferred. On top of that URL constants are combined in one file without clear ownership and contain a mix of legacy and new urls with some parts looking outdated as navigating to the url causes redirecting to a specific page.

Having only relevant URL constants in a common file will help to reduce confusion. As the next step constants should be split into files/folders with clear ownership.

Also having visit() adding no extra params (besides common for ALL the tests) will make the intention clear. Whenever a time range is needed visitWithTimeRange() can be used (ideally accepting a time range defined in a test). And the same stays true for any other pages, e.g. rule details page can have a utility visitRuleDetailsPage(id: string) containing some general waiting logic so the following actions operate on a loaded page.

Details

As a step towards clearness and transparent ownership this PR performs refactoring of x-pack/test/security_solution_cypress/cypress/urls/navigation.ts and x-pack/test/security_solution_cypress/cypress/tasks/login.ts files. The following has been done

  • all url constants in x-pack/test/security_solution_cypress/cypress/urls/navigation.ts were checked and updated to remove duplications, avoid redirections and grouped
  • legacy urls were moved to the only one test using them to test compatibility (x-pack/test/security_solution_cypress/cypress/e2e/urls/compatibility.cy.ts)
  • visit() was renamed to visitWithTimeRange()
  • visitWithoutDateRange() was renamed to visit()
  • visit() was refactored to accept a query string

Next steps

It's expected teams decompose x-pack/test/security_solution_cypress/cypress/urls/navigation.ts into feature specific file(s)/folder(s) with assigned owners.

There is no 100% chance a generic wait for a page to be loaded helper function meet requirements for each page. It makes sense to consider adding per feature visitFeatureAPage() helper function containing assertions for the page to be loaded. visitRuleDetailsPage(id: string) was added for this purpose while waiting for page to be loaded functionality is omitted in this PR to reduce a number of changes.

@maximpn maximpn added technical debt Improvement of the software architecture and operational architecture Team:Detections and Resp Security Detection Response Team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Team:Detection Rule Management Security Detection Rule Management Team v8.11.0 labels Sep 11, 2023
@maximpn maximpn self-assigned this Sep 11, 2023
@maximpn maximpn force-pushed the rectify-cypress-urls branch 2 times, most recently from 7fe7738 to 5fd6a47 Compare September 13, 2023 09:19
@maximpn maximpn changed the title [Security Solution] Rectify Cypress urls [Security Solution] Refactor Cypress tests navigation utilities Sep 13, 2023
@maximpn maximpn marked this pull request as ready for review September 13, 2023 18:43
@maximpn maximpn requested review from a team as code owners September 13, 2023 18:43
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-detections-response (Team:Detections and Resp)

@elasticmachine
Copy link
Contributor

Pinging @elastic/security-solution (Team: SecuritySolution)

@maximpn maximpn force-pushed the rectify-cypress-urls branch 2 times, most recently from 91a3a3b to 6afa689 Compare September 14, 2023 23:41
@maximpn maximpn added the release_note:skip Skip the PR/issue when compiling release notes label Sep 15, 2023
Copy link
Contributor

@semd semd left a comment

Choose a reason for hiding this comment

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

Security changes LGTM. Thanks for the refactor, it looks much better 👏

@maximpn
Copy link
Contributor Author

maximpn commented Sep 20, 2023

Files by Code Owner

elastic/security-detection-engine

  • x-pack/test/security_solution_cypress/cypress/e2e/data_sources/create_runtime_field.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/data_sources/sourcerer.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/data_sources/sourcerer_timeline.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/data_sources/sourcerer_timeline.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/detection_alerts/alert_tags.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/detection_alerts/alerts_charts.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/detection_alerts/alerts_detection_callouts_index_outdated.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/detection_alerts/cti_enrichments.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/detection_alerts/enrichments.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/detection_alerts/missing_privileges_callout.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/detection_alerts/ransomware_detection.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/detection_alerts/ransomware_prevention.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_actions/rule_actions.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_creation/custom_query_rule.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_creation/custom_query_rule_data_view.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_creation/custom_saved_query_rule.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_creation/event_correlation_rule.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_creation/indicator_match_rule.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_creation/machine_learning_rule.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_creation/new_terms_rule.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_creation/override.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_creation/threshold_rule.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/detection_response/value_lists/value_lists.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/entity_analytics/entity_analytics_management_page.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/exceptions/alerts_table_flow/endpoint_exceptions.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/exceptions/alerts_table_flow/rule_exceptions/auto_populate_with_alert_data.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/exceptions/alerts_table_flow/rule_exceptions/closing_all_matching_alerts.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/exceptions/entry/flyout_validation.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/exceptions/entry/multiple_conditions.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/exceptions/entry/use_value_list.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/exceptions/rule_details_flow/add_edit_endpoint_exception.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/exceptions/rule_details_flow/add_edit_exception.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/exceptions/rule_details_flow/add_edit_exception_data_view.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/exceptions/rule_details_flow/read_only_view.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/exceptions/shared_exception_lists_management/list_detail_page/list_details.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/exceptions/shared_exception_lists_management/manage_exceptions.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/exceptions/shared_exception_lists_management/shared_exception_list_page/duplicate_lists.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/exceptions/shared_exception_lists_management/shared_exception_list_page/filter_table.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/exceptions/shared_exception_lists_management/shared_exception_list_page/import_lists.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/exceptions/shared_exception_lists_management/shared_exception_list_page/manage_lists.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/exceptions/shared_exception_lists_management/shared_exception_list_page/read_only.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/overview/cti_link_panel.cy.ts
  • x-pack/test/security_solution_cypress/cypress/urls/edit_rule.ts
  • x-pack/test/security_solution_cypress/cypress/urls/navigation.ts
  • x-pack/test/security_solution_cypress/cypress/urls/rule_details.ts
  • x-pack/test/security_solution_cypress/cypress/urls/rules_management.ts

elastic/security-detection-rule-management

  • x-pack/test/security_solution_cypress/cypress/e2e/detection_response/prebuilt_rules/prebuilt_rules_install_update_authorization.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/detection_response/prebuilt_rules/prebuilt_rules_install_update_error_handling.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/detection_response/prebuilt_rules/prebuilt_rules_install_update_workflows.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/detection_response/prebuilt_rules/prebuilt_rules_management.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/detection_response/prebuilt_rules/prebuilt_rules_notifications.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/authorization/all_rules_read_only.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/maintenance_windows/maintenance_window_callout.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/related_integrations/related_integrations.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rule_actions/bulk_actions/bulk_duplicate_rules.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rule_actions/bulk_actions/bulk_edit_rules.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rule_actions/bulk_actions/bulk_edit_rules_actions.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rule_actions/bulk_actions/bulk_edit_rules_data_view.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rule_actions/import_export/export_rule.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rule_actions/import_export/import_rules.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rule_actions/snoozing/rule_snoozing.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rules_table/rules_table_auto_refresh.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rules_table/rules_table_filtering.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rules_table/rules_table_links.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rules_table/rules_table_persistent_state.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rules_table/rules_table_selection.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rules_table/rules_table_sorting.cy.ts

elastic/security-threat-hunting-explore

  • x-pack/test/security_solution_cypress/cypress/e2e/explore/cases/attach_alert_to_case.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/explore/cases/attach_timeline.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/explore/cases/connector_options.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/explore/cases/connectors.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/explore/cases/creation.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/explore/cases/privileges.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/explore/dashboards/enable_risk_score.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/explore/dashboards/entity_analytics.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/explore/dashboards/entity_analytics_serverless_splash_screen.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/explore/dashboards/upgrade_risk_score.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/explore/filters/pinned_filters.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/explore/guided_onboarding/tour.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/explore/host_details/risk_tab.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/explore/hosts/events_viewer.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/explore/hosts/host_risk_tab.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/explore/hosts/hosts_risk_column.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/explore/network/hover_actions.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/explore/network/overflow_items.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/explore/overview/overview.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/explore/pagination/pagination.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/explore/users/user_details.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/explore/users/users_tabs.cy.ts

elastic/security-threat-hunting-investigations

  • x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/alert_table_action_column.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/alert_table_controls.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/alerts_cell_actions.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/alerts_details.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/building_block_alerts.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/changing_alert_status.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/detection_page_filters.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/event_rendered_view.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_left_panel_analyzer_graph_tab.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_left_panel_correlations_tab.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_left_panel_entities_tab.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_left_panel_investigation_tab.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_left_panel_prevalence_tab.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_left_panel_response_tab.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_left_panel_session_view_tab.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_left_panel_threat_intelligence_tab.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_preview_panel_alert_reason_preview.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_preview_panel_rule_preview.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_right_panel.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_right_panel_json_tab.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_right_panel_overview_tab.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_right_panel_table_tab.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_url_sync.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/investigate_in_timeline.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/navigation.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/resolver.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/investigations/dasbhoards/detection_response.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/investigations/timeline_templates/creation.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/investigations/timeline_templates/export.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/investigations/timelines/bulk_add_to_timeline.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/investigations/timelines/correlation_tab.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/investigations/timelines/creation.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/investigations/timelines/data_providers.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/investigations/timelines/discover/cell_actions.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/investigations/timelines/discover/discover_state.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/investigations/timelines/discover/search_filter.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/investigations/timelines/export.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/investigations/timelines/fields_browser.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/investigations/timelines/flyout_button.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/investigations/timelines/full_screen.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/investigations/timelines/inspect.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/investigations/timelines/local_storage.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/investigations/timelines/notes_tab.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/investigations/timelines/open_timeline.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/investigations/timelines/overview.cy.tsx
  • x-pack/test/security_solution_cypress/cypress/e2e/investigations/timelines/pagination.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/investigations/timelines/query_tab.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/investigations/timelines/row_renderers.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/investigations/timelines/search_or_filter.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/investigations/timelines/toggle_column.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/investigations/timelines/unsaved_timeline.cy.ts
  • x-pack/test/security_solution_cypress/cypress/e2e/investigations/timelines/url_state.cy.ts
  • x-pack/test/security_solution_cypress/cypress/urls/edit_rule.ts
  • x-pack/test/security_solution_cypress/cypress/urls/navigation.ts
  • x-pack/test/security_solution_cypress/cypress/urls/rule_details.ts
  • x-pack/test/security_solution_cypress/cypress/urls/rules_management.ts

Copy link
Contributor

@PhilippeOberti PhilippeOberti left a comment

Choose a reason for hiding this comment

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

LGTM for the Threat Hunting Investigations team

@kibana-ci
Copy link
Collaborator

kibana-ci commented Sep 22, 2023

💔 Build Failed

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #30 / serverless common UI Index Management Index Templates "before all" hook for "renders the index templates tab"
  • [job] [logs] FTR Configs #10 / Upgrade Assistant Overview Page "before each" hook for "Should render overview page"

Metrics [docs]

✅ unchanged

History

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

cc @maximpn

@maximpn maximpn merged commit 5c7b57c into elastic:main Sep 22, 2023
35 of 37 checks passed
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Sep 22, 2023
@maximpn maximpn deleted the rectify-cypress-urls branch September 22, 2023 19:02
joemcelroy pushed a commit to joemcelroy/kibana that referenced this pull request Sep 25, 2023
…tic#166201)

**Relates to:** elastic#153645

## Summary

This PR makes refactoring of navigation utilities and constants to make it transparent and be able to specify correct ownership later on.

## Motivation

Engineers need to add new tests and maintain the older ones. Base building blocks of this are constants and utility functions in particular URL constants and `visit()` and `visitWithoutDataRange()` functions. It turned out a simple `visit()` helper function also passes `timerange` as a query param while only some tests need it. Having it as a base utility function (as the name suggests) it also gets used in the new code while `visitWithoutDateRange()` should be preferred. On top of that URL constants are combined in one file without clear ownership and contain a mix of legacy and new urls with some parts looking outdated as navigating to the url causes redirecting to a specific page.

Having only relevant URL constants in a common file will help to reduce confusion. As the next step constants should be split into files/folders with clear ownership.

Also having `visit()` adding no extra params (besides common for ALL the tests) will make the intention clear. Whenever a time range is needed `visitWithTimeRange()` can be used (ideally accepting a time range defined in a test). And the same stays true for any other pages, e.g. rule details page can have a utility `visitRuleDetailsPage(id: string)` containing some general waiting logic so the following actions operate on a loaded page.

## Details

As a step towards clearness and transparent ownership this PR performs refactoring of `x-pack/test/security_solution_cypress/cypress/urls/navigation.ts` and `x-pack/test/security_solution_cypress/cypress/tasks/login.ts` files. The following has been done

- all url constants in `x-pack/test/security_solution_cypress/cypress/urls/navigation.ts` were checked and updated to remove duplications, avoid redirections and grouped
- legacy urls were moved to the only one test using them to test compatibility (`x-pack/test/security_solution_cypress/cypress/e2e/urls/compatibility.cy.ts`)
- `visit()` was renamed to `visitWithTimeRange()`
- `visitWithoutDateRange()` was renamed to `visit()`
- `visit()` was refactored to accept a query string

## Next steps

It's expected teams decompose `x-pack/test/security_solution_cypress/cypress/urls/navigation.ts` into feature specific file(s)/folder(s) with assigned owners.

There is no 100% chance a generic wait for a page to be loaded helper function meet requirements for each page. It makes sense to consider adding per feature `visitFeatureAPage()` helper function containing assertions for the page to be loaded. `visitRuleDetailsPage(id: string)` was added for this purpose while waiting for page to be loaded functionality is omitted in this PR to reduce a number of changes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting ci:all-cypress-suites release_note:skip Skip the PR/issue when compiling release notes Team:Detection Rule Management Security Detection Rule Management Team Team:Detections and Resp Security Detection Response Team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. technical debt Improvement of the software architecture and operational architecture v8.11.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants