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 [email protected]: Invalid bin field for "mini-css-extract-plugin".
warning [email protected]: Invalid bin field for "file-loader".
warning [email protected]: Invalid bin field for "url-loader".
warning [email protected]: Invalid bin field for "url-loader".
info [email protected]: The platform "win32" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
info [email protected]: The platform "win32" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[4/5] Linking dependencies...
warning " > [email protected]" has unmet peer dependency "@types/cypress@^1.1.0".
warning " > [email protected]" has incorrect peer dependency "cypress@^4.5.0".
warning "cypress-image-snapshot > [email protected]" has incorrect peer dependency "jest@>=20 <=26".
warning " > [email protected]" has incorrect peer dependency "@storybook/addons@^3.4.8".
warning " > [email protected]" has incorrect peer dependency "styled-components@^3.3.2".
warning " > [email protected]" 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 [email protected]: 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 [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN [email protected] requires a peer of prop-types@^15.0.0 || ^16.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of react@^16.0.0-0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of react-dom@^16.0.0-0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of react@* but none is installed. You must install peer dependencies yourself.
npm WARN @icons/[email protected] requires a peer of react@* but none is installed. You must install peer dependencies yourself.
npm WARN @storybook/[email protected] requires a peer of react@* but none is installed. You must install peer dependencies yourself.
npm WARN @storybook/[email protected] requires a peer of react-dom@* but none is installed. You must install peer dependencies yourself.
npm WARN @storybook/[email protected] 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 [email protected] 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 [email protected] 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 [email protected] 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 [email protected] requires a peer of react@^15.5.4 || ^16.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] 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/[email protected] 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/[email protected] 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 [email protected] requires a peer of react@^15.3.0 || ^16.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of react-dom@^15.3.0 || ^16.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of react@>=15.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of react-dom@>=15.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of jest@>=20 <=26 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of prop-types@^15.6.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] 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 ?

1 Answer 1

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\""
Sign up to request clarification or add additional context in comments.

2 Comments

Thaks but that's not the cause the cause of my problem.
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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.