summaryrefslogtreecommitdiff
path: root/src/browser/mod.rs
diff options
context:
space:
mode:
authorSanto Cariotti <santo@dcariotti.me>2021-08-05 19:00:37 +0200
committerSanto Cariotti <santo@dcariotti.me>2021-08-05 19:00:37 +0200
commit429489349688ce452f124a691c7542d2ca2177d1 (patch)
treee2f124dc11a1bf92f13e172f267ae9ae42e07f53 /src/browser/mod.rs
parent51ea2896cdcdf7b6027f96421a0ce2b454486e03 (diff)
feat: handle the callback of the faculty
Diffstat (limited to 'src/browser/mod.rs')
-rw-r--r--src/browser/mod.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/browser/mod.rs b/src/browser/mod.rs
index 7205f27..1675595 100644
--- a/src/browser/mod.rs
+++ b/src/browser/mod.rs
@@ -34,3 +34,19 @@ pub async unsafe fn get_faculties() -> WebDriverResult<Option<HashMap<String, St
Ok(None)
}
+
+pub async unsafe fn select_option(
+ klass: &str,
+ property_name: &str,
+ property_value: &str,
+) -> WebDriverResult<bool> {
+ if let Some(driver) = &WEB_BROWSER {
+ let result = driver
+ .select_option_from_list(klass, property_name, property_value)
+ .await?;
+
+ return Ok(result);
+ }
+
+ Ok(false)
+}