Skip to content

Commit ac35af1

Browse files
feat(playwright): use target as baseURL by default
1 parent 0d740cb commit ac35af1

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

packages/artillery-engine-playwright/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,10 @@ class PlaywrightEngine {
7676
}
7777
}
7878

79-
const contextOptions = self.contextOptions || {};
79+
const contextOptions = {
80+
baseURL: self.target,
81+
...self.contextOptions
82+
}
8083

8184
let browser;
8285
if (self.useSeparateBrowserPerVU) {

packages/types/schema/config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ const ConfigSchemaWithoutEnvironments = Joi.object({
8484
target: Joi.string()
8585
.meta({ title: 'Target' })
8686
.description(
87-
'Endpoint of the system under test, such as a hostname, IP address or a URI.\nhttps://www.artillery.io/docs/reference/test-script#target---target-service'
87+
'Endpoint of the system under test, such as a hostname, IP address or a URI.\nIn Playwright tests, this will be used as the baseURL by default.\n\nhttps://www.artillery.io/docs/reference/test-script#target---target-service'
8888
)
8989
.example('https://example.com')
9090
.example('ws://127.0.0.1'),

0 commit comments

Comments
 (0)