Playwright Project
A Playwright project requires a configuration. The configuration contains a list of browsers and image versions.
The list of browsers be supplied in a file named playwright.config.js which must be located in the root folder. In this case, the image versions are supplied separately and apply to all browsers.
projects: [
{
name: 'browser name'
},
...
,
{
name: 'browser name'
}
]
If the playwright.config.js file is not supplied, this information must be supplied with the Image Versions.
Image Versions
The image versions must be provided. You can do this in one of these ways:
-
conf parameter as a JSON string to the POST request.
-
File named digitalai.json with the required configuration in the root directory of the project.
If you use both options, the conf parameter is used**.**
Conf Parameter
Name | Type | Mandatory | Description |
---|---|---|---|
browsers | List | Yes | A list of browser names and playwright versions to run the project on. If playwright.config.js is not used, this is the format: { "browser": "browser name" "imageVersion": "playwright image version" } When playwright.config.js is used, this is the format: { "imageVersion": "playwright image version" } Supported browsers are Chromium, Firefox, and Webkit. |
digitalai.json
{
"browsers": [{
"browser": "chromium",
"imageVersion": "1.28.0"
},
{
"browser": "firefox",
"imageVersion": "1.28.1"
},
{
"browser": "webkit",
"imageVersion": "1.28.1"
}
]
}
{
"browsers": [{
"imageVersion": "1.28.0"
},
{
"imageVersion": "1.28.1"
}
]
}
NPM Dependencies
A Playwright project can contain a package.json file where you can add your NPM dependencies. To run a Playwright project with external NPM packages:
-
Add the required packages to the project's package.json file.
-
Add package.json to the project zip.
-
Make sure the file is located in the root folder of the project.