main.rs 1.4 KB

12345678910111213141516171819202122232425262728293031323334
  1. // Copyright 2019-2024 Tauri Programme within The Commons Conservancy
  2. // SPDX-License-Identifier: Apache-2.0
  3. // SPDX-License-Identifier: MIT
  4. //! [![](https://github.com/tauri-apps/tauri/raw/dev/.github/splash.png)](https://tauri.app)
  5. //!
  6. //! Cross-platform WebDriver server for Tauri applications.
  7. //!
  8. //! This is a [WebDriver Intermediary Node](https://www.w3.org/TR/webdriver/#dfn-intermediary-nodes) that wraps the native WebDriver server for platforms that [Tauri](https://github.com/tauri-apps/tauri) supports. Your WebDriver client will connect to the running `tauri-driver` server, and `tauri-driver` will handle starting the native WebDriver server for you behind the scenes. It requires two separate ports to be used since two distinct [WebDriver Remote Ends](https://www.w3.org/TR/webdriver/#dfn-remote-ends) run.
  9. #![doc(
  10. html_logo_url = "https://github.com/tauri-apps/tauri/raw/dev/.github/icon.png",
  11. html_favicon_url = "https://github.com/tauri-apps/tauri/raw/dev/.github/icon.png"
  12. )]
  13. mod cli;
  14. mod server;
  15. mod webdriver;
  16. fn main() {
  17. let args = pico_args::Arguments::from_env().into();
  18. // start the native webdriver on the port specified in args
  19. let mut driver = webdriver::native(&args);
  20. let driver = driver
  21. .spawn()
  22. .expect("error while running native webdriver");
  23. // start our webdriver intermediary node
  24. if let Err(e) = server::run(args, driver) {
  25. eprintln!("error while running server: {}", e);
  26. std::process::exit(1);
  27. }
  28. }