Closed SirCameron closed 3 years ago
Hi, the playwright-android package is deprecated, see here for an up-to-date example: https://playwright.dev/docs/api/class-android
thanks @mxschmitt . I tried it using the android class from the playwright package and it simply hangs... no error, nothing.
Running the webview example on the page you provided, it never logs out the page title. simply hangs on webview.page()
.
where does it hang? Could you try setting the following environment variable, this should give you more debug logs: DEBUG=pw:android
Thanks, as I've said "simply hangs on webview.page()
". Until it finally times out.
I have been running it with the DEBUG=pw:android
env variabled, but it hasn't given me anything valuable.
this is the output:
yarn run v1.22.10
$ DEBUG=pw:android jest
console.log
Model: AOSP on IA Emulator
at src/e2e/android.test.ts:73:17
console.log
Serial: emulator-5554
at src/e2e/android.test.ts:74:17
pw:android Stopping the old driver +0ms
pw:android Uninstalling the old driver +0ms
pw:android Installing the new driver +0ms
pw:android Opening install socket +0ms
pw:android Writing driver bytes: 587818 +0ms
pw:android Written driver bytes: Success
pw:android +0ms
pw:android Opening install socket +0ms
pw:android Writing driver bytes: 770013 +0ms
pw:android Written driver bytes: Success
pw:android +0ms
pw:android Starting the new driver +0ms
pw:android Polling the socket localabstract:playwright_android_driver_socket +0ms
pw:android Connected to localabstract:playwright_android_driver_socket +0ms
pw:android Polling the socket localabstract:webview_devtools_remote_12888 +0ms
pw:android Connected to localabstract:webview_devtools_remote_12888 +0ms
FAIL browser: chromium src/e2e/android.test.ts (122.505 s)
Android test
✕ should complete a paypal checkout (119996 ms)
● Android test › should complete a paypal checkout
thrown: "Exceeded timeout of 120000 ms for a test.
Use jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test."
69 |
70 | describe('Android test', () => {
> 71 | it('should complete a paypal checkout', async () => {
| ^
72 | const [device] = await _android.devices()
73 | console.log(`Model: ${device.model()}`)
74 | console.log(`Serial: ${device.serial()}`)
at src/e2e/android.test.ts:71:5
at Object.<anonymous> (src/e2e/android.test.ts:70:1)
Test Suites: 1 failed, 1 total
Tests: 1 failed, 1 total
Snapshots: 0 total
Time: 123.472 s
Which android sdk version are you using in your emulator? We use the following: create avd --force --name android30 --device "Nexus 5X" --package "system-images;android-30;google_apis;x86"
Thanks @mxschmitt I created a nexus 5x device with android 30 and it's working now.
Hi
I'm using the
playwright-android
package on an emulator.Running this returns the above error:
I have not been able to find anything about this around the web and the android-playwright package has no documentation of it's own. Would using
webview.page()
be the correct way to interact with elements in a webview?Also, where can I find information/documentation on AndroidSelector?
Thanks in advance for any help.