tauri-apps / tauri

Build smaller, faster, and more secure desktop and mobile applications with a web frontend.
https://tauri.app
Apache License 2.0
84.59k stars 2.54k forks source link

[bug] Version 0.1.4 breaks my end-to-end tests #8828

Open amosjyng opened 9 months ago

amosjyng commented 9 months ago

Describe the bug

My end-to-end tests on GitHub CI started breaking today:

[0-0] 2024-02-09T02:56:58.452Z ERROR webdriver: Request failed with status 500 due to session not created: Failed to match capabilities
[0-0] 2024-02-09T02:56:58.454Z ERROR webdriver: session not created: Failed to match capabilities
[0-0]     at getErrorFromResponseBody (file:///home/runner/work/zamm-ui/zamm-ui/node_modules/webdriverio/node_modules/webdriver/build/utils.js:195:12)
[0-0]     at NodeJSRequest._request (file:///home/runner/work/zamm-ui/zamm-ui/node_modules/webdriverio/node_modules/webdriver/build/request/index.js:193:23)
[0-0]     at processTicksAndRejections (node:internal/process/task_queues:95:5)

Pinning the installed version to 0.1.3 gets them to pass again.

I have not looked into why this is, I'm just reporting this phenomenon. My yarn.lock has these versions:

Reproduction

I'm using an end-to-end test script based on https://github.com/chippers/hello_tauri

Expected behavior

Patch versions should ideally not result in breaking changes to my CI setup

Full tauri info output

My local machine where the driver works fine on 0.1.3

cargo tauri info

[✔] Environment
    - OS: Ubuntu 22.04 X64
    ✔ webkit2gtk-4.0: 2.42.4
    ✔ rsvg2: 2.52.5
    ✔ rustc: 1.71.1 (eb26296b5 2023-08-03)
    ✔ Cargo: 1.71.1 (7f1d04c00 2023-07-29)
    ✔ rustup: 1.26.0 (5af9b9484 2023-04-05)
    ✔ Rust toolchain: 1.71.1-x86_64-unknown-linux-gnu (environment override by RUSTUP_TOOLCHAIN)
    - node: 20.5.1
    - pnpm: 8.7.6
    - yarn: 1.22.19
    - npm: 9.8.0

[-] Packages
    - tauri [RUST]: 1.5.4
    - tauri-build [RUST]: 1.5.1
    - wry [RUST]: 0.24.7
    - tao [RUST]: 0.16.5
    - @tauri-apps/api [NPM]: 1.5.3
    - @tauri-apps/cli [NPM]: 1.4.0

[-] App
    - build-type: bundle
    - CSP: unset
    - distDir: ../src-svelte/build
    - devPath: http://localhost:1420/
    - framework: Svelte
    - bundler: Vite

I have yet to kick off a run on CI with this command, because I just want to be able to report it first in case anyone else runs into the same issue.



### Stack trace

_No response_

### Additional context

_No response_
jLynx commented 8 months ago

Any updates around this? I forked it and made a few changes and got a bit closer, but its still broken for me https://github.com/jLynx/hello_tauri

bukowa commented 4 months ago

Perhaps you were using an older version of Tauri, because the difference between versions 0.1.3 and 0.1.4 includes a change in the environment variable from TAURI_AUTOMATION to TAURI_WEBVIEW_AUTOMATION.

But the problem is still here Failed to match capabilities

marcelsby commented 4 months ago

I was with the same problem here on Linux, then i worked out like you've mentioned about the browser name as a empty string, now my Selenium tests started to run, but i'm receiving this error:

Screenshot from 2024-06-27 12-59-22

It seems that the driver initialization is hanging while trying to create a session, the WebdriverIO example is presenting the same behavior:

image

Maybe some tauri-driver bug?

The example project being used is this.

bukowa commented 4 months ago

I was with the same problem here on Linux, then i worked out like you've mentioned about the browser name as a empty Maybe some tauri-driver bug?

Yep same problem I am already investigating, works fine on Windows so let's see.

bukowa commented 4 months ago

tauri 1.6.8 > tauri-runtime-wry 0.14.8 > wry 0.24.10 when latest wry==0.41.0

I am checking this path

Edit @marcelsby :

$ cargo build -p tauri-runtime-wry
    Updating crates.io index
error: failed to select a version for `wry`.                                                                                                                                               
    ... required by package `tauri-runtime-wry v0.14.8 (C:\Users\buk\RustroverProjects\tauri2\core\tauri-runtime-wry)`
    ... which satisfies path dependency `tauri-runtime-wry` (locked to 0.14.8) of package `tauri v1.6.7 (C:\Users\buk\RustroverProjects\tauri2\core\tauri)`
versions that meet the requirements `^0.25.0` are: 0.25.0

the package `tauri-runtime-wry` depends on `wry`, with features: `tracing` but `wry` does not have these features.

failed to select a version for `wry` which could resolve this conflict

And here some breaking changes related to webkit:

https://github.com/tauri-apps/wry/compare/wry-v0.24.1...wry-v0.25.0#diff-06572a96a58dc510037d5efa622f9bec8519bc1beab13c9f251e97e657a9d4edR5

bukowa commented 4 months ago

Well... just migrate to tauri v2 it works there ^^ but you need the browserName set to wry otherwise it fails ❌

bukowa commented 4 months ago

Runs fine on my wsl ubuntu with Tauri v2... But timeouts on github actions. Xvfb takes a while to warmup, but still looks like cannot start in github actions

marcelsby commented 4 months ago

Hello, sorry for the late reply, i was a bit busy, but in this meantime i migrated my personal Tauri project to v2 and run the selenium test with the same setup of "hello_tauri", but the hanging behavior keeps the same.

I tested in Ubuntu 22.04.

bukowa commented 4 months ago

Hello, sorry for the late reply, i was a bit busy, but in this meantime i migrated my personal Tauri project to v2 and run the selenium test with the same setup of "hello_tauri", but the hanging behavior keeps the same.

I tested in Ubuntu 22.04.

Take a look here, it works for me and in github actions https://github.com/bukowa/tauri-e2e

amosjyng commented 6 days ago

Upgrading to Tauri v2 and tauri-driver 2.0.1 magically fixed things for me. I'm using Webdriver