From 40291c6366d5ecf78f86a555cd6167b282f961b9 Mon Sep 17 00:00:00 2001 From: Ladislav Dokoupil Date: Tue, 5 Aug 2025 10:30:30 +0200 Subject: [PATCH 1/2] Save video on spec fail --- README.md | 2 ++ packages/testsuite/cypress.config.ts | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/README.md b/README.md index 205e9ed21..0974e1a11 100644 --- a/README.md +++ b/README.md @@ -67,6 +67,8 @@ npm run develop HAL_IMAGE=quay.io/myorg/hal WILDFLY_IMAGE=quay.io/myorg/wildfly npm test ... ``` +- For debugging purposes videos (and screenshots) of failed tests are stored after the test run (works only with chrome). + ## Available environment properties Following is a table of supported environment properties that can be used when running the testsuite. diff --git a/packages/testsuite/cypress.config.ts b/packages/testsuite/cypress.config.ts index 214fe9083..231896cf0 100644 --- a/packages/testsuite/cypress.config.ts +++ b/packages/testsuite/cypress.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from "cypress"; import { PullPolicy, GenericContainer, StartedTestContainer, StoppedTestContainer, Wait } from "testcontainers"; import { Environment } from "testcontainers/build/types"; import { findAPortNotInUse } from "portscanner"; +import fs from "fs"; export default defineConfig({ defaultCommandTimeout: 16000, @@ -10,6 +11,7 @@ export default defineConfig({ reporterOptions: { configFile: "reporter-config.json", }, + video: true, videoCompression: false, e2e: { setupNodeEvents(on, config) { @@ -337,6 +339,12 @@ export default defineConfig({ return Promise.all(promises); }, }); + on("after:spec", (spec: Cypress.Spec, results: CypressCommandLine.RunResult) => { + // Keep videos only for failed specs + if (results && results.video && results.stats.failures === 0 && fs.existsSync(results.video)) { + fs.unlinkSync(results.video); + } + }); return config; }, }, From c6da3c807b3432d9f7d37f639b9c0f1f13a97646 Mon Sep 17 00:00:00 2001 From: Ladislav Dokoupil Date: Tue, 5 Aug 2025 10:31:01 +0200 Subject: [PATCH 2/2] Bugfix EJB TS --- ...ystem-ejb-container-remoting-profile.cy.ts | 20 +++++++++---------- ...tem-ejb-state-management-passivation.cy.ts | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/testsuite/cypress/e2e/ejb/test-configuration-subsystem-ejb-container-remoting-profile.cy.ts b/packages/testsuite/cypress/e2e/ejb/test-configuration-subsystem-ejb-container-remoting-profile.cy.ts index 5328ec30b..365ac76f8 100644 --- a/packages/testsuite/cypress/e2e/ejb/test-configuration-subsystem-ejb-container-remoting-profile.cy.ts +++ b/packages/testsuite/cypress/e2e/ejb/test-configuration-subsystem-ejb-container-remoting-profile.cy.ts @@ -2,8 +2,8 @@ describe("TESTS: Configuration => Subsystem => EJB => Container => Remoting Prof let managementEndpoint: string; const address = ["subsystem", "ejb3", "remoting-profile"]; - const remotingProfilesTableId = "ejb3-remoting-profile-table"; - const configurationFormId = "ejb3-remoting-profile-form"; + const remotingProfilesTableId = "remoting-profile-table"; + const configurationFormId = "remoting-profile-form"; const remotingProfiles = { create: { @@ -39,9 +39,9 @@ describe("TESTS: Configuration => Subsystem => EJB => Container => Remoting Prof it("Create Remoting Profile", () => { cy.navigateTo(managementEndpoint, "ejb3-configuration"); cy.get("#ejb3-container-item").click(); - cy.get("#ejb3-remoting-profile-item").click(); + cy.get("#remoting-profile-item").click(); cy.addInTable(remotingProfilesTableId); - cy.text("ejb3-remoting-profile-table-add", "name", remotingProfiles.create.name); + cy.text("remoting-profile-table-add", "name", remotingProfiles.create.name); cy.confirmAddResourceWizard(); cy.verifySuccess(); cy.validateAddress(managementEndpoint, address.concat(remotingProfiles.create.name), true); @@ -58,7 +58,7 @@ describe("TESTS: Configuration => Subsystem => EJB => Container => Remoting Prof value = (result as { result: boolean }).result; cy.navigateTo(managementEndpoint, "ejb3-configuration"); cy.get("#ejb3-container-item").click(); - cy.get("#ejb3-remoting-profile-item").click(); + cy.get("#remoting-profile-item").click(); cy.selectInTable(remotingProfilesTableId, remotingProfiles.update.name); cy.editForm(configurationFormId); cy.flip(configurationFormId, "exclude-local-receiver", value); @@ -84,7 +84,7 @@ describe("TESTS: Configuration => Subsystem => EJB => Container => Remoting Prof value = (result as { result: boolean }).result; cy.navigateTo(managementEndpoint, "ejb3-configuration"); cy.get("#ejb3-container-item").click(); - cy.get("#ejb3-remoting-profile-item").click(); + cy.get("#remoting-profile-item").click(); cy.selectInTable(remotingProfilesTableId, remotingProfiles.update.name); cy.editForm(configurationFormId); cy.flip(configurationFormId, "local-receiver-pass-by-value", value); @@ -102,7 +102,7 @@ describe("TESTS: Configuration => Subsystem => EJB => Container => Remoting Prof it("Edit static-ejb-discovery via type", () => { cy.navigateTo(managementEndpoint, "ejb3-configuration"); cy.get("#ejb3-container-item").click(); - cy.get("#ejb3-remoting-profile-item").click(); + cy.get("#remoting-profile-item").click(); cy.selectInTable(remotingProfilesTableId, remotingProfiles.update.name); cy.editForm(configurationFormId); cy.formInput(configurationFormId, "static-ejb-discovery") @@ -127,7 +127,7 @@ describe("TESTS: Configuration => Subsystem => EJB => Container => Remoting Prof it("Edit static-ejb-discovery via wizard", () => { cy.navigateTo(managementEndpoint, "ejb3-configuration"); cy.get("#ejb3-container-item").click(); - cy.get("#ejb3-remoting-profile-item").click(); + cy.get("#remoting-profile-item").click(); cy.selectInTable(remotingProfilesTableId, remotingProfiles.update.name); cy.editForm(configurationFormId); cy.formInput(configurationFormId, "static-ejb-discovery") @@ -158,7 +158,7 @@ describe("TESTS: Configuration => Subsystem => EJB => Container => Remoting Prof it("Remove", () => { cy.navigateTo(managementEndpoint, "ejb3-configuration"); cy.get("#ejb3-container-item").click(); - cy.get("#ejb3-remoting-profile-item").click(); + cy.get("#remoting-profile-item").click(); cy.removeFromTable(remotingProfilesTableId, remotingProfiles.remove.name); cy.verifySuccess(); cy.validateAddress(managementEndpoint, address.concat(remotingProfiles.remove.name), false); @@ -167,7 +167,7 @@ describe("TESTS: Configuration => Subsystem => EJB => Container => Remoting Prof it("Reset", () => { cy.navigateTo(managementEndpoint, "ejb3-configuration"); cy.get("#ejb3-container-item").click(); - cy.get("#ejb3-remoting-profile-item").click(); + cy.get("#remoting-profile-item").click(); cy.selectInTable(remotingProfilesTableId, remotingProfiles.reset.name); cy.resetForm(configurationFormId, managementEndpoint, address.concat(remotingProfiles.reset.name)); }); diff --git a/packages/testsuite/cypress/e2e/ejb/test-configuration-subsystem-ejb-state-management-passivation.cy.ts b/packages/testsuite/cypress/e2e/ejb/test-configuration-subsystem-ejb-state-management-passivation.cy.ts index 5c7d9ba68..e83b26c0c 100644 --- a/packages/testsuite/cypress/e2e/ejb/test-configuration-subsystem-ejb-state-management-passivation.cy.ts +++ b/packages/testsuite/cypress/e2e/ejb/test-configuration-subsystem-ejb-state-management-passivation.cy.ts @@ -128,7 +128,7 @@ describe("TESTS: Configuration => Subsystem => EJB => State Management => Passiv cy.addInTable(passivationTableId); cy.text("ejb3-passivation-table-add", "name", passivations.create.name); cy.text("ejb3-passivation-table-add", "bean-cache", cacheContainers.default["default-cache"].name); - cy.text("ejb3-passivation-table-add", "bean-cache", cacheContainers.default.name); + cy.text("ejb3-passivation-table-add", "cache-container", cacheContainers.default.name); cy.text("ejb3-passivation-table-add", "max-size", "1000"); cy.confirmAddResourceWizard(); cy.verifySuccess();