Skip to content

Commit 8472a55

Browse files
authored
CI pipeline e2e tests integration
* Added cypress setup to serve tests and run in headless mode * Fixed configuratio flags * Added rules to skip videos and screenshots * Added rule to skip tests downloads * Fixed /dist url and build integrated before serving * Update maven on tasks commands * Add docker container config
1 parent 4e6c678 commit 8472a55

File tree

7 files changed

+240
-2
lines changed

7 files changed

+240
-2
lines changed

.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,8 @@ ui/.vscode/*
5252
!ui/.vscode/tasks.json
5353
!ui/.vscode/launch.json
5454
!ui/.vscode/extensions.json
55+
56+
# Cypress e2e tests
57+
ui/cypress/videos
58+
ui/cypress/downloads
59+
ui/cypress/screenshots

ui/cypress-dc-local.json

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"integrationFolder": "cypress/integration",
3+
"supportFile": "cypress/support/index.ts",
4+
"videosFolder": "cypress/videos",
5+
"screenshotsFolder": "cypress/screenshots",
6+
"pluginsFile": "cypress/plugins/index.ts",
7+
"fixturesFolder": "cypress/fixtures",
8+
"baseUrl": "http://localhost:9393/dashboard/index.html",
9+
"chromeWebSecurity": false,
10+
"defaultCommandTimeout": 60000,
11+
"pageLoadTimeout": 60000,
12+
"viewportWidth": 1400,
13+
"viewportHeight": 800
14+
}

ui/cypress-dc-local.yml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
version: '3'
2+
3+
services:
4+
5+
rabbitmq-server:
6+
image: rabbitmq:management
7+
ports:
8+
- "5672:5672"
9+
- "15672:15672"
10+
11+
skipper-server:
12+
image: springcloud/spring-cloud-skipper-server:2.9.0-SNAPSHOT
13+
ports:
14+
- "7577:7577"
15+
- "8888:8888"
16+
- "8889:8889"
17+
- "20000-20099:20000-20099"
18+
environment:
19+
- SPRING_CLOUD_SKIPPER_SERVER_PLATFORM_LOCAL_ACCOUNTS_DEFAULT_PORTRANGE_LOW=20000
20+
- SPRING_CLOUD_SKIPPER_SERVER_PLATFORM_LOCAL_ACCOUNTS_DEFAULT_PORTRANGE_HIGH=20100
21+
22+
dataflow-server:
23+
image: springcloud/spring-cloud-dataflow-server:2.10.0-SNAPSHOT
24+
ports:
25+
- "9393:9393"
26+
- "20100-20199:20100-20199"
27+
environment:
28+
- MANAGEMENT_ENDPOINTS_WEB_EXPOSURE_INCLUDE=*
29+
- SPRING_CLOUD_DATAFLOW_FEATURES_SCHEDULES_ENABLED=true
30+
- SPRING_CLOUD_SKIPPER_CLIENT_SERVER_URI=http://skipper-server:7577/api
31+
- SPRING_CLOUD_DATAFLOW_APPLICATIONPROPERTIES_STREAM_SPRING_RABBITMQ_ADDRESSES=rabbitmq-server:5672

ui/cypress.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
"pluginsFile": "cypress/plugins/index.ts",
77
"fixturesFolder": "cypress/fixtures",
88
"baseUrl": "http://localhost:4200",
9-
"defaultCommandTimeout": 10000,
9+
"chromeWebSecurity": false,
10+
"defaultCommandTimeout": 60000,
11+
"pageLoadTimeout": 60000,
1012
"viewportWidth": 1400,
1113
"viewportHeight": 800
1214
}

ui/cypress/support/commands.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Cypress.Commands.add('shouldShowToast', (title?: string, desc?: string) => {
3535
Cypress.Commands.add('importAppsStream', () => {
3636
cy.get('.nav-content > a[routerlink = "apps"]').click();
3737
cy.get('button#btnAddApplications').click();
38-
cy.get('[value="stream.kafka.docker"] + label').click();
38+
cy.get('[value="stream.rabbitmq.maven"] + label').click();
3939
cy.get('button[type=submit]').click();
4040
cy.shouldShowToast('Import starters', 'Application(s) Imported.');
4141
cy.get('app-apps-list').should('be.exist');

ui/package-lock.json

+180
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ui/package.json

+6
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
"start": "ng serve --proxy-config proxy.conf.json",
88
"build": "ng build",
99
"test": "ng test",
10+
"ci:start-server": "angular-http-server --path ./dist/index.html -p 4200",
11+
"cy:run": "cypress run --headless --browser chrome",
12+
"cy:run-dc-local": "cypress run --headless --browser chrome --config-file cypress-dc-local.json",
13+
"ci:cy-run": "start-server-and-test ci:start-server http://localhost:4200 cy:run",
1014
"pretty": "pretty-quick",
1115
"test-saucelabs-local": "node ./node_modules/@angular/cli/bin/ng test --karma-config ./src/karma-saucelabs.conf.js",
1216
"test-browserstack-local": "node ./node_modules/@angular/cli/bin/ng test --karma-config ./src/karma-browserstack.conf.js",
@@ -79,6 +83,7 @@
7983
"@types/node": "12.11.1",
8084
"@typescript-eslint/eslint-plugin": "5.3.0",
8185
"@typescript-eslint/parser": "5.3.0",
86+
"angular-http-server": "^1.10.0",
8287
"browserstack-local": "1.4.5",
8388
"codelyzer": "6.0.1",
8489
"cypress": "^9.5.0",
@@ -104,6 +109,7 @@
104109
"prettier": "2.3.0",
105110
"pretty-quick": "3.1.0",
106111
"shelljs": "0.8.4",
112+
"start-server-and-test": "^1.14.0",
107113
"ts-node": "8.8.1",
108114
"typescript": "4.4.4",
109115
"webpack-bundle-analyzer": "3.6.1"

0 commit comments

Comments
 (0)