Skip on Failure | Jest | Playwright - Part 21

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

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

  • @saranyab2304
    @saranyab2304 3 года назад +2

    I want to add screenshot only on failure cases in jest allure. Can you pls tell me how to do ??

    • @letcode
      @letcode  3 года назад

      Not possible directly, but I'll look into it ☺️

  • @study_krishna
    @study_krishna 3 года назад +1

    Thank You, Kaushik Sir. 🙏

    • @letcode
      @letcode  3 года назад

      Welcome bro 😀

  • @mohapatradharitree
    @mohapatradharitree 2 года назад +1

    Hi Koushik I observed in my script, playwright script is getting stuck and not proceeding to next test block when it is unable to locate the right locator. Any resolution for this.? In afterEach i have placed context close and page close.

    • @letcode
      @letcode  2 года назад +1

      I believe your timeout is more so if locator is not present then it will wait the timeout is expired.

  • @4ihpix
    @4ihpix 3 года назад +2

    I was wondering if you are planing present a video about waitForNav, waitForResponse and others wait methods?

    • @letcode
      @letcode  3 года назад +1

      Yes, however while writing test I have already shown few wait demo.

  • @salmaassem5904
    @salmaassem5904 3 года назад +1

    Hi, is there anyway not to rerun the beforeall if one test is failed in the test file?

    • @letcode
      @letcode  3 года назад

      No direct implementation, Boolean might useful, but i haven't tried.

  • @rashmikale6499
    @rashmikale6499 3 года назад +1

    hi, do we have any way for...how to rerun the failed test cases in playwright jest?

    • @letcode
      @letcode  3 года назад +1

      I don't think so, we don't have that feature in jest

    • @rashmikale6499
      @rashmikale6499 3 года назад +1

      @@letcode ..okay then ..is there any other way...like if we can do it by jenkins ?

    • @letcode
      @letcode  3 года назад

      No, Jenkins is just a CI CD tool. I'll check if there is any other way.

    • @rashmikale6499
      @rashmikale6499 3 года назад +1

      @@letcode yes please.i need t implement it in my current project.please let me know if there any...

  • @rm4321
    @rm4321 3 года назад +1

    Hi Koushik,
    I am facing issue while configuring jest for unit tests and playwright jest for functional test.
    Need guidance

    • @letcode
      @letcode  3 года назад

      What is the issue.
      Common issue is... You should install the dependencies as dev dependencies.

    • @rm4321
      @rm4321 3 года назад +1

      Thanks for prompt response 🙏
      More specific while preset for both jest-preset-angular and jest-playwright-preset
      Have to manually change that preset option

    • @letcode
      @letcode  3 года назад

      Oh... I don't think so we have a option to set 2 preset. Let me check the docs.

    • @rm4321
      @rm4321 3 года назад +1

      @@letcode please will wait for your response 🙏

    • @letcode
      @letcode  3 года назад +1

      Preset allows only string, so we can not do it directly but we can set up multiple config file.
      One for unit and another for functional.
      Found a reference medium, probably it might help you.
      medium.com/coding-stones/separating-unit-and-integration-tests-in-jest-f6dd301f399c

  • @tanujlakshakar8473
    @tanujlakshakar8473 3 года назад +1

    Is there a way to have "Skip on Failure" in playwright-testrunner as we have in jest ?

    • @letcode
      @letcode  3 года назад

      No direct implementation I guess, as all the test are independent. But we can use the test.skip() annotations.

    • @tanujlakshakar8473
      @tanujlakshakar8473 3 года назад +1

      @@letcode actually I was looking a case if out of n-tests any of test fails, it should stop the complete execution, no need to execute further tests like we do in jest by "bail".

    • @letcode
      @letcode  3 года назад +1

      @@tanujlakshakar8473 may be we can request a feature.

  • @nikhilgupta5721
    @nikhilgupta5721 2 года назад +1

    Hi Koushik, can we continue our test if one of the test case failed it actually exit the automation when any one of the test failed. I am migrating from Protractor to Playwright, in protractor when test fail it continue with the next it block with flag as realTimeFailure: true

    • @letcode
      @letcode  2 года назад

      I'll look into it.

    • @nikhilgupta5721
      @nikhilgupta5721 2 года назад +1

      @@letcode Did you find any solution for it, actually my test are dependent, any one of them failing exit the automation which I don't want. Also in next test block page will be continue till what previous test left, right? So that we can do continue test flow in chunks of test blocks

    • @letcode
      @letcode  2 года назад

      If u r using a playwright fixture, it won't happen. all the tests were independent. If one test fails it continues with the other tests.

    • @nikhilgupta5721
      @nikhilgupta5721 2 года назад +1

      @@letcode 😭 why the super brain tool inventor forget this basic features in the tools. E2E is completely based on entire test flow, it is not necessary to make test cases independent all the time for a large scenario. Protractor is very robust, unfortunately it is going to be end by end of 2022.

    • @letcode
      @letcode  2 года назад

      You can break down the tests using test.steps that will be handy to write big tests.

  • @КостянтинБєлозьоров
    @КостянтинБєлозьоров 3 года назад +1

    Hi, Koushik! I think that instead of these 2 lines of code(bail: true, bail: 1) one is enough(bail: 1), they are identical. Am I right?

    • @letcode
      @letcode  3 года назад +1

      By default, Jest runs all tests and produces all errors into the console upon completion. The bail config option can be used here to have Jest stop running tests after n failures. Setting bail to true is the same as setting bail to 1.
      From official documents

    • @КостянтинБєлозьоров
      @КостянтинБєлозьоров 3 года назад +1

      @@letcode thank you!