Skip to content

Commit 948f132

Browse files
committed
feat: vite compilation
1 parent 105de34 commit 948f132

File tree

9 files changed

+3246
-2729
lines changed

9 files changed

+3246
-2729
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ See the official [playwright component testing documentation](https://playwright
6969
- [x] Update component props/inputs: `component.update({ props: {} })`
7070
- [ ] Update component slots/ng-content: `component.update({ slots: {} })`
7171
- [x] Update component events/outputs: `component.update({ on: {} })`
72-
- [ ] Transpilation, perhaps through [@analogjs/vite-plugin-angular](https://www.npmjs.com/package/@analogjs/vite-plugin-angular), for more info see: https://github.com/microsoft/playwright/issues/14153#issuecomment-1359709214
72+
- [x] Transpilation, perhaps through [@analogjs/vite-plugin-angular](https://www.npmjs.com/package/@analogjs/vite-plugin-angular), for more info see: https://github.com/microsoft/playwright/issues/14153#issuecomment-1359709214
7373
- [x] Testing components with a store and or router
7474
- [x] Override/register dependencies with dependency injection
7575
- [ ] Testing components that are not standalone

ct-angular/package.json

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,24 @@
1010
"test": "npx playwright test"
1111
},
1212
"dependencies": {
13-
"@angular/animations": "^14.2.0",
14-
"@angular/common": "^14.2.0",
15-
"@angular/compiler": "^14.2.0",
16-
"@angular/core": "^14.2.0",
17-
"@angular/forms": "^14.2.0",
18-
"@angular/platform-browser": "^14.2.0",
19-
"@angular/platform-browser-dynamic": "^14.2.0",
20-
"@angular/router": "^14.2.0",
13+
"@angular/animations": "^15.1.0",
14+
"@angular/common": "^15.1.0",
15+
"@angular/compiler": "^15.1.0",
16+
"@angular/core": "^15.1.0",
17+
"@angular/forms": "^15.1.0",
18+
"@angular/platform-browser": "^15.1.0",
19+
"@angular/platform-browser-dynamic": "^15.1.0",
20+
"@angular/router": "^15.1.0",
2121
"rxjs": "~7.5.0",
2222
"tslib": "^2.3.0",
2323
"zone.js": "~0.11.4"
2424
},
2525
"devDependencies": {
26-
"@angular-devkit/build-angular": "^14.2.6",
27-
"@angular/cli": "~14.2.6",
28-
"@angular/compiler-cli": "^14.2.0",
29-
"@playwright/test": "1.32.1",
26+
"@angular-devkit/build-angular": "^15.1.0",
27+
"@angular/cli": "~15.1.0",
28+
"@angular/compiler-cli": "^15.1.0",
29+
"@playwright/test": "1.32.3",
3030
"@sand4rt/experimental-ct-angular": "*",
31-
"typescript": "~4.7.2"
31+
"typescript": "~4.9.0"
3232
}
3333
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<button (click)="submit.emit('hello')">{{title}}</button>

ct-angular/src/components/button.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Component, EventEmitter, Input, Output } from '@angular/core';
33
@Component({
44
standalone: true,
55
selector: 'button-component',
6-
template: `<button (click)="submit.emit('hello')">{{title}}</button>`,
6+
templateUrl: './button.component.html',
77
})
88
export class ButtonComponent {
99
@Input() title!: string;

ct-angular/tsconfig.spec.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
"outDir": "./out-tsc/spec",
66
"types": ["node"]
77
},
8-
"include": ["tests/**/*.spec.ts"]
8+
"include": ["tests/**/*.spec.ts", "src/**/*.ts"]
99
}

playwright-ct-angular/hooks.mjs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@
1414
* limitations under the License.
1515
*/
1616

17-
// TODO: move this import
18-
import '@angular/compiler';
19-
2017
const __pw_hooks_before_mount = [];
2118
const __pw_hooks_after_mount = [];
2219

playwright-ct-angular/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function plugin() {
2525
const { createPlugin } = require('@playwright/test/lib/plugins/vitePlugin');
2626
return createPlugin(
2727
path.join(__dirname, 'registerSource.mjs'),
28-
() => {}
28+
() => import('@analogjs/vite-plugin-angular').then(plugin => plugin.default())
2929
)
3030
};
3131

playwright-ct-angular/package.json

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -40,23 +40,26 @@
4040
}
4141
},
4242
"dependencies": {
43-
"@angular/common": "^15.2.0",
44-
"@angular/compiler": "^15.2.0",
45-
"@angular/core": "^15.2.0",
46-
"@angular/platform-browser": "^15.2.0",
47-
"@angular/platform-browser-dynamic": "^15.2.0",
48-
"@angular/router": "^15.2.0",
43+
"@analogjs/vite-plugin-angular": "0.2.0-beta.1",
44+
"@angular/common": "^16.0.0-rc.1",
45+
"@angular/compiler": "^16.0.0-rc.1",
46+
"@angular/core": "^16.0.0-rc.1",
47+
"@angular/platform-browser": "^16.0.0-rc.1",
48+
"@angular/platform-browser-dynamic": "^16.0.0-rc.1",
49+
"@angular/router": "^16.0.0-rc.1",
4950
"rxjs": "~7.8.0",
5051
"tslib": "^2.5.0",
51-
"vite": "^4.1.4",
52-
"zone.js": "~0.12.0"
52+
"vite": "^4.2.1",
53+
"zone.js": "~0.13.0"
5354
},
5455
"devDependencies": {
55-
"@playwright/test": "1.32.1",
56-
"typescript": "^4.9.5"
56+
"@angular-devkit/build-angular": "^16.0.0-rc.0",
57+
"@playwright/test": "1.32.3",
58+
"typescript": "^5.0.4"
5759
},
5860
"peerDependencies": {
59-
"@playwright/test": ">=1.31.0"
61+
"@playwright/test": ">=1.31.0",
62+
"typescript": ">=4.9.0"
6063
},
6164
"bin": {
6265
"playwright": "./cli.js"

0 commit comments

Comments
 (0)