0

I am trying to setup a GitHub workflow for executing the Cypress tests in parallel using the cypress-split package to split up the tests. My GitHub repository is also part of a GitHub Enterprise organization (not sure if it is relevant, but wanted to mention it since it might be part of the reason I am having this issue).

The problem is that at the end of the test execution I am getting messages like:

Could not find spec results for ./cypress/e2e/demo.cy.ts

and there is no test summary data in the workflow:

enter image description here

I also tried to setup the cypress.config.ts file to use cypress-mochawesome-reporter:

  reporter: 'cypress-mochawesome-reporter',
  reporterOptions: {
    reporterEnabled: 'cypress-mochawesome-reporter',
    cypressMochawesomeReporterReporterOptions: {
      reportDir: './cypress/reports',
      reportFilename: `results-${process.env.SPLIT_INDEX ?? 0}`,
      saveHtml: false,
      saveJson: true,
      saveAllAttempts: false,
      quiet: true,
    },
  },

and during the test execution I can see the following messages:

[mochawesome] Report JSON saved to /home/runner/work/demo-project/cypress/reports/html/.jsons/mochawesome_001.json

However, after the tests finish I have a step for printing the whole structure of the project:

      - name: Verify test project
        if: always()
        run: tree .

and I cannot find the final json, even the files from cypress/reports/html/.jsons/ are no longer there (which would be expected if they were merged into one, but there is no other file).

My project doesn't have the Cypress github action whitelisted, so I am starting the project like this:

      - name: Install Cypress binary
        run: npx cypress install

      - name: Executing tests 
        run: npm run cypress:run

Does anyone have any idea what could be the issue and how to fix this?

t3stI0
  • 68
  • 1
  • 7
  • Hello. Have you tried to save the reports in the artifacts and check if they are generated as expected? – Alex Izbas Jul 19 '23 at 13:34
  • @AlexIzbas yes, but I cannot find the results, I also tried using `tree .` to print the whole project structure after the tests finish and there is a `cypress/reports/html` directory but `cypress/reports/html/.jsons/` is gone even though we see the `[mochawesome] Report JSON saved to /home/runner/work/demo-project/cypress/reports/html/.jsons/mochawesome_001.json` messages after each test suite – t3stI0 Jul 25 '23 at 11:23

0 Answers0