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

Feature/protractor issue101 #188

Merged
43 commits merged into from
Dec 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
e0abcbd
enable protractor
Nov 16, 2020
329b1c3
try resolve error compilation protractor
Nov 16, 2020
c447cf4
update release notes and shelljs version for warnings
Nov 16, 2020
0e2a630
adding client e2e tests in pipeline
Nov 16, 2020
149b508
run for e2e client test
Nov 17, 2020
8d74a88
update protractor version 5.4.3
Nov 17, 2020
c0be481
customize protractor
Nov 17, 2020
9368cc3
try update angular protractor for run on pipeline
Nov 17, 2020
081d6ac
added new package-lock
Nov 17, 2020
aaf7431
update gitignore
Nov 17, 2020
29ebf0a
update protractor files
Nov 17, 2020
352ef64
fix some tests admin e2e client
Nov 24, 2020
eb43334
fix i18n title client page
Nov 24, 2020
d2b825c
try upgrade google-chrome
Nov 24, 2020
81f9b0f
implement change password
Nov 25, 2020
cd11058
adding routing angular in nestjs
Nov 25, 2020
88051d1
enable admin botton
Nov 25, 2020
93b5635
added docker compose keycloak task
Nov 25, 2020
5d0ad50
modify pipeline for run keycloak
Nov 25, 2020
b3129b4
change node version in 10.23.0
Nov 25, 2020
fb361e3
enable user management admin button for client angular-react
Nov 26, 2020
b284ba4
added user registration api
Nov 26, 2020
8ea2a3b
test change password
Nov 26, 2020
08b2b85
update common README
Nov 26, 2020
c6152fd
modify pipeline test integration
Nov 28, 2020
d35eb16
review pipeline
Nov 28, 2020
b6d8acb
change bash command scritps
Nov 28, 2020
d4b80a9
added e2e client templates
Nov 28, 2020
071ce23
replace last e2e entity templates
Nov 28, 2020
97a73eb
comment generator in test
Nov 28, 2020
1fb09ab
fix folder generator entities--amend
Nov 28, 2020
bb592cf
fix folder generator entities--amend
Nov 28, 2020
1fad0d4
modified entities react e2e
Nov 28, 2020
acb71f6
wait angular admin account client e2e
Nov 28, 2020
82fa3f9
try fix e2e
Nov 30, 2020
0d30cc9
modified seed db
Nov 30, 2020
319a64d
delete unused client template
Nov 30, 2020
bcf4697
add more test integration
Nov 30, 2020
2ccf0db
modify model
Nov 30, 2020
515387e
remove entity client
Nov 30, 2020
245d6c3
Update generators/server/templates/server/src/service/auth.service.ts…
Nov 30, 2020
d88ecc4
try fix auth react error
Nov 30, 2020
754517e
update roadmap
Dec 1, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/generator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ jobs:
name: npm test
runs-on: ${{ matrix.os }}
if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')"
timeout-minutes: 20
timeout-minutes: 40
strategy:
fail-fast: false
matrix:
node_version: [12.16.2]
node_version: [12.16.1]
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v1
Expand Down
100 changes: 76 additions & 24 deletions .github/workflows/test-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,55 +5,107 @@ jobs:
name: ${{ matrix.app-type }}
runs-on: ${{ matrix.os }}
if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')"
timeout-minutes: 20
timeout-minutes: 40
strategy:
fail-fast: false
matrix:
node_version: [12.16.2]
node_version: [12.16.1]
os: [ubuntu-latest]
app-type:
- monolith-react-oauth2-dev
- monolith-angular-jwt-i18n-dev
- monolith-react-jwt-jdl
- monolith-react-jwt-i18n-jdl
- monolith-react-oauth2-jdl
- monolith-react-oauth2-i18n-jdl
- monolith-angular-jwt-jdl
- monolith-angular-jwt-i18n-jdl
- monolith-angular-oauth2-jdl
- monolith-angular-oauth2-i18n-jdl
- monolith-angular-jwt-i18n-dev
- monolith-react-oauth2-dev
- microservice-oauth2-jdl
include:
- app-type: monolith-react-oauth2-dev
arg: 'no'
- app-type: monolith-angular-jwt-i18n-dev
arg: 'no'
- app-type: monolith-react-jwt-jdl
arg: import-jdl
app-folder: monolith-client-auth-template-jdl
entity: import-jdl
e2e: jwt
- app-type: monolith-react-jwt-i18n-jdl
app-folder: monolith-client-auth-i18n-template-jdl
entity: import-jdl
e2e: jwt
- app-type: monolith-react-oauth2-jdl
app-folder: monolith-client-auth-template-jdl
entity: import-jdl
e2e: 'oauth2'
- app-type: monolith-react-oauth2-i18n-jdl
arg: import-jdl
app-folder: monolith-client-auth-i18n-template-jdl
entity: import-jdl
e2e: oauth2
- app-type: monolith-angular-jwt-jdl
app-folder: monolith-client-auth-template-jdl
entity: import-jdl
e2e: jwt
- app-type: monolith-angular-jwt-i18n-jdl
app-folder: monolith-client-auth-i18n-template-jdl
entity: import-jdl
e2e: jwt
- app-type: monolith-angular-oauth2-jdl
app-folder: monolith-client-auth-template-jdl
entity: import-jdl
e2e: oauth2
- app-type: monolith-angular-oauth2-i18n-jdl
app-folder: monolith-client-auth-i18n-template-jdl
entity: import-jdl
e2e: oauth2
- app-type: monolith-angular-jwt-i18n-dev
app-folder: monolith-angular-jwt-i18n-dev
entity: 'no'
e2e: jwt
- app-type: monolith-react-oauth2-dev
app-folder: monolith-react-oauth2-dev
entity: 'no'
e2e: oauth2
- app-type: microservice-oauth2-jdl
arg: post-import-jdl
app-folder: microservice-oauth2-jdl
entity: post-import-jdl
e2e: 'no'
env:
JHI_APP: ${{ matrix.app-type }}
JHI_ARG: ${{ matrix.arg }}
NHI_APP: ${{ matrix.app-type }}
NHI_APP_FOLDER: ${{ matrix.app-folder }}
NHI_ENTITY: ${{ matrix.entity }}
NHI_E2E: ${{ matrix.e2e }}

steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: git history
- name: GIT HISTORY
run: git --no-pager log -n 10 --graph --pretty='%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue) <%an>%Creset' --abbrev-commit
- name: DOWNLOAD LATEST CHROME binary
run: |
sudo apt update
sudo apt install google-chrome-stable
- name: PREPARE jhipster env
run: sudo sh test-integration/00-install-all-jhipster.sh
- name: 'CONFIGURE EVENTUAL TEMPLATE APP'
if: contains(env.NHI_APP_FOLDER, 'template')
run: sudo bash test-integration/0x-configure-template.sh $NHI_APP_FOLDER $NHI_APP
- name: 'GENERATE NHipster app'
run: sudo sh test-integration/01-generate-app-sample.sh $JHI_APP $JHI_ARG
run: sudo sh test-integration/01-generate-app-sample.sh $NHI_APP_FOLDER $NHI_ENTITY
- name: 'INSTALL DEPENDENCIES of generated app'
run: sudo sh test-integration/02-install-dependencies-app-sample.sh $JHI_APP
run: sudo sh test-integration/02-install-dependencies-app-sample.sh $NHI_APP_FOLDER
- name: 'GENERATE bar SERVER SERVICE'
run: sudo sh test-integration/03-generate-component-sample.sh $JHI_APP service bar
run: sudo sh test-integration/03-generate-component-sample.sh $NHI_APP_FOLDER service bar
- name: 'GENERATE foo SERVER CONTROLLER'
run: sudo sh test-integration/03-generate-component-sample.sh $JHI_APP controller foo
run: sudo sh test-integration/03-generate-component-sample.sh $NHI_APP_FOLDER controller foo
- name: 'RUN UNIT TESTS of generated app'
run: sudo sh test-integration/04-run-generated-unit-tests-of-sample.sh $JHI_APP
- name: 'RUN E2E TESTS of generated app'
run: sudo sh test-integration/05-run-generated-e2e-tests-of-sample.sh $JHI_APP
run: sudo sh test-integration/04-run-generated-unit-tests-of-sample.sh $NHI_APP_FOLDER
- name: 'RUN SERVER E2E TESTS of generated app'
run: sudo sh test-integration/05-run-generated-e2e-tests-of-sample.sh $NHI_APP_FOLDER
- name: 'BUILD AND RUN SERVER APP'
run: sudo sh test-integration/06-run-generated-app-sample.sh $JHI_APP build
- name: 'START APP'
run: sudo sh test-integration/06-run-generated-app-sample.sh $JHI_APP run
run: sudo sh test-integration/07-run-generated-app-sample.sh $NHI_APP_FOLDER build
- name: 'RUN DOCKER KEYCLOAK for CLIENT E2E oauth2 TESTS'
if: "env.NHI_E2E == 'oauth2'"
run: sudo sh test-integration/06-docker-compose.sh $NHI_APP_FOLDER
- name: 'START APP WITH EVENTUAL CLIENT E2E TESTS'
run: sudo sh test-integration/07-run-generated-app-sample.sh $NHI_APP_FOLDER $NHI_E2E
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@

