Playwright configuration file (jpc_playwright.config.ts)
- Organization of this page
Format
import { defineConfig, devices } from '../lib/playwright/node_modules/@playwright/test';
export default defineConfig({
name: 'test_1',
testDir: '../lib/playwright/tests',
fullyParallel: false,
:
(Abbreviated)
:
use: {
deviceScaleFactor: 1,
acceptDownloads: false,
ignoreHTTPSErrors: false,
:
(Abbreviated)
:
},
projects: [
{
name: 'project_1',
testMatch: /.*/,
use: {
trace: {
mode: 'on',
attachments: false,
screenshots: true,
snapshots: false,
sources: false,
},
},
},
],
});
File
jpc_playwright.config.ts
jpc_playwright.config.ts.model (model file)
Storage directory
- ■Integrated agent host
-
In Windows:
-
For a physical host (definition files and model files)
Agent-path\conf\
-
For a logical host (definition file)
shared-folder\jp1ima\conf\
-
Description
This is a configuration file that defines the operation of Playwright.
Character code
UTF-8 (without BOM)
Line feed code
CR+LF
When the definitions are applied
When Web scenarios are executed by the Web exporter, they are reflected in Playwright operation.
Information that is specified
|
Item |
Description |
Changeability |
What You Setup in Your JP1/IM - Agent |
JP1/IM - Agent Defaults Value |
|||
|---|---|---|---|---|---|---|---|
|
name |
Specifies the name of the entire test. The specified name is stored in the trace file path name. If you specify both this parameter-name of globals-and projects, name in projects takes precedence. If you omit both this parameter (global name) and the name in projects, it is an anonymous test and the name of the test is not used in the trace file path name. Notes: Name in projects are parameters that specify the names of the individual tests. |
Y |
Specifies the name of the entire test. Specify so that the number of characters in the folder name where the trace file is stored is 255 full-pitch or half-pitch characters or less. One full-pitch character and one half-pitch character are calculated respectively. |
test_1 |
|||
|
testDir |
Specify the folder to call the test file. |
N |
-- |
testDir |
|||
|
fullyParallel |
You can configure entire test run to concurrently execute all tests in all files using this option. |
N |
-- |
false |
|||
|
globalTimeout |
Maximum time in milliseconds the whole test suite can run. Zero timeout (default) disables this behavior. |
N |
-- |
0 |
|||
|
ignoreSnapshots |
Whether to skip snapshot expectations. |
N |
-- |
true |
|||
|
maxFailures |
The maximum number of test failures for the whole test suite run. After reaching this number, testing will stop and exit with an error. While retries specifies the maximum number of retries for each test, maxFailure specifies the total number of failures overall. Setting to zero (default) disables this behavior. |
Y |
Specify the maximum number of failed tests in the range 0 to 2. |
0 |
|||
|
preserveOutput |
Specify whether to save the test product. |
N |
-- |
always |
|||
|
quiet |
Whether to suppress stdio and stderr output from the tests. |
N |
-- |
false |
|||
|
repeatEach |
The number of times to repeat each test, useful for debugging flaky tests. |
N |
-- |
1 |
|||
|
retries |
The maximum number of retry attempts given to failed tests. If this parameter is specified, the test will be retried even if the test fails, until it succeeds or the specified maximum number of times is reached. |
Y |
Specify the maximum number of retries in the range of 0 to 2 when each test fails. |
0 |
|||
|
timeout |
Timeout for each test in milliseconds Test functions, fixtures, and beforeEach and afterEach hooks are included in the timeout period. This is a base timeout for all tests. In addition, each test can configure its own timeout with test.setTimeout(). |
N |
-- |
0 |
|||
|
updateSnapshots |
Whether to update expected snapshots with the actual results produced by the test run. |
N |
-- |
none |
|||
|
workers |
The maximum number of concurrent worker processes to use for parallelizing tests. Can also be set as percentage of logical CPU cores, e.g. '50%'. |
N |
-- |
1 |
|||
|
use |
Global options for all tests. |
Y |
-- |
-- |
|||
|
deviceScaleFactor |
Specify device scale factor (can be thought of as dpr). Defaults to 1. |
N |
-- |
1 |
|||
|
viewport |
Emulates consistent viewport for each page. |
N |
-- |
-- |
|||
|
width |
Page width in pixels. |
N |
-- |
1280 |
|||
|
height |
Page height in pixels. |
N |
-- |
720 |
|||
|
acceptDownloads |
Whether to automatically download all the attachments. |
N |
-- |
false |
|||
|
ignoreHTTPSErrors |
Whether to ignore HTTPS errors when sending network requests. |
Y |
You can specify one of the following:
|
false |
|||
|
javaScriptEnabled |
Whether or not to enable JavaScript in the context. |
Y |
You can specify one of the following:
|
true |
|||
|
launchOptions |
Options used to launch the browser, as passed to browserType.launch(). Specific options testOptions.headless and testOptions.channel take priority over this. |
Y |
-- |
-- |
|||
|
proxy |
Used when browserName is chromium and the use.proxy parameter is specified. |
Y |
-- |
-- |
|||
|
server |
Specify any single-byte alphanumeric characters. For Web scenario runs by proxy, if browserName is chromium, you must configure the global proxy once when you run browserType.launch() and override it with use.proxy when running Web scenario. |
Y |
Specify any single-byte alphanumeric characters. |
-- |
|||
|
proxy |
Network proxy settings. If browserName is chromium and using this parameter, specify proxy.server of launchOptions. |
Y |
-- |
-- |
|||
|
server |
Proxy to be used for all requests. Proxy to be used for all requests. HTTP and SOCKS proxies are supported, for example http-or-socks://myproxy.com:port-number. While HTTP server operates at the application layer, SOCKS server relays communications by TCP or UDP lower than HTTP. There is no limit to the higher-layer protocols that communicate using TCP/UDP, and they can be used more generally than HTTP proxies. If HTTP or SOCKS is omitted, it is treated as an HTTP. |
Y |
Specifies the proxy used for requests in alphanumeric characters up to 253 characters for the entire domain. |
-- |
|||
|
bypass |
Optional comma-separated domains to bypass proxy. |
Y |
Specifies the domain for proxy bypass using up to 253 half-width alphanumeric characters. Specify a comma-separated range, such as "localhost", ". com", or ". domain.com". |
-- |
|||
|
username |
Optional username to use if HTTP proxy requires authentication. |
Y |
Specifies the username to be used when requesting authentication of HTTP proxy. It can be up to 255 characters. |
-- |
|||
|
password |
Optional password to use if HTTP proxy requires authentication. |
Y |
Specifies the password to be used when requesting authentication of HTTP proxy. The password can be up to 255 characters. |
-- |
|||
|
screenshot |
Whether to automatically capture a screenshot after each test. 'off': Do not capture screenshots. 'on': Capture screenshot after each test. 'only-on-failure': Capture screenshot after each test failure. |
Y |
You can specify one of the following:
|
off |
|||
|
serviceWorkers |
Whether to allow sites to register Service workers. |
N |
-- |
allow |
|||
|
trace |
Whether to record trace for each test. The trace contents can also be checked in the trace viewer. For each attachment, screenshot, snapshot, or source file item, you can turn output on or off for the output setting of the trace. This parameter configures the trace-output settings for all Web scenarios. However, for Web scenarios in which individual values are specified in trace in projects parameters, tracing is performed based on the settings. Therefore, if you want to change the trace output setting related to the Web scenario specified in testMatch in the projects parameter, you must edit trace in the same projects parameter. Initially, all Web scenarios are set to be included in project_1. Also note that if you run the "log in" Web scenario, the password is printed in clear text in the trace file. Even if the trace file is output in resource folder, it can be turned off by snapshots setting. However, since files outside resource folder are output regardless of trace setting, you need to manage them yourself. |
Y |
-- |
-- |
|||
|
mode |
Specify whether traces are logged for each test run. |
Y |
You can specify one of the following:
|
on |
|||
|
attachments |
Whether to include test attachments. |
N |
-- |
false |
|||
|
screenshots |
Whether to capture screenshots during tracing. |
Y |
You can specify one of the following:
|
true |
|||
|
snapshots |
Whether to capture snapshot on every action. |
Y |
You can specify one of the following:
|
false |
|||
|
sources |
Whether to include source files for trace actions. |
Y |
You can specify one of the following:
|
false |
|||
|
video |
Whether to record video for each test. |
N |
-- |
off |
|||
|
actionTimeout |
Default timeout for each Playwright action in milliseconds, defaults to 0 (no timeout). |
N |
-- |
0 |
|||
|
browserName |
Name of the browser that runs tests. |
N |
-- |
chromium |
|||
|
bypassCSP |
Toggles bypassing page's Content-Security-Policy. |
N |
-- |
false |
|||
|
channel |
Browser distribution channel. |
R |
You can specify one of the following:
|
chrome |
|||
|
headless |
Whether to run browser in headless mode. |
Y |
The default is true. Specify false only if you are using client authentication. |
true |
|||
|
testIdAttribute |
Custom attribute to be used in page.getByTestId(). |
N |
-- |
data-testid |
|||
|
projects |
This parameter allows you to test multiple projects at the same time. Use this parameter if you want to make different settings for each test. |
Y |
-- |
-- |
|||
|
name |
Specify the test name. The specified name is stored in the trace file path name. Specify this parameter if you want each test to have a unique name. If you specify both this parameter (name in projects) and name of globals, it is overridden by name parameter in projects. If you omit both this parameter (name in projects) and the global name, it is an anonymous test and the name of the test is not used in the trace file path name. Notes: Name of globals is a parameterthat specifies the name to be used for all tests. |
Y |
Specify a name to identify each test. Specify so that the number of characters in the folder name where the trace file is stored is 255 full-pitch or half-pitch characters or less. One full-pitch character and one half-pitch character are calculated respectively. |
project_1 |
|||
|
testMatch |
Specify a string and a regular expression for the file to be executed in the test file. The settings you make in projects apply only to Web scenario file that you specify in testMatch parameter. |
Y |
Specify Web scenario file for which you want to run the tests according to the settings that you specified in projects. When specifying a character string, specify it with up to 255 double-byte or single-byte alphanumeric characters. You must specify only the filename without including the filepath. |
/.*/ |
|||
|
use |
You can handle the same settings as use parameters at the top level. Use of globals is the setting for all tests, whereas use in projects can be set separately for each test. |
Y |
-- |
-- |
|||
|
trace |
Specify whether traces are logged for each test run. The trace contents can also be checked in the trace viewer. For each attachment, screenshot, snapshot, or source file item, you can turn output on or off for the output setting of the trace. This parameter sets the tracing for Web scenario specified in testMatch. Initially, all Web scenarios are set to be included in project_1, so if testMatch is default state and you want change the trace output setting, you should change this parameter. Also note that if you run the "log in" Web scenario, the password is printed in clear text in the trace file. Even if the trace file is output in resource folder, it can be turned off by snapshots setting. However, since files outside resource folder are output regardless of trace setting, you need to manage them yourself. |
Y |
-- |
-- |
|||
|
mode |
Specify whether traces are logged for each test run. |
Y |
You can specify one of the following:
Record only at first run of each test and do not record retries. |
on |
|||
|
attachments |
Specify whether the attachment file is included in the trace log. |
N |
-- |
false |
|||
|
screenshots |
Specify whether screenshots are included in the trace log. |
Y |
You can specify one of the following:
Do not output screenshots. |
true |
|||
|
snapshots |
Specify whether the snapshot is included in the trace log. |
Y |
You can specify one of the following:
Do not output snapshots. |
false |
|||
|
sources |
Specify whether to save Web scenario files used as traced log. |
Y |
You can specify one of the following:
Do not output Web scenario files. |
false |
|||
- Legend:
-
R: Required, Y: Changeable, N: Not changeable, --: Not applicable