Browse Source

fix(test): Added clipboard support playwright

pull/4386/head
Muhammed Mustafa 2 years ago
parent
commit
d91ee4ceb2
  1. 4
      tests/playwright/pages/Base.ts
  2. 4
      tests/playwright/playwright.config.ts

4
tests/playwright/pages/Base.ts

@ -78,4 +78,8 @@ export default abstract class BasePage {
});
return data as any;
}
async getClipboardText() {
return await this.rootPage.evaluate(() => navigator.clipboard.readText());
}
}

4
tests/playwright/playwright.config.ts

@ -48,6 +48,10 @@ const config: PlaywrightTestConfig = {
name: 'chromium',
use: {
...devices['Desktop Chrome'],
contextOptions: {
// chromium-specific permissions
permissions: ['clipboard-read', 'clipboard-write'],
},
},
},

Loading…
Cancel
Save