diff --git a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/workspace-plugin/mds_workspace_create.spec.js b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/workspace-plugin/mds_workspace_create.spec.js index 66f61c6fb..9244999a8 100644 --- a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/workspace-plugin/mds_workspace_create.spec.js +++ b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/workspace-plugin/mds_workspace_create.spec.js @@ -8,19 +8,16 @@ const miscUtils = new MiscUtils(cy); const workspaceName = 'test_workspace_az3RBx6cE'; const inputWorkspaceName = (workspaceName) => { - const nameInput = cy.getElementByTestId( - 'workspaceForm-workspaceDetails-nameInputText' - ); - nameInput.clear(); - nameInput.type(workspaceName); + const nameInputTestId = 'workspaceForm-workspaceDetails-nameInputText'; + cy.getElementByTestId(nameInputTestId).clear(); + cy.getElementByTestId(nameInputTestId).type(workspaceName); }; const inputWorkspaceColor = (color = '#000000') => { - const colorPicker = cy.getElementByTestId( - 'euiColorPickerAnchor workspaceForm-workspaceDetails-colorPicker' - ); - colorPicker.clear({ force: true }); - colorPicker.type(color); + const colorPickerTestId = + 'euiColorPickerAnchor workspaceForm-workspaceDetails-colorPicker'; + cy.getElementByTestId(colorPickerTestId).clear({ force: true }); + cy.getElementByTestId(colorPickerTestId).type(color); }; if (Cypress.env('WORKSPACE_ENABLED')) { diff --git a/cypress/support/index.js b/cypress/support/index.js index ee60936d9..43a1340f8 100644 --- a/cypress/support/index.js +++ b/cypress/support/index.js @@ -19,7 +19,7 @@ // *********************************************************** // Import commands.js using ES2015 syntax: -import '../utils/commands'; +import * as commands from '../utils/commands'; import '../utils/dashboards/commands'; import '../utils/dashboards/datasource-management-dashboards-plugin/commands'; import '../utils/plugins/index-management-dashboards-plugin/commands'; @@ -33,13 +33,13 @@ import '../utils/plugins/notifications-dashboards/commands'; import '../utils/plugins/dashboards-assistant/commands'; import '../utils/dashboards/console/commands'; import '../utils/dashboards/workspace-plugin/commands'; -import { currentBackendEndpoint } from '../utils/commands'; import 'cypress-real-events'; // Alternatively you can use CommonJS syntax: // require('./commands') +const { currentBackendEndpoint } = commands; const resizeObserverLoopErrRe = /^[^(ResizeObserver loop limit exceeded)]/; Cypress.on('uncaught:exception', (err) => { /* returning false here prevents Cypress from failing the test */