Jest & Playwright Preset Configuration | Playwright - Part 18

preview_player
Показать описание
Very important concept! Please watchfully.
In this video. we are going to config the jest & playwright preset.
It will help us to integrate the report and parallel execution.

Source code:

Chapters:
0:00 Jest config
2:00 Setting up files
6:00 Removing browser context
11:00 Wait for navigation
13:00 Recap
--------------------------------SOCIAL--------------------------------

Join our WhatsApp group.

#letcode #playwright
Рекомендации по теме
Комментарии
Автор

Hi Kaushik it solved by Updating Dependencies in Package.json like "devDependencies": {
"jest": "^27.5.1",
"jest-playwright-preset": "^1.7.0",
"playwright": "^1.19.2",
"ts-jest": "^27.1.3",
"typescript": "^4.6.2"
}, This will help others also if they face same issue.. Thanks Kaushik for this series.

pravinjadhav
Автор

Hi Koushik, i got error could you please help me.
my error is

Invalid transformer module:
specified in the "transform"object of jest configuration.
must export a 'process' or 'process Async ' or Code transformer function.
at async Promise.all (index 0)

saipitchuka
Автор

how to mock es6 modules with jest-playwright-preset?

ManishSingh-dfgi
Автор

Thank you Kaushik, This is a great channel! I only caught sight of you folks in recent times, but it’s now among my favourite channels.

kullemadhuri
Автор

Nice video!!

Question: Can we alter the jest-playwright.config.js file at runtime? Specifically altering the browsers under test. This would be required/useful when running in CI. Deciding to run on one two or three browsers

Thanks again

bthompz
Автор

@Letcode with koushik

Can we passed browser in terminal for run jest test?

jayeshpatel
Автор

Hi Koushik, very nice videos. I have a jest-playwright-config.js file as below. I'm specifying the recordVideo section in the file but its not recording any videos. I have double checked the path and it is correct, but don't know why its not working, any inputs?

module.exports = {
browsers: ["chromium"],
contextOptions: {
viewport: null,
acceptDownloads: true,
recordVideo: {dir: "./videos"
}
},
exitOnPageError: false,
launchOptions: {
args:["--start-maximized"],
headless: false,
slowMo: 100
}
}

ankittvaish
Автор

Hi Koushik, Thanks for the video! it's very much helpful. I am having "TypeError: Jest: a transform must export something." Can you please help? package.json {
"name": "careteamautomation",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "jest"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"jest": "^26.6.3",
"jest-playwright-preset": "^1.4.5",
"playwright": "^1.8.0",
"ts-jest": "^26.5.5",
"typescript": "^4.1.3"
},
"testTimeout": 120000
}

PremaCS
Автор

Hi Kaushik need your help to take screenshot on failure with same project. Any link for this ?

pravinjadhav
Автор

I am using Jest -Playwright but it is getting error tobeVisible. How can I fix this thing?
The error is "any
Property 'toBeVisible' does not exist on type 'JestMatchers<string>'"

nomanshahid
Автор

Hi Koushik, Can you please let us know how to recordVideo using jest-playwrightConfig?
Actually I have used below lines in jest-playwrightConfig file but folder is not created.

contextOptions: {
recordVideo: {
dir: "./videos/"
}
}

Kindly help me with an answer

rakeshbadanala
Автор

Hi Koushik

specified in the "transform" object of Jest configuration
must export a `process` or `processAsync` or `createTransformer` function.

Getting this error after doing the changes as explained in this Video

presithprakash
Автор

Hi Koushik,
I Am getting syntax error like
SyntaxError: Missing semicolon. (9:14)

7 | describe("TC001", ()=>{
8 |
> 9 | let header:Headerpage;
| ^
10 | let login: Loginpage;
11 | let common: Commonfunc;
12 |


You have any idea??

supriyareddy
Автор

Hi Koushik, I tried this one.. but I am not able to run this program, I am getting error as timeout -Async callback was not invoked within the 15000 ms timeout specified by jest.settimeout.timeout - Async callback was not invoked within the 15000 ms timeout specified by jest.settimeout.error.
I tried to increase the timeout.. still didn't work.. so could you please help me in this..

letscode