From 8de625e9eba926c7ca8c2f86d658283480938b2f Mon Sep 17 00:00:00 2001 From: Santo Cariotti Date: Wed, 29 Sep 2021 00:05:12 +0200 Subject: fix: `LOGIN_URL` for using `.starts_with()` --- src/browser/web_browser.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/browser/web_browser.rs b/src/browser/web_browser.rs index 8ba21d6..59b2dff 100644 --- a/src/browser/web_browser.rs +++ b/src/browser/web_browser.rs @@ -7,7 +7,7 @@ use thirtyfour::prelude::{By, WebDriverResult}; use thirtyfour::{FirefoxCapabilities, WebDriver, WebDriverCommands, WebElement}; /// This url is used to make the login -const LOGIN_URL: &str = "https://studenti.smartedu.unict.it/WorkFlow2011/Logon/Logon.aspx?ReturnUrl=%2fStudenti%2fDefault.aspx"; +const LOGIN_URL: &str = "https://studenti.smartedu.unict.it/WorkFlow2011/Logon/Logon.aspx"; /// This url is used to go to the page where a student can book a room for study pub const ROOMS_URL: &str = "https://studenti.smartedu.unict.it/StudentSpaceReserv?Type=unaTantum"; @@ -66,7 +66,7 @@ impl Browser { // If the current url is the same as `LOGIN_URL` it means the login didn't work, so // returns a "login error" - if _d.current_url().await? == LOGIN_URL { + if _d.current_url().await?.starts_with(LOGIN_URL) { return Err(WebDriverError::SessionNotCreated(WebDriverErrorInfo { status: 400, error: "SessionNotCreated".to_string(), -- cgit v1.2.3-18-g5258