How to detect broken links with Playwright Test

Поделиться
HTML-код
  • Опубликовано: 21 ноя 2024

Комментарии • 12

  • @ChecklyHQ
    @ChecklyHQ  2 месяца назад +1

    Thanks for watching! 🦝
    You can find the source code on GitHub. 👇
    If you have any questions or comments, let us know!
    github.com/checkly/playwright-examples/

  • @VassiliHuang12
    @VassiliHuang12 2 месяца назад

    Great video 👍🏻

  • @shabarish32
    @shabarish32 2 месяца назад

    you are awesome mate :)

  • @07torne
    @07torne 2 месяца назад

    thanks!

  • @kryptoniansz
    @kryptoniansz 2 месяца назад +1

    sir please make a tutorial for playwright + cucumber

    • @ChecklyHQ
      @ChecklyHQ  Месяц назад

      Heyoooo. I don't have any experience with cucumber so, unfortunately, it's very unlikely that we'll cover it here on the channel. :/

  • @harish3787
    @harish3787 2 месяца назад

    Hello brother, could you please explain or make a video on when to use promise.all method and when not to. Like in this video you have used promise.all but what was the purpose of that ?

    • @lfc67671
      @lfc67671 2 месяца назад

      Promise.all is often used when you want to do multiple functions at once but will wait until all the methods encased within it are complete before proceeding. General playwright tests involve awaiting for each step as you often need the previous step to be complete before you continue. You may want to use promise.all when you can do a series of concurrent operations without effecting the test input/output. For example, when making breakfast you dont do one operation from start to finish at the same time. you may start the cooker, boil the kettle and retrieve the ingredients from the fridge. However you cannot begin cooking the breakfast until you have done those tasks so... Promise.all would contain the methods; startCooker(), boilKettle(), and retrieveIngredients() (as it doesnt matter when these methods finish as they do not rely on each other). once all these steps are done then 'await beginCooking()' method can begin. Hope this helps

    • @ChecklyHQ
      @ChecklyHQ  2 месяца назад

      I recommend looking into Promise Handling in JavaScript. In the video, an Array of string values is mapped into an Array of Promises (`getAttribute` in this case). JS Promises are async - we don't know when they resolve with a value (or reject with an error). So we have to wait until all these async operations finish.
      To access all the promise values, we then can call `Promise.all`, which takes an array of promises, waits for them to resolve, and returns an array of values.
      So, when writing Playwright (or JS) code, you should always check the data structures you're dealing with. Some are synchronous, while others will be async with promises.