Skip to content

Latest commit

 

History

History
378 lines (261 loc) · 16.4 KB

CHANGELOG.md

File metadata and controls

378 lines (261 loc) · 16.4 KB

Changelog

0.16.0

Minor Changes

  • #58 2962b6e Thanks @SebastianSedzik! - Add @retries decorator

    Set the maximum number of retry attempts given to failed @tests in the @suite

    import { suite, test, retries } from "playwright-decorators";
    
    @retries(3) // <-- Decorate suite with @retries()
    @suite()
    class MyTestSuite {
      @test()
      async test() {
        // <- This test may be retried up to 3 times if it fails
        // ...
      }
    }

0.15.0

Minor Changes

  • #56 3a44870 Thanks @SebastianSedzik! - Add support for fixtures

    This release introduce a new method extend<T>(customFixture) that allows to create decorators (afterAll, afterEach, test, beforeAll, beforeEach) with access to custom fixtures.

    import { test as base } from 'playwright';
    import { suite, test, extend } from 'playwright-decorators';
    
    // #1 Create fixture type
    type UserFixture = {
    
          firstName: string;
          lastName: string;
        }
    }
    
    // #2 Create user fixture
    const withUser = base.extend<UserFixture>({
     ({}, use) => {
            await use({
                firstName: 'John',
                lastName: 'Doe'
            })
        }
    })
    
    // #3 Generate afterAll, afterEach, test, beforeAll, beforeEach decorators with access to the user fixture
    const {
        afterAll,
        afterEach,
        test,
        beforeAll,
        beforeEach,
    } = extend<UserFixture>(withUser);
    
    // #4 Use decorators
    @suite()
    class MyTestSuite {
        @beforeAll()
        async beforeAll({ user }: TestArgs<UserFixture>) { // have access to user fixture
            // ...
        }
    
        @test()
        async test({ user }: TestArgs<UserFixture>) { // have access to user fixture
            // ...
        }
    }

0.14.3

Patch Changes

  • #51 a83fc39 Thanks @SebastianSedzik! - @test and @suite decorators do no longer keep logic related to fail, only, skip, slow. Code was moved to dedicated decorators.

0.14.2

Patch Changes

0.14.1

Patch Changes

  • #44 e8997d2 Thanks @SebastianSedzik! - Redact error messages thrown by custom decorators: createSuiteDecorator, createTestDecorator, createSuiteAndTestDecorator

0.14.0

Minor Changes

  • #40 a50e25b Thanks @SebastianSedzik! - Add @debug decorator

    Runs a @test(s) or @suite(s) in debug mode. Tests or suites without the @debug decorator will not be excluded. Learn more about debug mode: https://playwright.dev/docs/debug

    import { suite, test, debug, TestArgs } from "playwright-decorators";
    
    // Debug selected test suite(s)
    @debug() // <-- Decorate suite with @debug()
    @suite()
    class DebugTestSuite {}
    
    // Or debug selected test(s)
    @suite()
    class TestSuite {
      @debug() // <-- Decorate test with @debug()
      @test()
      async test({ page }: TestArgs) {
        // ...
      }
    }
  • #42 a2e7892 Thanks @SebastianSedzik! - Add @preview decorator

    Runs a @test(s) or @suite(s) in preview (headed browser) mode, simulating user interaction (slowing down each operation by 1000ms). Tests or suites without the @preview decorator will not be excluded.

    import { suite, test, preview, TestArgs } from "playwright-decorators";
    
    // Preview selected test suite(s)
    @preview() // <-- Decorate suite with @preview()
    @suite()
    class PreviewTestSuite {}
    
    // Or preview selected test(s)
    @suite()
    class TestSuite {
      @preview() // <-- Decorate test with @preview()
      @test()
      async test({ page }: TestArgs) {
        // ...
      }
    }

Patch Changes

0.13.0

Minor Changes

  • #38 dbea0b6 Thanks @SebastianSedzik! - Added support for creating custom test and suite decorator

    import { createSuiteAndTestDecorator } from "playwright-decorators";
    import playwright from "@playwright/test";
    
    const mySuiteAndTestDecorator = createSuiteAndTestDecorator(
      "mySuiteAndTestDecorator",
      ({ suite }) => {
        suite.initialized(() => {
          /** run custom code when suite is initialized **/
        });
      },
      ({ test }) => {
        test.beforeTest(() => {
          /** run custom code before test execution **/
        });
        test.afterTest(() => {
          /** run custom code after test execution **/
        });
    
        playwright.beforeEach(() => {
          /** run custom code before each test execution **/
        });
      },
    );

