Skip to content

Commit

Permalink
CI pipeline e2e tests integration
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
claudiahub authored Mar 22, 2022
1 parent 4e6c678 commit 8472a55
Show file tree
Hide file tree
Showing 7 changed files with 240 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,8 @@ ui/.vscode/*
!ui/.vscode/tasks.json
!ui/.vscode/launch.json
!ui/.vscode/extensions.json

# Cypress e2e tests
ui/cypress/videos
ui/cypress/downloads
ui/cypress/screenshots
14 changes: 14 additions & 0 deletions ui/cypress-dc-local.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"integrationFolder": "cypress/integration",
"supportFile": "cypress/support/index.ts",
"videosFolder": "cypress/videos",
"screenshotsFolder": "cypress/screenshots",
"pluginsFile": "cypress/plugins/index.ts",
"fixturesFolder": "cypress/fixtures",
"baseUrl": "http://localhost:9393/dashboard/index.html",
"chromeWebSecurity": false,
"defaultCommandTimeout": 60000,
"pageLoadTimeout": 60000,
"viewportWidth": 1400,
"viewportHeight": 800
}
31 changes: 31 additions & 0 deletions ui/cypress-dc-local.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
version: '3'

services:

rabbitmq-server:
image: rabbitmq:management
ports:
- "5672:5672"
- "15672:15672"

skipper-server:
image: springcloud/spring-cloud-skipper-server:2.9.0-SNAPSHOT
ports:
- "7577:7577"
- "8888:8888"
- "8889:8889"
- "20000-20099:20000-20099"
environment:
- SPRING_CLOUD_SKIPPER_SERVER_PLATFORM_LOCAL_ACCOUNTS_DEFAULT_PORTRANGE_LOW=20000
- SPRING_CLOUD_SKIPPER_SERVER_PLATFORM_LOCAL_ACCOUNTS_DEFAULT_PORTRANGE_HIGH=20100

dataflow-server:
image: springcloud/spring-cloud-dataflow-server:2.10.0-SNAPSHOT
ports:
- "9393:9393"
- "20100-20199:20100-20199"
environment:
- MANAGEMENT_ENDPOINTS_WEB_EXPOSURE_INCLUDE=*
- SPRING_CLOUD_DATAFLOW_FEATURES_SCHEDULES_ENABLED=true
- SPRING_CLOUD_SKIPPER_CLIENT_SERVER_URI=http://skipper-server:7577/api
- SPRING_CLOUD_DATAFLOW_APPLICATIONPROPERTIES_STREAM_SPRING_RABBITMQ_ADDRESSES=rabbitmq-server:5672
4 changes: 3 additions & 1 deletion ui/cypress.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
"pluginsFile": "cypress/plugins/index.ts",
"fixturesFolder": "cypress/fixtures",
"baseUrl": "http://localhost:4200",
"defaultCommandTimeout": 10000,
"chromeWebSecurity": false,
"defaultCommandTimeout": 60000,
"pageLoadTimeout": 60000,
"viewportWidth": 1400,
"viewportHeight": 800
}
2 changes: 1 addition & 1 deletion ui/cypress/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Cypress.Commands.add('shouldShowToast', (title?: string, desc?: string) => {
Cypress.Commands.add('importAppsStream', () => {
cy.get('.nav-content > a[routerlink = "apps"]').click();
cy.get('button#btnAddApplications').click();
cy.get('[value="stream.kafka.docker"] + label').click();
cy.get('[value="stream.rabbitmq.maven"] + label').click();
cy.get('button[type=submit]').click();
cy.shouldShowToast('Import starters', 'Application(s) Imported.');
cy.get('app-apps-list').should('be.exist');
Expand Down
180 changes: 180 additions & 0 deletions ui/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
"start": "ng serve --proxy-config proxy.conf.json",
"build": "ng build",
"test": "ng test",
"ci:start-server": "angular-http-server --path ./dist/index.html -p 4200",
"cy:run": "cypress run --headless --browser chrome",
"cy:run-dc-local": "cypress run --headless --browser chrome --config-file cypress-dc-local.json",
"ci:cy-run": "start-server-and-test ci:start-server http://localhost:4200 cy:run",
"pretty": "pretty-quick",
"test-saucelabs-local": "node ./node_modules/@angular/cli/bin/ng test --karma-config ./src/karma-saucelabs.conf.js",
"test-browserstack-local": "node ./node_modules/@angular/cli/bin/ng test --karma-config ./src/karma-browserstack.conf.js",
Expand Down Expand Up @@ -79,6 +83,7 @@
"@types/node": "12.11.1",
"@typescript-eslint/eslint-plugin": "5.3.0",
"@typescript-eslint/parser": "5.3.0",
"angular-http-server": "^1.10.0",
"browserstack-local": "1.4.5",
"codelyzer": "6.0.1",
"cypress": "^9.5.0",
Expand All @@ -104,6 +109,7 @@
"prettier": "2.3.0",
"pretty-quick": "3.1.0",
"shelljs": "0.8.4",
"start-server-and-test": "^1.14.0",
"ts-node": "8.8.1",
"typescript": "4.4.4",
"webpack-bundle-analyzer": "3.6.1"
Expand Down

0 comments on commit 8472a55

Please sign in to comment.