-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
test(angular): Add Angular 20.0.0-rc.2
e2e test
#16364
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
Open
Lms24
wants to merge
6
commits into
develop
Choose a base branch
from
lms/test-e2e-angular-20
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
22edc86
test(angular): Add Angular `20.0.0-rc.2` e2e test
Lms24 c5184df
bump repo node version from 20.18.2 to 20.19.0
Lms24 66c3370
remove node version bump, try bypass node version check
Lms24 2e82058
special-case angular-20 node version
Lms24 7f9c829
remove disable version check
Lms24 09ccfcd
yml syntax error
Lms24 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
dev-packages/e2e-tests/test-applications/angular-20/.editorconfig
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Editor configuration, see https://editorconfig.org | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
indent_style = space | ||
indent_size = 2 | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
[*.ts] | ||
quote_type = single | ||
ij_typescript_use_double_quotes = false | ||
|
||
[*.md] | ||
max_line_length = off | ||
trim_trailing_whitespace = false |
44 changes: 44 additions & 0 deletions
44
dev-packages/e2e-tests/test-applications/angular-20/.gitignore
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# See https://docs.github.com/get-started/getting-started-with-git/ignoring-files for more about ignoring files. | ||
|
||
# Compiled output | ||
/dist | ||
/tmp | ||
/out-tsc | ||
/bazel-out | ||
|
||
# Node | ||
/node_modules | ||
npm-debug.log | ||
yarn-error.log | ||
|
||
# IDEs and editors | ||
.idea/ | ||
.project | ||
.classpath | ||
.c9/ | ||
*.launch | ||
.settings/ | ||
*.sublime-workspace | ||
|
||
# Visual Studio Code | ||
.vscode/* | ||
!.vscode/settings.json | ||
!.vscode/tasks.json | ||
!.vscode/launch.json | ||
!.vscode/extensions.json | ||
.history/* | ||
|
||
# Miscellaneous | ||
/.angular/cache | ||
.sass-cache/ | ||
/connect.lock | ||
/coverage | ||
/libpeerconnection.log | ||
testem.log | ||
/typings | ||
|
||
# System files | ||
.DS_Store | ||
Thumbs.db | ||
|
||
test-results |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
@sentry:registry=http://127.0.0.1:4873 | ||
@sentry-internal:registry=http://127.0.0.1:4873 |
3 changes: 3 additions & 0 deletions
3
dev-packages/e2e-tests/test-applications/angular-20/README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Angular 20 | ||
|
||
E2E test app for Angular 20 and `@sentry/angular`. |
87 changes: 87 additions & 0 deletions
87
dev-packages/e2e-tests/test-applications/angular-20/angular.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
{ | ||
"$schema": "./node_modules/@angular/cli/lib/config/schema.json", | ||
"version": 1, | ||
"newProjectRoot": "projects", | ||
"projects": { | ||
"angular-20": { | ||
"projectType": "application", | ||
"schematics": {}, | ||
"root": "", | ||
"sourceRoot": "src", | ||
"prefix": "app", | ||
"architect": { | ||
"build": { | ||
"builder": "@angular-devkit/build-angular:application", | ||
"options": { | ||
"outputPath": "dist/angular-20", | ||
"index": "src/index.html", | ||
"browser": "src/main.ts", | ||
"polyfills": ["zone.js"], | ||
"tsConfig": "tsconfig.app.json", | ||
"assets": [ | ||
{ | ||
"glob": "**/*", | ||
"input": "public" | ||
} | ||
], | ||
"styles": ["src/styles.css"], | ||
"scripts": [] | ||
}, | ||
"configurations": { | ||
"production": { | ||
"budgets": [ | ||
{ | ||
"type": "initial", | ||
"maximumWarning": "500kB", | ||
"maximumError": "1MB" | ||
}, | ||
{ | ||
"type": "anyComponentStyle", | ||
"maximumWarning": "4kB", | ||
"maximumError": "8kB" | ||
} | ||
], | ||
"outputHashing": "all" | ||
}, | ||
"development": { | ||
"optimization": false, | ||
"extractLicenses": false, | ||
"sourceMap": true | ||
} | ||
}, | ||
"defaultConfiguration": "production" | ||
}, | ||
"serve": { | ||
"builder": "@angular-devkit/build-angular:dev-server", | ||
"configurations": { | ||
"production": { | ||
"buildTarget": "angular-20:build:production" | ||
}, | ||
"development": { | ||
"buildTarget": "angular-20:build:development" | ||
} | ||
}, | ||
"defaultConfiguration": "development" | ||
}, | ||
"extract-i18n": { | ||
"builder": "@angular-devkit/build-angular:extract-i18n" | ||
}, | ||
"test": { | ||
"builder": "@angular-devkit/build-angular:karma", | ||
"options": { | ||
"polyfills": ["zone.js", "zone.js/testing"], | ||
"tsConfig": "tsconfig.spec.json", | ||
"assets": [ | ||
{ | ||
"glob": "**/*", | ||
"input": "public" | ||
} | ||
], | ||
"styles": ["src/styles.css"], | ||
"scripts": [] | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
50 changes: 50 additions & 0 deletions
50
dev-packages/e2e-tests/test-applications/angular-20/package.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
{ | ||
"name": "angular-20", | ||
"version": "0.0.0", | ||
"scripts": { | ||
"ng": "ng", | ||
"dev": "ng serve", | ||
"proxy": "node start-event-proxy.mjs", | ||
"preview": "http-server dist/angular-20/browser --port 8080", | ||
"build": "ng build", | ||
"watch": "ng build --watch --configuration development", | ||
"test": "playwright test", | ||
"test:build": "pnpm install && pnpm build", | ||
"test:assert": "playwright test", | ||
"clean": "npx rimraf .angular node_modules pnpm-lock.yaml dist" | ||
}, | ||
"private": true, | ||
"dependencies": { | ||
"@angular/animations": "^20.0.0-rc.2", | ||
"@angular/common": "^20.0.0-rc.2", | ||
"@angular/compiler": "^20.0.0-rc.2", | ||
"@angular/core": "^20.0.0-rc.2", | ||
"@angular/forms": "^20.0.0-rc.2", | ||
"@angular/platform-browser": "^20.0.0-rc.2", | ||
"@angular/platform-browser-dynamic": "^20.0.0-rc.2", | ||
"@angular/router": "^20.0.0-rc.2", | ||
"@sentry/angular": "* || latest", | ||
"rxjs": "~7.8.0", | ||
"tslib": "^2.3.0", | ||
"zone.js": "~0.15.0" | ||
}, | ||
"devDependencies": { | ||
"@angular-devkit/build-angular": "^20.0.0-rc.2", | ||
"@angular/cli": "^20.0.0-rc.2", | ||
"@angular/compiler-cli": "^20.0.0-rc.2", | ||
"@playwright/test": "~1.50.0", | ||
"@sentry-internal/test-utils": "link:../../../test-utils", | ||
"@types/jasmine": "~5.1.0", | ||
"http-server": "^14.1.1", | ||
"jasmine-core": "~5.4.0", | ||
"karma": "~6.4.0", | ||
"karma-chrome-launcher": "~3.2.0", | ||
"karma-coverage": "~2.2.0", | ||
"karma-jasmine": "~5.1.0", | ||
"karma-jasmine-html-reporter": "~2.1.0", | ||
"typescript": "~5.8.3" | ||
}, | ||
"volta": { | ||
"extends": "../../package.json" | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
dev-packages/e2e-tests/test-applications/angular-20/playwright.config.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { getPlaywrightConfig } from '@sentry-internal/test-utils'; | ||
|
||
const config = getPlaywrightConfig({ | ||
startCommand: `pnpm preview`, | ||
port: 8080, | ||
}); | ||
|
||
export default config; |
Binary file added
BIN
+14.7 KB
dev-packages/e2e-tests/test-applications/angular-20/public/favicon.ico
Binary file not shown.
12 changes: 12 additions & 0 deletions
12
dev-packages/e2e-tests/test-applications/angular-20/src/app/app.component.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { Component } from '@angular/core'; | ||
import { RouterOutlet } from '@angular/router'; | ||
|
||
@Component({ | ||
selector: 'app-root', | ||
standalone: true, | ||
imports: [RouterOutlet], | ||
template: `<router-outlet></router-outlet>`, | ||
}) | ||
export class AppComponent { | ||
title = 'angular-20'; | ||
} |
29 changes: 29 additions & 0 deletions
29
dev-packages/e2e-tests/test-applications/angular-20/src/app/app.config.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { | ||
ApplicationConfig, | ||
ErrorHandler, | ||
inject, | ||
provideAppInitializer, | ||
provideZoneChangeDetection, | ||
} from '@angular/core'; | ||
import { Router, provideRouter } from '@angular/router'; | ||
|
||
import { TraceService, createErrorHandler } from '@sentry/angular'; | ||
import { routes } from './app.routes'; | ||
|
||
export const appConfig: ApplicationConfig = { | ||
providers: [ | ||
provideZoneChangeDetection({ eventCoalescing: true }), | ||
provideRouter(routes), | ||
{ | ||
provide: ErrorHandler, | ||
useValue: createErrorHandler(), | ||
}, | ||
{ | ||
provide: TraceService, | ||
deps: [Router], | ||
}, | ||
provideAppInitializer(() => { | ||
inject(TraceService); | ||
}), | ||
], | ||
}; |
42 changes: 42 additions & 0 deletions
42
dev-packages/e2e-tests/test-applications/angular-20/src/app/app.routes.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { Routes } from '@angular/router'; | ||
import { cancelGuard } from './cancel-guard.guard'; | ||
import { CancelComponent } from './cancel/cancel.components'; | ||
import { ComponentTrackingComponent } from './component-tracking/component-tracking.components'; | ||
import { HomeComponent } from './home/home.component'; | ||
import { UserComponent } from './user/user.component'; | ||
|
||
export const routes: Routes = [ | ||
{ | ||
path: 'users/:id', | ||
component: UserComponent, | ||
}, | ||
{ | ||
path: 'home', | ||
component: HomeComponent, | ||
}, | ||
{ | ||
path: 'cancel', | ||
component: CancelComponent, | ||
canActivate: [cancelGuard], | ||
}, | ||
{ | ||
path: 'component-tracking', | ||
component: ComponentTrackingComponent, | ||
}, | ||
{ | ||
path: 'redirect1', | ||
redirectTo: '/redirect2', | ||
}, | ||
{ | ||
path: 'redirect2', | ||
redirectTo: '/redirect3', | ||
}, | ||
{ | ||
path: 'redirect3', | ||
redirectTo: '/users/456', | ||
}, | ||
{ | ||
path: '**', | ||
redirectTo: 'home', | ||
}, | ||
]; |
5 changes: 5 additions & 0 deletions
5
dev-packages/e2e-tests/test-applications/angular-20/src/app/cancel-guard.guard.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { ActivatedRouteSnapshot, CanActivateFn, RouterStateSnapshot } from '@angular/router'; | ||
|
||
export const cancelGuard: CanActivateFn = (_next: ActivatedRouteSnapshot, _state: RouterStateSnapshot) => { | ||
return false; | ||
}; |
8 changes: 8 additions & 0 deletions
8
dev-packages/e2e-tests/test-applications/angular-20/src/app/cancel/cancel.components.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { Component } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'app-cancel', | ||
standalone: true, | ||
template: `<div></div>`, | ||
}) | ||
export class CancelComponent {} |
21 changes: 21 additions & 0 deletions
21
.../test-applications/angular-20/src/app/component-tracking/component-tracking.components.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { AfterViewInit, Component, OnInit } from '@angular/core'; | ||
import { TraceClass, TraceMethod, TraceModule } from '@sentry/angular'; | ||
import { SampleComponent } from '../sample-component/sample-component.components'; | ||
|
||
@Component({ | ||
selector: 'app-component-tracking', | ||
standalone: true, | ||
imports: [TraceModule, SampleComponent], | ||
template: ` | ||
<app-sample-component trace="sample-component"></app-sample-component> | ||
<app-sample-component trace></app-sample-component> | ||
`, | ||
}) | ||
@TraceClass({ name: 'ComponentTrackingComponent' }) | ||
export class ComponentTrackingComponent implements OnInit, AfterViewInit { | ||
@TraceMethod({ name: 'ngOnInit' }) | ||
ngOnInit() {} | ||
|
||
@TraceMethod() | ||
ngAfterViewInit() {} | ||
} |
26 changes: 26 additions & 0 deletions
26
dev-packages/e2e-tests/test-applications/angular-20/src/app/home/home.component.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { Component } from '@angular/core'; | ||
import { RouterLink } from '@angular/router'; | ||
|
||
@Component({ | ||
selector: 'app-home', | ||
standalone: true, | ||
imports: [RouterLink], | ||
template: ` | ||
<main> | ||
<h1>Welcome to Sentry's Angular 20 E2E test app</h1> | ||
<ul> | ||
<li><a id="navLink" [routerLink]="['/users', '123']">Visit User 123</a></li> | ||
<li><a id="redirectLink" [routerLink]="['/redirect1']">Redirect</a></li> | ||
<li><a id="cancelLink" [routerLink]="['/cancel']">Cancel</a></li> | ||
<li><a id="nonExistentLink" [routerLink]="['/non-existent']">Error</a></li> | ||
<li><a id="componentTracking" [routerLink]="['/component-tracking']">Component Tracking</a></li> | ||
</ul> | ||
<button id="errorBtn" (click)="throwError()">Throw error</button> | ||
</main> | ||
`, | ||
}) | ||
export class HomeComponent { | ||
throwError() { | ||
throw new Error('Error thrown from Angular 20 E2E test app'); | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
...ests/test-applications/angular-20/src/app/sample-component/sample-component.components.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'app-sample-component', | ||
standalone: true, | ||
template: `<div>Component</div>`, | ||
}) | ||
export class SampleComponent implements OnInit { | ||
ngOnInit() { | ||
console.log('SampleComponent'); | ||
} | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wdyt about generally adding canary tests here with
"@angular/<package>": "next"
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we could! Let me take a look how easy this would be. My only concern is that sometimes, it's not just the package versions that need updating but also the app config/module files. But I guess we'd probably see this in the canary tests. Will open a separate PR for canary tests though, as I wanna convert this application to 20 stable when it's released.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can use the same format we use for other tests to run this for actual canary, the "normal" tests should not use canary as that may fail and we do not want to block on this!