-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature] Add BrowserType.connect support in @playwright/test #8379
Comments
You can override the browser fixture to connect via browserless, but we do not currently have simple way to configure a remote browser. |
Good to know, can you provide me an example? |
@JoelEinbinder @mxschmitt given the number of browser-hosting providers out there AND the number of teams migrating from selenium-based frameworks, I think this feature / functionality would be critical for widespread adoption of playwright-test. https://aerokube.com/moon/ |
@archlichking I used the following config without playwright-test: const pw = require('playwright');
|
Note: linking #8432 |
(archlichking the comment was deleted because it contained credentials) |
(@mxschmitt thanks for the check up). Here is the sanitized code import base, { chromium } from '@playwright/test';
// caps is copied from browserstack guide
const caps = {
browser: 'chrome',
os: 'osx',
os_version: 'catalina',
name: 'My first playwright test',
build: 'playwright-build-1',
'browserstack.username': process.env.BROWSERSTACK_USERNAME
'browserstack.accessKey': process.env.BROWSERSTACK_ACCESS_KEY,
'client.playwrightVersion': '1.13.1',
};
export const visitorTestFixture = base.extend<{}>({
browser: async ({ browser }, use, workerInfo) => {
const vBrowser = await chromium.connect({
wsEndpoint:
`wss://cdp.browserstack.com/playwright?caps=` +
`${encodeURIComponent(JSON.stringify(caps))}`,
});
await use(vBrowser);
await vBrowser.close();
},
}); |
@mxschmitt Any timelines on when this would be picked up? |
When I am using page fixture with browser into Moon
and have spec with test which runs one by one, |
Hasn’t this been solved already? If I understand the documentation there is a |
It's only possible if you override and extend the base class in a separate fixture. It becomes quite complicated when you have multiple setups using playwright test |
This is implemented now via For further questions please file new issues. |
I'm trying to follow up https://www.browserstack.com/docs/automate/playwright, is there a way to setup
wsEndpoint
as a configuration in config file or in fixtures?Edit: from the Playwright Team:
The text was updated successfully, but these errors were encountered: