Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cypress as e2e tests framework #12210

Merged
merged 119 commits into from Aug 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
119 commits
Select commit Hold shift + click to select a range
25bfbaa
feat: add cypress initial commit
sendilkumarn Jun 19, 2020
9d89606
Move to single Cypress folder
nassimerrahoui Jun 29, 2020
363666e
Migrate to Typescript
nassimerrahoui Jun 29, 2020
571d4bb
[Account] Login page (with Angular)
nassimerrahoui Jun 30, 2020
f4fdaf5
[Account] Login page (with React)
nassimerrahoui Jun 30, 2020
8802815
[Account] Register page (with Angular)
nassimerrahoui Jul 1, 2020
2218f81
[Account] Register page (with React)
nassimerrahoui Jul 1, 2020
948a3f0
[Account] Administration pages (with Angular)
nassimerrahoui Jul 1, 2020
258c6be
[Account] Administration pages (with React)
nassimerrahoui Jul 1, 2020
babe237
[Account] Settings page (with Angular)
nassimerrahoui Jul 2, 2020
939582d
[Account] Settings page (with React)
nassimerrahoui Jul 2, 2020
8b346fd
[Password] password page (with Angular)
nassimerrahoui Jul 15, 2020
c114569
[Password] password page (with React)
nassimerrahoui Jul 15, 2020
fff72ef
[Account] Reset initiate/finish page
nassimerrahoui Jul 15, 2020
26bf849
[Account] Reset initiate/finish page
nassimerrahoui Jul 15, 2020
46c9755
[Account] Reset initiate/finish page
nassimerrahoui Jul 16, 2020
cf2a279
upgrade Cypress version to 4.11.0
avdev4j Aug 3, 2020
8a6a03b
[OAuth2] add oauth2 commands
nassimerrahoui Aug 4, 2020
b486957
[OAuth2] fix generation conditions
nassimerrahoui Aug 5, 2020
de529e3
[OAuth2] fix tests
nassimerrahoui Aug 5, 2020
a3f765e
Add new Cypress script
avdev4j Aug 4, 2020
f448123
Add npm Cypress run script to package.json
avdev4j Aug 4, 2020
9ecc4a2
[angular] Call Cypress in e2e step instead of Protractor
avdev4j Aug 4, 2020
46c049e
[angular] Add Cypress to sample
avdev4j Aug 4, 2020
ec437c2
[angular] Avoid conflicts between Cypress and Jest libraries.
avdev4j Aug 5, 2020
c25dec4
Move all Angular samples from protractor to Cypress
avdev4j Aug 6, 2020
8d9080f
Move all React samples from protractor to Cypress
avdev4j Aug 6, 2020
17be484
Move all Webflux samples from protractor to Cypress
avdev4j Aug 6, 2020
2ac135f
Move all Azure pipelines build from protractor to Cypress
avdev4j Aug 6, 2020
9d1c193
Rename cypress shell file name to e2e
avdev4j Aug 6, 2020
579172f
Add cypress folder in eslint ignore
avdev4j Aug 6, 2020
572c33e
Add cypress:run in react package.json
avdev4j Aug 6, 2020
703abac
Use loadConfig instead of old way
avdev4j Aug 6, 2020
4b5d1e4
Add cypress as test framework option in jdl
avdev4j Aug 6, 2020
34cdcb3
add default viewport
nassimerrahoui Aug 6, 2020
7daffb5
[Vue] add cypress for vue
nassimerrahoui Aug 6, 2020
04d9625
Improve e2e and app subGen
avdev4j Aug 7, 2020
4b0543d
Add config for running cypress with vue
avdev4j Aug 7, 2020
973e9ab
Improve template
avdev4j Aug 7, 2020
1f5515b
Use Cypress in Vue CI
avdev4j Aug 7, 2020
05cd934
Add cypressTests in loadConfig
avdev4j Aug 7, 2020
e568458
Fix tsconfig.json.ejs
avdev4j Aug 7, 2020
617a6e3
Improve package.json scripts
avdev4j Aug 7, 2020
70559d0
Rename e2e folder and compose from client subGen insteadOf app
avdev4j Aug 7, 2020
95bbaeb
Fix method order
avdev4j Aug 7, 2020
09246d1
Move .eslintignore.ejs to the new file-common writer
avdev4j Aug 7, 2020
52b46ea
Move CLIENT_DIST_DIR to default priority
avdev4j Aug 7, 2020
0bdf0cb
fix click in Cypress
nassimerrahoui Aug 7, 2020
e67fa0a
reword common file
avdev4j Aug 8, 2020
e8d641b
fix removing "allowJs"
avdev4j Aug 8, 2020
8426114
Add webdriver dependency if cypressTests
avdev4j Aug 10, 2020
9e93deb
Fix npm tests
avdev4j Aug 10, 2020
cf09497
Fix vue Cypress failing
avdev4j Aug 10, 2020
3c2e787
Mark Protractor label as deprecated
avdev4j Aug 10, 2020
84ced36
Fix typo
avdev4j Aug 10, 2020
a9ada84
Upgrade Cypress to 4.12.1
avdev4j Aug 10, 2020
1c4ea0a
Fix data-cy values
avdev4j Aug 10, 2020
6db981a
Add Chrome browser option with react and vue
avdev4j Aug 10, 2020
bb4b034
rename Cypress test files
avdev4j Aug 10, 2020
f4d0b89
Fix indentation
avdev4j Aug 10, 2020
7656294
Remove unused code
avdev4j Aug 10, 2020
a54352b
Avoid to add oauth2 specific code in common case
avdev4j Aug 10, 2020
c0478d0
rename kc to keycloack
avdev4j Aug 10, 2020
777535f
camel case convention for data-cy
nassimerrahoui Aug 10, 2020
0bf02a7
Run headless mode when using Chrome browser
avdev4j Aug 10, 2020
b6599a6
Improve Cypress TS files
avdev4j Aug 10, 2020
d224c37
Add consistency for vue component url
nassimerrahoui Aug 10, 2020
6b13d73
Rework register tests
avdev4j Aug 10, 2020
882b659
Rework login page tests
avdev4j Aug 10, 2020
f708af6
Remove line not used in login tests
nassimerrahoui Aug 10, 2020
a1f577a
Fix settings test
nassimerrahoui Aug 10, 2020
e1f292d
fix tests to match with session authenticate endPoint
avdev4j Aug 10, 2020
299fc18
Preserve cookies for session authentication's type
nassimerrahoui Aug 11, 2020
ebf0941
Expect 401 when login fail
nassimerrahoui Aug 11, 2020
9cf6b0f
Fix test login
nassimerrahoui Aug 11, 2020
bab59de
Move all Webflux samples from protractor to Cypress
avdev4j Aug 6, 2020
3c71809
fix indentation
avdev4j Aug 12, 2020
e990b0d
Launch either Cypress or Protractor
avdev4j Aug 12, 2020
6c61a17
keep at least one Angular build with Protractor
avdev4j Aug 12, 2020
d44cb68
Make e2e script to be able to launch both Protractor and Cypress
avdev4j Aug 12, 2020
6258557
Add npm test for cypress files
nassimerrahoui Aug 13, 2020
2dcf061
Improve package.json scripts and use generic JHI_E2E variable in CI
avdev4j Aug 13, 2020
83cda0f
Replace filename _spec by .spec name
nassimerrahoui Aug 14, 2020
16d043b
Add clearCookies to clear state correctly
nassimerrahoui Aug 14, 2020
dc05abf
Fix sub generator name in index.js
nassimerrahoui Aug 14, 2020
a147f0b
Fix indentation
avdev4j Aug 14, 2020
a668a6e
Refactor cypress tests.
mshima Aug 14, 2020
99d943c
Lint fix
mshima Aug 14, 2020
dd7511a
Client generator should compose with common.
mshima Aug 14, 2020
0ad6e92
Add oauth2 condition to commands file
nassimerrahoui Aug 17, 2020
983c72f
fix indent
nassimerrahoui Aug 17, 2020
001881e
Add tests for entity-client part
nassimerrahoui Aug 18, 2020
c56f93a
Fix load details and edit entity instance
nassimerrahoui Aug 18, 2020
21ed3bc
Remove data-cy entityTableColumnId
nassimerrahoui Aug 18, 2020
34503c5
Add readOnly condition to entity tests
nassimerrahoui Aug 18, 2020
2effa24
Add beforeEach step for oauth2 case
nassimerrahoui Aug 18, 2020
47cf459
Fix indentations and comments
nassimerrahoui Aug 19, 2020
d1e93e3
Add insertion and deletion entity tests
nassimerrahoui Aug 20, 2020
1f7124c
Fix random text in entity tests
nassimerrahoui Aug 20, 2020
bf98467
Fix entity tests
nassimerrahoui Aug 20, 2020
9bad293
Fix react deletion tests
nassimerrahoui Aug 21, 2020
08cedb0
Remove functions for some fields + use faker
nassimerrahoui Aug 21, 2020
2d86fdb
Fix generateFakeData
nassimerrahoui Aug 21, 2020
534966f
Import faker from files.js + fixes
nassimerrahoui Aug 21, 2020
03765a2
Fix imports in files.js
nassimerrahoui Aug 21, 2020
97c4673
Implement entity generateFakeData for a full validated sample.
mshima Aug 22, 2020
ec12d58
Improvements to generateFakeData
mshima Aug 22, 2020
6d0df1b
Fix cypress test.
mshima Aug 22, 2020
11b4a75
Change screenshots folder
mshima Aug 22, 2020
8ac5bd3
Store cypress failure screenshots
mshima Aug 22, 2020
dbb5c9d
Fix fake user
mshima Aug 22, 2020
48ad291
Generate a validated full entity sample.
mshima Aug 22, 2020
7a97743
Use timestamp from generateFakeData
mshima Aug 22, 2020
dc5f5b2
Scroll to top for a better screenshot
mshima Aug 22, 2020
e21f552
Use enum sample
mshima Aug 22, 2020
9a5ac5a
Drop faker from generated package.json
mshima Aug 22, 2020
bd588e6
Merge pull request #1 from mshima/skip_ci_cypress
nassimerrahoui Aug 23, 2020
ce15c71
Merge pull request #55 from nassimerrahoui/add-cypress
avdev4j Aug 24, 2020
776da07
merge modifications from master
avdev4j Aug 24, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
28 changes: 17 additions & 11 deletions .github/workflows/angular.yml
Expand Up @@ -77,68 +77,68 @@ jobs:
entity: sql
profile: prod
war: 0
protractor: 1
e2e: 1
testcontainers: 1
- app-type: ngx-psql-es-noi18n-mapsid
entity: sqlfull
profile: prod
war: 0
protractor: 1
e2e: 1
testcontainers: 0
- app-type: ngx-mariadb-oauth2-infinispan
entity: sqlfull
profile: prod
war: 0
protractor: 1
e2e: 1
testcontainers: 0
- app-type: ngx-mongodb-kafka-cucumber
entity: mongodb
profile: dev,webpack
war: 0
protractor: 1
e2e: 1
testcontainers: 0
- app-type: ngx-h2mem-ws-nol2
entity: sql
profile: dev,webpack
war: 0 # TODO: need change to 1, when maven+war is fixed
protractor: 1
e2e: 1
testcontainers: 0
- app-type: ngx-gradle-fr
entity: sql
profile: prod
war: 0
protractor: 1
e2e: 1
testcontainers: 0
- app-type: ngx-gradle-psql-es-noi18n-mapsid
entity: sqlfull
profile: prod
war: 0
protractor: 1
e2e: 1
testcontainers: 1
- app-type: ngx-gradle-mariadb-oauth2-infinispan
entity: sql
profile: dev,webpack
war: 0
protractor: 1
e2e: 1
testcontainers: 1
- app-type: ngx-gradle-mongodb-kafka-cucumber
entity: mongodb
profile: prod
war: 0
protractor: 1
e2e: 1
testcontainers: 0
- app-type: ngx-gradle-h2disk-ws-nocache
entity: sql
profile: dev,webpack
war: 1
protractor: 1
e2e: 1
testcontainers: 0
env:
JHI_ENTITY: ${{ matrix.entity }}
JHI_APP: ${{ matrix.app-type }}
JHI_PROFILE: ${{ matrix.profile }}
JHI_WAR: ${{ matrix.war }}
JHI_PROTRACTOR: ${{ matrix.protractor }}
JHI_E2E: ${{ matrix.e2e }}
JHI_TESTCONTAINERS: ${{ matrix.testcontainers }}
steps:
#----------------------------------------------------------------------
Expand Down Expand Up @@ -190,7 +190,13 @@ jobs:
run: npm run e2e:update-webdriver --versions.chrome ${{ steps.chromedriver-version.outputs.version }}
working-directory: /home/runner/app
- name: 'TESTS: End-to-End'
id: e2e
run: $JHI_SCRIPTS/24-tests-e2e.sh
- uses: actions/upload-artifact@v2
if: ${{ always() && steps.e2e.outcome == 'failure'}}
with:
name: screenshots-${{ matrix.app-type }}
path: /home/runner/app/target/cypress/screenshots
- name: 'TESTS: Sonar analysis'
run: $JHI_SCRIPTS/25-sonar-analyze.sh
env:
Expand Down
26 changes: 16 additions & 10 deletions .github/workflows/react.yml
Expand Up @@ -76,62 +76,62 @@ jobs:
entity: sql
profile: prod
war: 0
protractor: 1
e2e: 1
testcontainers: 0
- app-type: react-maven-psql-es-noi18n-mapsid
entity: sqlfull
profile: prod
war: 0
protractor: 1
e2e: 1
testcontainers: 1
- app-type: react-maven-h2mem-memcached
entity: sql
profile: dev,webpack
war: 0 # TODO: need change to 1, when maven+war is fixed
protractor: 1
e2e: 1
testcontainers: 0
- app-type: react-maven-cassandra-session-redis
entity: cassandra
profile: prod
war: 0
protractor: 1
e2e: 1
testcontainers: 0
- app-type: react-maven-couchbase-caffeine
entity: couchbase
profile: prod
war: 0
protractor: 0
e2e: 0
testcontainers: 0
- app-type: react-gradle-psql-es-noi18n-mapsid
entity: sqlfull
profile: prod
war: 0
protractor: 1
e2e: 1
testcontainers: 0
- app-type: react-gradle-h2mem-memcached
entity: sql
profile: dev,webpack
war: 1
protractor: 1
e2e: 1
testcontainers: 0
- app-type: react-gradle-cassandra-session-redis
entity: cassandra
profile: prod
war: 0
protractor: 1
e2e: 1
testcontainers: 0
- app-type: react-gradle-couchbase-caffeine
entity: couchbase
profile: prod
war: 0
protractor: 1
e2e: 1
testcontainers: 0
env:
JHI_ENTITY: ${{ matrix.entity }}
JHI_APP: ${{ matrix.app-type }}
JHI_PROFILE: ${{ matrix.profile }}
JHI_WAR: ${{ matrix.war }}
JHI_PROTRACTOR: ${{ matrix.protractor }}
JHI_E2E: ${{ matrix.e2e }}
JHI_TESTCONTAINERS: ${{ matrix.testcontainers }}
steps:
#----------------------------------------------------------------------
Expand Down Expand Up @@ -183,7 +183,13 @@ jobs:
run: npm run e2e:update-webdriver --versions.chrome ${{ steps.chromedriver-version.outputs.version }}
working-directory: /home/runner/app
- name: 'TESTS: End-to-End'
id: e2e
run: $JHI_SCRIPTS/24-tests-e2e.sh
- uses: actions/upload-artifact@v2
if: ${{ always() && steps.e2e.outcome == 'failure'}}
with:
name: screenshots-${{ matrix.app-type }}
path: /home/runner/app/target/cypress/screenshots
- name: 'TESTS: Sonar analysis'
run: $JHI_SCRIPTS/25-sonar-analyze.sh
env:
Expand Down
30 changes: 18 additions & 12 deletions .github/workflows/vue.yml
Expand Up @@ -77,58 +77,58 @@ jobs:
entity: sqlfull
profile: prod
war: 0
protractor: 1
e2e: 1
- app-type: vue-noi18n
entity: sqlfull
profile: prod
war: 0
protractor: 1
e2e: 1
- app-type: vue-fulli18n-es
entity: sql
profile: prod
war: 0
protractor: 1
e2e: 1
- app-type: vue-gateway
entity: sql
profile: dev,webpack
war: 0
protractor: 1
e2e: 1
- app-type: vue-gradle-session
entity: sql
profile: dev,webpack
war: 0
protractor: 1
e2e: 1
- app-type: vue-ws-theme
entity: sql
profile: dev,webpack
war: 0
protractor: 1
e2e: 1
- app-type: vue-oauth2
entity: sql
profile: prod
war: 0
protractor: 1
e2e: 1
- app-type: vue-couchbase
entity: couchbase
profile: dev,webpack
war: 0
protractor: 1
e2e: 1
- app-type: vue-mongodb-kafka-cucumber
entity: mongodb
profile: dev,webpack
war: 0
protractor: 1
e2e: 1
- app-type: vue-session-cassandra-fr
entity: cassandra
profile: dev,webpack
war: 0
protractor: 1
e2e: 1
env:
JHI_ENTITY: ${{ matrix.entity }}
JHI_APP: ${{ matrix.app-type }}
JHI_PROFILE: ${{ matrix.profile }}
JHI_WAR: ${{ matrix.war }}
JHI_PROTRACTOR: ${{ matrix.protractor }}
JHI_E2E: ${{ matrix.e2e }}
steps:
#----------------------------------------------------------------------
# Install all tools and check configuration
Expand Down Expand Up @@ -175,8 +175,14 @@ jobs:
- name: 'TESTS: packaging'
run: $JHI_SCRIPTS/23-package.sh
- name: 'Synchronize chromedriver version'
if: ${{ matrix.protractor == 1 }}
if: ${{ matrix.e2e == 1 }}
run: npm run e2e:update-webdriver --versions.chrome ${{ steps.chromedriver-version.outputs.version }}
working-directory: /home/runner/app
- name: 'TESTS: End-to-End'
id: e2e
run: $JHI_SCRIPTS/24-tests-e2e.sh
- uses: actions/upload-artifact@v2
if: ${{ always() && steps.e2e.outcome == 'failure'}}
with:
name: screenshots-${{ matrix.app-type }}
path: /home/runner/app/target/cypress/screenshots
20 changes: 10 additions & 10 deletions .github/workflows/webflux.yml
Expand Up @@ -72,48 +72,48 @@ jobs:
entity: mongodb
profile: prod
war: 0
protractor: 1
e2e: 1
- app-type: webflux-mongodb-es-session
entity: mongodb
profile: prod
war: 0
protractor: 1
e2e: 1
- app-type: webflux-mongodb-oauth2
entity: mongodb
profile: prod
war: 0
protractor: 1
e2e: 1
- app-type: webflux-gateway-jwt
entity: none
profile: prod
war: 0
protractor: 1
e2e: 1
- app-type: webflux-gateway-oauth2
entity: none
profile: prod
war: 0
protractor: 1
e2e: 1
- app-type: webflux-couchbase
entity: couchbase
profile: prod
war: 0
protractor: 1
e2e: 1
- app-type: webflux-couchbase-es-oauth2
entity: couchbase
profile: prod
war: 0
protractor: 1
e2e: 1
- app-type: webflux-psql
entity: none
profile: prod
war: 0
protractor: 1
e2e: 1
env:
JHI_ENTITY: ${{ matrix.entity }}
JHI_APP: ${{ matrix.app-type }}
JHI_PROFILE: ${{ matrix.profile }}
JHI_WAR: ${{ matrix.war }}
JHI_PROTRACTOR: ${{ matrix.protractor }}
JHI_E2E: ${{ matrix.e2e }}
steps:
#----------------------------------------------------------------------
# Install all tools and check configuration
Expand Down Expand Up @@ -164,7 +164,7 @@ jobs:
run: npm run e2e:update-webdriver --versions.chrome ${{ steps.chromedriver-version.outputs.version }}
working-directory: /home/runner/app
- name: 'TESTS: End-to-End'
run: $JHI_SCRIPTS/24-tests-e2e.sh
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keep the old name: 24-tests-e2e.sh

