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

(e2e): catalog versions e2e weekly tests #1889

Merged
merged 1 commit into from
Jan 22, 2025
Merged
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
@@ -105,6 +105,7 @@ jobs:
working-directory: packages/ui-tests
wait-on: 'http://127.0.0.1:4173'
wait-on-timeout: 120
env: grepTags=-weekly
env:
CYPRESS_PROJECT_ID: ${{ secrets.CYPRESS_PROJECT_ID }}
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
@@ -164,6 +165,7 @@ jobs:
working-directory: packages/ui-tests
wait-on: 'http://127.0.0.1:4173'
wait-on-timeout: 120
env: grepTags=-weekly
env:
CYPRESS_PROJECT_ID: ${{ secrets.CYPRESS_PROJECT_ID }}
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
@@ -223,6 +225,7 @@ jobs:
working-directory: packages/ui-tests
wait-on: 'http://127.0.0.1:4173'
wait-on-timeout: 120
env: grepTags=-weekly
env:
CYPRESS_PROJECT_ID: ${{ secrets.CYPRESS_PROJECT_ID }}
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
243 changes: 243 additions & 0 deletions .github/workflows/e2e-weekly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,243 @@
name: 🏗️ E2E Weekly Tests (Cypress)

on:
schedule:
- cron: "0 0 * * 7"

jobs:
install:
runs-on: ubuntu-latest

container:
image: cypress/browsers:node-20.13.1-chrome-125.0.6422.60-1-ff-126.0-edge-125.0.2535.51-1
options: --user 1001

steps:
- name: 👷‍♀️ Checkout
uses: actions/checkout@v4

- uses: actions/cache@v4
with:
path: |
**/node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
cache: 'maven'

# Install dependencies
- run: yarn install --immutable

# Build packages excluding @kaoto/camel-catalog since it was build during installing dependencies
- name: Build packages
run: yarn workspaces foreach --verbose --all --topological-dev --exclude @kaoto/camel-catalog run build

# Build lib
- name: Build @kaoto/kaoto package in lib mode
run: yarn workspace @kaoto/kaoto run build:lib

- name: 💾 Save build folder
uses: actions/upload-artifact@v4
with:
name: ui-dist
if-no-files-found: error
path: packages/ui/dist

- name: 💾 Save catalog build folder
uses: actions/upload-artifact@v4
with:
name: catalog-dist
if-no-files-found: error
path: packages/catalog-generator/dist/camel-catalog

test-on-firefox:
needs: install
runs-on: ubuntu-latest
container:
image: cypress/browsers:node-20.13.1-chrome-125.0.6422.60-1-ff-126.0-edge-125.0.2535.51-1
options: --user 1001

steps:
- name: 👷‍♀️ Checkout
uses: actions/checkout@v4

- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
cache: 'maven'

- name: 🗄️ Download the UI build folder
uses: actions/download-artifact@v4
with:
name: ui-dist
path: packages/ui/dist

- name: 🗄️ Download the catalog build folder
uses: actions/download-artifact@v4
with:
name: catalog-dist
path: packages/camel-catalog/dist

- name: 🔨 Cypress run
uses: cypress-io/[email protected]
with:
browser: firefox
# we have already installed all dependencies above
# install: false
start: yarn workspace @kaoto/kaoto run preview --host
config: baseUrl=http://localhost:4173
working-directory: packages/ui-tests
wait-on: 'http://127.0.0.1:4173'
wait-on-timeout: 120
env: grepTags=weekly
env:
CYPRESS_PROJECT_ID: ${{ secrets.CYPRESS_PROJECT_ID }}
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: 💾 Save videos
if: failure()
uses: actions/upload-artifact@v4
with:
name: videos-firefox
path: packages/ui-tests/cypress/videos

- name: 💾 Save screenshots
if: failure()
uses: actions/upload-artifact@v4
with:
name: screenshots-firefox
path: packages/ui-tests/cypress/screenshots

test-on-chrome:
needs: install
runs-on: ubuntu-latest
container:
image: cypress/browsers:node-20.13.1-chrome-125.0.6422.60-1-ff-126.0-edge-125.0.2535.51-1
options: --user 1001

steps:
- name: 👷‍♀️ Checkout
uses: actions/checkout@v4

- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
cache: 'maven'

- name: 🗄️ Download the UI build folder
uses: actions/download-artifact@v4
with:
name: ui-dist
path: packages/ui/dist

