Skip to content

Commit

Permalink
Do not paste text on macOS in e2e tests
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 e2869c3 commit 8f7d281
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 8f7d281

Please sign in to comment.