Page Object Model with Cucumber | Playwright & Cucumber - Typescript | Part 10

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

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

  • @HariBaabu-dp1mf
    @HariBaabu-dp1mf Год назад +1

    Thanks Koushik .. it was helpful sessions

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

      Glad you like it.

  • @bharathmeshach6369
    @bharathmeshach6369 Месяц назад +1

    Hi koushik so far everything was great ,could you create another video about how to integrate this code to jenkins

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

      Hi, it should be similar to this
      ruclips.net/video/Bh5t8UwbeiA/видео.htmlsi=V-nAZzARkmNfMGHM

  • @KarunyaGowda-w4d
    @KarunyaGowda-w4d Год назад +2

    is it possible to Playwright UI watch mode , when we integrate cucumber+playwright?

  • @LâmVănBảo-z2y
    @LâmVănBảo-z2y Год назад +1

    tutorial synpress with metamask in Cucumber. thank you Koushik

  • @kamiliwanowicz2297
    @kamiliwanowicz2297 10 месяцев назад +1

    Hi, is there a way to run the cucumber tests using VSC "Testing" UI? If not, how do can we debug these tests, e.g. is it possible to stop at a breakpoint when triggering a test from the command line?

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

      Page.pause should work.

  • @KarunyaGowda-w4d
    @KarunyaGowda-w4d Год назад +1

    Can you pls let know how to run testcases based on tags? the changes that should be done to package.json please.

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

      Sure, I'll cover in the upcoming videos

  • @vijaymore181
    @vijaymore181 Месяц назад +1

    Can you share link of video POM cucumber playwright ?

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

      Is it not pom cucumber?
      Or are you asking for the entire cucumber playlist?

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

      @@letcode Yes

  • @lilu4480
    @lilu4480 11 месяцев назад +1

    Hello dear Koushik. When running the Scenario: Register new user, it shows this error: TypeError: Cannot read properties of undefined (reading 'registerUser'). Thanks for your answer!

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

      Is the object created properly?

  • @sumitgoyal385
    @sumitgoyal385 6 месяцев назад +1

    line 7 and 8th dont work at timestamp 19:20 any reason ,pls explain me in detail

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

      As it is not class, it won't create the object until we call it explicitly. So calling inside the function.

  • @NandhiniSunil-n1p
    @NandhiniSunil-n1p Год назад +1

    Can I use playwright test runner , by integrating playwright with cucumber?

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

      No, both are different test runner

    • @NandhiniSunil-n1p
      @NandhiniSunil-n1p Год назад +1

      How to debug playwright with cucumber?

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

      I'll update the playlist and add a few videos.

  • @lawrencechandrasekar9488
    @lawrencechandrasekar9488 6 месяцев назад +1

    Hi Koushik, How to debug this framework Please share your ideas. I would really appreciate it. TIA

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

      Page. Pause should help I guess

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

    Hi Koushik, Than ks for tutorials. Onething I want to know how to execute scenarios based on tags here

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

      I have explained in one video.
      In cucumber.json file u can add tags and the same in the feature file.

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

    hi Koushik, is there a chance to make a video on how to upload this into GitLab and execute through it. using CI

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

      I have covered the GitHub action.
      ruclips.net/video/1KPSIwbiyNQ/видео.html
      You can apply the same concept..

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

    Hi Koushik,
    I'm struggling with Playwright + BDD running parallel via the Selenium grid, How to run Playwright distributed test via the Selenium grid by using Cucumber runner? (because Playwright docs just guide override global selenium_grid_url variable and trigger by playwright runner). Could you make a video about that? Thank you so much

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

      Hi, sure I'll try

  • @HariBaabu-dp1mf
    @HariBaabu-dp1mf Год назад +1

    Is there a way to integrate the playwright test runner with cucumber step defs ..
    E.g. call the playwright test () from stepdefinition file
    Since some playwright functionalities are specific to the test runner

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

      Yes, we can but in that case if we have to use the test runner then why should we use cucumber.
      Use any one, don't mix.
      Playwright core and test runner both have the same functionality, do let me know if you're finding any difficulties.

    • @HariBaabu-dp1mf
      @HariBaabu-dp1mf Год назад +1

      There is a requirement to use BDD .. and
      There is a need for using .tohavescreenshot() but this functionality is limited to the playwright test ()
      So confused if there is a better way to use it using cucumber-js

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

      Ok, I'll check.

    • @HariBaabu-dp1mf
      @HariBaabu-dp1mf Год назад

      Any thoughts on how to handle it .. thanks in advance

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

    Why we should use page object model? Ehat benefits it gives?

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

      ruclips.net/video/AdIu6LpjbsM/видео.htmlsi=Ww7yj2cmNugvFPhz

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

    Hi Sir,
    Can we have a session on scroll bar in playwright
    means scroll bar is present or not...

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

      To do the scroll we can use scrollIfneeded function.
      But I'm not sure if we can test the scroll bar present or not.

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

      @@letcode scrollintoviewifneeded function is use for scrolling only

  • @shankykalra4987
    @shankykalra4987 6 месяцев назад +1

    Thanks Koushik, for the session.
    One thing, I observed, that rerun is not getting executed after the failed tests.
    Do we need to update the entries in cucumber.json for the page class ?

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

      Welcome 🤗.
      Rerun doesn't execute on its own, we have to trigger.

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

      ​@@letcode Yes, I know, since I am following your videos from first lecture.
      I check my terminal, it is running in the bash.
      Error: Unexpected error on worker.receiveMessage
      at exit (C:\Users\kalrs\playwright\Project\DEH_Automation
      ode_modules\@cucumber\cucumber\src
      untime\parallel
      un_worker.ts:7:21)
      at C:\Users\kalrs\playwright\Project\DEH_Automation
      ode_modules\@cucumber\cucumber\src
      untime\parallel
      un_worker.ts:21:9
      at processTicksAndRejections (node:internal/process/task_queues:95:5) {
      [cause]: Error: a BeforeAll hook errored on worker 0, process exiting: src\hooks\hooks.ts:14
      at Worker.runTestRunHooks (C:\Users\kalrs\playwright\Project\DEH_Automation
      ode_modules\@cucumber\cucumber\src
      untime
      un_test_run_hooks.ts:37:19)
      at processTicksAndRejections (node:internal/process/task_queues:95:5)
      at async Worker.initialize (C:\Users\kalrs\playwright\Project\DEH_Automation
      ode_modules\@cucumber\cucumber\src
      untime\parallel\worker.ts:90:5)
      at async Worker.receiveMessage (C:\Users\kalrs\playwright\Project\DEH_Automation
      ode_modules\@cucumber\cucumber\src
      untime\parallel\worker.ts:107:7) {
      [cause]: Error: Please set the proper Browser!
      at invokeBrowser (C:\Users\kalrs\playwright\Project\DEH_Automation\src\helper\browsers\browserManager.ts:18:19)
      at Object. (C:\Users\kalrs\playwright\Project\DEH_Automation\src\hooks\hooks.ts:16:34)
      at step (C:\Users\kalrs\playwright\Project\DEH_Automation\src\hooks\hooks.ts:33:23)
      at Object.next (C:\Users\kalrs\playwright\Project\DEH_Automation\src\hooks\hooks.ts:14:53)
      at C:\Users\kalrs\playwright\Project\DEH_Automation\src\hooks\hooks.ts:8:71
      at new Promise ()
      at __awaiter (C:\Users\kalrs\playwright\Project\DEH_Automation\src\hooks\hooks.ts:4:12)
      at Object. (C:\Users\kalrs\playwright\Project\DEH_Automation\src\hooks\hooks.ts:50:12)
      at Object.run (C:\Users\kalrs\playwright\Project\DEH_Automation
      ode_modules\@cucumber\cucumber\src\user_code_runner.ts:37:21)
      at C:\Users\kalrs\playwright\Project\DEH_Automation
      ode_modules\@cucumber\cucumber\src
      untime
      un_test_run_hooks.ts:25:28
      }
      }
      I am getting above error.

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

      Command to run - npm run test:failed
      package.json -
      scripts": {
      "pretest": "npx ts-node src/helper/report/init.ts",
      "test": "cross-env ENV=UAT2 cucumber-js test || true",
      "posttest": "npx ts-node src/helper/report/report.ts",
      "test:failed": "cucumber-js -p rerun @rerun.txt"
      }

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

    Hello koushik, your videos are amazing way to learn...
    When I assert through POM all the steps are passed but scenario getting failed, im getting the error as
    After # src/hooks/hooks.ts
    locator.type: Target closed
    ====Logs====
    Waiting for locator(userName locator)
    ===============================
    You got any idea on this y am I getting this issue?

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

      Hi, welcome. Locator is wrong so after timeout browser is getting closed.

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

      Hi Kaushik, I am following video. Thsese are very helpful for me.
      I am also getting same issue with POM
      if I use cucumber and playwright code is working fine no issues observed. but if we add POM then getting same issue as mentioned above. steps which calling methods from are not executed but showing as pass and it failed at after hooks. could you please helm me

  • @ravichandrakammar6667
    @ravichandrakammar6667 Месяц назад +1

    Thank you

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

      Welcome 🤗

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

    Hi Koushik, i am noticing an issue with "page.pause()" it seems that the debugger opens but then it closes really quick and it is not making the test to pause . Any idea what could be happening?

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

      Hi, i will check this.

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

      In my case(cucumber-playwright-js project) it depends on cucumber default timeout settings. I have 80000ms in hooks script, but if I need to use page.pause() I increase it: setDefaultTimeout(300000) or setDefaultTimeout() for endless timeout.

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

      @@RMmoG page.pause is not working for me, i have to check alternate ways. I'll let u know.

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

      @@letcode I have added await fixture.page.pause(); in any step definitions of your Playwright_Cucumber_TS project and it's working fine.

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

      That's nice but does the inspector show the source code?

  • @pranitdhole5978
    @pranitdhole5978 8 месяцев назад

    Please add video related to how to handle multiple tabs in this framework.
    Can't use context.pages in pageobject.js file

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

      Will upload soon

  • @AnmolKhanna-fo8xo
    @AnmolKhanna-fo8xo 8 месяцев назад +1

    Hi Koushik whenever I'm trying this command " await expect(statuslogo).toHaveText("Draft");" it is asserting the value when I try to print the value os status logo it is printing the XPath.
    > coengage-e2e@1.0.0 test
    > cross-env ENV=qa cucumber-js test || true
    9/11 steps [==================================================================================================================== ] locator('//div[contains(@class,\'mantine-Group-root mantine-17caxu2\')]')

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

      To print the text you have to use textContent function.

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

    Hi Koushik, it was a really nice session. Helped a lot. Wanted to know if we have playwright and perfecto integration? Like we can run playwright test in lambtatest plateform.

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

      Thanks, not sure about perfecto, i haven't used it.

  • @AnkitSingh-qb6hk
    @AnkitSingh-qb6hk Год назад +1

    Sorry to ask you randomly but i wanna know that how can we stop test script for 5 mins?
    There's a scenario in which I have to wait for 5 min before executing next step in FF

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

      Page.waitForTimeOut will wait for the given time, it's like thread.sleep

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

      2015 pass out sir enakku softwer tester la job ketikkuma sir

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

      Friends yaruna testing la work pannitu erundha refer panna sollunga bro. Appo kedaikum.

    • @AnkitSingh-qb6hk
      @AnkitSingh-qb6hk Год назад

      @@letcode I used it already, it throws error as "function timed out, ensure the promise resolves within 5000 milliseconds"
      The official playwright site says that it should be only used for debugging. Testing using the timer in production are going to be flaky

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

      @@AnkitSingh-qb6hk playwright has a default timeout of 5 seconds.
      You can adjust it manually like this (most likely ur case, since you just want it to wait 5 min on one operation):
      await page.goto(url, { timeout: 300000 });
      await expect(page).toHaveTitle(/Playwright/, { timeout: 300000 });
      Or you can set it globally by adding this to your test file:
      import { test, expect } from "@playwright/test";
      test.use({
      // (overrides the default timeout of 5 seconds)
      timeout: 300000,
      });

  • @jagrutibachhav-m4o
    @jagrutibachhav-m4o Год назад +1

    Hi Koushik,
    Thank You for the Session, It really Helped a lot,
    I am using the same folder structure and trying to generate Junit .xml report to integrate Playwright automation test result with Testrail,
    could you please help me how to generate Junit .xml report using this same framework/folder structure?
    Thank You in advance..!!

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

      Hi, you can refer to this video
      ruclips.net/video/g5wpLpncoN0/видео.html

    • @jagrutibachhav-m4o
      @jagrutibachhav-m4o Год назад +1

      @@letcode I referred the mentioned video, but it is regarding generating report using html and json but for integration of Playwright automation test result with Testrail it supports .xml report only, so wanted to know how to generate Junit .xml report using this same framework/folder structure?

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

      Instead of json you can mention junit with filename.xml