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>;
}
s
.replace("@target@", &format!("{}/target", &ds.start_dir))
.replace("@srcbuild@", &ds.start_dir)
+ .replace("@url@", &URL)
}
inner(self, s.as_ref())
}
#[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 = "."
.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")?;
}
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);
- }
}