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.