chiark / gitweb /
well maybe it starts ff ?
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 23 Dec 2020 01:50:55 +0000 (01:50 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 23 Dec 2020 01:50:55 +0000 (01:50 +0000)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
wdriver.rs

index a0929beda2d3dc2af680c26aff7c9588c84c3161..9d19e47d4d8f8b15c3d37bb2c7e7de3dc022f0f7 100644 (file)
@@ -5,8 +5,11 @@
 pub use anyhow::{anyhow, Context};
 pub use fehler::{throw, throws};
 pub use structopt::StructOpt;
+pub use thirtyfour_sync as t4;
 pub use void::Void;
 
+pub use t4::WebDriverCommands;
+
 pub use std::env;
 pub use std::fs;
 pub use std::io::{BufRead, BufReader, ErrorKind, Write};
@@ -280,6 +283,15 @@ fn prepare_geckodriver(cln: &cleanup_notify::Handle) {
   }
 }
 
+#[throws(AE)]
+fn prepare_thirtyfour() {
+  let caps = t4::DesiredCapabilities::firefox();
+  let driver = t4::WebDriver::new("http://localhost:4444", &caps)
+    .context("create 34 WebDriver")?;
+  driver.get("http://localhost:8000")
+    .context("dummy navigation")?;
+}
+
 #[throws(AE)]
 pub fn setup() -> Setup {
   let current_exe : String = env::current_exe()
@@ -300,6 +312,7 @@ pub fn setup() -> Setup {
 
   prepare_xserver(&cln).context("setup X server")?;
   prepare_geckodriver(&cln).context("setup webdriver serverr")?;
+  prepare_thirtyfour().context("prepare web session")?;
 
   Setup {
     tmp,