Hi When i am running the tests it is giving error as No tests found, exiting with code 1 Run with `--passWithNoTests` to exit with code 0 In D:\Violet\playwrite\poc 9 files checked. testMatch: rootDir/test/bulkedit/**.ts - 0 matches
How can we execute the same test on chromium and firefox concurrently with jest...? Just by mentioning the browsers in the config is executing it sequentially.-> browsers: ["chromium","firefox"]
Great stuff, I extended my jest to use projects so I can configure unit/functional and e2e, but still use the initial jest config as well. Very useful information.
hey Feral Goose can you tell me what changes did you make to run the test cases in parallel because according to the tutorial I have followed the same steps but it's not executing all test suites unexpectedly closing the browser
i had a 5 test case scenario in the test/pageobjects then i wish to run only two how counld i do it...you told jest -i is sequencial right..but i need to specfic the file name like test/PageObjects/scenario_001.ts and test/PageObjects/scenario_004.ts only i want to run means like pom.xml we can do it in the test ng like that here we can specify the two path with comman sperator is it right.
I have not integrated my Playwright to Jest. I am using just factory default Playwright. In my test folder I have two test files namely: 1. file1.test.ts 2. file2.test.ts When I am running in Parallel mode by settings workers = 2 in playwright.config.ts, its running the test case of the single file in different browser instances due to which my test case is failing as the first test case was to login and second is to perform the required action. Can you please suggest how can I overcome this issue?
@@letcode Thanks a lot, this worked. I have two new queries, could you please help? 1. Playwright browser is getting closed without the expect statement execution is finished. Expect only works if I have another locator present after the expect statement. 2. Even though videos are turned on, videos are not being recorded. Looking forward to hearing from you soon. I hope you continue helping the less minded like me as always :)
@@letcode Update on the issues: 1. expect wasn't working because I missed to add ''await" keyword before the expect statement, however, out of 116 expect statements, there's one which is not working and returning the following error: Error: expect: Property 'then' not found. 243 | 244 | await app.editProperties.save().click(); > 245 | await expect(util.controls.alert.success.message(), data.message.success.editProperties); | ^ 246 | await util.controls.alert.success.closeBtn().click() 247 | }); 248 | at C:\Playwright_Automation\Playwright_Automation\tests\app\poc-smoke-test-suite.test.ts:245:21 Here, message: () => this.page.locator('.alert-success message-content'), writing await expect(await util.controls.alert.success.message(), data.message.success.editProperties); is also throwing the same error. Have you ever come across such issue? I am using the same expect statement in the same test file for different messages like 20+ times, but its failing only for this one. =====================================NOTE: Temporary Fix======================================== The error does not persists if I rewrite the same expect statement as following: expect(await util.controls.alert.success.message(), data.message.success.editProperties); ============================================================================================== 2. Video not being recorded: I searched online and I found that there's a closed issue [github.com/playwright-community/jest-playwright/issues/708]. There's a solution to create a super teardown method , but I don't know where to place it. :/
I am writing test cases electron app but I am a stuck little bit and the document is not clear for the electron and is very thankful to you if can make a video for the electron app.
I have four test suites to execute in parallel like account.test.js, post.test.js, action.test.js, and invite.test.js but the problem is while I am executing the last test suite the browser is getting close without executing the last test suite. please tell me what could be the reason?
@@letcode yes, I got the details of 3 test suites out of 4 because the 4th test suite is closed unexpectedly when the test cases are running. Below is the code that I had done already to achieve the parallel execution This is the jest.config.js file preset: "jest-puppeteer", testMatch: [ "/tests/paralleltest/**.test.js", ], This is the jest-puppeteer.config.js file module.exports = { launch: { headless: false, exitOnPageError: true, args: ['--no-sandbox','--disable-notifications','--start-maximized','--force-device-scale-factor=1.0'], defaultViewport: null,
},
browserContext: "incognito", }; This is the folder structure for parallel execution test/paralleltest/account.test.js,invite.test.js,action.test.js This is the script for parallel execution "parallel_testing":" jest ",
Hi Koushik, I am trying to execute single testcase with title and tried using 'jest -t '@Reg' but it gave Reference error .Similar functionality exists in Playwright - npx playwright test --grep @Reg . Can you suggest if there is a way to do this in Playwright Jest. Thank you.
jest -t name-of-spec this is command, not sure y u r getting error. I'll recommend to switch to playwright test runner, it's awesome. More control over jest.
Am trying Playwright test runner as well. But how can I pass 'TestInfo' to a page so that i can attach screenshot or use that in report . Any example can you please give me.
I am using jest with puppeteer and I want to run 2 tests in parallel, meaning that I want 2 headless chrome instances to be opened and running at the same. The problem is that only one browser does the test and the other one doesn't. I am trying to configure the browser setUp, but still haven't figure it out. Do you have any ideas? Thank you!!
Good one brother.. can you pls make a video to understand the utility class that has all common functions like click, all types of waits, set or fill etc.,, And also how to maintain test blocks inSide describe in bigger projects, and read data from Excel for execution.
Hi Sir, I have a doubt in sequential run.If suppose we have create.js, delete.js,update.js,in this case delete will execute before updatw.so do we have to name to js file in ascending order? Or do we have priority in testng ??thanks for ur video Sir
@@letcode not working sequentially here 002.e2e-spec.ts file execute 1st could you pls help? "testMatch": ["/A320_FOR_IT/001.e2e-spec.ts","/A320_FOR_IT/002.e2e-spec.ts"],
sir, can I do like I have 4 different users and I have one test script for e.g login.test.js and I want to run parallel for all 4 users. can I do this?
Hi When i am running the tests it is giving error as
No tests found, exiting with code 1
Run with `--passWithNoTests` to exit with code 0
In D:\Violet\playwrite\poc
9 files checked.
testMatch: rootDir/test/bulkedit/**.ts - 0 matches
Hi bro.
Test match pattern might be wrong.
Check the file path.
How can we execute the same test on chromium and firefox concurrently with jest...? Just by mentioning the browsers in the config is executing it sequentially.-> browsers: ["chromium","firefox"]
You can use the worker option for that.
Great stuff, I extended my jest to use projects so I can configure unit/functional and e2e, but still use the initial jest config as well. Very useful information.
hey Feral Goose can you tell me what changes did you make to run the test cases in parallel because according to the tutorial I have followed the same steps but it's not executing all test suites unexpectedly closing the browser
i had a 5 test case scenario in the test/pageobjects then i wish to run only two how counld i do it...you told jest -i is sequencial right..but i need to specfic the file name like test/PageObjects/scenario_001.ts and test/PageObjects/scenario_004.ts only i want to run means like pom.xml we can do it in the test ng like that here we can specify the two path with comman sperator is it right.
Yeah with in the testmatch we can mention n number of files with comma separated..
how to make sure that 2 specific files(x.test.ts & y.test.ts) never run together parallelly in playwright?
Good question, but i don't have answer now 😞.
I'll check.
projects: [
{
testMatch: [/.*smoke.spec.ts/]
},
You can use like this, with in test match you can specific those 2 tests
I have not integrated my Playwright to Jest. I am using just factory default Playwright.
In my test folder I have two test files namely:
1. file1.test.ts
2. file2.test.ts
When I am running in Parallel mode by settings workers = 2 in playwright.config.ts, its running the test case of the single file in different browser instances due to which my test case is failing as the first test case was to login and second is to perform the required action.
Can you please suggest how can I overcome this issue?
You have to use the serial mode.
Pls refer to this video
ruclips.net/video/q8oZD5uO6_s/видео.html
@@letcode Thanks a lot, this worked.
I have two new queries, could you please help?
1. Playwright browser is getting closed without the expect statement execution is finished. Expect only works if I have another locator present after the expect statement.
2. Even though videos are turned on, videos are not being recorded.
Looking forward to hearing from you soon.
I hope you continue helping the less minded like me as always :)
@@letcode
Update on the issues:
1. expect wasn't working because I missed to add ''await" keyword before the expect statement, however, out of 116 expect statements, there's one which is not working and returning the following error:
Error: expect: Property 'then' not found.
243 |
244 | await app.editProperties.save().click();
> 245 | await expect(util.controls.alert.success.message(), data.message.success.editProperties);
| ^
246 | await util.controls.alert.success.closeBtn().click()
247 | });
248 |
at C:\Playwright_Automation\Playwright_Automation\tests\app\poc-smoke-test-suite.test.ts:245:21
Here,
message: () => this.page.locator('.alert-success message-content'),
writing await expect(await util.controls.alert.success.message(), data.message.success.editProperties);
is also throwing the same error.
Have you ever come across such issue?
I am using the same expect statement in the same test file for different messages like 20+ times, but its failing only for this one.
=====================================NOTE: Temporary Fix========================================
The error does not persists if I rewrite the same expect statement as following:
expect(await util.controls.alert.success.message(), data.message.success.editProperties);
==============================================================================================
2. Video not being recorded: I searched online and I found that there's a closed issue [github.com/playwright-community/jest-playwright/issues/708]. There's a solution to create a super teardown method , but I don't know where to place it. :/
I have covered all those on the playwright playlist, pls go through that.
do you have any video for electron app with playwright testt
Not yet 😕
@@letcode can you create a video for that
@@BobbyKumar-mb4hd if I get any good sample application then definitely i can.
I am writing test cases electron app but I am a stuck little bit and the document is not clear for the electron and is very thankful to you if can make a video for the electron app.
@@letcode can we use the code gen in playwright application
I have four test suites to execute in parallel like account.test.js, post.test.js, action.test.js, and invite.test.js but the problem is while I am executing the last test suite the browser is getting close without executing the last test suite. please tell me what could be the reason?
Did u check report, anything suspicious?
@@letcode yes, I got the details of 3 test suites out of 4 because the 4th test suite is closed unexpectedly when the test cases are running.
Below is the code that I had done already to achieve the parallel execution
This is the jest.config.js file
preset: "jest-puppeteer",
testMatch: [
"/tests/paralleltest/**.test.js",
],
This is the jest-puppeteer.config.js file
module.exports = {
launch: {
headless: false,
exitOnPageError: true,
args: ['--no-sandbox','--disable-notifications','--start-maximized','--force-device-scale-factor=1.0'],
defaultViewport: null,
},
browserContext: "incognito",
};
This is the folder structure for parallel execution
test/paralleltest/account.test.js,invite.test.js,action.test.js
This is the script for parallel execution
"parallel_testing":" jest ",
Hi Koushik, I am trying to execute single testcase with title and tried using 'jest -t '@Reg' but it gave Reference error .Similar functionality exists in Playwright - npx playwright test --grep @Reg . Can you suggest if there is a way to do this in Playwright Jest.
Thank you.
jest -t name-of-spec this is command, not sure y u r getting error.
I'll recommend to switch to playwright test runner, it's awesome.
More control over jest.
Am trying Playwright test runner as well. But how can I pass 'TestInfo' to a page so that i can attach screenshot or use that in report . Any example can you please give me.
That's a new feature, i will create a video.
Thank you .If you could do it little faster Would be really helpful
Can we able to able to control the parallel execution threads. like i need to run only 3 test case parallel ?
Yes we can, we have to use the -worker=3
@@letcode - this keyword works in Jest or only in playwright runner ?
Workers is for playwright test runner.
I am using jest with puppeteer and I want to run 2 tests in parallel, meaning that I want 2 headless chrome instances to be opened and running at the same. The problem is that only one browser does the test and the other one doesn't. I am trying to configure the browser setUp, but still haven't figure it out. Do you have any ideas? Thank you!!
I have used playwright in this video, but set up is almost same. Did u tried as per the video ?
@@letcode I managed to do it, it wasn't simple, but I did it haha. Thank you so much!!
Great 😊
Good one brother.. can you pls make a video to understand the utility class that has all common functions like click, all types of waits, set or fill etc.,, And also how to maintain test blocks inSide describe in bigger projects, and read data from Excel for execution.
Sure bro.
So far we have used only the POM, in upcoming videos we'll implement common functions.
Hi Sir, I have a doubt in sequential run.If suppose we have create.js, delete.js,update.js,in this case delete will execute before updatw.so do we have to name to js file in ascending order? Or do we have priority in testng ??thanks for ur video Sir
Good question, testmatch accept string array. So you can specify based on the file name sequence. It will run in the sequence as we declared.
@@letcode not working sequentially here 002.e2e-spec.ts file execute 1st could you pls help? "testMatch": ["/A320_FOR_IT/001.e2e-spec.ts","/A320_FOR_IT/002.e2e-spec.ts"],
sir, can I do like I have 4 different users and I have one test script for e.g login.test.js
and I want to run parallel for all 4 users. can I do this?
Yes, we can do. To achieve that we have to use the worker concept.
Is it possible to run test cases in alphabetical order?
testmatch accept string array. So you can specify based on the file name sequence. It will run in the sequence as we declared.
Great tutorial
❤️
Waiting for pom video bro