Skip to content

Commit ddb62dd

Browse files
authored
Merge branch 'main' into feature/kubectl-command-helper-dialogs
2 parents bce63fe + 0061a64 commit ddb62dd

File tree

7 files changed

+413
-319
lines changed

7 files changed

+413
-319
lines changed

.github/workflows/build.yaml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
name: Build
1+
name: Build and Test
22

33
on:
44
workflow_call:
55

66
jobs:
7-
build:
7+
build-and-test:
88
runs-on: ubuntu-latest
99
permissions:
1010
contents: read
@@ -16,9 +16,24 @@ jobs:
1616
uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0
1717
with:
1818
node-version: 22
19+
cache: 'npm' # Added caching for faster installs
1920

2021
- name: Install dependencies
2122
run: npm ci
2223

2324
- name: Build
2425
run: npm run build
26+
27+
- name: Run Cypress Tests
28+
run: npm run test
29+
30+
- name: Upload Cypress Screenshots
31+
if: always() # Run this step even if tests fail
32+
uses: actions/upload-artifact@v4
33+
with:
34+
name: cypress-screenshots
35+
path: |
36+
cypress/screenshots/
37+
retention-days: 7 # Keep artifacts for 7 days
38+
if-no-files-found: warn # Warn instead of fail if no screenshots found
39+

cypress/support/component.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ import { ThemeProvider } from '@ui5/webcomponents-react';
2020
import { mount } from 'cypress/react';
2121
// Import commands.js using ES2015 syntax:
2222
import './commands';
23-
import { FrontendConfigProvider, Landscape } from "../../src/context/FrontendConfigContext";
23+
import { FrontendConfigContext } from '../../src/context/FrontendConfigContext';
24+
import { mockedFrontendConfig } from '../../src/utils/testing';
2425

2526
// Augment the Cypress namespace to include type definitions for
2627
// your custom command.
@@ -36,12 +37,11 @@ declare global {
3637
}
3738

3839

39-
4040
Cypress.Commands.add('mount', (component, options) => {
41-
return mount(<ThemeProvider><FrontendConfigProvider config={{
42-
"backendUrl": "http://localhost:3000",
43-
"landscape": "DEV" as Landscape,
44-
"documentationBaseUrl": "http://localhost:3000"
45-
}}>{component} </FrontendConfigProvider></ThemeProvider>, options);
41+
return mount(<ThemeProvider>
42+
<FrontendConfigContext value={mockedFrontendConfig}>
43+
{component}
44+
</FrontendConfigContext>
45+
</ThemeProvider>, options);
4646
});
4747

0 commit comments

Comments
 (0)