chiark / gitweb /
wip actually show a thing
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 23 Dec 2020 18:32:38 +0000 (18:32 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 23 Dec 2020 18:32:38 +0000 (18:32 +0000)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
wdriver.rs
wdriver/wdt-simple.rs

index af0ec3c3c574fbcfd742d7fc2ee721a0bf803223..a410d818d6f7bae55a8d43cb15a16e00e7921a5d 100644 (file)
@@ -27,6 +27,8 @@ use otter::config::DAEMON_STARTUP_REPORT;
 pub const MS : time::Duration = time::Duration::from_millis(1);
 pub type AE = anyhow::Error;
 
+pub const URL : &str = "http://localhost:8000";
+
 pub trait AlwaysContext<T,E> {
   fn always_context(self, msg: &'static str) -> anyhow::Result<T>;
 }
@@ -76,6 +78,7 @@ impl DirSubst {
       s
         .replace("@target@",   &format!("{}/target", &ds.start_dir))
         .replace("@srcbuild@", &ds.start_dir)
+        .replace("@url@",      &URL)
     }
     inner(self, s.as_ref())
   }
@@ -349,7 +352,7 @@ fn prepare_xserver(cln: &cleanup_notify::Handle, ds: &DirSubst) {
 #[throws(AE)]
 fn prepare_gameserver(cln: &cleanup_notify::Handle, ds: &DirSubst) {
   let config = ds.subst(r##"
-public_url = "http://localhost:8000"
+public_url = "@url"
 base_dir = "@srcbuild@"
 command_socket = "command.socket"
 save_dir = "."
@@ -411,9 +414,11 @@ fn prepare_thirtyfour() {
     .context("create 34 WebDriver")?;
 //  driver.fullscreen_window()
 //    .context("fullscreen")?;
-  driver.get("http://localhost:")
-    .context("dummy navigation")?;
-  driver.screenshot(path::Path::new("test.png"))
+  driver.screenshot(path::Path::new("test1.png"))
+    .context("screenshot")?;
+  driver.get(URL)
+    .context("navigate to home page")?;
+  driver.screenshot(path::Path::new("test2.png"))
     .context("screenshot")?;
 }
 
index c2692c9c50602cb12bbbf230061f9e52afd6c404..3868a8ab6dedf8b9151e1daa4289ba6c2f57ad14 100644 (file)
@@ -9,14 +9,4 @@ fn main(){
   let s = setup().always_context("setup")?;
 
   println!("hi! {:#?}", &s);
-
-  for _ in 0..2 {
-    let mut c = Command::new("xdpyinfo");
-    let s = c
-      .spawn().context("spawn")?
-      .wait().context("wait")?;
-    println!("s = {:?}", &s);
-
-    std::thread::sleep(500 * MS);
-  }
 }