run: $JHI_SCRIPTS/24-tests-cypress.sh
- name: 'TESTS: Sonar analysis'
run: $JHI_SCRIPTS/25-sonar-analyze.sh
env:
Expand Down
12 changes: 6 additions & 6 deletions azure-pipelines.yml
Expand Up @@ -28,7 +28,7 @@ jobs:
variables:
JHI_PROFILE: dev,webpack
JHI_RUN_APP: 1
JHI_PROTRACTOR: 0
JHI_CYPRESS: 0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename to JHI_E2E

JHI_JDK: 11
# if JHI_LIB_BRANCH value is release, use the release from Maven
JHI_LIB_REPO: https://github.com/jhipster/jhipster.git
Expand All @@ -50,12 +50,12 @@ jobs:
JHI_APP: ms-ngx-gateway-eureka-jwt
JHI_ENTITY: sqllight
JHI_PROFILE: prod
JHI_PROTRACTOR: 1
JHI_CYPRESS: 1
ms-ngx-gateway-eureka-oauth2:
JHI_APP: ms-ngx-gateway-eureka-oauth2
JHI_ENTITY: sqllight
JHI_PROFILE: prod
JHI_PROTRACTOR: 1
JHI_CYPRESS: 1
ms-ngx-gateway-eureka-uaa:
JHI_APP: ms-ngx-gateway-eureka-uaa
JHI_ENTITY: uaa
Expand All @@ -69,17 +69,17 @@ jobs:
JHI_APP: ms-react-gateway-consul-jwt
JHI_ENTITY: sqllight
JHI_PROFILE: prod
JHI_PROTRACTOR: 1
JHI_CYPRESS: 1
ms-react-gateway-consul-oauth2:
JHI_APP: ms-react-gateway-consul-oauth2
JHI_ENTITY: sqllight
JHI_PROFILE: prod
JHI_PROTRACTOR: 1
JHI_CYPRESS: 1
jdl-default:
JHI_APP: jdl-default
JHI_ENTITY: jdl
JHI_PROFILE: prod
JHI_PROTRACTOR: 1
JHI_CYPRESS: 1
JHI_TESTCONTAINERS: 1
steps:
#----------------------------------------------------------------------
Expand Down
3 changes: 2 additions & 1 deletion generators/app/prompts.js
Expand Up @@ -99,7 +99,8 @@ async function askForTestOpts() {
}
if (!this.skipClient) {
// all client side test frameworks should be added here
choices.push({ name: 'Protractor', value: 'protractor' });
choices.push({ name: 'Protractor **Deprecated**', value: 'protractor' });
choices.push({ name: 'Cypress', value: 'cypress' });
}
const PROMPT = {
type: 'checkbox',
Expand Down
1 change: 0 additions & 1 deletion generators/client/files-angular.js
Expand Up @@ -39,7 +39,6 @@ const files = {
'tsconfig.app.json',
'tslint.json',
'.eslintrc.json',
'.eslintignore',
'angular.json',
'webpack/utils.js',
'webpack/webpack.common.js',
Expand Down