Playwright Test Fixtures Made Easy

Поділитися
Вставка
  • Опубліковано 15 жов 2024
  • Playwright Test is based on the concept of the test fixtures. Test fixtures are used to establish environment for each test, giving the test everything it needs and nothing else.
    Playwright Test looks at each test declaration, analyses the set of fixtures the test needs and prepares those fixtures specifically for the test. Values prepared by the fixtures are merged into a single object that is available to the test, hooks, annotations and other fixtures as a first parameter.

КОМЕНТАРІ • 21

  • @LeandroAnjosSantos
    @LeandroAnjosSantos 22 дні тому +1

    Brilliant!!! Thanks for sharing your knowledge.

  • @Swekar14
    @Swekar14 9 місяців тому +1

    Super informative for someone who has recently started using playwright

  • @MaheshJoshi_wellington
    @MaheshJoshi_wellington 7 місяців тому

    You are an amazing teacher 🙏🏻 looking for more videos on playwright

    • @CommitQuality
      @CommitQuality  7 місяців тому +1

      Thank you :) more are coming 😊

    • @MaheshJoshi_wellington
      @MaheshJoshi_wellington 7 місяців тому

      @@CommitQuality thank you do you mentor as well 🙏🏻

    • @CommitQuality
      @CommitQuality  7 місяців тому +1

      Its something I have done in the past & I have considered it online as part of memberships, however its finding the time and not spreading myself too thin.

  • @aliadnan38
    @aliadnan38 Рік тому +1

    A comprehensive video on fixtures. Waiting for some more content on fixtures

    • @CommitQuality
      @CommitQuality  Рік тому +3

      Thank you! The next released video will go over how to convert a hook into a fixture

  • @simonjohnade
    @simonjohnade Рік тому +1

    Very good video, thank you. Would you use fixtures, like a code developer would use functions? Specifically for re-use. So have a Login fixture and a Logout fixture that could then be included and called by many other tests. Am I correct in my thinking or is there a better way for 're-usability' ?

    • @CommitQuality
      @CommitQuality  Рік тому +1

      I personally wouldn't use fixtures for Logging in each time. Instead I would save the state before all tests run (video coming in the next few weeks around this). I do have a video around using fixtures instead of using hooks though and that is definitely a use case. I wouldn't say fixtures replace functions though, there's definitely use cases for both.

    • @simonjohnade
      @simonjohnade Рік тому

      @@CommitQuality Thank you. Look forward to your upcoming videos. 👍

  • @AnonYmous-kf7uu
    @AnonYmous-kf7uu 9 місяців тому

    Great video! One question - how can I add a page class to a helper.ts file for cases where I'm just trying to run some ancillary code to set up some test data? If the page classes are instantiated in the fixture how can I use them in other places than just "test" cases?

    • @CommitQuality
      @CommitQuality  9 місяців тому

      You can instantiate the classes like you would with any other class. You can view my page object model video which will provide examples of instantiating a class in a test without using fixtures ua-cam.com/video/Hp4QIBJO3yY/v-deo.htmlsi=-HlUMbSRBIwsUGGr

  • @serdarfesli2433
    @serdarfesli2433 5 місяців тому

    thanks a lot. great video

  • @MoonlightInHeaven
    @MoonlightInHeaven Рік тому

    You are great! Thanks a lot!

  • @aneelazulfiqar661
    @aneelazulfiqar661 Рік тому

    Clearly explained. Thanks

  • @kurucayerdal
    @kurucayerdal Рік тому

    Thank you !

  • @imperuminate
    @imperuminate Рік тому

    thanks

  • @Aizsaule
    @Aizsaule Рік тому

    Thank you!