| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
The API has been designed to closely resemble Playwright's API wherever applicable. This library is (without guarantee) aimed at facilitating a smooth transition once Playwright offers official support for Angular component testing.
Along with all these ✨ awesome capabilities ✨ that come with Playwright, you will also get:
Initialize Playwright Angular component testing with PNPM, NPM or Yarn and follow the installation steps:
pnpm create playwright-sand4rt --ctnpm init playwright-sand4rt@latest -- --ctyarn create playwright-sand4rt --ctNow you can start creating your tests:
// button.component.ts
import { Component, Input } from '@angular/core';
@Component({
standalone: true,
selector: 'button-component',
template: `<button>{{title}}</button>`,
})
export class ButtonComponent {
@Input() title!: string;
}// button.component.test.ts
import { test, expect } from '@sand4rt/experimental-ct-angular';
import { ButtonComponent } from './components/button.component';
test('render props', async ({ mount }) => {
const component = await mount(ButtonComponent, {
props: {
title: 'Submit',
},
});
await expect(component).toContainText('Submit');
});See the official playwright component testing documentation and the tests for more information on how to use it.
| Back | FazBrowse Home | New Git URL |