0.0.10 • Published 2 years ago

sitgent v0.0.10

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
2 years ago

sitgent

An anagram of testing. @playwright/test's assertions in Vitest.

Usage

import { expect } from 'vitest';
import { matchers } from 'sitgent/matchers';
import { chromium } from 'playwright';

expect.extend(matchers);

let browser, page;

beforeAll(async (context) => {
	browser = await chromium.launch();

	return async () => await browser.close();
});

beforeEach(async () => {
    page = await browser.newPage();
});

it('is something', async () => {
    const element = await page.locator('#element');

    expect(element)
        // Playwright assertion
        .toHaveJSProperty();
        // Implemented:
        // .toBeChecked(...);
        // .toBeDisabled(...);
        // .toBeEditable(...);
        // .toBeEmpty(...);
        // .toBeEnabled(...);
        // .toBeHidden(...);
        // .toBeVisible(...);
        // .toContainText(...);
        // .toHaveAttribute(...);
        // .toHaveClass(...);
        // .toHaveCount(...);
        // .toHaveCSS(...);
        // .toHaveId(...);
        // .toHaveJSProperty(...);
        // .toHaveText(...);
        // .toHaveValue(...);
        // .toHaveValues(...);
        // .toHaveTitle(...);
        // .toHaveURL(...);
});

See Playwright assertion documentation for function signatures and options.

0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago