Skip to content

Commit 12a281d

Browse files
committed
Remove old e2e tests that are replaced by Cypress integration tests
1 parent 48f3385 commit 12a281d

File tree

24 files changed

+18846
-45848
lines changed

24 files changed

+18846
-45848
lines changed

.github/workflows/push.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,5 @@ jobs:
2424
run: npm run test:unit
2525
env:
2626
CI: true
27+
- name: Cypress run
28+
uses: cypress-io/github-action@v2

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ You can run tests by executing:
4040
```bash
4141
$ npm run test
4242
```
43-
To run e2e tests, you must have Java installed. [[download Java here](https://java.com/download/)]
4443

4544
## CSS Build
4645
The Chooser uses PostCSS plugin for PurgeCSS to make CSS bundle size smaller. It automatically removes unused CSS based on the classes found in the final built bundle. Some styles for dynamic components or dynamically-imported files can also be removed. If you find that the built site misses some styles, you can manually add the necessary classes or Regex expressions to the `safelist` array in the `postcss.config.js` file.

cypress.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
{
22
"project": "creativecommons-chooser",
3-
"baseUrl": "http://localhost:8080/"
3+
"baseUrl": "http://localhost:8080/",
4+
"integrationFolder": "tests/cypress/integration/",
5+
"fixturesFolder": "tests/cypress/fixtures",
6+
"pluginsFile": "tests/cypress/plugins/index.js",
7+
"supportFile": "tests/cypress/support/index.js"
48
}

package-lock.json

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

package.json

Lines changed: 75 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -1,99 +1,79 @@
11
{
2-
"name": "chooser",
3-
"version": "1.0.0",
4-
"private": false,
5-
"description": "The new and improved Creative Commons License Chooser",
6-
"author": "akmadian <akmadian@gmail.com>",
7-
"scripts": {
8-
"serve": "vue-cli-service serve",
9-
"build": "vue-cli-service build && shx rm -rf ./docs && shx cp -r ./dist ./docs",
10-
"test:unit": "vue-cli-service test:unit",
11-
"test:e2e": "vue-cli-service test:e2e",
12-
"lint": "vue-cli-service lint && npx stylelint ./src/**/*.{vue,css} --fix",
13-
"i18n:report": "vue-cli-service i18n:report -v --src src/**/*.vue --locales src/locales/**.json -o output.json",
14-
"test": "vue-cli-service test:unit --coverage && vue-cli-service test:e2e && npm run test:cypress",
15-
"test:cypress": "node_modules/.bin/cypress open"
16-
},
17-
"dependencies": {
18-
"@creativecommons/vocabulary": "^2020.11.3",
19-
"@creativecommons/vue-vocabulary": "^2020.11.3",
20-
"@sentry/vue": "^5.29.2",
21-
"bulma": "^0.9.1",
22-
"clipboard": "^2.0.6",
23-
"core-js": "^3.6.5",
24-
"node-sass": "^4.14.1",
25-
"sass-loader": "^8.0.2",
26-
"vue": "^2.6.10",
27-
"vue-analytics": "^5.22.1",
28-
"vue-hotjar": "^1.2.0",
29-
"vue-i18n": "^8.20.0",
30-
"vue-scrollto": "^2.20.0",
31-
"vuex": "^3.5.1"
32-
},
33-
"devDependencies": {
34-
"@fullhuman/postcss-purgecss": "^3.1.3",
35-
"@vue/cli-plugin-babel": "^4.4.6",
36-
"@vue/cli-plugin-e2e-nightwatch": "^4.4.6",
37-
"@vue/cli-plugin-eslint": "~4.5.0",
38-
"@vue/cli-plugin-unit-jest": "^4.4.6",
39-
"@vue/cli-service": "^4.4.6",
40-
"@vue/eslint-config-standard": "^5.1.2",
41-
"@vue/test-utils": "^1.1.2",
42-
"babel-eslint": "^10.1.0",
43-
"chromedriver": "^87.0.0",
44-
"clipboardy": "^2.3.0",
45-
"cypress": "^6.3.0",
46-
"eslint": "^6.8.0",
47-
"eslint-config-prettier": "^7.2.0",
48-
"eslint-plugin-import": "^2.22.0",
49-
"eslint-plugin-node": "^11.1.0",
50-
"eslint-plugin-prettier": "^3.3.1",
51-
"eslint-plugin-promise": "^4.2.1",
52-
"eslint-plugin-standard": "^4.0.1",
53-
"eslint-plugin-vue": "^6.2.2",
54-
"geckodriver": "^1.19.1",
55-
"lint-staged": "^9.5.0",
56-
"prettier": "^1.19.1",
57-
"shx": "^0.3.3",
58-
"stylelint": "^13.10.0",
59-
"stylelint-config-prettier": "^8.0.2",
60-
"stylelint-config-standard": "^20.0.0",
61-
"vue-cli-plugin-i18n": "^0.6.1",
62-
"vue-template-compiler": "^2.6.10"
63-
},
64-
"jest": {
65-
"moduleFileExtensions": [
66-
"js",
67-
"vue"
68-
],
69-
"moduleNameMapper": {
70-
"^@/(.*)$": "<rootDir>/src/$1"
2+
"name": "chooser",
3+
"version": "1.0.0",
4+
"description": "The new and improved Creative Commons License Chooser",
5+
"author": "akmadian <akmadian@gmail.com>",
6+
"private": false,
7+
"repository": {
8+
"type": "git",
9+
"url": "git+https://github.com/creativecommons/chooser.git"
7110
},
72-
"transform": {
73-
"^.+\\.js$": "<rootDir>/node_modules/babel-jest",
74-
".*\\.(vue)$": "<rootDir>/node_modules/vue-jest",
75-
"^.+\\.(svg|png)$": "<rootDir>/tests/unit/svgTransform.js"
11+
"license": "MIT",
12+
"scripts": {
13+
"serve": "vue-cli-service serve",
14+
"build": "vue-cli-service build && shx rm -rf ./docs && shx cp -r ./dist ./docs",
15+
"test:unit": "vue-cli-service test:unit",
16+
"test:e2e": "vue-cli-service test:e2e",
17+
"lint": "vue-cli-service lint && npx stylelint ./src/**/*.{vue,css} --fix",
18+
"i18n:report": "vue-cli-service i18n:report -v --src src/**/*.vue --locales src/locales/**.json -o output.json",
19+
"test": "vue-cli-service test:unit --coverage && vue-cli-service test:e2e && npm run test:cypress",
20+
"test:cypress": "node_modules/.bin/cypress open"
7621
},
77-
"snapshotSerializers": [
78-
"<rootDir>/node_modules/jest-serializer-vue"
79-
]
80-
},
81-
"gitHooks": {
82-
"pre-commit": "lint-staged"
83-
},
84-
"lint-staged": {
85-
"*.{js,jsx,vue}": [
86-
"vue-cli-service lint",
87-
"git add"
88-
],
89-
"*.{css,vue}": [
90-
"stylelint --fix",
91-
"git add"
92-
]
93-
},
94-
"license": "MIT",
95-
"repository": {
96-
"type": "git",
97-
"url": "git+https://github.com/creativecommons/chooser.git"
98-
}
22+
"dependencies": {
23+
"@creativecommons/vocabulary": "^2020.11.3",
24+
"@creativecommons/vue-vocabulary": "^2020.11.3",
25+
"@sentry/vue": "^5.29.2",
26+
"bulma": "^0.9.1",
27+
"clipboard": "^2.0.6",
28+
"core-js": "^3.6.5",
29+
"node-sass": "^4.14.1",
30+
"sass-loader": "^8.0.2",
31+
"vue": "^2.6.10",
32+
"vue-analytics": "^5.22.1",
33+
"vue-hotjar": "^1.2.0",
34+
"vue-i18n": "^8.20.0",
35+
"vue-scrollto": "^2.20.0",
36+
"vuex": "^3.5.1"
37+
},
38+
"devDependencies": {
39+
"@fullhuman/postcss-purgecss": "^3.1.3",
40+
"@vue/cli-plugin-babel": "^4.4.6",
41+
"@vue/cli-plugin-e2e-nightwatch": "^4.4.6",
42+
"@vue/cli-plugin-eslint": "^4.4.6",
43+
"@vue/cli-plugin-unit-jest": "^4.4.6",
44+
"@vue/cli-service": "^4.4.6",
45+
"@vue/eslint-config-standard": "^5.1.2",
46+
"@vue/test-utils": "^1.1.2",
47+
"babel-eslint": "^10.1.0",
48+
"chromedriver": "^87.0.0",
49+
"clipboardy": "^2.3.0",
50+
"cypress": "^6.5.0",
51+
"eslint": "^6.8.0",
52+
"eslint-plugin-import": "^2.22.0",
53+
"eslint-plugin-node": "^10.0.0",
54+
"eslint-plugin-promise": "^4.2.1",
55+
"eslint-plugin-standard": "^4.0.1",
56+
"eslint-plugin-vue": "^6.2.2",
57+
"geckodriver": "^1.19.1",
58+
"shx": "^0.3.3",
59+
"vue-cli-plugin-i18n": "^0.6.1",
60+
"vue-template-compiler": "^2.6.10"
61+
},
62+
"jest": {
63+
"moduleFileExtensions": [
64+
"js",
65+
"vue"
66+
],
67+
"moduleNameMapper": {
68+
"^@/(.*)$": "<rootDir>/src/$1"
69+
},
70+
"transform": {
71+
"^.+\\.js$": "<rootDir>/node_modules/babel-jest",
72+
".*\\.(vue)$": "<rootDir>/node_modules/vue-jest",
73+
"^.+\\.(svg|png)$": "<rootDir>/tests/unit/svgTransform.js"
74+
},
75+
"snapshotSerializers": [
76+
"<rootDir>/node_modules/jest-serializer-vue"
77+
]
78+
}
9979
}

tests/README.md

Lines changed: 2 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# Testing
22

3-
This file will be used to document some useful commands and tips for tests. Also, some common errors found that may prevent you from running them.
4-
5-
## Unit Testing
3+
There are two types of tests in the Chooser: unit tests and integration tests.
64

75
### Useful Commands and Tips
86
If you want to run only unit tests, use:
@@ -11,38 +9,8 @@ If you want to run only unit tests, use:
119
$ npm run test:unit
1210
```
1311

14-
If you want to run only e2e tests, use:
12+
If you want to run only integration tests, use:
1513
``` bash
1614
$ npm run test:e2e
1715
```
1816

19-
### About Snapshots Test
20-
When updating some components, snapshots test may fail if the UI's changed. To prevent that from happening, press u while in watch mode to update your snapshots.
21-
22-
### Common Errors
23-
When running your unit tests for the first time, you may encounter this error:
24-
25-
``` bash
26-
$ ENOSPC: System limit for number of file watchers reached
27-
```
28-
29-
This means that your system's preventing you from running the command, since the numbers of files it can watch has been exceeded. To fix it you'll have to manually expand it's file limits. On Ubuntu distributions, it looks like this:
30-
31-
``` bash
32-
$ sudo vim /etc/sysctl.conf
33-
```
34-
35-
Then add the following line:
36-
37-
``` bash
38-
$ fs.inotify.max_user_watches=524288
39-
```
40-
41-
After running it you should be good to go!
42-
43-
44-
45-
1903 18362.535
46-
node 13.3.0
47-
npm 6.4.1
48-
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)