Skip to content

Commit

Permalink
Do not paste text on macOS in e2e tests (#5044)
Browse files Browse the repository at this point in the history
Pasting text was introduced in f2365a5
and doesn't work on my macOS machine.

Reading through puppeteer/puppeteer#1313
tells me that other people also couldn't get pasting via Meta+V to work
on macOS with Puppeteer.

This commit adds an override for macOS while leaving the existing
`paste` function as is.
  • Loading branch information
mrnugget committed Aug 1, 2019
1 parent 354a8f2 commit 31f602e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions web/src/e2e/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ export class Driver {
}

public async enterText(method: EnterTextMethod = 'type', text: string): Promise<void> {
// Pasting does not work on macOS. See: https://github.com/GoogleChrome/puppeteer/issues/1313
method = os.platform() === 'darwin' ? 'type' : method
switch (method) {
case 'type':
await this.page.keyboard.type(text)
Expand Down

0 comments on commit 31f602e

Please sign in to comment.