diff --git a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/workspace-plugin/mds_workspace_analytics_overviews.spec.js b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/workspace-plugin/mds_workspace_analytics_overviews.spec.js index 2f8241a74..67dd454d1 100644 --- a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/workspace-plugin/mds_workspace_analytics_overviews.spec.js +++ b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/workspace-plugin/mds_workspace_analytics_overviews.spec.js @@ -118,34 +118,38 @@ if (Cypress.env('WORKSPACE_ENABLED')) { cy.get('.euiLink') .contains('Quickstart guide') .should('be.visible') - .and( - 'have.attr', - 'href', - 'https://opensearch.org/docs/latest/dashboards/quickstart/' - ); + .and('have.attr', 'href') + .and((href) => { + expect(href).to.match( + /https:\/\/opensearch.org\/docs\/(latest|(\d.)+)\/dashboards\/quickstart\/$/ + ); + }); cy.get('.euiLink') .contains('Building data visualizations') .should('be.visible') - .and( - 'have.attr', - 'href', - 'https://opensearch.org/docs/latest/dashboards/visualize/viz-index/' - ); + .and('have.attr', 'href') + .and((href) => { + expect(href).to.match( + /https:\/\/opensearch.org\/docs\/(latest|(\d.)+)\/dashboards\/visualize\/viz-index\/$/ + ); + }); cy.get('.euiLink') .contains('Creating dashboards') .should('be.visible') - .and( - 'have.attr', - 'href', - 'https://opensearch.org/docs/latest/dashboards/dashboard/index/' - ); + .and('have.attr', 'href') + .and((href) => { + expect(href).to.match( + /https:\/\/opensearch.org\/docs\/(latest|(\d.)+)\/dashboards\/dashboard\/index\/$/ + ); + }); cy.contains('Learn more in Documentation') .should('be.visible') - .and( - 'have.attr', - 'href', - 'https://opensearch.org/docs/latest/dashboards/index/' - ); + .and('have.attr', 'href') + .and((href) => { + expect(href).to.match( + /https:\/\/opensearch.org\/docs\/(latest|(\d.)+)\/dashboards\/index\/$/ + ); + }); }); }); } diff --git a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/workspace-plugin/mds_workspace_essential_overviews.spec.js b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/workspace-plugin/mds_workspace_essential_overviews.spec.js index 8d24abaf6..45423f564 100644 --- a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/workspace-plugin/mds_workspace_essential_overviews.spec.js +++ b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/workspace-plugin/mds_workspace_essential_overviews.spec.js @@ -127,27 +127,30 @@ if (Cypress.env('WORKSPACE_ENABLED')) { // get a link with text as Quickstart guide cy.get('a') .contains('Quickstart guide') - .should( - 'have.attr', - 'href', - 'https://opensearch.org/docs/latest/dashboards/quickstart/' - ); + .should('have.attr', 'href') + .and((href) => { + expect(href).to.match( + /^https:\/\/opensearch.org\/docs\/(latest|(\d.)+)\/dashboards\/quickstart\/$/ + ); + }); cy.get('a') .contains('Building data visualizations') - .should( - 'have.attr', - 'href', - 'https://opensearch.org/docs/latest/dashboards/visualize/viz-index/' - ); + .should('have.attr', 'href') + .and((href) => { + expect(href).to.match( + /^https:\/\/opensearch.org\/docs\/(latest|(\d.)+)\/dashboards\/visualize\/viz-index\/$/ + ); + }); cy.get('a') .contains('Creating dashboards') - .should( - 'have.attr', - 'href', - 'https://opensearch.org/docs/latest/dashboards/dashboard/index/' - ); + .should('have.attr', 'href') + .and((href) => { + expect(href).to.match( + /^https:\/\/opensearch.org\/docs\/(latest|(\d.)+)\/dashboards\/dashboard\/index\/$/ + ); + }); }); }); }