Skip to content
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

[Bug]: Seems the command options of launchBrowser for Antroid testing does not work #34259

Open
PupilTong opened this issue Jan 9, 2025 · 1 comment · May be fixed by #34262
Open

[Bug]: Seems the command options of launchBrowser for Antroid testing does not work #34259

PupilTong opened this issue Jan 9, 2025 · 1 comment · May be fixed by #34262

Comments

@PupilTong
Copy link

PupilTong commented Jan 9, 2025

Version

main (source code)

Steps to reproduce

https://playwright.dev/docs/api/class-androiddevice#android-device-launch-browser-option-command

Based on my understanding, It's means we could override the internal pkg name by using this option.

However, based on my experiments:

test('androidDevice.launchBrowser', async function({ androidDevice }) {
  test.slow();
  const context = await androidDevice.launchBrowser({command: 'org.chromium.chrome'});
  const [page] = context.pages();
  await page.goto('data:text/html,<title>Hello world!</title>');
  expect(await page.title()).toBe('Hello world!');
  await context.close();
});

The command config doesn't work. It's not passed to the Android server impl.

In the packages/playwright-core/src/protocol/validator.ts, seems the command option is not a valid parameter for AndroidDeviceLaunchBrowserParams.

Also, I found that in the packages/playwright-core/src/server/dispatchers/androidDispatcher.ts, it's using the params.pkg rather command to get the Android pkg name to run.

Image

Expected behavior

I'm not sure if it's an expected behavior.

Actual behavior

It's always starting the chrome browser.

Additional context

No response

Environment

(Not related)
@Skn0tt
Copy link
Member

Skn0tt commented Jan 9, 2025

Looks like a docs issue to me. Let me take a look.

@Skn0tt Skn0tt linked a pull request Jan 9, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants