docs(android): android doc nits (#5924)

This commit is contained in:
Pavel Feldman 2021-03-24 04:20:41 +08:00 committed by GitHub
parent 8f1d03f846
commit f70eaf4ff3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 8 deletions

View File

@ -4,17 +4,17 @@
Playwright has **experimental** support for Android automation. You can access android namespace via: Playwright has **experimental** support for Android automation. You can access android namespace via:
```js ```js
const { _android } = require('playwright'); const { _android: android } = require('playwright');
``` ```
An example of the Android automation script would be: An example of the Android automation script would be:
```js ```js
const { _android } = require('playwright'); const { _android: android } = require('playwright');
(async () => { (async () => {
// Connect to the device. // Connect to the device.
const [device] = await playwright._android.devices(); const [device] = await android.devices();
console.log(`Model: ${device.model()}`); console.log(`Model: ${device.model()}`);
console.log(`Serial: ${device.serial()}`); console.log(`Serial: ${device.serial()}`);
// Take screenshot of the whole device. // Take screenshot of the whole device.
@ -35,7 +35,7 @@ const { _android } = require('playwright');
// Work with WebView's page as usual. // Work with WebView's page as usual.
const page = await webview.page(); const page = await webview.page();
await page.page.waitForNavigation({ url: /.*microsoft\/playwright.*/ }); await page.waitForNavigation({ url: /.*microsoft\/playwright.*/ });
console.log(await page.title()); console.log(await page.title());
} }

8
types/types.d.ts vendored
View File

@ -7329,17 +7329,17 @@ export {};
* Playwright has **experimental** support for Android automation. You can access android namespace via: * Playwright has **experimental** support for Android automation. You can access android namespace via:
* *
* ```js * ```js
* const { _android } = require('playwright'); * const { _android: android } = require('playwright');
* ``` * ```
* *
* An example of the Android automation script would be: * An example of the Android automation script would be:
* *
* ```js * ```js
* const { _android } = require('playwright'); * const { _android: android } = require('playwright');
* *
* (async () => { * (async () => {
* // Connect to the device. * // Connect to the device.
* const [device] = await playwright._android.devices(); * const [device] = await android.devices();
* console.log(`Model: ${device.model()}`); * console.log(`Model: ${device.model()}`);
* console.log(`Serial: ${device.serial()}`); * console.log(`Serial: ${device.serial()}`);
* // Take screenshot of the whole device. * // Take screenshot of the whole device.
@ -7360,7 +7360,7 @@ export {};
* *
* // Work with WebView's page as usual. * // Work with WebView's page as usual.
* const page = await webview.page(); * const page = await webview.page();
* await page.page.waitForNavigation({ url: /.*microsoft\/playwright.*\/ }); * await page.waitForNavigation({ url: /.*microsoft\/playwright.*\/ });
* console.log(await page.title()); * console.log(await page.title());
* } * }
* *