diff --git a/packages/playwright-core/src/server/dom.ts b/packages/playwright-core/src/server/dom.ts index 51b34dba8a..b1babf7a5c 100644 --- a/packages/playwright-core/src/server/dom.ts +++ b/packages/playwright-core/src/server/dom.ts @@ -937,8 +937,8 @@ function compensateHalfIntegerRoundingError(point: types.Point) { export type SchedulableTask = (injectedScript: js.JSHandle) => Promise>>; function joinWithAnd(strings: string[]): string { - if (strings.length < 1) - return strings.join(', '); + if (strings.length <= 1) + return strings.join(''); return strings.slice(0, strings.length - 1).join(', ') + ' and ' + strings[strings.length - 1]; }