Skip to content
This repository was archived by the owner on Jun 27, 2023. It is now read-only.

Commit d9880c8

Browse files
committed
feat(unit-e2e): added tests but not working for now
1 parent 156e791 commit d9880c8

File tree

8 files changed

+2942
-646
lines changed

8 files changed

+2942
-646
lines changed

.nyc_output/out.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

cypress.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
{
22
"baseUrl": "http://localhost:6044",
3-
"pluginsFile": "tests/e2e/plugins/index.js"
3+
"pluginsFile": "tests/e2e/plugins/index.js",
4+
"supportFile": "tests/e2e/support/index.js",
5+
"fixturesFolder": "tests/e2e/fixtures",
6+
"integrationFolder": "tests/e2e/integration",
7+
"testFiles": "**/*.e2e.js*",
8+
"experimentalComponentTesting": true,
9+
"componentFolder": "tests/e2e/components"
410
}

package-lock.json

Lines changed: 2908 additions & 625 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"build:dts": "api-extractor run --local --verbose && tail -n +7 >> dist/as-dynamic-forms.d.ts",
1212
"semantic-release": "semantic-release",
1313
"test": "vue-cli-service test:unit",
14+
"test:components": "vue-cli-service test:components",
1415
"test:watch": "vue-cli-service test:unit --verbose --no-cache --watchAll"
1516
},
1617
"main": "dist/as-dynamic-forms.cjs.js",
@@ -23,6 +24,7 @@
2324
"deep-object-diff": "^1.1.0"
2425
},
2526
"devDependencies": {
27+
"@cypress/vue": "*",
2628
"@microsoft/api-extractor": "^7.12.0",
2729
"@rollup/plugin-alias": "^3.1.1",
2830
"@rollup/plugin-buble": "^0.21.3",
@@ -45,6 +47,7 @@
4547
"babel-eslint": "10.1.0",
4648
"babel-jest": "26.6.3",
4749
"chalk": "^4.1.0",
50+
"cypress": "*",
4851
"eslint": "7.14.0",
4952
"eslint-plugin-prettier": "^3.1.4",
5053
"eslint-plugin-vue": "^7.1.0",
@@ -64,6 +67,7 @@
6467
"ts-node": "^9.0.0",
6568
"typescript": "~4.1.2",
6669
"vue": "^3.0.0",
70+
"vue-cli-plugin-cypress-experimental": "~1.2.0",
6771
"vue-jest": "^5.0.0-alpha.6",
6872
"vue-select": "3.10.8"
6973
},

tests/.eslintrc.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
module.exports = {
2+
plugins: ['cypress'],
3+
env: {
4+
mocha: true,
5+
'cypress/globals': true,
6+
},
7+
rules: {
8+
strict: 'off',
9+
},
10+
};

tests/e2e/specs/text-input.js renamed to tests/e2e/integration/text-input.e2e.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ describe('Text Input test Suite', () => {
33
cy.visit('/'); // "baseUrl" is defined in cypress.json file
44
});
55

6-
context('Change Value', () => {
7-
it.only('should allow me to change value', () => {
6+
context('Changes Value', () => {
7+
it.only('should update FormValues when input changes', () => {
88
cy.get('input[type="email"').type('[email protected]').blur();
99
cy.get('[data-cy=form-values]').should('contain', '[email protected]');
1010
});

tests/e2e/plugins/index.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,19 @@
77
// https://docs.cypress.io/api/plugins/preprocessors-api.html#Examples
88

99
// /* eslint-disable import/no-extraneous-dependencies, global-require */
10-
// const webpack = require('@cypress/webpack-preprocessor')
10+
const webpack = require('@cypress/webpack-preprocessor');
1111

1212
module.exports = (on, config) => {
13-
// on('file:preprocessor', webpack({
14-
// webpackOptions: require('@vue/cli-service/webpack.config'),
15-
// watchOptions: {}
16-
// }))
13+
on(
14+
'file:preprocessor',
15+
webpack({
16+
webpackOptions: require('@vue/cli-service/webpack.config'),
17+
watchOptions: {},
18+
}),
19+
);
1720

1821
return Object.assign({}, config, {
19-
fixturesFolder: 'tests/e2e/fixtures',
20-
integrationFolder: 'tests/e2e/specs',
21-
screenshotsFolder: 'tests/e2e/screenshots',
22-
videosFolder: 'tests/e2e/videos',
23-
supportFile: 'tests/e2e/support/index.js',
22+
experimentalComponentTesting: true,
23+
componentFolder: 'tests/e2e/components',
2424
});
2525
};

tests/e2e/specs/test.js

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)