Changelog - Testing
This changelog refers to the @viasoft/testing library.
2.0.2 (07/03/2023)
This version of @viasoft/testing no longer depends on the ‘cypress-image-snapshot’ library. Instead, the ‘matchImageSnapshot’ function has been added directly to the @viasoft/testing. So it is no longer necessary to install ‘cypress-image-snapshot’ in your project.
To use the image snapshot functionality in this version of @viasoft/testing, you can import the “plugin.js” and “command.js” files from the
@viasoft/testing/snapshotpath.
2.0.1 (01/03/2023)
This version of @viasoft/testing includes the ‘cypress-image-snapshot’ library. Therefore, it’s no longer necessary to install ‘cypress-image-snapshot’ in your project.
2.0.0 (27/02/2023)
This version brings Angular up to v14, Node up to v18 and Chrome up to v107
Before updating
After each “dependency update” step, you might need to delete your
node_modulesfolder andpackage-lock.jsonfile and runnpm iagain.
Update dependencies
These are the final dependency tables, go through each dependency and perform the necessary changes.
Dependency |
Status |
Version |
Documentation |
|---|---|---|---|
@angular-devkit/core |
🔄 Updated |
|
|
@angular-devkit/schematics |
🔄 Updated |
|
|
typescript |
🔄 Updated |
|
|
yargs |
🔄 Updated |
|
Dev dependency |
Status |
Version |
Documentation |
|---|---|---|---|
@babel/cli |
🔄 Updated |
|
|
@babel/core |
🔄 Updated |
|
|
@babel/preset-env |
🔄 Updated |
|
|
@types/jasmine |
🔄 Updated |
|
|
@types/node |
🔄 Updated |
|
|
jasmine |
🔄 Updated |
|
Breaking changes
Updated the default docker image.
korp/cypress-docker:node14.16.0-chrome89-ff86
korp/cypress-docker:node18.12.0-chrome107
Changed the default spec folder.
cypress/integration
cypress/e2e
The
testFilesproperty has been renamed tospecPatternand is now insidee2e.
cypressJson.testFiles
cypressJson.e2e.specPattern
Renamed the E2E support file.
cypress/support/index.js
cypress/support/e2e.js
Changed the cypress config testFiles.
cypress.json
cypress-config.json
Now
baseUrlproperty is insidee2e.
cypressJson.baseUrl
cypressJson.e2e.baseUrl
1.1.4 (17/06/2021)
Bug Fixes
FRM-1700:
test.script.jswould stay up indefinitely if an error occurred duringng serve. The default test script has been updated to fix this so new repositories won’t have this issue, but existing repositories will have to implement this change manually. Reminder: your application should ALWAYS be served with AOT on.
Fixing the script in existing repositories
Inside test.script.js, replace the content in the Serve app and run rests region with the following code:
//#region Serve app and run rests
const serve = shell.exec(SERVE_COMMAND, { silent: false, async: true });
let runningTests = false;
const endProcess = (code) => {
if (serve) {
serve.kill(code);
}
process.exit(code);
}
serve
.stdout
.on('data', data => {
if (String(data).indexOf('Angular Live Development Server') > -1) {
setTimeout(() => {
if (!runningTests) {
console.log('Error detected, process will exit now.');
endProcess(-1);
}
}, 5000);
}
if (String(data).indexOf('Compiled successfully') > -1) {
runningTests = true;
console.log('Running tests...');
endProcess(shell.exec(TEST_COMMAND).code);
}
});
//#endregion
1.1.0 (21/07/2020)
Features
Added support for TypeScript
Use
typescript-migrationschematic to add TS support to your current Cypress environmentAdded type definitions to all helper commands
Added several helper commands
waitForElement()waitForElementToNotExist()waitForNgAnimation()waitForMatSidenavOpen()waitForMatButtonAnimation()waitForMatTooltipOpen()waitForMatTooltipClose()waitForMatModalOpen()waitForMatSelectOpen()waitForGridPageMenuOpen()waitForGridPageMenuClose()selectTab()
Breaking Changes
Commands are now exported from a single function:
addHelperCommands()addTreeTableHelperCommandsandaddVsInputHelperCommandswill no longer work
npx vs-test createwill always generate TS tests from now on
How to Update a JavaScript test to TypeScript
Rename file from
<name>.jsto<name>.tsFix typescript / lint errors
Rename snapshot folder from
<name>.jsto<name>.ts
We recommend using the PowerRename module in Microsoft PowerToys to easily rename all test files and snapshot folders.
1.0.13 (26/06/2020)
FRM-1280: Added TreeTable helper commands
1.0.12 (24/04/2020)
FRM-1180: Updated vs-input commands
Following the 4.4.0 release of
@viasoft/components, vs-input commands will now query forformControlNameinstead ofcontrolName. To use the old format, set thelegacyparameter (usually the last one) totrueas such:cy.getVsInput('name', true);cy.validateVsInput('name', 'abc', true);cy.typeAndValidateVsInput('name', 'abc', '123', true);
Changed the selector so that it queries for vs-input specifically, which might fix some issues where the command would find more than one element at a time.
1.0.3 (28/02/2020)
FRM-1071: Added
--jenkinsflagThis flag will enable Jenkins mode, in which the Cypress test command is run directly since it’s already in a Docker environment.
1.0.2 (28/02/2020)
FRM-1069: Changed default
TEST_COMMANDconst intest.script.jsIf you’ve already generated this file, please change the
TEST_COMMANDconstant manually fromvs-test run -atonpx vs-test run -a.
FRM-1070: Added
--reportflagThis flag will enable JUnit reporting, which enables you to see your test results in the Jenkins pipeline.
1.0.1 (26/02/2020)
Added
--force-base-urlflag
1.0.0 (26/02/2020)
Initial Release