-
-
Notifications
You must be signed in to change notification settings - Fork 339
Expand file tree
/
Copy pathsendMousePlugin.test.ts
More file actions
86 lines (80 loc) · 2.59 KB
/
Copy pathsendMousePlugin.test.ts
File metadata and controls
86 lines (80 loc) · 2.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
import { describe, it, before, after } from 'node:test';
import path from 'path';
import selenium from 'selenium-standalone';
import { runTests } from '@web/test-runner-core/test-helpers';
import { chromeLauncher } from '@web/test-runner-chrome';
import { webdriverLauncher } from '@web/test-runner-webdriver';
import { playwrightLauncher } from '@web/test-runner-playwright';
import { sendMousePlugin } from '../../dist/sendMousePlugin.js';
import { startSeleniumServer } from '../selenium-server.ts';
describe('sendMousePlugin', { timeout: 50000 }, () => {
it('can send mouse on puppeteer', async () => {
await runTests({
files: [path.join(import.meta.dirname, 'browser-test.js')],
browsers: [chromeLauncher()],
plugins: [sendMousePlugin()],
});
});
it('can send mouse on playwright', async () => {
await runTests({
files: [path.join(import.meta.dirname, 'browser-test.js')],
browsers: [
playwrightLauncher({ product: 'chromium' }),
playwrightLauncher({ product: 'firefox' }),
playwrightLauncher({ product: 'webkit' }),
],
plugins: [sendMousePlugin()],
});
});
/**
* Temporarily disabled until webdriver selenium-standalone issues are fixed
* https://github.com/webdriverio/selenium-standalone/issues/788
*/
describe.skip('webdriver', () => {
let seleniumServer!: selenium.ChildProcess;
before(async () => {
seleniumServer = await startSeleniumServer({
chrome: { version: 'latest' },
firefox: { version: 'latest' },
});
});
after(() => {
if (seleniumServer) {
seleniumServer.kill();
}
});
it('can send mouse on webdriver', async () => {
await runTests({
files: [path.join(import.meta.dirname, 'browser-test.js')],
concurrency: 1,
browsers: [
webdriverLauncher({
automationProtocol: 'webdriver',
hostname: 'localhost',
port: 4444,
path: '/wd/hub/',
capabilities: {
browserName: 'chrome',
'goog:chromeOptions': {
args: ['--no-sandbox', '--headless'],
},
},
}),
webdriverLauncher({
automationProtocol: 'webdriver',
hostname: 'localhost',
port: 4444,
path: '/wd/hub/',
capabilities: {
browserName: 'firefox',
'moz:firefoxOptions': {
args: ['-headless'],
},
},
}),
],
plugins: [sendMousePlugin()],
});
});
});
});