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?
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!
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
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
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.
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
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 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.
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?
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
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?
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.
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\')]')
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.
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 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
@@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, });
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 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?
Thanks Koushik .. it was helpful sessions
Glad you like it.
Hi koushik so far everything was great ,could you create another video about how to integrate this code to jenkins
Hi, it should be similar to this
ruclips.net/video/Bh5t8UwbeiA/видео.htmlsi=V-nAZzARkmNfMGHM
is it possible to Playwright UI watch mode , when we integrate cucumber+playwright?
No bro
tutorial synpress with metamask in Cucumber. thank you Koushik
Thanks 👍
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?
Page.pause should work.
Can you pls let know how to run testcases based on tags? the changes that should be done to package.json please.
Sure, I'll cover in the upcoming videos
Can you share link of video POM cucumber playwright ?
Is it not pom cucumber?
Or are you asking for the entire cucumber playlist?
@@letcode Yes
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!
Is the object created properly?
line 7 and 8th dont work at timestamp 19:20 any reason ,pls explain me in detail
As it is not class, it won't create the object until we call it explicitly. So calling inside the function.
Can I use playwright test runner , by integrating playwright with cucumber?
No, both are different test runner
How to debug playwright with cucumber?
I'll update the playlist and add a few videos.
Hi Koushik, How to debug this framework Please share your ideas. I would really appreciate it. TIA
Page. Pause should help I guess
Hi Koushik, Than ks for tutorials. Onething I want to know how to execute scenarios based on tags here
I have explained in one video.
In cucumber.json file u can add tags and the same in the feature file.
hi Koushik, is there a chance to make a video on how to upload this into GitLab and execute through it. using CI
I have covered the GitHub action.
ruclips.net/video/1KPSIwbiyNQ/видео.html
You can apply the same concept..
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
Hi, sure I'll try
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
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.
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
Ok, I'll check.
Any thoughts on how to handle it .. thanks in advance
Why we should use page object model? Ehat benefits it gives?
ruclips.net/video/AdIu6LpjbsM/видео.htmlsi=Ww7yj2cmNugvFPhz
Hi Sir,
Can we have a session on scroll bar in playwright
means scroll bar is present or not...
To do the scroll we can use scrollIfneeded function.
But I'm not sure if we can test the scroll bar present or not.
@@letcode scrollintoviewifneeded function is use for scrolling only
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 ?
Welcome 🤗.
Rerun doesn't execute on its own, we have to trigger.
@@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.
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"
}
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?
Hi, welcome. Locator is wrong so after timeout browser is getting closed.
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
Thank you
Welcome 🤗
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?
Hi, i will check this.
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.
@@RMmoG page.pause is not working for me, i have to check alternate ways. I'll let u know.
@@letcode I have added await fixture.page.pause(); in any step definitions of your Playwright_Cucumber_TS project and it's working fine.
That's nice but does the inspector show the source code?
Please add video related to how to handle multiple tabs in this framework.
Can't use context.pages in pageobject.js file
Will upload soon
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\')]')
To print the text you have to use textContent function.
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.
Thanks, not sure about perfecto, i haven't used it.
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
Page.waitForTimeOut will wait for the given time, it's like thread.sleep
2015 pass out sir enakku softwer tester la job ketikkuma sir
Friends yaruna testing la work pannitu erundha refer panna sollunga bro. Appo kedaikum.
@@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
@@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,
});
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..!!
Hi, you can refer to this video
ruclips.net/video/g5wpLpncoN0/видео.html
@@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?
Instead of json you can mention junit with filename.xml