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

chore: expose adb devices and actions #4647

Merged
merged 1 commit into from
Dec 9, 2020

Conversation

pavelfeldman
Copy link
Member

@pavelfeldman pavelfeldman commented Dec 9, 2020

@pavelfeldman pavelfeldman force-pushed the android branch 6 times, most recently from f6aff88 to 7fe1027 Compare December 9, 2020 17:36
packages/playwright-android/install.js Outdated Show resolved Hide resolved
version: '0.0.2', // Manually manage playwright-android version.
description: 'A high-level API to automate Chrome for Android',
browsers: [],
files: [...PLAYWRIGHT_CORE_FILES, ...FFMPEG_FILES, 'android-types.d.ts', 'bin/android-driver.apk', 'bin/android-driver-target.apk'],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please take a look at npmignore file. I think we are either shipping apks to all packages, or ignoring them in playwright-android.

src/client/types.ts Outdated Show resolved Hide resolved
try {
socket = await this._backend.open(`localabstract:playwright_android_driver_socket`);
} catch (e) {
await new Promise(f => setTimeout(f, 100));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we'll need a timeout for this operation.

}
}

class AndroidBrowser extends EventEmitter {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall we mark this as implements Transport? IIUC, this serves as a transport for protocol connection?

const controller = new ProgressController();
await controller.run(async progress => {
await browser._defaultContext!._loadDefaultContext(progress);
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For proper timeout managing, you have to wrap everything in this method into controller.run and pass TimeoutSettings.timeout(options) to it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doing it in a follow up...

@@ -111,10 +113,11 @@ DEPS['src/server/common/'] = [];
DEPS['src/server/injected/'] = ['src/server/common/'];

// Electron and Clank use chromium internally.
DEPS['src/server/android/'] = [...DEPS['src/server/'], 'src/server/chromium/', 'src/protocol/transport.ts'];
DEPS['src/server/electron/'] = [...DEPS['src/server/'], 'src/server/chromium/'];
DEPS['src/server/clank/'] = [...DEPS['src/server/'], 'src/server/chromium/'];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Drop this line now?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing works w/o it!

@pavelfeldman pavelfeldman merged commit aacd8e6 into microsoft:master Dec 9, 2020
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 this pull request may close these issues.

2 participants