Ver Fonte

Merge pull request #27 from cyril-ui-developer/update-cluster-baseurl

CONSOLE-3303: Move plugin template to the openshift GitHub org - update-cluster-baseurl
Sam Padgett há 3 anos atrás
pai
commit
714f71248c
3 ficheiros alterados com 19 adições e 26 exclusões
  1. 0 1
      integration-tests/cypress.config.js
  2. 18 25
      integration-tests/support/login.ts
  3. 1 0
      test-prow-e2e.sh

+ 0 - 1
integration-tests/cypress.config.js

@@ -22,6 +22,5 @@ module.exports = defineConfig({
     },
     specPattern: 'tests/**/*.cy.{js,jsx,ts,tsx}',
     supportFile: 'support/index.ts',
-    baseUrl: 'http://localhost:9000/',
   },
 });

+ 18 - 25
integration-tests/support/login.ts

@@ -4,11 +4,7 @@ import { masthead } from '../views/masthead';
 declare global {
   namespace Cypress {
     interface Chainable {
-      login(
-        providerName?: string,
-        username?: string,
-        password?: string,
-      ): Chainable<Element>;
+      login(username?: string, password?: string): Chainable<Element>;
       logout(): Chainable<Element>;
     }
   }
@@ -20,28 +16,25 @@ const KUBEADMIN_USERNAME = 'kubeadmin';
 
 // This will add 'cy.login(...)'
 // ex: cy.login('my-idp', 'my-user', 'my-password')
-Cypress.Commands.add(
-  'login',
-  (provider: string, username: string, password: string) => {
-    // Check if auth is disabled (for a local development environment).
-    cy.visit('http://localhost:9000/dashboards'); // visits baseUrl which is set in plugins/index.js
-    cy.window().then((win: any) => {
-      if (win.SERVER_FLAGS?.authDisabled) {
-        return;
-      }
+Cypress.Commands.add('login', (username: string, password: string) => {
+  // Check if auth is disabled (for a local development environment).
+  cy.visit('/'); // visits baseUrl which is set in plugins/index.js
+  cy.window().then((win: any) => {
+    if (win.SERVER_FLAGS?.authDisabled) {
+      return;
+    }
 
-      // Make sure we clear the cookie in case a previous test failed to logout.
-      cy.clearCookie('openshift-session-token');
+    // Make sure we clear the cookie in case a previous test failed to logout.
+    cy.clearCookie('openshift-session-token');
 
-      cy.get('#inputUsername').type(username || KUBEADMIN_USERNAME);
-      cy.get('#inputPassword').type(
-        password || Cypress.env('BRIDGE_KUBEADMIN_PASSWORD'),
-      );
-      cy.get(submitButton).click();
-      masthead.username.shouldBeVisible();
-    });
-  },
-);
+    cy.get('#inputUsername').type(username || KUBEADMIN_USERNAME);
+    cy.get('#inputPassword').type(
+      password || Cypress.env('BRIDGE_KUBEADMIN_PASSWORD'),
+    );
+    cy.get(submitButton).click();
+    masthead.username.shouldBeVisible();
+  });
+});
 
 Cypress.Commands.add('logout', () => {
   // Check if auth is disabled (for a local development environment).

+ 1 - 0
test-prow-e2e.sh

@@ -4,6 +4,7 @@ set -exuo pipefail
 
 ARTIFACT_DIR=${ARTIFACT_DIR:=/tmp/artifacts}
 SCREENSHOTS_DIR=integration-tests/screenshots
+INSTALLER_DIR=${INSTALLER_DIR:=${ARTIFACT_DIR}/installer}
 
 function copyArtifacts {
   if [ -d "$ARTIFACT_DIR" ] && [ -d "$SCREENSHOTS_DIR" ]; then