# [1.4.0](https://github.com/jhipster/generator-jhipster-nodejs/tree/v1.4.0)

- Protractor or another tool for client e2e tests [issue #101](https://github.com/jhipster/generator-jhipster-nodejs/issues/101)
- Support the account management with user registration, delete, creation and changes password with settings [issue #166](https://github.com/jhipster/generator-jhipster-nodejs/issues/166)
- NestJS migration from 6 to 7 version [issue #183](https://github.com/jhipster/generator-jhipster-nodejs/issues/183)

# [1.3.0](https://github.com/jhipster/generator-jhipster-nodejs/tree/v1.3.0) - 02/11/2020 released date
Expand Down
5 changes: 4 additions & 1 deletion ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ To contribute for the next featues, fork the repo and open a pull request regard
- Swagger support
- Entity ORM generation for prod database (sql) and dev database (default db is sqlite already configured)
- Basic security management with jwt and oauth2
- Jest e2e tests for server and jhipster e2e client tests
- All subgenerators

> Let it free to give advices or tips!
Expand Down Expand Up @@ -47,6 +48,8 @@ To contribute for the next featues, fork the repo and open a pull request regard
- [x] OAuth2 feature for Keycloack
- [x] Encrypt user password in db
- [x] Languages subgenerator support i18n: translate home page for NHipster and remove spring boot resources message
- [x] Jhipster client e2e protractor tests integrated
- [x] Other core/admin jhipster management api

## To DO for next release

Expand All @@ -57,4 +60,4 @@ To contribute for the next featues, fork the repo and open a pull request regard
- [ ] pagination options in client
- [ ] Elastic Search support
- [ ] Search api
- [ ] Other core/admin jhipster management api and services with sending email
- [ ] Admin services sending email (for new user and change password api)
9 changes: 7 additions & 2 deletions generators/app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,13 @@ module.exports = class extends AppGenerator {
validateJava() {},

customSettings() {
this.testFrameworks = [];
this.protractorTests = false;
if (!this.skipClient) {
this.testFrameworks = ['protractor'];
this.protractorTests = true;
} else {
this.testFrameworks = [];
this.protractorTests = false;
}
if (this.options['skip-i18n']) {
this.enableTranslation = false;
this.skipI18n = true;
Expand Down
28 changes: 27 additions & 1 deletion generators/client/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,44 @@ const clientFiles = {
file: 'react/shared/layout/header/header.tsx',
method: 'processJsx',
renameTo: () => `${REACT_DIR}shared/layout/header/header.tsx`
},
{
file: 'react/shared/layout/menus/admin.tsx',
method: 'processJsx',
renameTo: () => `${REACT_DIR}shared/layout/menus/admin.tsx`
}
]
}
],
testMain: [
testE2EWithMain: [
{
condition: generator => generator.clientFramework === 'react',
templates: [
{
file: 'react/shared/layout/header/header.spec.tsx',
method: 'processJsx',
renameTo: () => `${TEST_DIR}spec/app/shared/layout/header/header.spec.tsx`
},
{
file: 'react/test/protractor.conf.js',
renameTo: () => `${TEST_DIR}protractor.conf.js`
},
{
file: 'react/test/e2e/administration.spec.ts',
renameTo: () => `${TEST_DIR}e2e/modules/administration/administration.spec.ts`
}
]
},
{
condition: generator => generator.clientFramework === 'angularX',
templates: [
{
file: 'angular/test/protractor.conf.js',
renameTo: () => `${TEST_DIR}protractor.conf.js`
},
{
file: 'angular/test/e2e/administration.spec.ts',
renameTo: () => `${TEST_DIR}e2e/admin/administration.spec.ts`
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<span class="hipster img-fluid rounded"></span>
</div>
<div class="col-md-9">
<h1 class="display-4" jhiTranslate="home.title">Welcome, Node Hipster Official Blueprint!</h1>
<h1 class="display-4" jhiTranslate="home.title">Welcome, Java Hipster!</h1>
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this make sense? There's no Java in a Node.js-generated project, is there?

Copy link
Author

@ghost ghost Nov 30, 2020

Choose a reason for hiding this comment

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

The reason that I changed it, is that we use the e2e client jhipster tests (I have not overrided the templates of jhipster e2e tests, only for the administration because I have removed the admin java features not supported, such as the logs, metrics), that have assertions for the home title. However, if it is selected the i18n, the home title is replaced with the node hipster customization:

"title": "Welcome, Node Hipster Official Blueprint!",

In the other words, the account test generated is that of jhipster client generator (not overrided from the blueprint): https://github.com/jhipster/generator-jhipster/blob/8f0db2da608b9a76b961c148b4cf6d1ed594c530/generators/client/templates/angular/src/test/javascript/e2e/account/account.spec.ts.ejs#L48

<p class="lead" jhiTranslate="home.subtitle">This is your homepage</p>

<div [ngSwitch]="isAuthenticated()">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,33 @@
<!-- jhipster-needle-add-entity-to-menu - JHipster will add entities to the menu here -->
</ul>
</li>
<li *<%= jhiPrefix %>HasAnyAuthority="'ROLE_ADMIN'" ngbDropdown class="nav-item dropdown pointer" display="dynamic" routerLinkActive="active" [routerLinkActiveOptions]="{ exact: true }">
<a class="nav-link dropdown-toggle" ngbDropdownToggle href="javascript:void(0);" id="admin-menu">
<span>
<fa-icon icon="user-plus"></fa-icon>
<span jhiTranslate="global.menu.admin.main">Administration</span>
</span>
</a>
<ul class="dropdown-menu" ngbDropdownMenu aria-labelledby="admin-menu">
<%_ if (applicationType === 'gateway' && serviceDiscoveryType) { _%>
<li>
<a class="dropdown-item" routerLink="admin/gateway" routerLinkActive="active" (click)="collapseNavbar()">
<fa-icon icon="road" fixedWidth="true"></fa-icon>
<span jhiTranslate="global.menu.admin.gateway">Gateway</span>
</a>
</li>
<%_ } _%>
<%_ if (!skipUserManagement) { _%>
<li>
<a class="dropdown-item" routerLink="admin/user-management" routerLinkActive="active" (click)="collapseNavbar()">
<fa-icon icon="user" fixedWidth="true"></fa-icon>
<span jhiTranslate="global.menu.admin.userManagement">User management</span>
</a>
</li>
<%_ } _%>
<!-- jhipster-needle-add-element-to-admin-menu - JHipster will add entities to the admin menu here -->
</ul>
</li>
<%_ if (enableTranslation) { _%>
<li ngbDropdown class="nav-item dropdown pointer" display="dynamic" *ngIf="languages && languages.length > 1">
<a class="nav-link dropdown-toggle" ngbDropdownToggle href="javascript:void(0);" id="languagesnavBarDropdown">
Expand Down
4 changes: 2 additions & 2 deletions generators/client/templates/angular/package.json.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
"postcss-loader": "3.0.0",
"prettier": "1.19.1",
<%_ if (protractorTests) { _%>
"protractor": "5.4.2",
"protractor": "5.4.3",
<%_ } _%>
"reflect-metadata": "0.1.13",
"rimraf": "3.0.0",
Expand Down Expand Up @@ -178,7 +178,7 @@
"postinstall": "node node_modules/protractor/bin/webdriver-manager update --gecko false",
<%_ } _%>
<%_ if (!skipServer) { _%>
"postInstall": "cd server && npm run lint:fix",
"preinstall": "cd server && npm run lint:fix",
<%_ } _%>
"start": "<%= clientPackageManager %> run webpack:dev",
<%_ if (skipServer) { _%>
Expand Down
Loading