0

I'm in the process of setting-up a Github Action workflow to test my app using testcafe on IE11 (Internet Explorer).

name: Tests
on:
  push:
    branches:
      - master
  pull_request:
    types: [opened, reopened, synchronize, ready_for_review]

jobs:
  test-e2e-ie11:
    name: Run Tests for IE11
    runs-on: windows-2016
    steps:
      - name: Checkout code
        uses: actions/checkout@v2
      - name: Install Ddependencies
        run: yarn install
      - name: End-to-end testing
        uses: DevExpress/testcafe-action@latest
        with:
          args: "ie testcafe --app-init-delay 60000 --app node scripts/start.js -- --deploy=local"
        env:
          NODE_ENV: development

What happen

Installing dependencies is a bit long but happens correctly:

Install Ddependencies
info There appears to be trouble with your network connection. Retrying...
warning mini-css-extract-plugin@0.4.5: Invalid bin field for "mini-css-extract-plugin".
warning file-loader@2.0.0: Invalid bin field for "file-loader".
warning url-loader@1.1.2: Invalid bin field for "url-loader".
warning url-loader@1.1.1: Invalid bin field for "url-loader".
info fsevents@2.3.2: The platform "win32" is incompatible with this module.
info "fsevents@2.3.2" is an optional dependency and failed compatibility check. Excluding it from installation.
info fsevents@1.2.13: The platform "win32" is incompatible with this module.
info "fsevents@1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation.
[4/5] Linking dependencies...
warning " > cypress-iframe@1.0.1" has unmet peer dependency "@types/cypress@^1.1.0".
warning " > cypress-image-snapshot@4.0.1" has incorrect peer dependency "cypress@^4.5.0".
warning "cypress-image-snapshot > jest-image-snapshot@4.2.0" has incorrect peer dependency "jest@>=20 <=26".
warning " > storybook-addon-styled-component-theme@1.1.0" has incorrect peer dependency "@storybook/addons@^3.4.8".
warning " > storybook-addon-styled-component-theme@1.1.0" has incorrect peer dependency "styled-components@^3.3.2".
warning " > storybook-styled-components@1.1.2" has incorrect peer dependency "@storybook/addons@^3.3.0".
[5/5] Building fresh packages...
$ husky install
husky - Git hooks installed
Done in 468.00s.

What Fails

Testcafe action is behaving weirdly IMHO, with a lot of warning

Run DevExpress/testcafe-action@latest
  with:
    args: ie testcafe --app-init-delay 60000 --app node scripts/start.js -- --deploy=local
    version: latest
    skip-install: false
  env:
    NODE_ENV: development
