Quellcode durchsuchen

Fix e2e tests close guided tour modal before running tests

Vikram Raj vor 1 Jahr
Ursprung
Commit
97dab3d667
1 geänderte Dateien mit 19 neuen und 1 gelöschten Zeilen
  1. 19 1
      integration-tests/tests/example-page.cy.ts

+ 19 - 1
integration-tests/tests/example-page.cy.ts

@@ -4,6 +4,23 @@ const PLUGIN_TEMPLATE_NAME = 'console-plugin-template';
 const PLUGIN_TEMPLATE_PULL_SPEC = Cypress.env('PLUGIN_TEMPLATE_PULL_SPEC');
 export const isLocalDevEnvironment = Cypress.config('baseUrl').includes('localhost');
 
+export const guidedTour = {
+  close: () => {
+    cy.get('body').then(($body) => {
+      if ($body.find(`[data-test="guided-tour-modal"]`).length > 0) {
+        cy.get(`[data-test="tour-step-footer-secondary"]`).contains('Skip tour').click();
+      }
+    });
+  },
+  isOpen: () => {
+    cy.get('body').then(($body) => {
+      if ($body.find(`[data-test="guided-tour-modal"]`).length > 0) {
+        cy.get(`[data-test="guided-tour-modal"]`).should('be.visible');
+      }
+    });
+  },
+};
+
 const installHelmChart = (path: string) => {
   cy.exec(
     `cd ../../console-plugin-template && ${path} upgrade -i ${PLUGIN_TEMPLATE_NAME} charts/openshift-console-plugin -n ${PLUGIN_TEMPLATE_NAME} --create-namespace --set plugin.image=${PLUGIN_TEMPLATE_PULL_SPEC}`,
@@ -35,7 +52,8 @@ const deleteHelmChart = (path: string) => {
 describe('Console plugin template test', () => {
   before(() => {
     cy.login();
-
+    guidedTour.isOpen();
+    guidedTour.close();
     if (!isLocalDevEnvironment) {
       console.log('this is not a local env, installig helm');