octaltree / playwright-rust

Playwright port to Rust
316 stars 36 forks source link

feat: update playwright version to 1.13.0 #53

Open eredotpkfr opened 5 months ago

eredotpkfr commented 5 months ago

Problem

Hey folks, I am currently using MacOS operating system and then playwright version 1.11 is not support browsers for apple silicon machines. I was getting following error when I try install browsers. Also this PR related with #27

foo@bar:~/playwright-rust$ target/debug/playwright install
Failed to install browsers
Error: Failed to download chromium, caused by
Error: ERROR: Playwright does not support chromium on mac14-arm64
    at Object.assert (/Users/foo/Library/Caches/ms-playwright/playwright-rust/driver/package/lib/utils/utils.js:86:15)
    at Registry.downloadURL (/Users/foo/Library/Caches/ms-playwright/playwright-rust/driver/package/lib/utils/registry.js:346:17)
    at Object.downloadBrowserWithProgressBar (/Users/foo/Library/Caches/ms-playwright/playwright-rust/driver/package/lib/install/browserFetcher.js:84:26)
    at async validateCache (/Users/foo/Library/Caches/ms-playwright/playwright-rust/driver/package/lib/install/installer.js:129:9)
    at async Object.installBrowsersWithProgressBar (/Users/foo/Library/Caches/ms-playwright/playwright-rust/driver/package/lib/install/installer.js:80:9)
    at async Object.installBrowsers (/Users/foo/Library/Caches/ms-playwright/playwright-rust/driver/package/lib/cli/driver.js:93:5)
    at async Command.<anonymous> (/Users/foo/Library/Caches/ms-playwright/playwright-rust/driver/package/lib/cli/cli.js:108:9)

PR

In this PR, I updated playwright version to 1.13.0, this version compatible with this project. I tried so many versions (like a latest version 1.43) but I could not solve the following error on tests

---- imp::browser_context::tests::storage_state stdout ----
thread 'imp::browser_context::tests::storage_state' panicked at src/imp/browser_context.rs:307:62:
called `Result::unwrap()` on an `Err` value: InitializationError

It seems, playwright-rust could not parse incoming json data from /Users/foo/Library/Caches/ms-playwright/playwright-rust/driver/package/cli.js run-driver. As I understand, new versions of playwright does not serve this data

Also I updated build.rs file cause of cargo: notation is not available on new rust versions, here is the reference

Tests

Following tests are fails, I got timeout error when I run tests

thread 'chromium_devices' panicked at tests/devices/mod.rs:87:32:
called `Result::unwrap()` on an `Err` value: Timeout

Conclusion

I am still working on this PR, I will update this PR when tests are succeeded, maybe we can work on it together @octaltree

i7solar commented 1 month ago

bump pls merge