Skip to content

Releases: testing-library/playwright-testing-library

v4.5.0

28 Sep 08:32
Compare
Choose a tag to compare

4.5.0 (2022-09-28)

Features

  • fixture: support chaining locator queries with locator.within() (81e6bc3)

👷🏻‍♀️ Note: for some reason @playwright-testing-library/test didn't release properly at first here — I manually published it, so it should be good to go now.

v4.4.2

24 Sep 05:38
Compare
Choose a tag to compare

4.4.2 (2022-09-24)

Bug Fixes

  • fixture: improve error message for invalid function TextMatch (aa54dd4)

v4.4.1

22 Sep 23:18
Compare
Choose a tag to compare

4.4.1 (2022-09-22)

Bug Fixes

  • fixture: support function TextMatch argument in queries (4ecf17d)

v4.4.0

18 Sep 11:55
Compare
Choose a tag to compare

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 provide Locator-based queries (9ca0808)
  • fixture: add screen fixture that combines Page and Queries (ac9e452)
  • fixture: add support for find* queries in locator fixture (1b888cf)
  • fixture: expose unofficial queriesFor helper (c9f081e)
  • fixture: support Page in within fixture (returns Screen) (9a40ba8)
  • support configure API with locator fixture via test.use (ed66c3f)

v4.4.0-beta.6

18 Sep 07:43
29f4673
Compare
Choose a tag to compare
v4.4.0-beta.6 Pre-release
Pre-release

4.4.0-beta.6 (2022-09-14)

Features

  • fixture: add screen fixture that combines Page and Queries (cb353fa)
  • fixture: support Page in within fixture (returns Screen) (77960b2)

v4.4.0-beta.5

18 Sep 07:42
7b9819c
Compare
Choose a tag to compare
v4.4.0-beta.5 Pre-release
Pre-release

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

18 Sep 07:42
cd25797
Compare
Choose a tag to compare
v4.4.0-beta.4 Pre-release
Pre-release

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

18 Sep 07:42
cd25797
Compare
Choose a tag to compare
v4.4.0-beta.3 Pre-release
Pre-release

4.4.0-beta.3 (2022-09-06)

Features

  • fixture: add support for find* queries in locator fixture (c34812b)
  • fixture: expose unofficial queriesFor helper (cff36b5)

v4.4.0-beta.2

18 Sep 07:42
59e1646
Compare
Choose a tag to compare
v4.4.0-beta.2 Pre-release
Pre-release

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

18 Sep 07:41
38b01b7
Compare
Choose a tag to compare
v4.4.0-beta.1 Pre-release
Pre-release

4.4.0-beta.1 (2022-08-25)

Features

  • fixture: add locatorFixtures that provide Locator-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]');
})