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.06k stars 2.53k forks source link

[feat] MacOSX Support for tauri-driver #7068

Open prestomation opened 1 year ago

prestomation commented 1 year ago

Describe the problem

tauri-driver does not support Mac.

I have a Tauri app that has some platform-specific code in it. (Think: tauri-plugin-deep-link). I need to write automated tests of my app, and I need to run on every platform, as the platform-specific code must be verified on every platform.

Describe the solution you'd like

I would like tauri-driver to support mac similarly to how it supports windows and linux

Alternatives considered

Selenium Test on windows/linux, and get by with manual testing and unit tests on mac for mac-specific functionality

Additional context

I understand this is not a priority for the tauri team, understandable as most app testing can be done on a single platform. I still wanted to file this to collect interest and any more information about solving this.

I would be interested in contributing this based upon required effort and my own priorities.

Does the tauri team have any thoughts on how this could be implemented?

I did some research and while there is a safaridriver I don't see a WKWebview driver for selenium

FabianLars commented 1 year ago

For visibility, cross-linking the comment about why there is no macos support yet (it's what you said in your last sentence): https://github.com/tauri-apps/tauri/issues/5551#issuecomment-1304348684

Does the tauri team have any thoughts on how this could be implemented?

Afaik only what's in the readme:

note: the (probably) items haven't been proof-of-concept'd yet, and if it is not possible to use the listed native webdriver, then a custom implementation will be used that wraps around wry.

Though tbh that doesn't really sound like a viable option to me, but i'm also completely out of the loop on that topic so idk...

PJUllrich commented 5 days ago

Hey folks, just wanted to add that if you try to run cargo run tauri-driver inside your src-tauri on macOS today, this is the error you'll see.

In the shell, you'll see a warning:

warning: my-app v0.1.0 (/Users/my-user/my-app/src-tauri) ignoring invalid dependency `tauri-driver` which is missing a lib target

and in the browser console, you'll see:

Failed to load resource: Could not connect to the server.

I add this only for folks to find it on Google in case they wonder why the app "seems" to start on macOS, but then doesn't work properly :)