Bladeren bron

OCPBUGS-65887: More dep bumps

logonoff 6 maanden geleden
bovenliggende
commit
7636cae31b

+ 4 - 2
integration-tests/cypress.config.js

@@ -3,8 +3,8 @@ const { defineConfig } = require('cypress');
 module.exports = defineConfig({
   viewportWidth: 1920,
   viewportHeight: 1080,
-  screenshotsFolder: './screenshots',
-  videosFolder: './videos',
+  screenshotsFolder: './screenshots/screenshots',
+  videosFolder: './screenshots/videos',
   video: true,
   reporter: '../../node_modules/cypress-multi-reporters',
   reporterOptions: {
@@ -22,5 +22,7 @@ module.exports = defineConfig({
     },
     specPattern: 'tests/**/*.cy.{js,jsx,ts,tsx}',
     supportFile: 'support/index.ts',
+    testIsolation: false,
+    injectDocumentDomain: true,
   },
 });

+ 4 - 5
integration-tests/plugins/index.ts

@@ -1,9 +1,6 @@
-import * as wp from '@cypress/webpack-preprocessor';
+const wp = require('@cypress/webpack-preprocessor');
 
-module.exports = (
-  on: Cypress.PluginEvents,
-  config: Cypress.PluginConfigOptions,
-): Cypress.PluginConfigOptions => {
+const config: Cypress.PluginConfig = (on, config) => {
   const options = {
     webpackOptions: {
       resolve: {
@@ -26,3 +23,5 @@ module.exports = (
   config.env.BRIDGE_KUBEADMIN_PASSWORD = process.env.BRIDGE_KUBEADMIN_PASSWORD;
   return config;
 };
+
+module.exports = config;

+ 0 - 1
integration-tests/support/index.ts

@@ -1,4 +1,3 @@
-// Import commands.js using ES2015 syntax:
 import './login';
 
 export const checkErrors = () =>

+ 42 - 14
integration-tests/support/login.ts

@@ -5,30 +5,58 @@ declare global {
       logout(): Chainable<Element>;
     }
   }
+  interface Window {
+    SERVER_FLAGS?: {
+      authDisabled?: boolean;
+    };
+  }
 }
 
-const KUBEADMIN_USERNAME = 'kubeadmin';
+export const KUBEADMIN_USERNAME = 'kubeadmin';
 
 // This will add 'cy.login(...)'
 // ex: cy.login('my-user', 'my-password')
-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) => {
-    if (win.SERVER_FLAGS?.authDisabled) {
-      return;
-    }
+Cypress.Commands.add(
+  'login',
+  (
+    username: string = KUBEADMIN_USERNAME,
+    password: string = Cypress.env('BRIDGE_KUBEADMIN_PASSWORD'),
+  ) => {
+    // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
+    const baseURL = Cypress.config('baseUrl')!;
 
     // 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('button[type=submit]').click();
+    cy.visit(baseURL);
 
-    cy.get('[data-test="username"]').should('be.visible');
-  });
-});
+    cy.session(
+      username,
+      () => {
+        // Check if auth is disabled (for a local development environment).
+        cy.window().then((win) => {
+          if (win.SERVER_FLAGS?.authDisabled) {
+            return;
+          }
+        });
+
+        cy.visit(baseURL);
+
+        cy.get('[data-test-id="login"]').should('be.visible');
+        cy.get('#inputUsername').type(username);
+        cy.get('#inputPassword').type(password);
+        cy.get('button[type=submit]').click();
+      },
+      {
+        cacheAcrossSpecs: true,
+        validate() {
+          cy.visit(baseURL);
+          cy.get('[data-test="username"]').should('exist');
+        },
+      },
+    );
+  },
+);
 
 Cypress.Commands.add('logout', () => {
   // Check if auth is disabled (for a local development environment).

+ 11 - 11
package.json

@@ -24,11 +24,11 @@
     "webpack": "node -r ts-node/register ./node_modules/.bin/webpack"
   },
   "devDependencies": {
-    "@babel/core": "^7.28.5",
-    "@babel/preset-env": "^7.28.5",
+    "@babel/core": "^7.29.0",
+    "@babel/preset-env": "^7.29.0",
     "@cypress/webpack-preprocessor": "^7.0.2",
-    "@openshift-console/dynamic-plugin-sdk": "4.20.0",
-    "@openshift-console/dynamic-plugin-sdk-webpack": "4.20.0",
+    "@openshift-console/dynamic-plugin-sdk": "4.20-latest",
+    "@openshift-console/dynamic-plugin-sdk-webpack": "4.20-latest",
     "@patternfly/react-core": "^6.2.2",
     "@patternfly/react-icons": "^6.2.2",
     "@patternfly/react-table": "^6.2.2",
@@ -38,17 +38,17 @@
     "@typescript-eslint/eslint-plugin": "^5.62.0",
     "@typescript-eslint/parser": "^5.62.0",
     "babel-loader": "^10.0.0",
-    "copy-webpack-plugin": "^13.0.1",
-    "css-loader": "^7.1.2",
-    "cypress": "^14.2.1",
-    "cypress-multi-reporters": "^1.6.2",
+    "copy-webpack-plugin": "^14.0.0",
+    "css-loader": "^7.1.4",
+    "cypress": "^15.11.0",
+    "cypress-multi-reporters": "^2.0.5",
     "eslint": "^8.10.0",
     "eslint-config-prettier": "^8.5.0",
     "eslint-plugin-cypress": "^2.12.1",
     "eslint-plugin-prettier": "^4.0.0",
     "eslint-plugin-react": "^7.29.1",
     "i18next": "^23.11.5",
-    "i18next-parser": "^9.3.0",
+    "i18next-parser": "^9.4.0",
     "mocha": "^10.2.0",
     "mocha-junit-reporter": "^2.2.1",
     "mochawesome": "^7.1.4",
@@ -68,9 +68,9 @@
     "ts-loader": "^9.5.4",
     "ts-node": "^10.9.2",
     "typescript": "^5.9.3",
-    "webpack": "^5.75.0",
+    "webpack": "^5.100.0",
     "webpack-cli": "^6.0.1",
-    "webpack-dev-server": "^5.2.2"
+    "webpack-dev-server": "^5.2.3"
   },
   "consolePlugin": {
     "name": "console-plugin-template",

+ 8 - 1
test-frontend.sh

@@ -12,4 +12,11 @@ if [ -n "$GIT_STATUS" ]; then
   echo "i18n files are not up to date. Run 'yarn i18n' then commit changes."
   git --no-pager diff
   exit 1
-fi
+fi
+
+if ! yarn dedupe --strategy highest --check ; then
+  echo "You have duplicate version resolutions of some packages in yarn.lock. Run 'yarn dedupe' and commit the updated yarn.lock."
+  yarn dedupe --strategy highest
+  git --no-pager diff
+  exit 1
+fi

File diff suppressed because it is too large
+ 308 - 308
yarn.lock


Some files were not shown because too many files changed in this diff