0

After a couple of regression in our app undre Internet Explorer (IE11), we decided to setup a dedicated CI workflow to prevent them anyfurther. So we went with testcafe, but the setup is more complicated than with Cypress. Currently my tests are starting but they got stock

Package.json

  "scripts": {
   "start": "node scripts/start.js -- --deploy=local",
    "test:ci:ie": "node ./node_modules/testcafe/bin/testcafe ie testcafe/ --app \"node scripts/start.js -- --deploy=local\" --app-init-delay 60000 --reporter spec-time"
  }

Workflow using DevExpress/testcafe-action@latest

Noting fancy here

jobs: test-e2e-ie11: if: github.event.pull_request.draft == false name: Run Tests for IE11 runs-on: windows-2019 steps: - name: Checkout code uses: actions/checkout@v2

  - uses: actions/setup-node@v2
    with:
      node-version: "14"
      cache: "yarn"

  - name: Get yarn cache directory path
    id: yarn-cache-dir-path
    run: echo "::set-output name=dir::$(yarn cache dir)"

  - name: Cache node_modules
    id: yarn-cache
    uses: actions/cache@v2
    with:
      path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
      key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}

  - name: Install dependencies
    run: yarn install --frozen-lockfile

  - name: End-to-end testing
    uses: DevExpress/testcafe-action@latest
    timeout-minutes: 10
    with:
      skip-install: true
      args: 'ie testcafe --app "node scripts/start.js --deploy=local" --app-init-delay 60000 --browser-init-timeout 60000'
    env:
      NODE_ENV: development
      DEBUG: testcafe:*

Testcafe Step Log (using action)

2021-07-20T09:09:30.385Z testcafe:tested-app:stdout Compiled successfully!

2021-07-20T09:09:30.385Z testcafe:tested-app:stdout 
You can now view web-bot in the browser.

  Local:            http://localhost:3000/
  On Your Network:  http://10.1.0.132:3000

Note that the development build is not optimized.
To create a production build, use yarn build.


 Running tests in:
 - Internet Explorer 11.0 / Windows 10

 theme_04: conversation
2021-07-20T09:09:51.216Z testcafe:test-run:Internet Explorer 11.0 / Windows 10:driver-message 
    {
      cmd: 'ready',
      status: {
        id: '1330.243',
        isCommandResult: false,
        executionError: null,
        pageError: null,
        resent: false,
        result: null,
        consoleMessages: {
          null: [Object]
        },
        isPendingWindowSwitching: false,
        isFirstRequestAfterWindowSwitching: false,
        debug: ''
      },
      disableResending: true,
      allowRejecting: true,
      sessionId: 'dOloGSq4b'
    }

2021-07-20T09:09:51.267Z testcafe:test-run:Internet Explorer 11.0 / Windows 10:command 
    AssertionCommand {
      type: 'assertion',
      assertionType: 'ok',
      actual: ReExecutablePromise {
        _then: [],
        _fn: [Function (anonymous)],
        _taskPromise: null
      },
      expected: undefined,
      expected2: undefined,
      message: null,
      options: AssertionOptions {
        timeout: undefined,
        allowUnawaitedPromise: false
      }
    }

2021-07-20T09:09:51.271Z testcafe:test-run:Internet Explorer 11.0 / Windows 10:command 
    ExecuteSelectorCommand {
      type: 'execute-selector',
      instantiationCallsiteName: 'Selector',
      fnCode: '(function(){\n' +
        '   var __f$=(function(){return document.querySelectorAll("#bot-frame");});;\n' +
        '   return function(){\n' +
        '       var args           = __dependencies$.boundArgs || arguments;\n' +
        "       var selectorFilter = window['%testCafeSelectorFilter%'];\n" +
        '\n' +
        '       var nodes = __f$.apply(this, args);\n' +
        '       nodes     = selectorFilter.cast(nodes);\n' +
        '\n' +
        '       if (!nodes.length && !selectorFilter.error)\n' +
        '           selectorFilter.error = __dependencies$.apiInfo.apiFnID;\n' +
        '\n' +
        '       return selectorFilter.filter(nodes, __dependencies$.filterOptions, __dependencies$.apiInfo);\n' +
        '   };\n' +
        '})();',
      args: [
        []
      ],
      dependencies: [
        [Object: null prototype] {
          filterOptions: [Object: null prototype],
          apiInfo: [Object: null prototype],
          boundArgs: [Object: null prototype],
          customDOMProperties: [Object: null prototype],
          customMethods: [Object: null prototype]
        }
      ],
      visibilityCheck: true,
      timeout: null,
      apiFnChain: [
        "Selector('#bot-frame')"
      ],
      index: 0
    }

Error: The action has timed out.

Workflow using run with npm command

The last command is different, see the log.

     - name: End-to-end testing
        run: npm run test:ci:ie
        timeout-minutes: 10
        env:
          NODE_ENV: development
          DEBUG: testcafe:*

Testcafe Step Log (using run)

2021-07-20T09:24:57.703Z testcafe:test-run:Internet Explorer 11.0 / Windows 10:driver-message 
    {
      cmd: 'ready',
      status: {
        id: '4626.4743',
        isCommandResult: false,
        executionError: null,
        pageError: null,
        resent: false,
        result: null,
        consoleMessages: {
          null: [Object]
        },
        isPendingWindowSwitching: false,
        isFirstRequestAfterWindowSwitching: false,
        debug: ''
      },
      disableResending: true,
      allowRejecting: true,
      sessionId: 'ZA8TILRDy'
    }

Terminate batch job (Y/N)? 
Error: The action has timed out.
Alex Skorkin
  • 4,264
  • 3
  • 25
  • 47
Édouard Lopez
  • 40,270
  • 28
  • 126
  • 178
  • I tried to reproduce the issue with my own test project, but I was unsuccessful. My test for IE passed in both cases with testcafe-action and without it. Could you please clarify if your tests work properly in IE on your local machine? If so, please prepare a simple project that can reproduce the issue on our side. – Dmitry Ostashev Jul 22 '21 at 08:32
  • @DmitryOstashev I'm on Linux, that's why I want to setup the CI. The tests run nicely on Chrome. Can you contact me via twitter so we do a pair-programming session to debug ? – Édouard Lopez Jul 22 '21 at 13:26
  • 2
    You can try to run your test on a Windows virtual machine. You can download it for free here: https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/. Sorry, but we do not do custom programming on StackOverflow, we just answer questions. – Dmitry Ostashev Jul 23 '21 at 08:41
  • Thanks for your help, I explored `testcafe` in order to avoid the tedious task of installing and configuring my project on a whole different environment but still be able to test on IE11. I was able to configure it locally but unable to make it work on github action, either for Windows/IE11 or [Linux/Chrome](https://github.com/DevExpress/testcafe-action/issues/24https://github.com/DevExpress/testcafe-action/issues/24). I hope you can reach the same maturity as `Cypress` as you offer opportunities they don't. – Édouard Lopez Aug 02 '21 at 08:34

0 Answers0