1.41.0 • Published 4 months ago

@sand4rt/experimental-ct-web v1.41.0

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

🎭 Playwright Web component testing

Note The API has been designed to closely resemble Playwright's API wherever applicable. This library is (without guarantee) aimed at facilitating a smooth transition to Playwright once it offers official support for Web components. It is important to take into account that this library will reach end of life when Playwright has official support for Web component testing.

To push for official support, feedback in the form of github issues and or stars is appreciated!

Capabilities

  • Run tests fast, in parallel and optionally over multiple machines with sharding or Azure's Testing Service.
  • Run the test headless or headed accross multiple real desktop and/or mobile browser engines.
  • Full support for shadow DOM, multiple origins, (i)frames, browser tabs and contexts.
  • Minimizes flakyness, due to auto waiting, web first assertions and ensures that every test runs in full isolation.
  • Advanced emulation capabilities such as modifying screen size, geolocation, color scheme and the network.
  • Interactions with the components are indistinguishable from real user behavior.
  • Visual regression / screenshot testing.
  • Zero-configuration TypeScript support.

Along with all these ✨ awesome capabilities ✨ that come with Playwright, you will also get:

Usage

Initialize Playwright Web component testing with PNPM, NPM or Yarn and follow the installation steps:

pnpm create playwright-sand4rt --ct
npm init playwright-sand4rt@latest -- --ct
yarn create playwright-sand4rt --ct

Now you can start creating your tests:

// Button.ts
import { LitElement, html } from 'lit';
import { customElement, property } from 'lit/decorators.js';

@customElement('button-component')
export class Button extends LitElement {
  @property({ type: String })
  title!: string;

  render() {
    return html`<button>${this.title}</button>`;
  }
}
// Button.test.ts
import { test, expect } from '@sand4rt/experimental-ct-web';
import { Button } from './components/Button';

test('render props', async ({ mount }) => {
  const component = await mount(Button, {
    props: {
      title: 'Submit',
    },
  });
  await expect(component).toContainText('Submit');
});

See the official playwright component testing documentation and the tests for lit and native web components for more information on how to use it.

1.41.0

4 months ago

1.36.0

10 months ago

1.37.0

9 months ago

1.36.1

10 months ago

1.38.0

8 months ago

1.37.1

9 months ago

1.36.2

9 months ago

1.39.0

7 months ago

1.38.1

8 months ago

1.36.3

9 months ago

1.40.0

6 months ago

1.40.1

5 months ago

1.35.1

11 months ago

1.34.2

12 months ago

1.34.3

12 months ago

1.34.0

12 months ago

1.33.1

1 year ago

1.35.0

11 months ago

1.33.0

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

0.0.14

1 year ago

0.0.13

1 year ago

0.0.12

1 year ago

0.0.11

1 year ago

0.0.10

1 year ago

0.0.9

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago

1.0.0

1 year ago