Playwright Jest Config & Launch Browser | Playwright - Part 2

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

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

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

    I searched for Playwright tutorial and i end up here. Good content. Thank you

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

      Glad u like it, thank you 😊

  • @HoangAnh-ys4kc
    @HoangAnh-ys4kc 3 года назад +2

    Hi Koushik, thank you for the great series. Could you enable auto-generated subtitles for all videos? English is not my first language, so the Engsub will help me a lot to understand your tutorial. Thanks

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

      Sure, most of the video already has auto generated subtitles, I'll check again.

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

    Hi Koushik, Thanks for making such a nice tutorial series. I have a query: How we will create BDD (or other) framework in PlayWright? Which tools we require to do so? Thanks

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

      Hi, thanks for the feedback.
      As of now we have used jest and playwright test runner.
      In upcoming days I'll start cucumber.
      Its easy only, as we do in selenium or protractor.

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

    Could you tell me, why better the mentioned method to launch a webpage, then :
    test.beforeEach(async ({ page }) => {
    const baseUrl = 'https:...'
    await page.goto(baseUrl )}
    Or it is does not matter? (I have only one browser chrome)

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

      This is the second video of the playlist, i started from the basis.
      Continue with the playlist it will get changed.

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

    @koushik Do you have any platform or code review forum to discuss about issues coming up in RUclips videos to be discussed. Kindly do update. Thanks.

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

      Yes, discord is there, you can find the link from the channel page..

  • @raghunaths.v3136
    @raghunaths.v3136 3 года назад +2

    Hi Koushik thanks for the nice tutorial. What would you choose btw Protractor and Playwright and why? Thanks

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

      Good question.
      I will prefer playwright now.
      Few good reasons are there, like the automatic waits. Recording of tests and so many things.
      It is more easy I feel

    • @raghunaths.v3136
      @raghunaths.v3136 3 года назад +1

      @@letcode Thanks Koushik. You are doing a great job!

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

    Hi Koushik, I am getting Cannot find module 'playwright' or its corresponding type declarations. Error
    What is the best solution for this??

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

      Dependencies not installed properly i guess.

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

    Hi Koushik. We’re planning on migrating from Jasmine to Playwright. Do you know if there’s a way to use ‘jasmine-data-provider’ in Playwright?

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

      There is no option as data provider but data can stored in an array and test can be iterate

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

      @@letcode Thank you so much for the feedback. I'll try to implement it with array and see how it goes.

  • @Aowek955
    @Aowek955 Год назад +1

    Hey Koushik,
    When I install Playwright my dev dependencies does not include Jest, I closely followed your tutorial. In devDependencies I only have
    "@playwright/test" and nothing else.
    I cannot continue the tutorial it is always saying Jest is not recognized command , any help ?

    • @letcode
      @letcode  Год назад

      Hi, we don't use jest anymore.
      Playwright has its own test runner.
      Pls watch this to understand ruclips.net/video/qoG5gidhj_A/видео.html

    • @Aowek955
      @Aowek955 Год назад +1

      @@letcode I do understand now. So I should just skip the jest part and move on with the course correct ?
      Thank you for fast response

    • @letcode
      @letcode  Год назад

      @@Aowek955 yes 😊, welcome

  • @Reyolive-z5b
    @Reyolive-z5b 6 месяцев назад +1

    Bro engha office la playwright with typescript padichi script pottu katta sollirukangha. Endha playlist dha first pakkanum ella vera edhachi erukka.. because jasmine soldringha protector soldringha jest soldringha purila

    • @letcode
      @letcode  6 месяцев назад

      Idhu full ah paarunga bro puriyum

    • @Reyolive-z5b
      @Reyolive-z5b 6 месяцев назад

      @@letcode okay, Thank you

  • @vinothkanna86
    @vinothkanna86 3 года назад +3

    Jest did not exit one second after the test run has completed.
    This usually means that there are asynchronous operations that weren't stopped in your tests. Consider running Jest with `--detectOpenHandles` to troubleshoot this issue.
    Am getting above error again and again plz help me how to resolve

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

      You have close all the objects like browser, context and page.

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

      import {chromium} from "playwright";
      describe('Launch Browser', () => {
      test('open letcode', async () => {
      const browser = await chromium.launch({headless:false})
      const context = await browser.newContext();
      const page = await browser.newPage();
      await page.goto("www.google.com")
      await page.waitForTimeout(5000)
      await browser.close();
      })
      })
      Plz find my above code guide me what went wrong

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

      You should choose the page and context as well

    • @242526mafars
      @242526mafars 2 года назад

      @@letcode I closed browser, context and page, but still getting an error

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

      @@242526mafars I am having the same issue. Any resolution?

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

    Hi Koushik,
    am getting cannot find module '../traverse/traversefast'
    Require stack error while executing "jest login.test.ts command". Please suggest the solution

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

      Hi, that is your file path I beleive, you might have given wrong file path

  • @NG-tc7mh
    @NG-tc7mh 2 года назад +1

    Nice video bro. When installing npm playwrigght browser in vscode, i'm getting failed error which says "unable to install chromium and get local issuer certificate" in my company laptop. DO you have any suggestion?

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

      Seems like company has blocked those links to download files.
      Can you check with network admin.

  • @sumitgoyal385
    @sumitgoyal385 Год назад

    Hi brother Iam able to understand how to use playwright runner ,one question when we hit npx playwright test example.spec.ts ,so we donot need to convert the file to js ,as you mentioned in jest lecture you did some setup (Iam not following jest) as many people going with playwright testrunner ,so my question is we donot need to worry about conversion of typescript to js ?

    • @letcode
      @letcode  Год назад +1

      Playwright will handle that, no need to worry about it.

    • @sumitgoyal385
      @sumitgoyal385 Год назад +1

      @@letcode thanks brother I will surely buy you one coffee after this series 😊

  • @prateekverma8390
    @prateekverma8390 10 месяцев назад +2

    I am facing error while writing describe keyword...

    • @letcode
      @letcode  10 месяцев назад

      Jest is not required now, only playwright is enough.

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

    Hi Koushik,
    I want to use single class object across multiple test suits in playwright, is it possible here?
    I tried various solutions, but not working, could you please help me here..
    Thank you!

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

      Yes,
      ruclips.net/video/w05KGL8G0f4/видео.html

  • @amansharma-gj7eu
    @amansharma-gj7eu 2 года назад +1

    Hi Koushik,
    I am unable to launch chromium browser. Getting below error:
    '/System/Library/Frameworks/Chromium Framework.framework/Versions/105.0.5195.19/Chromium Framework' (no such file).
    Can you please help with this?

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

      Is all the dependencies installed correctly

    • @amansharma-gj7eu
      @amansharma-gj7eu 2 года назад +1

      @@letcode Yes have installed below dependencies:
      "@playwright/test": "^1.25.0",
      "@types/jest": "^28.1.6",
      "jest": "^28.1.3",
      "jest-cli": "^28.1.3",
      "jest-playwright-preset": "^2.0.0",
      "playwright-core": "^1.25.0",
      "ts-jest": "^28.0.7",
      "tslib": "^2.4.0",
      "typescript": "^4.7.4"
      and also installed chromium browser on machine but still getting this error. When I am running with other browser like chrome its working fine.

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

      I'm not sure about it, can u check this latest installation video
      ruclips.net/video/AdFgipIPAlg/видео.html

  • @Arasuari
    @Arasuari 2 года назад +2

    It will be helpful if you start from scratch

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

      I started from scratch only. Go with the playlist 🙂

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

    Awesome. Thanks a lot

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

    Hi Koushik,
    I am getting Error at Launch Browser › Open URL
    Like:
    Timeout - Async callback was not invoked within the 3000 ms timeout specified by jest.setTimeout.Timeout
    - Async callback was not invoked within the 3000 ms timeout specified by jest.setTimeout.Error:
    How to fix this issue, Please help me

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

      HI, In the config you have to increase the timeout option.

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

      @@letcode In Which Config file , Need to increase timeout

  • @sumitgoyal385
    @sumitgoyal385 Год назад

    Hello bhai , you said We should give name like fiilename.test.ts ,but playwright default test name is example.spec.js which one we choose or we can choose anyone

    • @letcode
      @letcode  Год назад

      Anything is fine.
      While using jest name.test is recommended, for playwright test runner anything is fine

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

    Despite having headerless false and close browser, this error is still coming. How can I fix it? Kindly Tell me
    "" Timeout - Async callback was not invoked within the 5000 ms timeout specified by jest.setTimeout.Timeout - Async callback was not invoked within
    the 5000 ms timeout specified by jest.setTimeout.Error:""

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

      Pls refer the code in GitHub, link in the description.
      You have to increase the timeout.

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

      @@letcode What is language type & Can we run multiple test cases simultaneously?

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

      Yeah you can do everything, continue with the playlist, I'm using typescript language in this playlist.

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

      @@letcode Thank You

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

    Hey! Question to see if you really master playwright or not : I got 3 url with the same html page , I have to do the same tests for each url, so I have a loop around my test with url var, but I want to run it in parallele in 3 different tab of the same browser ? How can I achieve it?

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

      I'm not a master.

  • @MiesumAbbas
    @MiesumAbbas 16 дней назад +1

    Sir how to fix "ReferenceError: describe is not definedplaywright" error. Please guide me

    • @letcode
      @letcode  16 дней назад

      It should be test.desctibe using playwright test runner.

    • @miesumabbas1255
      @miesumabbas1255 16 дней назад

      ​@@letcode Sir but I am using Jest test runner

    • @letcode
      @letcode  16 дней назад +1

      Oh , in that case it should work with describe block, pls check if the package is added properly.
      Now it is recommended to use the playwright test runner jest is not good.

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

    Hi Kaushik
    Nice tutorial.
    Can you please give detailed tutorial of playwright -typescript using cucumber(BDD)
    I need it for my new project

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

      Working on it, tutorial coming soon.

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

      @@letcode Thanks
      Waiting for it

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

    Hi Koushik
    I am getting " SyntaxError: Cannot use import statement outside a module" error

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

      R u using JS ?

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

      @@letcode No, using TS

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

      Try to reinstall the dependency again and check.

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

      @@letcode Seems it resolved but now getting specified in the "transform" object of Jest configuration
      must export a `process` or `processAsync` or `createTransformer` function.

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

    hey thank you very much , can we record the audio of the test please?

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

      I haven't tried, may be it can I believe.

  • @simoachangli
    @simoachangli Год назад +1

    I'm new to typescript but guest what i will learn playwright first

    • @letcode
      @letcode  Год назад

      If u know any programming language, then learning TS is very easy. All three best.

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

    How get red flag to FAIL word? and yellow for RUNS

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

      Sorry i didn't get it.

  • @MohamedJasirKA
    @MohamedJasirKA 3 месяца назад

    Subscribed ☺

    • @letcode
      @letcode  3 месяца назад

      Thanks 👍

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

    very nice.

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

      Thank you 😊

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

    Hi Koushik,
    I'm getting error :
    C:\TestPlaywright\Pattern\test\lounchBrowser.test.ts:1
    ({"Object.":function(module,exports,require,__dirname,__filename,jest){import { chromium } from 'playwright';
    ^^^^^^
    SyntaxError: Cannot use import statement outside a module
    can you please help me.

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

    Hi Koushik Thanks a ton for this wonderful video series.
    I am getting below error while try to run the script:
    npm ERR! code EJSONPARSE
    npm ERR! path C:\Users\DebjaniG\Desktop\Project Docs\playwright/package.json
    npm ERR! JSON.parse Unexpected string in JSON at position 648 while parsing '{
    npm ERR! JSON.parse "name": "playwright",
    npm ERR! JSON.parse "version": "'
    npm ERR! JSON.parse Failed to parse JSON data.
    npm ERR! JSON.parse Note: package.json must be actual JSON, not just JavaScript.
    can you please let me know what is the wrong thing I am doing
    Thanks in Advance

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

      U have compile time issue in package.jsin file.
      You can check the reference in my GitHub.
      Link in the description.

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

      @@letcode it is working fine now. Thank you for your all support and prompt reply.

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

    What is jest?

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

      Jest is a unit testing framework to run js/TS.
      Similar to Jasmine or mocha

  • @sumitgoyal385
    @sumitgoyal385 Год назад

    Iam confused how to proceed as here ruclips.net/video/qoG5gidhj_A/видео.html ,kaushik says migrate to test runner

    • @letcode
      @letcode  Год назад

      Within the test block everything will be the same as the playwright code.
      The only difference is the runner.

  • @sumitgoyal385
    @sumitgoyal385 Год назад

    Hi brother My describe blocks not recognized no autosuggestions coming as well ,found your one video > ruclips.net/video/qoG5gidhj_A/видео.html , do I need to move to test runner or Jest ,which one you suggest ?

    • @letcode
      @letcode  Год назад

      Test runner is better as explained in the video.

    • @sumitgoyal385
      @sumitgoyal385 Год назад +1

      @@letcode should I skip start 21 videos and continue with 22nd video ??

    • @letcode
      @letcode  Год назад +1

      @@sumitgoyal385 no continue all the video, only thing is instead of creating page like chromium.create all those, use the fixture test ({page})

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

    Hi Koushik,
    I've gone through your video and run the launchBrowser.test.ts file.
    It still failed the test because of Timeout, even though I've used " await browser.close()" command,
    thanks in advance

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

      You have to increase the timeout in config file.

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

      @@letcode Thanks

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

      @@letcode how to do that

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

      Go to playwright.config file,
      You will find a timeout, there u have to increase the value.
      For reference you can check my GitHub repo.

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

      @@letcode Hi, where can I find the playwright.config file? I'm brand new to this so sorry if it's a dumb question.