Releases: testing-library/playwright-testing-library
Releases · testing-library/playwright-testing-library
v4.5.0
v4.4.2
v4.4.1
v4.4.0
4.4.0 (2022-09-18)
Bug Fixes
- fixture: throw correct error when
find*
query times out on visibility (ee5115b)
Features
- fixture: add
locatorFixtures
that provideLocator
-based queries (9ca0808) - fixture: add
screen
fixture that combinesPage
andQueries
(ac9e452) - fixture: add support for
find*
queries in locator fixture (1b888cf) - fixture: expose unofficial
queriesFor
helper (c9f081e) - fixture: support
Page
inwithin
fixture (returnsScreen
) (9a40ba8) - support configure API with locator fixture via
test.use
(ed66c3f)
v4.4.0-beta.6
4.4.0-beta.6 (2022-09-14)
Features
v4.4.0-beta.5
4.4.0-beta.5 (2022-09-08)
Bug Fixes
- fixture: throw correct error when
find*
query times out on visibility (348344b)
v4.4.0-beta.4
4.4.0-beta.4 (2022-09-07)
Reverts
- Revert "build(deps-dev): bump generate-export-aliases from 1.1.0 to 1.2.0" (72255c6)
v4.4.0-beta.3
4.4.0-beta.3 (2022-09-06)
Features
v4.4.0-beta.2
4.4.0-beta.2 (2022-08-26)
Features
- support configure API with locator fixture via
test.use
(d92153e)
Global
// playwright.config.ts
import type { PlaywrightTestConfig } from '@playwright/test';
const config: PlaywrightTestConfig = {
use: {
testIdAttribute: 'data-custom-test-id',
asyncUtilsTimeout: 5000,
},
};
export default config;
Local
import { test as baseTest } from '@playwright/test'
import {
locatorFixtures as fixtures,
LocatorFixtures as TestingLibraryFixtures,
within
} from '@playwright-testing-library/test/fixture';
const test = baseTest.extend<TestingLibraryFixtures>(fixtures);
const {expect} = test;
// Entire test suite
test.use({ testIdAttribute: 'data-custom-test-id' });
test.describe(() => {
// Specific block
test.use({
testIdAttribute: 'some-other-test-id',
asyncUtilsTimeout: 5000,
});
test('my form', async ({queries: {getByTestId}}) => {
// ...
});
});
v4.4.0-beta.1
4.4.0-beta.1 (2022-08-25)
Features
- fixture: add
locatorFixtures
that provideLocator
-based queries (3fc61e1)
This will likely replace the fixtures that provided ElementHandle
-based
queries in a future major release, but for now the Locator
queries are
exported as locatorFixtures
:
import { test as baseTest } from '@playwright/test'
import {
locatorFixtures as fixtures,
LocatorFixtures as TestingLibraryFixtures,
within
} from '@playwright-testing-library/test/fixture';
const test = baseTest.extend<TestingLibraryFixtures>(fixtures);
const {expect} = test;
test('my form', async ({queries: {getByTestId}}) => {
// Queries now return `Locator`
const formLocator = getByTestId('my-form');
// Locator-based `within` support
const {getByLabelText} = within(formLocator);
const emailInputLocator = getByLabelText('Email');
// Interact via `Locator` API 🥳
await emailInputLocator.fill('[email protected]');
// Assert via `Locator` APIs 🎉
await expect(emailInputLocator).toHaveValue('[email protected]');
})