- name: 🗄️ Download the catalog build folder
uses: actions/download-artifact@v4
with:
name: catalog-dist
path: packages/camel-catalog/dist

- name: 🔨 Cypress run
uses: cypress-io/[email protected]
with:
browser: chrome
# we have already installed all dependencies above
# install: false
start: yarn workspace @kaoto/kaoto run preview --host
config: baseUrl=http://localhost:4173
working-directory: packages/ui-tests
wait-on: 'http://127.0.0.1:4173'
wait-on-timeout: 120
env: grepTags=weekly
env:
CYPRESS_PROJECT_ID: ${{ secrets.CYPRESS_PROJECT_ID }}
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: 💾 Save videos
if: failure()
uses: actions/upload-artifact@v4
with:
name: videos-chrome
path: packages/ui-tests/cypress/videos

- name: 💾 Save screenshots
if: failure()
uses: actions/upload-artifact@v4
with:
name: screenshots-chrome
path: packages/ui-tests/cypress/screenshots

test-on-edge:
needs: install
runs-on: ubuntu-latest
container:
image: cypress/browsers:node-20.13.1-chrome-125.0.6422.60-1-ff-126.0-edge-125.0.2535.51-1
options: --user 1001

steps:
- name: 👷‍♀️ Checkout
uses: actions/checkout@v4

- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
cache: 'maven'

- name: 🗄️ Download the UI build folder
uses: actions/download-artifact@v4
with:
name: ui-dist
path: packages/ui/dist

- name: 🗄️ Download the catalog build folder
uses: actions/download-artifact@v4
with:
name: catalog-dist
path: packages/camel-catalog/dist

- name: 🔨 Cypress run
uses: cypress-io/[email protected]
with:
browser: edge
# we have already installed all dependencies above
# install: false
start: yarn workspace @kaoto/kaoto run preview --host
config: baseUrl=http://localhost:4173
working-directory: packages/ui-tests
wait-on: 'http://127.0.0.1:4173'
wait-on-timeout: 120
env: grepTags=weekly
env:
CYPRESS_PROJECT_ID: ${{ secrets.CYPRESS_PROJECT_ID }}
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: 💾 Save videos
if: failure()
uses: actions/upload-artifact@v4
with:
name: videos-edge
path: packages/ui-tests/cypress/videos

- name: 💾 Save screenshots
if: failure()
uses: actions/upload-artifact@v4
with:
name: screenshots-edge
path: packages/ui-tests/cypress/screenshots
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
describe('Test for catalog versions', () => {
beforeEach(() => {
cy.openHomePage();
});

const testData = [
{ type: 'Main', version: 'Camel Main 4.9.0' },
{ type: 'Main', version: 'Camel Main 4.4.0.redhat-00046' },
{ type: 'Main', version: 'Camel Main 4.8.0.redhat-00017' },
{ type: 'Main', version: 'Camel Main 4.4.4' },
{ type: 'Main', version: 'Camel Main 4.8.2' },
{ type: 'Quarkus', version: 'Camel Quarkus 3.17.0' },
{ type: 'Quarkus', version: 'Camel Quarkus 3.15.1' },
{ type: 'Quarkus', version: 'Camel Quarkus 3.8.4' },
{ type: 'Quarkus', version: 'Camel Quarkus 3.15.0.redhat-00007' },
{ type: 'Quarkus', version: 'Camel Quarkus 3.8.0.redhat-00018' },
{ type: 'Spring Boot', version: 'Camel Spring Boot 4.4.0.redhat-00039' },
{ type: 'Spring Boot', version: 'Camel Spring Boot 4.8.0.redhat-00022' },
{ type: 'Spring Boot', version: 'Camel Spring Boot 4.4.4' },
{ type: 'Spring Boot', version: 'Camel Spring Boot 4.8.2' },
{ type: 'Spring Boot', version: 'Camel Spring Boot 4.9.0' },
];
testData.forEach((data) => {
it(`Catalog version test for ${data.version}`, { tags: ['weekly'] }, () => {
cy.uploadFixture('flows/camelRoute/catalogConfig.yaml');
cy.openDesignPage();

cy.hoverOnRuntime(data.type);
cy.get(`[data-testid^="runtime-selector-${data.version}"] button.pf-v5-c-menu__item`)
.first()
.click({ force: true });
cy.get('body').then((body) => {
if (body.find('[testid="loading-schemas"]').length > 0) {
cy.waitSchemasLoading();
}
});

cy.openStepConfigurationTab('timer', 0);
cy.selectFormTab('All');
// Check the configured fields didn't change in the node
cy.checkConfigInputObject('parameters.timerName', 'testTimerName');
cy.checkConfigInputObject('parameters.delay', '2000');
cy.checkConfigInputObject('parameters.period', '2000');
cy.checkConfigInputObject('parameters.repeatCount', '10');

cy.openStepConfigurationTab('setHeader', 0);
cy.selectFormTab('All');
// Check the configured fields didn't change in the node
cy.checkConfigInputObject('expression', 'testExpression');
cy.checkConfigInputObject('id', 'testId');
cy.checkConfigInputObject('name', 'testName');

cy.openStepConfigurationTab('log', 0);
cy.selectFormTab('All');
// Check the configured fields didn't change in the node
cy.checkConfigInputObject('description', 'log');
cy.checkConfigInputObject('logName', 'testLoggerName');
cy.contains('button', 'Processor advanced properties').click();
cy.checkConfigInputObject('marker', 'testMarker');

cy.selectPrependNode('log');
cy.chooseFromCatalog('component', 'amqp');
cy.checkNodeExist('amqp', 1);
});
});
});
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ describe('Tests for switching description and ID in settings page', () => {
});

// Reset nodeLabel to description
after(() => {
afterEach(() => {
cy.openSettings();
cy.selectInTypeaheadField('nodeLabel', 'description');
cy.get('[data-testid="settings-form-save-btn"]').click();
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
- route:
id: route-3933
from:
id: from-3455
uri: timer
parameters:
delay: "2000"
fixedRate: false
period: "2000"
repeatCount: "10"
timerName: testTimerName
steps:
- setHeader:
id: setHeader-2258
expression:
simple:
id: testId
expression: testExpression
name: testName
- log:
id: log-3491
description: log
logName: testLoggerName
marker: testMarker
message: ${body}
3 changes: 3 additions & 0 deletions packages/ui-tests/cypress/support/e2e.ts
Original file line number Diff line number Diff line change
@@ -20,6 +20,9 @@ import './next-commands/nodeConfiguration';
import './next-commands/design';
import './next-commands/metadata';

import registerCypressGrep from '@cypress/grep/src/support';
registerCypressGrep();

Cypress.on('uncaught:exception', (_err, _runnable) => {
// returning false here prevents Cypress from
// failing the test
4 changes: 3 additions & 1 deletion packages/ui-tests/package.json
Original file line number Diff line number Diff line change
@@ -12,7 +12,8 @@
"license": "Apache License v2.0",
"scripts": {
"e2e": "cypress open --config-file=cypress.config.ts",
"e2e:headless": "cypress run",
"e2e:headless": "cypress run --env grepTags=-weekly",
"e2e:headless-weekly": "cypress run --env grepTags=weekly",
"e2e-preview": "cypress open --config-file=cypress.config.ts --config baseUrl=http://localhost:4173/",
"e2e-preview:headless": "cypress run --config baseUrl=http://localhost:4173/",
"lint": "yarn eslint \"cypress/**/*.{ts,tsx}\" \"stories/**/*.{ts,tsx}\"",
@@ -22,6 +23,7 @@
"chromatic": "chromatic --build-script-name 'build:storybook' --exit-zero-on-changes --project-token=chpt_7a4940aa65b14ab"
},
"devDependencies": {
"@cypress/grep": "^4.1.0",
"@eslint/js": "^9.10.0",
"@kaoto/kaoto": "workspace:*",
"@storybook/addon-essentials": "^8.2.8",
64 changes: 62 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
@@ -1965,6 +1965,19 @@ __metadata:
languageName: node
linkType: hard

"@cypress/grep@npm:^4.1.0":
version: 4.1.0
resolution: "@cypress/grep@npm:4.1.0"
dependencies:
debug: "npm:^4.3.4"
find-test-names: "npm:^1.28.18"
globby: "npm:^11.0.4"
peerDependencies:
cypress: ">=10"
checksum: 10/15a40991fb3b1ab5738c171b1dcd42c9eb2bde1e2bcb0ec69a058aff624715b92ec3fc860f66ce811dca0d60c3ec6ff4eab86793aaf3f6bc855042c36c0c8d7b
languageName: node
linkType: hard

"@cypress/request@npm:^3.0.0":
version: 3.0.1
resolution: "@cypress/request@npm:3.0.1"
@@ -2916,6 +2929,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "@kaoto/kaoto-tests@workspace:packages/ui-tests"
dependencies:
"@cypress/grep": "npm:^4.1.0"
"@eslint/js": "npm:^9.10.0"
"@kaoto/kaoto": "workspace:*"
"@storybook/addon-essentials": "npm:^8.2.8"
@@ -7006,6 +7020,15 @@ __metadata:
languageName: node
linkType: hard

"acorn-walk@npm:^8.2.0":
version: 8.3.4
resolution: "acorn-walk@npm:8.3.4"
dependencies:
acorn: "npm:^8.11.0"
checksum: 10/871386764e1451c637bb8ab9f76f4995d408057e9909be6fb5ad68537ae3375d85e6a6f170b98989f44ab3ff6c74ad120bc2779a3d577606e7a0cd2b4efcaf77
languageName: node
linkType: hard

"acorn@npm:^7.4.1":
version: 7.4.1
resolution: "acorn@npm:7.4.1"
@@ -9322,6 +9345,18 @@ __metadata:
languageName: node
linkType: hard

"debug@npm:^4.3.3":
version: 4.4.0
resolution: "debug@npm:4.4.0"
dependencies:
ms: "npm:^2.1.3"
peerDependenciesMeta:
supports-color:
optional: true
checksum: 10/1847944c2e3c2c732514b93d11886575625686056cd765336212dc15de2d2b29612b6cd80e1afba767bb8e1803b778caf9973e98169ef1a24a7a7009e1820367
languageName: node
linkType: hard

"debug@npm:^4.3.6":
version: 4.3.6
resolution: "debug@npm:4.3.6"
@@ -10701,6 +10736,24 @@ __metadata:
languageName: node
linkType: hard

"find-test-names@npm:^1.28.18":
version: 1.29.1
resolution: "find-test-names@npm:1.29.1"
dependencies:
"@babel/parser": "npm:^7.24.7"
"@babel/plugin-syntax-jsx": "npm:^7.24.7"
acorn-walk: "npm:^8.2.0"
debug: "npm:^4.3.3"
globby: "npm:^11.0.4"
simple-bin-help: "npm:^1.8.0"
bin:
find-test-names: bin/find-test-names.js
print-tests: bin/print-tests.js
update-test-count: bin/update-test-count.js
checksum: 10/da5545517d103a99bf37f9f45912880c172a95142e4d7c979dc521f167b33c57d7095aa1bd7fea03c6c7afb0ec05592752889ea5a4e5bc40a73ef794160e88e6
languageName: node
linkType: hard

"find-up@npm:^3.0.0":
version: 3.0.0
resolution: "find-up@npm:3.0.0"
@@ -11343,7 +11396,7 @@ __metadata:
languageName: node
linkType: hard

"globby@npm:^11.1.0":
"globby@npm:^11.0.4, globby@npm:^11.1.0":
version: 11.1.0
resolution: "globby@npm:11.1.0"
dependencies:
@@ -14225,7 +14278,7 @@ __metadata:
languageName: node
linkType: hard

"ms@npm:2.1.3, ms@npm:^2.1.1":
"ms@npm:2.1.3, ms@npm:^2.1.1, ms@npm:^2.1.3":
version: 2.1.3
resolution: "ms@npm:2.1.3"
checksum: 10/aa92de608021b242401676e35cfa5aa42dd70cbdc082b916da7fb925c542173e36bce97ea3e804923fe92c0ad991434e4a38327e15a1b5b5f945d66df615ae6d
@@ -16867,6 +16920,13 @@ __metadata:
languageName: node
linkType: hard

"simple-bin-help@npm:^1.8.0":
version: 1.8.0
resolution: "simple-bin-help@npm:1.8.0"
checksum: 10/2333be11a8863f9ea7c5fbd9824824bcc56bfd91e436ea4364bd117600e9a2971ecdbaf1782924b53d3c16f393200e85ddbdf075a454375f80572481cd0aecd3
languageName: node
linkType: hard

"simple-git@npm:^3.22.0":
version: 3.25.0
resolution: "simple-git@npm:3.25.0"