Skip to content

Fix e2e #7664

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

Merged
merged 22 commits into from
Mar 28, 2023
Merged

Fix e2e #7664

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
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
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ jobs:
fail-on-severity: critical
e2e:
name: End-to-end tests
if: ${{ false }}
runs-on: ubuntu-latest
env:
NG_CLI_ANALYTICS: ci
Expand Down
4 changes: 4 additions & 0 deletions modules/web/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,7 @@ dist/
!.yarn/releases
!.yarn/sdks
!.yarn/versions

# Cypress

cypress/screenshots
30 changes: 30 additions & 0 deletions modules/web/cypress.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// Copyright 2017 The Kubernetes Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

const { defineConfig } = require('cypress');

module.exports = defineConfig({
"e2e": {
"baseUrl": "http://localhost:8080",
"supportFile": "./cypress/support/index.ts",
"video": false,
"chromeWebSecurity": false,
"screenshotOnRunFailure": true,
"videoCompression": false,
"pageLoadTimeout": 10000,
"viewportHeight": 1080,
"viewportWidth": 1920,
"testIsolation": false,
},
});
11 changes: 0 additions & 11 deletions modules/web/cypress.json

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*
*/
import {NavbarPage} from '../../pages/navbarPage';
import {NavbarPage} from '../pages/navbarPage';

describe('Navbar', () => {
before(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*
*/
import {UserpanelPage} from '../../pages/userpanelPage';
import {UserpanelPage} from '../pages/userpanelPage';

describe('Userpanel', () => {
before(() => {
Expand Down
4 changes: 4 additions & 0 deletions modules/web/cypress/support/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,7 @@
before(() => {
cy.clearCookies();
});

afterEach(() => {
cy.screenshot();
});
18 changes: 9 additions & 9 deletions modules/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
"check:ts": "gts lint",
"test": "npx jest -c jest.config.js",
"coverage": "npx jest -c jest.config.js --coverage",
"cypress": "wait-on -v http-get://localhost:9000/api/v1/node http://localhost:8000/config http://localhost:8080 && npx cypress run",
"cypress": "wait-on -v -i 10000 http-get://127.0.0.1:9000/api/v1/node http://127.0.0.1:8000/config http://127.0.0.1:8080 && npx cypress run",
"e2e": "concurrently -kill-others --success first \"yarn start\" \"yarn cypress\"",
"e2e:headed": "concurrently -kill-others --success first \"yarn start:e2e\" \"wait-on http://localhost:8080 && npx cypress run --headed\"",
"e2e:headed": "concurrently -kill-others --success first \"yarn start:e2e\" \"wait-on -i 10000 http://127.0.0.1:8080 && npx cypress run --headed\"",
"analyze": "ng build --stats-json && webpack-bundle-analyzer dist/stats.json"
},
"lint-staged": {
Expand Down Expand Up @@ -88,10 +88,10 @@
"@angular/cli": "15.1.5",
"@angular/compiler-cli": "15.1.4",
"@angular/language-service": "15.1.4",
"@babel/core": "7.19.1",
"@babel/preset-env": "7.19.1",
"@babel/register": "7.18.9",
"@cypress/webpack-preprocessor": "5.12.2",
"@babel/core": "7.21.3",
"@babel/preset-env": "7.20.2",
"@babel/register": "7.21.0",
"@cypress/webpack-preprocessor": "5.17.0",
"@types/d3": "7.4.0",
"@types/d3-scale": "4.0.2",
"@types/file-saver": "2.0.5",
Expand All @@ -105,7 +105,7 @@
"@typescript-eslint/parser": "5.38.0",
"codelyzer": "6.0.2",
"concurrently": "7.6.0",
"cypress": "9.7.0",
"cypress": "12.8.1",
"cypress-fail-fast": "5.0.1",
"del": "6.1.1",
"eslint": "8.33.0",
Expand Down Expand Up @@ -145,8 +145,8 @@
"ts-node": "10.9.1",
"typescript": "4.9.5",
"wait-on": "6.0.1",
"webpack-bundle-analyzer": "4.7.0",
"webpack-dev-server": "4.11.1"
"webpack-bundle-analyzer": "4.8.0",
"webpack-dev-server": "4.13.1"
},
"overrides": {
"colors": "1.4.0"
Expand Down
6 changes: 3 additions & 3 deletions modules/web/proxy-https.conf.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"/api": {
"target": "https://localhost:9001",
"target": "https://127.0.0.1:9001",
"secure": false,
"ws": true,
"changeOrigin": true
},
"/config": {
"target": "https://localhost:8001",
"target": "https://127.0.0.1:8001",
"secure": false,
"ws": true,
"changeOrigin": true
},
"/systembanner": {
"target": "https://localhost:8001",
"target": "https://127.0.0.1:8001",
"secure": false,
"ws": true,
"changeOrigin": true
Expand Down
6 changes: 3 additions & 3 deletions modules/web/proxy.conf.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"/api": {
"target": "http://localhost:9000",
"target": "http://127.0.0.1:9000",
"secure": false
},
"/config": {
"target": "http://localhost:8000",
"target": "http://127.0.0.1:8000",
"secure": false
},
"/systembanner": {
"target": "http://localhost:8000",
"target": "http://127.0.0.1:8000",
"secure": false
}
}
4 changes: 2 additions & 2 deletions modules/web/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
]
},
"outDir": ".tmp/out-tsc",
"moduleResolution": "Node",
"target": "ES2022",
"moduleResolution": "node",
"target": "ES2021",
"module": "ES2020",
"sourceMap": true,
"emitDecoratorMetadata": true,
Expand Down
Loading