VERSION: latest
BRANCH: not specified
COMMIT: not specified
SKIP INSTALL: false
Installing TestCafe from npm...
npm WARN deprecated…
npm WARN deprecated…
…
npm WARN rm not removing D:\a\webchat-v2\webchat-v2\node_modules\.bin\rimraf.cmd as it wasn't installed by D:\a\webchat-v2\webchat-v2\node_modules\rimraf
npm WARN rm not removing D:\a\webchat-v2\webchat-v2\node_modules\.bin\rimraf as it wasn't installed by D:\a\webchat-v2\webchat-v2\node_modules\rimraf
npm WARN rm not removing D:\a\webchat-v2\webchat-v2\node_modules\.bin\semver.cmd as it wasn't installed by D:\a\webchat-v2\webchat-v2\node_modules\semver
npm WARN rm not removing D:\a\webchat-v2\webchat-v2\node_modules\.bin\semver as it wasn't installed by D:\a\webchat-v2\webchat-v2\node_modules\semver
npm WARN rm not removing D:\a\webchat-v2\webchat-v2\node_modules\.bin\browserslist.cmd as it wasn't installed by D:\a\webchat-v2\webchat-v2\node_modules\browserslist
npm WARN rm not removing D:\a\webchat-v2\webchat-v2\node_modules\.bin\browserslist as it wasn't installed by D:\a\webchat-v2\webchat-v2\node_modules\browserslist
npm WARN rm not removing D:\a\webchat-v2\webchat-v2\node_modules\.bin\mkdirp.cmd as it wasn't installed by D:\a\webchat-v2\webchat-v2\node_modules\mkdirp
npm WARN rm not removing D:\a\webchat-v2\webchat-v2\node_modules\.bin\mkdirp as it wasn't installed by D:\a\webchat-v2\webchat-v2\node_modules\mkdirp
npm WARN rm not removing D:\a\webchat-v2\webchat-v2\node_modules\.bin\json5.cmd as it wasn't installed by D:\a\webchat-v2\webchat-v2\node_modules\json5
npm WARN rm not removing D:\a\webchat-v2\webchat-v2\node_modules\.bin\json5 as it wasn't installed by D:\a\webchat-v2\webchat-v2\node_modules\json5
npm WARN rm not removing D:\a\webchat-v2\webchat-v2\node_modules\.bin\jest.cmd as it wasn't installed by D:\a\webchat-v2\webchat-v2\node_modules\jest-cli
npm WARN rm not removing D:\a\webchat-v2\webchat-v2\node_modules\.bin\jest as it wasn't installed by D:\a\webchat-v2\webchat-v2\node_modules\jest-cli
npm WARN rm not removing D:\a\webchat-v2\webchat-v2\node_modules\.bin\detect.cmd as it wasn't installed by D:\a\webchat-v2\webchat-v2\node_modules\detect-port
npm WARN rm not removing D:\a\webchat-v2\webchat-v2\node_modules\.bin\detect-port.cmd as it wasn't installed by D:\a\webchat-v2\webchat-v2\node_modules\detect-port
npm WARN rm not removing D:\a\webchat-v2\webchat-v2\node_modules\.bin\detect as it wasn't installed by D:\a\webchat-v2\webchat-v2\node_modules\detect-port
npm WARN rm not removing D:\a\webchat-v2\webchat-v2\node_modules\.bin\detect-port as it wasn't installed by D:\a\webchat-v2\webchat-v2\node_modules\detect-port
npm WARN rm not removing D:\a\webchat-v2\webchat-v2\node_modules\.bin\acorn.cmd as it wasn't installed by D:\a\webchat-v2\webchat-v2\node_modules\acorn
npm WARN rm not removing D:\a\webchat-v2\webchat-v2\node_modules\.bin\acorn as it wasn't installed by D:\a\webchat-v2\webchat-v2\node_modules\acorn
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^2.3.2 (node_modules\jest-haste-map\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN render-fragment@0.1.1 requires a peer of prop-types@^15.0.0 || ^16.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN react-split-pane@0.1.92 requires a peer of react@^16.0.0-0 but none is installed. You must install peer dependencies yourself.
npm WARN react-split-pane@0.1.92 requires a peer of react-dom@^16.0.0-0 but none is installed. You must install peer dependencies yourself.
npm WARN react-color@2.19.3 requires a peer of react@* but none is installed. You must install peer dependencies yourself.
npm WARN @icons/material@0.2.4 requires a peer of react@* but none is installed. You must install peer dependencies yourself.
npm WARN @storybook/core@4.1.18 requires a peer of react@* but none is installed. You must install peer dependencies yourself.
npm WARN @storybook/core@4.1.18 requires a peer of react-dom@* but none is installed. You must install peer dependencies yourself.
npm WARN @storybook/react-komposer@2.0.5 requires a peer of react@^0.14.7 || ^15.0.0 || ^16.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN react-fuzzy@0.5.2 requires a peer of react@^0.14.7 || ^15.0.0 || ^16.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN react-modal@3.14.3 requires a peer of react@^0.14.0 || ^15.0.0 || ^16 || ^17 but none is installed. You must install peer dependencies yourself.
npm WARN react-modal@3.14.3 requires a peer of react-dom@^0.14.0 || ^15.0.0 || ^16 || ^17 but none is installed. You must install peer dependencies yourself.
npm WARN react-treebeard@3.1.0 requires a peer of react@^15.5.4 || ^16.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN react-treebeard@3.1.0 requires a peer of react-dom@^15.5.4 || ^16.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @storybook/react-simple-di@1.3.0 requires a peer of react@^0.14.0 || ^15.0.0 || ^16.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @storybook/react-stubber@1.0.1 requires a peer of react@^0.14.7 || ^15.0.0 || ^16.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN velocity-react@1.4.3 requires a peer of react@^15.3.0 || ^16.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN velocity-react@1.4.3 requires a peer of react-dom@^15.3.0 || ^16.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN react-transition-group@2.9.0 requires a peer of react@>=15.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN react-transition-group@2.9.0 requires a peer of react-dom@>=15.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN jest-image-snapshot@4.2.0 requires a peer of jest@>=20 <=26 but none is installed. You must install peer dependencies yourself.
npm WARN react-ga@2.7.0 requires a peer of prop-types@^15.6.0 but none is installed. You must install peer dependencies yourself.
npm WARN react-ga@2.7.0 requires a peer of react@^15.6.2 || ^16.0 but none is installed. You must install peer dependencies yourself.

Then when trying to start my application server so testcafe can reach it, it fail to find dotenv, a package present in my packages.json:

Running TestCafe...
process.env.DEPLOYMENT_ENV local
ERROR Cannot prepare tests due to the following error:

Error: Cannot find module 'dotenv'
Require stack:
- D:\a\webchat-v2\webchat-v2\config\env.js
- D:\a\webchat-v2\webchat-v2\scripts\start.js
- D:\a\webchat-v2\webchat-v2\node_modules\testcafe\lib\compiler\test-file\formats\es-next\compiler.js
- D:\a\webchat-v2\webchat-v2\node_modules\testcafe\lib\compiler\compilers.js
- D:\a\webchat-v2\webchat-v2\node_modules\testcafe\lib\compiler\index.js
- D:\a\webchat-v2\webchat-v2\node_modules\testcafe\lib\runner\bootstrapper.js
- D:\a\webchat-v2\webchat-v2\node_modules\testcafe\lib\runner\index.js
- D:\a\webchat-v2\webchat-v2\node_modules\testcafe\lib\testcafe.js
- D:\a\webchat-v2\webchat-v2\node_modules\testcafe\lib\index.js
- D:\a\webchat-v2\webchat-v2\node_modules\testcafe\lib\cli\cli.js
- D:\a\webchat-v2\webchat-v2\node_modules\testcafe\lib\cli\index.js
    at forEach (D:\a\webchat-v2\webchat-v2\config\env.js:34:7)
    at Object.<anonymous> (D:\a\webchat-v2\webchat-v2\config\env.js:31:13)
    at Object.<anonymous> (D:\a\webchat-v2\webchat-v2\scripts\start.js:12:1)

Type "testcafe -h" for help.
child_process.js:660
    throw err;
    ^

Error: Command failed: npx testcafe ie testcafe --app-init-delay 60000 --app node scripts/start.js -- --deploy=local
    at checkExecSyncError (child_process.js:621:11)
    at execSync (child_process.js:657:15)
    at Object.<anonymous> (D:\a\_actions\DevExpress\testcafe-action\latest\index.js:64:1)
    at Module._compile (internal/modules/cjs/loader.js:959:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
    at Module.load (internal/modules/cjs/loader.js:815:32)
    at Function.Module._load (internal/modules/cjs/loader.js:727:14)
    at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10)
    at internal/main/run_main_module.js:17:11 {
  status: 1,
  signal: null,
  output: [ null, null, null ],
  pid: 2220,
  stdout: null,
  stderr: null
}

Question

What is missing in my workflow so I can run my testcafe tests against my react development app ?

Alex Skorkin
  • 4,264
  • 3
  • 25
  • 47
Édouard Lopez
  • 40,270
  • 28
  • 126
  • 178

1 Answers1

1

You have an error in the arguments of the test run command:

args: "ie testcafe --app-init-delay 60000 --app node scripts/start.js -- --deploy=local"

I guess this line should look like this:

args: "ie --app-init-delay 60000 --app \"node scripts/start.js --deploy=local\""
Ilya Afanasenko
  • 517
  • 2
  • 7
  • Thaks but that's not the cause the cause of my problem. – Édouard Lopez Jul 12 '21 at 09:13
  • If fixing the argument line does not help, then to understand what is happening I need the files `scripts\start.js` and `config\env.js`. Better yet, a minimalistic project that reproduces the bug. – Ilya Afanasenko Jul 13 '21 at 13:18