diff options
Diffstat (limited to 'src/browser/mod.rs')
-rw-r--r-- | src/browser/mod.rs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/browser/mod.rs b/src/browser/mod.rs new file mode 100644 index 0000000..8359c51 --- /dev/null +++ b/src/browser/mod.rs @@ -0,0 +1,19 @@ +use self::web_browser::{Browser, WEB_BROWSER}; +use crate::Config; +use thirtyfour::prelude::WebDriverResult; + +mod web_browser; + +pub async fn init(driver_url: &String) { + unsafe { + WEB_BROWSER = Some(Browser::new(driver_url).await); + } +} + +pub async unsafe fn login(credentials: &Config) -> WebDriverResult<()> { + if let Some(driver) = &WEB_BROWSER { + driver._login(credentials).await?; + } + + Ok(()) +} |