xlr-ui-test-support
v0.2.35
Published
Test dsl & generic configs to support e2e tests. For XL Release & friends
Downloads
258
Readme
Protractor:
Example of reusing the basic protractor configuration:
const config = require('xlr-ui-test-support/e2e/protractor/base.conf');
exports.config = config.with({
specs: [
'./e2e/protractor/**/*.js'
]
});
Gulp:
To use gulp webdriver tasks the following line should be added to the gulpfile:
require('xlr-ui-test-support/gulp/webdriver')(gulp);
package.json:
Make sure to update script command to use gulp:
"update-webdriver": "gulp webdriver-update",
It is possible to set explicit version for selenium, chromedriver and geckodriver via command line argument instead of using it from selenium-versions.json
"update-webdriver": "gulp webdriver-update --chromedriver 84.0.4147.135",
How to debug locally
I use to call gulp directly because gradle is slow.
./gradlew yarn_install
./.gradle/nodejs/node-v12.15.0-linux-x64/bin/node ./node_modules/gulp/bin/gulp.js build-dist
cp dist/index.js ../xl-release/node_modules/xlr-ui-test-support/dist/index.js
cp ./e2e/protractor/base.conf.js ../xl-release/node_modules/xlr-ui-test-support/e2e/protractor/base.conf.js
Dom dumps
When test fails this testsuite will write json-stringified dom snapshot to console output log.
Here are some oneliners to retrieve it later:
cat the_log |
grep -P '^\{"domDump_' | jq '. | to_entries | .[].value' -jr |
cat > /tmp/a.html
Beware, that if there are more than one failure in the_log, you may need to cut failures yourself by using head/tail
cat the_log |
grep -P '^\{"domDump_' | less -SN
cat the_log |
grep -P '^\{"domDump_ | tail -n +13 | head -n 12 | jq '. | to_entries | .[].value' -jr |
cat > /tmp/a.html