Skip to content

Commit

Permalink
Add new test suite and workflow for left navigation menu in 2.x (#1707)
Browse files Browse the repository at this point in the history
* Add new test suite and workflow for left navigation menu

Signed-off-by: Owen Wang <owenwyk@amazon.com>

* Fix missing config for disable workspace

Signed-off-by: Owen Wang <owenwyk@amazon.com>

* Address comments by adding additional assertion to navigation menu

Signed-off-by: Owen Wang <owenwyk@amazon.com>

* Fix lint issue in dashboards test cases
Signed-off-by: Owen Wang <owenwyk@amazon.com>

---------

Signed-off-by: Owen Wang <owenwyk@amazon.com>
(cherry picked from commit 947aaa0)
  • Loading branch information
FriedhelmWS committed Feb 12, 2025
1 parent 7e42d4b commit 94b3fc3
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 16 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/left-navigation-release-e2e-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
with:
test-name: left navigation workspace enabled with security
test-command: env CYPRESS_WORKSPACE_ENABLED=true CYPRESS_SAVED_OBJECTS_PERMISSION_ENABLED=true yarn cypress:run-with-security --browser chromium --spec 'cypress/integration/core-opensearch-dashboards/opensearch-dashboards/left-navigation/*'
osd-serve-args: --workspace.enabled=true --savedObjects.permission.enabled=true --opensearchDashboards.dashboardAdmin.users='["admin"]' --uiSettings.overrides.home:useNewHomePage=true
osd-serve-args: --workspace.enabled=true --savedObjects.permission.enabled=true --opensearch_security.multitenancy.enabled=false --opensearchDashboards.dashboardAdmin.users='["admin"]' --uiSettings.overrides.home:useNewHomePage=true
artifact-name-suffix: '-workspace-enabled-with-security'
tests-workspace-enabled-without-security:
needs: changes
Expand All @@ -41,7 +41,7 @@ jobs:
with:
test-name: left navigation workspace disabled with security
test-command: env CYPRESS_WORKSPACE_ENABLED=false CYPRESS_SAVED_OBJECTS_PERMISSION_ENABLED=true yarn cypress:run-with-security --browser chromium --spec 'cypress/integration/core-opensearch-dashboards/opensearch-dashboards/left-navigation/*'
osd-serve-args: --workspace.enabled=false --savedObjects.permission.enabled=true --opensearchDashboards.dashboardAdmin.users='["admin"]' --uiSettings.overrides.home:useNewHomePage=true
osd-serve-args: --workspace.enabled=false --savedObjects.permission.enabled=true --opensearch_security.multitenancy.enabled=false --opensearchDashboards.dashboardAdmin.users='["admin"]' --uiSettings.overrides.home:useNewHomePage=true
artifact-name-suffix: '-workspace-disabled-with-security'
tests-workspace-disabled-without-security:
needs: changes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ if (isWorkspaceEnabled) {
}
});

it('features are visible inside left navigation analytics for analytics use case', () => {
it('features are visible inside left navigation for analytics use case', () => {
validateWorkspaceNavMenu('all', () => {
cy.contains(/Visualize and report/).should('exist');
cy.contains(/Observability/).should('exist');
Expand All @@ -83,19 +83,19 @@ if (isWorkspaceEnabled) {
});
});

it('features are visible inside left navigation analytics for essentials use case', () => {
it('features are visible inside left navigation for essentials use case', () => {
validateWorkspaceNavMenu('essentials', () => {});
});

it('features are visible inside left navigation analytics for search use case', () => {
it('features are visible inside left navigation for search use case', () => {
validateWorkspaceNavMenu('search', () => {
cy.contains(/Visualize and report/).should('exist');
isWorkspaceEnabled &&
cy.contains(/Compare search results/).should('exist');
});
});

it('features are visible inside left navigation analytics for security analytics use case', () => {
it('features are visible inside left navigation for security analytics use case', () => {
validateWorkspaceNavMenu('security-analytics', () => {
cy.contains(/Visualize and report/).should('exist');
cy.contains(/Threat detection/).should('exist');
Expand Down Expand Up @@ -261,7 +261,9 @@ describe('Left navigation menu', () => {
});
});

cy.wait(1000);
// wait for the page to be loaded
cy.get('.visualize').should('exist');
cy.get('.headerRecentItemsButton--loadingIndicator').should('not.exist');

// open recent history dialog
cy.get('.headerRecentItemsButton').should('exist').click();
Expand All @@ -271,23 +273,22 @@ describe('Left navigation menu', () => {
cy.contains(visualizationName).should('exist');
});

// click recent history button again to close the dialog
cy.get('.headerRecentItemsButton').click();

// back to dashboard
cy.get('.left-navigation-wrapper').within(() => {
cy.contains(/Dashboards/)
.should('exist')
.click();
.click({ force: true });
});

cy.wait(1000);
// wait for the page to be loaded
cy.get('.application').should('exist');
cy.get('.headerRecentItemsButton--loadingIndicator').should('not.exist');

// open recent history dialog again
cy.get('.headerRecentItemsButton').should('exist').click();
cy.get('div[role="dialog"]').within(() => {
// click recent visited visualization in the dialog
cy.contains(visualizationName).should('exist').click();
cy.contains(visualizationName).should('exist').click({ force: true });
});

// should go back to the visualization screen just visited
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
/// <reference types="cypress" />

import { setTimeFilter, TRACE_ID } from '../../../utils/constants';
import customParseFormat from 'dayjs/plugin/customParseFormat';
import dayjs from 'dayjs';

dayjs.extend(customParseFormat);

describe('Testing traces table', () => {
beforeEach(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ const deleteAllNotebooks = () => {
'DELETE',
'/api/observability/notebooks/note/savedNotebook/*'
).as('deleteNotebook');
cy.wait(delayTime*3);

cy.wait(delayTime * 3);
moveToNotebookHome();
cy.wait(delayTime*3);
cy.wait(delayTime * 3);

cy.get('[data-test-subj="globalLoadingIndicator"]').should('not.exist');

Expand Down

0 comments on commit 94b3fc3

Please sign in to comment.