feat(electron): add a test for clipboard access (#2606)

This commit is contained in:
Pavel Feldman 2020-06-17 14:16:17 -07:00 committed by GitHub
parent 4834e5653d
commit cc84506cbb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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() {