Skip to content

Commit 713d67a

Browse files
authored
add e2e test for wrappers (#29746)
1 parent 9187e62 commit 713d67a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+7183
-531
lines changed
Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
name: Wrappers E2E Tests
2+
3+
concurrency:
4+
group: wf-${{github.event.pull_request.number || github.sha}}-${{github.workflow}}
5+
cancel-in-progress: true
6+
7+
on:
8+
pull_request:
9+
paths-ignore:
10+
- 'apps/**/*.md'
11+
push:
12+
branches: [24_2, 25_*, 26_*]
13+
workflow_dispatch:
14+
15+
env:
16+
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_TOKEN }}
17+
NX_SKIP_NX_CACHE: ${{ (github.event_name != 'pull_request' || contains( github.event.pull_request.labels.*.name, 'skip-cache')) && 'true' || 'false' }}
18+
BUILD_TEST_INTERNAL_PACKAGE: true
19+
20+
jobs:
21+
build-packages:
22+
runs-on: devextreme-shr2
23+
name: Build DevExtreme and Wrappers
24+
timeout-minutes: 40
25+
26+
steps:
27+
- name: Get sources
28+
uses: actions/checkout@v4
29+
30+
- name: Use Node.js
31+
uses: actions/setup-node@v4
32+
with:
33+
node-version: '20'
34+
35+
- uses: pnpm/action-setup@v3
36+
with:
37+
version: 9
38+
run_install: false
39+
40+
- name: Get pnpm store directory
41+
shell: bash
42+
run: |
43+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
44+
45+
- uses: actions/cache@v4
46+
name: Setup pnpm cache
47+
with:
48+
path: |
49+
${{ env.STORE_PATH }}
50+
.nx/cache
51+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
52+
restore-keys: |
53+
${{ runner.os }}-pnpm-store
54+
55+
- name: Install dependencies
56+
run: pnpm install
57+
58+
- name: Build all DevExtreme packages
59+
env:
60+
BUILD_TEST_INTERNAL_PACKAGE: true
61+
run: pnpm run all:build-dev
62+
63+
- name: Build wrappers apps
64+
working-directory: e2e/wrappers
65+
run: |
66+
pnpm run build:all
67+
mkdir -p builds-artifacts
68+
7z a -tzip -mx3 -mmt2 builds-artifacts/react19-build.zip ./builders/react19/dist/*
69+
7z a -tzip -mx3 -mmt2 builds-artifacts/vue3-build.zip ./builders/vue3/dist/*
70+
7z a -tzip -mx3 -mmt2 builds-artifacts/angular19-build.zip ./builders/angular19/dist/*
71+
72+
- name: Upload wrappers builds
73+
uses: actions/upload-artifact@v4
74+
with:
75+
name: wrappers-builds
76+
path: e2e/wrappers/builds-artifacts
77+
retention-days: 1
78+
79+
test-wrappers:
80+
needs: build-packages
81+
runs-on: devextreme-shr2
82+
name: Test ${{ matrix.framework }}
83+
timeout-minutes: 30
84+
strategy:
85+
fail-fast: false
86+
matrix:
87+
framework: [react19, vue3, angular19]
88+
89+
steps:
90+
- name: Get sources
91+
uses: actions/checkout@v4
92+
93+
- name: Download wrappers builds
94+
uses: actions/download-artifact@v4
95+
with:
96+
name: wrappers-builds
97+
path: ./wrappers-builds
98+
99+
- name: Unpack wrapper build for ${{ matrix.framework }}
100+
run: |
101+
7z x wrappers-builds/${{ matrix.framework }}-build.zip -o./e2e/wrappers/builders/${{ matrix.framework }}/dist
102+
103+
- name: Setup Chrome
104+
uses: ./.github/actions/setup-chrome
105+
with:
106+
chrome-version: '133.0.6943.53'
107+
108+
- name: Use Node.js
109+
uses: actions/setup-node@v4
110+
with:
111+
node-version: '20'
112+
113+
- uses: pnpm/action-setup@v3
114+
with:
115+
version: 9
116+
run_install: false
117+
118+
- name: Get pnpm store directory
119+
shell: bash
120+
run: |
121+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
122+
123+
- uses: actions/cache@v4
124+
name: Setup pnpm cache
125+
with:
126+
path: |
127+
${{ env.STORE_PATH }}
128+
.nx/cache
129+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
130+
restore-keys: |
131+
${{ runner.os }}-pnpm-store
132+
133+
- name: Install dependencies
134+
run: pnpm install
135+
136+
- name: Start server for ${{ matrix.framework }}
137+
working-directory: e2e/wrappers
138+
run: |
139+
pnpm run start:${{ matrix.framework }} &
140+
sleep 10
141+
142+
- name: Run tests for ${{ matrix.framework }}
143+
working-directory: e2e/wrappers
144+
run: pnpm run test:${{ matrix.framework }}
145+
146+
- name: Upload test artifacts on failure
147+
if: ${{ failure() }}
148+
uses: actions/upload-artifact@v4
149+
with:
150+
name: test-fails-${{matrix.framework}}
151+
path: e2e/wrappers/screenshots
152+
if-no-files-found: ignore
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Editor configuration, see https://editorconfig.org
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
indent_style = space
7+
indent_size = 2
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.ts]
12+
quote_type = single
13+
ij_typescript_use_double_quotes = false
14+
15+
[*.md]
16+
max_line_length = off
17+
trim_trailing_whitespace = false
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# See https://docs.github.com/get-started/getting-started-with-git/ignoring-files for more about ignoring files.
2+
3+
# Compiled output
4+
/dist
5+
/tmp
6+
/out-tsc
7+
/bazel-out
8+
9+
# Node
10+
/node_modules
11+
npm-debug.log
12+
yarn-error.log
13+
14+
# IDEs and editors
15+
.idea/
16+
.project
17+
.classpath
18+
.c9/
19+
*.launch
20+
.settings/
21+
*.sublime-workspace
22+
23+
# Visual Studio Code
24+
.vscode/*
25+
!.vscode/settings.json
26+
!.vscode/tasks.json
27+
!.vscode/launch.json
28+
!.vscode/extensions.json
29+
.history/*
30+
31+
# Miscellaneous
32+
/.angular/cache
33+
.sass-cache/
34+
/connect.lock
35+
/coverage
36+
/libpeerconnection.log
37+
testem.log
38+
/typings
39+
40+
# System files
41+
.DS_Store
42+
Thumbs.db
43+
44+
#linked files
45+
src/external
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
{
2+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3+
"version": 1,
4+
"newProjectRoot": "projects",
5+
"projects": {
6+
"angular": {
7+
"projectType": "application",
8+
"schematics": {
9+
"@schematics/angular:component": {
10+
"style": "scss"
11+
}
12+
},
13+
"root": "",
14+
"sourceRoot": "src",
15+
"prefix": "app",
16+
"architect": {
17+
"build": {
18+
"builder": "@angular-devkit/build-angular:application",
19+
"options": {
20+
"styles": [
21+
"devextreme/dist/css/dx.light.css"
22+
],
23+
"preserveSymlinks": true,
24+
"outputPath": "dist/angular",
25+
"index": "src/index.html",
26+
"browser": "src/main.ts",
27+
"polyfills": [
28+
"zone.js"
29+
],
30+
"tsConfig": "tsconfig.app.json",
31+
"inlineStyleLanguage": "scss",
32+
"assets": [
33+
{
34+
"glob": "**/*",
35+
"input": "public",
36+
"output": "/"
37+
}
38+
],
39+
"scripts": []
40+
},
41+
"configurations": {
42+
"production": {
43+
"budgets": [
44+
{
45+
"type": "initial",
46+
"maximumWarning": "500kB",
47+
"maximumError": "1MB"
48+
},
49+
{
50+
"type": "anyComponentStyle",
51+
"maximumWarning": "4kB",
52+
"maximumError": "8kB"
53+
}
54+
],
55+
"outputHashing": "all"
56+
},
57+
"development": {
58+
"optimization": false,
59+
"extractLicenses": false,
60+
"sourceMap": true
61+
}
62+
},
63+
"defaultConfiguration": "production"
64+
},
65+
"serve": {
66+
"builder": "@angular-devkit/build-angular:dev-server",
67+
"configurations": {
68+
"production": {
69+
"buildTarget": "angular:build:production"
70+
},
71+
"development": {
72+
"buildTarget": "angular:build:development"
73+
}
74+
},
75+
"defaultConfiguration": "development"
76+
},
77+
"extract-i18n": {
78+
"builder": "@angular-devkit/build-angular:extract-i18n"
79+
},
80+
"test": {
81+
"builder": "@angular-devkit/build-angular:karma",
82+
"options": {
83+
"polyfills": [
84+
"zone.js",
85+
"zone.js/testing"
86+
],
87+
"tsConfig": "tsconfig.spec.json",
88+
"inlineStyleLanguage": "scss",
89+
"assets": [
90+
{
91+
"glob": "**/*",
92+
"input": "public",
93+
"output": "/"
94+
}
95+
],
96+
"scripts": []
97+
}
98+
}
99+
}
100+
}
101+
},
102+
"cli": {
103+
"analytics": "ec33dedc-8ed4-4ef7-9f6a-5e698d99daa4"
104+
}
105+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
const fs = require('fs');
2+
const path = require('path');
3+
4+
const linkPath = path.resolve(__dirname, '../src/external');
5+
const targetPath = path.resolve(__dirname, '../../../examples');
6+
7+
try {
8+
if(fs.existsSync(linkPath)) {
9+
const stat = fs.lstatSync(linkPath);
10+
if(!stat.isSymbolicLink()) {
11+
console.error('❌ "src/external" exists, but it is not a symlink. Please remove it manually.');
12+
process.exit(1);
13+
}
14+
} else {
15+
fs.symlinkSync(targetPath, linkPath, 'junction');
16+
console.log('✅ Symlink for angular created: src/external → ../../../examples');
17+
}
18+
} catch(err) {
19+
console.error('❌ Error creating symlink:', err.message);
20+
process.exit(1);
21+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { Component } from '@angular/core';
2+
import { RouterOutlet } from '@angular/router';
3+
4+
@Component({
5+
selector: 'app-root',
6+
standalone: true,
7+
imports: [RouterOutlet],
8+
template: '<router-outlet></router-outlet>',
9+
})
10+
export class AppComponent {}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { ApplicationConfig, provideZoneChangeDetection } from '@angular/core';
2+
import { provideRouter } from '@angular/router';
3+
import { provideClientHydration } from '@angular/platform-browser';
4+
5+
import { routes } from './app.routes';
6+
7+
export const appConfig: ApplicationConfig = {
8+
providers: [
9+
provideZoneChangeDetection({ eventCoalescing: true }),
10+
provideRouter(routes),
11+
provideClientHydration(),
12+
],
13+
};
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { NgModule } from '@angular/core';
2+
import { BrowserModule } from '@angular/platform-browser';
3+
import { RouterModule } from '@angular/router';
4+
5+
@NgModule({
6+
declarations: [],
7+
imports: [
8+
BrowserModule,
9+
RouterModule,
10+
],
11+
providers: [],
12+
bootstrap: [],
13+
})
14+
export class AppModule { }
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { Routes } from '@angular/router';
2+
import { ComponentViewComponent } from './component-view.component';
3+
4+
export const routes: Routes = [
5+
{
6+
path: 'examples/:examplePath',
7+
component: ComponentViewComponent,
8+
},
9+
];

0 commit comments

Comments
 (0)