diff --git a/.github/workflows/manual-test-matrix-workflow.yaml b/.github/workflows/manual-test-matrix-workflow.yaml index 94c18905f..52d452f28 100644 --- a/.github/workflows/manual-test-matrix-workflow.yaml +++ b/.github/workflows/manual-test-matrix-workflow.yaml @@ -11,11 +11,9 @@ jobs: matrix: specs: [ - "datasource", - "interface", - "path", "batch-jberet", "core-management", + "datasource", "deployment-scanner", "distributable-web", "ee", @@ -23,22 +21,24 @@ jobs: "elytron", "elytron-oidc-client", "health", + "homepage", + "interface", "io", "jmx", "jpa", "jsf", "mail", - "microprofile", "metrics", + "microprofile", + "path", "runtime", "security-manager", + "smoke", "system-property", "transaction", - "weld", - "homepage", - "smoke", - "update-manager", "undertow", + "update-manager", + "weld", ] exclude: - specs: "update-manager" @@ -57,7 +57,7 @@ jobs: distribution: "adopt" java-version: "17" - name: Install Chrome - uses: browser-actions/setup-chrome@v1 + uses: browser-actions/setup-chrome@v2 with: chrome-version: stable - name: Install Firefox @@ -71,15 +71,15 @@ jobs: - name: "Run compile" run: "npm run compile" - name: "Run test(s)" - run: "npm run test:compiled -- --browser=firefox --specs=packages/testsuite/cypress/e2e/${{ matrix.specs }}" + run: "npm run test:compiled -- --browser=chrome --specs=packages/testsuite/cypress/e2e/${{ matrix.specs }}" - name: "Archive test report(s) and video(s)" if: ${{ !cancelled() }} uses: actions/upload-artifact@v4 with: name: "${{ github.run_id}}-${{ strategy.job-index }}-artifacts" path: | - packages/testsuite/results - packages/testsuite/cypress/videos + results + cypress/videos process_report: name: "Collect results & deploy GH pages" needs: test_matrix @@ -97,7 +97,7 @@ jobs: - name: "Generate Mochawesome Report" run: mochawesome-merge "./*-artifacts/results/packages/testsuite/cypress/e2e/*.json" > mochawesome.json - name: "Copy video assets" - run: copyfiles -u 3 "./*-artifacts/packages/testsuite/cypress/videos/*.mp4" mochawesome-report/assets/videos + run: copyfiles -u 2 "./*-artifacts/cypress/videos/*.mp4" mochawesome-report/assets/videos - name: "Create GH Pages content" run: marge mochawesome.json -f index.html - name: "Get time info" diff --git a/.github/workflows/reusable-build-project-workflow.yaml b/.github/workflows/reusable-build-project-workflow.yaml index e12373873..a55e7c01c 100644 --- a/.github/workflows/reusable-build-project-workflow.yaml +++ b/.github/workflows/reusable-build-project-workflow.yaml @@ -23,7 +23,7 @@ jobs: distribution: "adopt" java-version: "17" - name: Install Chrome - uses: browser-actions/setup-chrome@v1 + uses: browser-actions/setup-chrome@v2 with: chrome-version: stable - name: Install Firefox diff --git a/.github/workflows/scheduled-run-all-tests-workflow.yaml b/.github/workflows/scheduled-run-all-tests-workflow.yaml index e920bdceb..e1d298b20 100644 --- a/.github/workflows/scheduled-run-all-tests-workflow.yaml +++ b/.github/workflows/scheduled-run-all-tests-workflow.yaml @@ -12,11 +12,9 @@ jobs: matrix: specs: [ - "datasource", - "interface", - "path", "batch-jberet", "core-management", + "datasource", "deployment-scanner", "distributable-web", "ee", @@ -24,21 +22,24 @@ jobs: "elytron", "elytron-oidc-client", "health", + "homepage", + "interface", "io", "jmx", "jpa", "jsf", "mail", "metrics", + "microprofile", + "path", "runtime", "security-manager", + "smoke", "system-property", "transaction", - "weld", - "homepage", - "smoke", - "update-manager", "undertow", + "update-manager", + "weld", ] exclude: - specs: "update-manager" @@ -57,7 +58,7 @@ jobs: distribution: "adopt" java-version: "17" - name: Install Chrome - uses: browser-actions/setup-chrome@v1 + uses: browser-actions/setup-chrome@v2 with: chrome-version: stable - name: Install Firefox @@ -78,8 +79,8 @@ jobs: with: name: "${{ github.run_id}}-${{ strategy.job-index }}-artifacts" path: | - packages/testsuite/results - packages/testsuite/cypress/videos + results + cypress/videos process_report: name: "Collect results & deploy GH pages" if: ${{ !cancelled() }} @@ -97,7 +98,7 @@ jobs: - name: "Generate Mochawesome Report" run: mochawesome-merge "./*-artifacts/results/packages/testsuite/cypress/e2e/*.json" > mochawesome.json - name: "Copy video assets" - run: copyfiles -u 3 "./*-artifacts/packages/testsuite/cypress/videos/*.mp4" mochawesome-report/assets/videos + run: copyfiles -u 2 "./*-artifacts/cypress/videos/*.mp4" mochawesome-report/assets/videos - name: "Create GH Pages content" run: marge mochawesome.json -f index.html - name: "Get time info" diff --git a/README.md b/README.md index 227585d6e..e1d23c660 100644 --- a/README.md +++ b/README.md @@ -54,11 +54,14 @@ npm run develop ``` - If you want to execute whole testsuite execute `npm test` - - It is also possible to run on specific browser by supplying `--browser` argument, e.g +- Chrome is the default browser and is recommended for video recording. Firefox may produce black videos. +- For debugging purposes, you can run tests in headed mode (visible browser window) by adding `--headed` flag: ``` -npm test -- --browser=chrome +npm test -- --browser=firefox --headed +or +npm test -- --browser=chrome --headed --specs="packages/testsuite/cypress/e2e/homepage/test-homepage.cy.ts" ``` - It is possible to reduce the amount of specs executed by passing `--specs` flag. It also supports glob patterns, e.g to execute only `homepage` related tests, run @@ -81,7 +84,7 @@ npm run test:compiled -- --specs="packages/testsuite/cypress/e2e/homepage/test-h 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). +- For debugging purposes, videos and screenshots of failed tests are stored after the test run in `cypress/videos` and `cypress/screenshots` directories. Video recording works best with Chrome browser. ## Available environment properties diff --git a/cypress.config.ts b/cypress.config.ts index 40730b855..0a91aa214 100644 --- a/cypress.config.ts +++ b/cypress.config.ts @@ -17,7 +17,7 @@ export const DEFAULT_WILDFLY_CONFIG = "standalone-insecure.xml"; export const WILDFLY_MANAGEMENT_PORT = 9990; export const WILDFLY_STARTUP_TIMEOUT = 333000; export const WILDFLY_PORT_RANGE = { min: 8080, max: 8180 }; -export const WILDFLY_READY_TIMEOUT_MS = 10000; +export const WILDFLY_READY_TIMEOUT_MS = 60000; export const WILDFLY_POLL_INTERVAL_MS = 500; // Keycloak configuration @@ -62,12 +62,14 @@ export const LOCALHOST_IP = "127.0.0.1"; export default defineConfig({ defaultCommandTimeout: 16000, + taskTimeout: 600000, reporter: require.resolve("cypress-multi-reporters/index.js"), reporterOptions: { configFile: "reporter-config.json", }, video: true, - videoCompression: false, + videoCompression: 32, + screenshotOnRunFailure: true, e2e: { supportFile: "packages/testsuite/cypress/support/e2e.ts", specPattern: "packages/testsuite/cypress/e2e/**/*.cy.ts", diff --git a/package.json b/package.json index 1011bde63..f35536c26 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,6 @@ "author": "", "license": "ISC", "devDependencies": { - "@cypress/xvfb": "1.2.4", "@types/command-line-args": "5.2.3", "@types/mochawesome": "6.2.4", "@types/portscanner": "2.1.4", diff --git a/packages/testsuite/cypress/support/containers-utils.ts b/packages/testsuite/cypress/support/containers-utils.ts index e4efb4975..d6378adf9 100644 --- a/packages/testsuite/cypress/support/containers-utils.ts +++ b/packages/testsuite/cypress/support/containers-utils.ts @@ -6,7 +6,7 @@ Cypress.Commands.add("startWildflyContainer", (options = { useNetworkHostMode: f configuration: "standalone-insecure.xml", useNetworkHostMode: options.useNetworkHostMode, }, - { timeout: 240_000 }, + { timeout: 600_000 }, ); }); @@ -18,7 +18,7 @@ Cypress.Commands.add("startWildflyContainerSecured", () => { configuration: "standalone.xml", useNetworkHostMode: true, }, - { timeout: 240_000 }, + { timeout: 600_000 }, ); }); diff --git a/packages/testsuite/run-e2e-tests.ts b/packages/testsuite/run-e2e-tests.ts index 752922450..bce3bbec5 100644 --- a/packages/testsuite/run-e2e-tests.ts +++ b/packages/testsuite/run-e2e-tests.ts @@ -5,12 +5,13 @@ import { OptionDefinition } from "command-line-args"; import path from "path"; const optionDefinitions: OptionDefinition[] = [ - { name: "browser", type: String, defaultValue: "firefox" }, + { name: "browser", type: String, defaultValue: "chrome" }, { name: "specs", type: String, defaultValue: "packages/testsuite/cypress/e2e/**/*.cy.ts", }, + { name: "headed", type: Boolean, defaultValue: false }, ]; (async () => { @@ -20,6 +21,7 @@ const optionDefinitions: OptionDefinition[] = [ const projectRoot = path.resolve(__dirname, "..", "..", ".."); const testRunResult = await cypress.run({ browser: options.browser as string, + headed: options.headed as boolean, project: projectRoot, configFile: path.join(projectRoot, "cypress.config.ts"), env: {