From cc84506cbb0f0cec660f4d27de9ea2ff0c9d7744 Mon Sep 17 00:00:00 2001 From: Pavel Feldman Date: Wed, 17 Jun 2020 14:16:17 -0700 Subject: [PATCH] feat(electron): add a test for clipboard access (#2606) --- test/electron/electron.spec.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/electron/electron.spec.js b/test/electron/electron.spec.js index 2daa01a3e1..b5fe8fe136 100644 --- a/test/electron/electron.spec.js +++ b/test/electron/electron.spec.js @@ -108,6 +108,12 @@ describe('Electron', function() { const window = await application.firstWindow(); expect(await window.title()).toBe('Hello World!'); }); + it('should have a clipboard instance', async ({ application }) => { + const clipboardContentToWrite = 'Hello from Playwright'; + await application.evaluate(async ({clipboard}, text) => clipboard.writeText(text), clipboardContentToWrite); + const clipboardContentRead = await application.evaluate(async ({clipboard}) => clipboard.readText()); + await expect(clipboardContentRead).toEqual(clipboardContentToWrite); + }); }); describe('Electron per window', function() {