summaryrefslogtreecommitdiff
path: root/src/browser/web_browser.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/browser/web_browser.rs')
-rw-r--r--src/browser/web_browser.rs21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/browser/web_browser.rs b/src/browser/web_browser.rs
index 5a855d5..10dacb7 100644
--- a/src/browser/web_browser.rs
+++ b/src/browser/web_browser.rs
@@ -188,6 +188,27 @@ impl Browser {
Ok(None)
}
+
+ // Select the row for the timetable booking
+ pub async unsafe fn select_timetable_row(&self, index: &str) -> WebDriverResult<bool> {
+ if let Some(_d) = &self.driver {
+ _d.find_element(By::Css(
+ &format!("#slotContainerTable tr:nth-child({}) td", index).to_owned()[..],
+ ))
+ .await?
+ .click()
+ .await?;
+ thread::sleep(time::Duration::from_millis(2000));
+ _d.find_element(By::Css("#partialQuestionYesNoConfirmButton:last-child"))
+ .await?
+ .click()
+ .await?;
+
+ return Ok(true);
+ }
+
+ Ok(false)
+ }
}
/// The static unsafe variable used to open a web browser