Skip to content

Commit

Permalink
fix: print warning only when function is not defined
Browse files Browse the repository at this point in the history
  • Loading branch information
hassy committed May 28, 2024
1 parent 3433c7e commit 2af901e
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions packages/artillery-engine-playwright/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ class PlaywrightEngine {
this.tracing = global.artillery.OTEL_TRACING_ENABLED || false;

this.defaultNavigationTimeout =
(isNaN(Number(this.config.defaultNavigationTimeout)) ? 30 : Number(this.config.defaultNavigationTimeout))
* 1000
;
(isNaN(Number(this.config.defaultNavigationTimeout))
? 30
: Number(this.config.defaultNavigationTimeout)) * 1000;
this.defaultTimeout =
(isNaN(Number(this.config.defaultTimeout)) ? 30 : Number(this.config.defaultTimeout))
* 1000
;
(isNaN(Number(this.config.defaultTimeout))
? 30
: Number(this.config.defaultTimeout)) * 1000;

this.testIdAttribute = this.config.testIdAttribute;

Expand Down Expand Up @@ -353,8 +353,9 @@ class PlaywrightEngine {
self.processor[spec.testFunction] ||
self.processor[spec.flowFunction];

console.error('Playwright test function not found:', fn);
if (!fn) {
console.error('Playwright test function not found:', fn);

return cb(
new Error('Playwright test function not found'),
initialContext
Expand Down

0 comments on commit 2af901e

Please sign in to comment.