cypress-io / cypress

Fast, easy and reliable testing for anything that runs in a browser.
https://cypress.io
MIT License
47.1k stars 3.19k forks source link

Cant run specs in Github Action #19383

Closed XFaramirX closed 2 years ago

XFaramirX commented 2 years ago

Current behavior

When using the GitHub Action basic workflow in a fresh project the following error is thrown and no execution is done.

`Oops...we found an error preparing this test file:

  cypress/integration/2-Shopping-Cart/cart.js

The error was:

Error: Webpack Compilation Error
./cypress/integration/2-Shopping-Cart/cart.js
Module not found: Error: Can't resolve '../../pageObjects/cartPage.js' in '/home/runner/work/ultraUIautomation/ultraUIautomation/cypress/integration/2-Shopping-Cart'
resolve '../../pageObjects/cartPage.js' in '/home/runner/work/ultraUIautomation/ultraUIautomation/cypress/integration/2-Shopping-Cart'
  using description file: /home/runner/work/ultraUIautomation/ultraUIautomation/package.json (relative path: ./cypress/integration/2-Shopping-Cart)
    using description file: /home/runner/work/ultraUIautomation/ultraUIautomation/package.json (relative path: ./cypress/pageObjects/cartPage.js)
      no extension
        /home/runner/work/ultraUIautomation/ultraUIautomation/cypress/pageObjects/cartPage.js doesn't exist
      .js
        /home/runner/work/ultraUIautomation/ultraUIautomation/cypress/pageObjects/cartPage.js.js doesn't exist
      .json
        /home/runner/work/ultraUIautomation/ultraUIautomation/cypress/pageObjects/cartPage.js.json doesn't exist
      .jsx
        /home/runner/work/ultraUIautomation/ultraUIautomation/cypress/pageObjects/cartPage.js.jsx doesn't exist
      .mjs
        /home/runner/work/ultraUIautomation/ultraUIautomation/cypress/pageObjects/cartPage.js.mjs doesn't exist
      .coffee
        /home/runner/work/ultraUIautomation/ultraUIautomation/cypress/pageObjects/cartPage.js.coffee doesn't exist
      as directory
        /home/runner/work/ultraUIautomation/ultraUIautomation/cypress/pageObjects/cartPage.js doesn't exist
[/home/runner/work/ultraUIautomation/ultraUIautomation/cypress/pageObjects/cartPage.js]
[/home/runner/work/ultraUIautomation/ultraUIautomation/cypress/pageObjects/cartPage.js.js]
[/home/runner/work/ultraUIautomation/ultraUIautomation/cypress/pageObjects/cartPage.js.json]
[/home/runner/work/ultraUIautomation/ultraUIautomation/cypress/pageObjects/cartPage.js.jsx]
[/home/runner/work/ultraUIautomation/ultraUIautomation/cypress/pageObjects/cartPage.js.mjs]
[/home/runner/work/ultraUIautomation/ultraUIautomation/cypress/pageObjects/cartPage.js.coffee]
 @ ./cypress/integration/2-Shopping-Cart/cart.js 9:39-79

    at handle (/home/runner/.cache/Cypress/9.1.1/Cypress/resources/app/packages/server/node_modules/@cypress/webpack-preprocessor/dist/index.js:180:23)
    at finalCallback (/home/runner/.cache/Cypress/9.1.1/Cypress/resources/app/node_modules/webpack/lib/Compiler.js:257:39)
    at /home/runner/.cache/Cypress/9.1.1/Cypress/resources/app/node_modules/webpack/lib/Compiler.js:306:14
    at AsyncSeriesHook.eval [as callAsync] (eval at create (/home/runner/.cache/Cypress/9.1.1/Cypress/resources/app/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
    at AsyncSeriesHook.lazyCompileHook (/home/runner/.cache/Cypress/9.1.1/Cypress/resources/app/node_modules/tapable/lib/Hook.js:154:20)
    at /home/runner/.cache/Cypress/9.1.1/Cypress/resources/app/node_modules/webpack/lib/Compiler.js:304:22
    at Compiler.emitRecords (/home/runner/.cache/Cypress/9.1.1/Cypress/resources/app/node_modules/webpack/lib/Compiler.js:499:39)
    at /home/runner/.cache/Cypress/9.1.1/Cypress/resources/app/node_modules/webpack/lib/Compiler.js:298:10
    at /home/runner/.cache/Cypress/9.1.1/Cypress/resources/app/node_modules/webpack/lib/Compiler.js:485:14
    at AsyncSeriesHook.eval [as callAsync] (eval at create (/home/runner/.cache/Cypress/9.1.1/Cypress/resources/app/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
    at AsyncSeriesHook.lazyCompileHook (/home/runner/.cache/Cypress/9.1.1/Cypress/resources/app/node_modules/tapable/lib/Hook.js:154:20)
    at /home/runner/.cache/Cypress/9.1.1/Cypress/resources/app/node_modules/webpack/lib/Compiler.js:482:27
    at /home/runner/.cache/Cypress/9.1.1/Cypress/resources/app/node_modules/neo-async/async.js:2818:7
    at done (/home/runner/.cache/Cypress/9.1.1/Cypress/resources/app/node_modules/neo-async/async.js:3522:9)
    at AsyncSeriesHook.eval [as callAsync] (eval at create (/home/runner/.cache/Cypress/9.1.1/Cypress/resources/app/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
    at AsyncSeriesHook.lazyCompileHook (/home/runner/.cache/Cypress/9.1.1/Cypress/resources/app/node_modules/tapable/lib/Hook.js:154:20)
    at /home/runner/.cache/Cypress/9.1.1/Cypress/resources/app/node_modules/webpack/lib/Compiler.js:464:33
    at /home/runner/.cache/Cypress/9.1.1/Cypress/resources/app/packages/server/node_modules/graceful-fs/graceful-fs.js:111:16
    at /home/runner/.cache/Cypress/9.1.1/Cypress/resources/app/node_modules/graceful-fs/graceful-fs.js:61:14
    at /home/runner/.cache/Cypress/9.1.1/Cypress/resources/app/packages/server/node_modules/graceful-fs/graceful-fs.js:45:10
    at FSReqCallback.oncomplete (fs.js:146:23)

This occurred while Cypress was compiling and bundling your test code. This is usually caused by:

- A missing file or dependency
- A syntax error in the file or one of its dependencies

Fix the error in your code and re-run your tests.`

Desired behavior

Complete execution.

Test code to reproduce

You can fork this repo and use it : https://github.com/XFaramirX/ultraUIautomation.git

Cypress Version

9.1.1

Other

Im able to run this in docker and different OS but for some reason in github actions fails. im using import and export with ecmaVersion: 2020,

XFaramirX commented 2 years ago

Closing as invalid ! There were typos in my code.