Patch Changes

  • #38 dbea0b6 Thanks @SebastianSedzik! - Export TestInfo type

    import { suite, test, TestArgs, TestInfo } from "@playwright/test";
    
    @suite()
    class TestSuite {
      @test()
      myTest({ page }: TestArgs, testInfo: TestInfo) {
        // ...
      }
    }

0.12.0

Minor Changes

  • #35 8ba55c6 Thanks @SebastianSedzik! - Enhanced TypeScript support:

    • constrained the @suite decorator to class contexts only.
    • constrained the @test decorator to class method context only. Type check of test method arguments.
    • exported the TestArgs type to provide validity within test methods.
    import { suite, test, TestArgs } from "playwright-decorators";
    
    @suite()
    class ExampleSuite {
      @test()
      async exampleTest({ page }: TestArgs) {
        // <- TestArgs ensures correct types of arguments
        // ...
      }
    }

Patch Changes

  • #29 7398cc2 Thanks @SebastianSedzik! - Fixes of @skip and @annotate decorators:

    • Pass reason from @skip decorator to the reporter.
    • Added support for annotations on skipped tests.

0.11.2

Patch Changes

  • 95c69a7: Use changeset to release process. Make test release

All notable changes to this project will be documented in this file. Dates are displayed in UTC.

Generated by auto-changelog.

  • docs: add examples #28

29 December 2023

  • feat: add support for custom decorators #27
  • chore: release v0.11.0 dbc769b

4 August 2023

  • docs: remove unstable API warning from docs #25
  • chore: release v0.10.1 32dc5da

31 July 2023

  • feat: throw errors when missing @test or @suite decorators for given test or class #24
  • chore: release v0.10.0 7f21318

26 July 2023

  • feat: add @annotation decorator #23
  • chore: release v0.9.0 44918a3

22 July 2023

  • docs: add npm package version and test status badges to readme #22
  • chore: release v0.8.1 5d15406

22 July 2023

  • feat: add @fixme decorator #21
  • chore: release v0.8.0 28aa5d0

20 July 2023

  • chore: dependency update #20
  • chore: release v0.7.1 be51ffb

20 July 2023

  • chore: fix release process #19
  • feat: add @fail decorator #18
  • chore: release v0.7.0 0e48603

17 July 2023

  • feat: add @tag decorator #17
  • chore: release v0.6.0 f7bbe46

16 July 2023

  • feat: add @only decorator #16
  • test: fix @slow tests 6359e65
  • chore: release v0.5.0 8d69e29
  • docs: fix formatting 92b3e36

15 July 2023

  • feat: add @slow decorator #15
  • chore: release v0.4.0 f7de0c4

15 July 2023

  • chore: add keywords, license, fix peerDeps #14
  • feat(skip): add skip decorator #13
  • chore: release v0.3.0 545e2c2

13 July 2023

  • feat: add afterAll, afterEach, beforeAll, beforeEach decorators #12
  • fix: use dynamic fixtures instead of hardcoded #11
  • chore: release v0.2.0 bff619f

12 July 2023

  • fix: access to fixtures from @test method #10
  • chore: release v0.1.2 516c41f
  • docs: add banner about early stage 8a72868

11 July 2023

  • fix: fix this context in @test method #9
  • ci: add GH actions for building, linting and testing package before merge #8
  • chore: update changelog 4b0cabf
  • chore: release v0.1.1 657f1c4

11 July 2023

  • chore: add release process #7
  • add tests, refactors base decorators, update readme #6
  • refactor: refactor suite and test decorators #5
  • chore: release v0.1.0 2011458
  • chore: fix release process command 18d274b

0.0.1

9 July 2023

  • ci: automate release #4
  • feat: add suite & test decorators #3
  • ci: automate release #2
  • chore: use linter & prettier #1
  • chore: initialize repo 6ec32a4
  • docs: initialize repo 6899678