/ tests / e2e / src / scenarios / not_found.rs
not_found.rs
 1  use crate::actor::Actor;
 2  use crate::locators::not_found;
 3  use crate::tasks::{base_url, Navigate};
 4  
 5  pub async fn run(actor: &Actor) -> crate::actor::Result {
 6      actor.attempts_to(Navigate::to("/this-does-not-exist")).await?;
 7      actor.expect(not_found::heading()).to_contain_text("404").await?;
 8      actor.expect(not_found::subheading()).to_contain_text("Page Not Found").await?;
 9  
10      actor.locate(not_found::back_home_button()).await.click(None).await?;
11      actor.expect_page().to_have_url_regex(&format!("^{}/?$", regex::escape(&base_url()))).await?;
12  
13      Ok(())
14  }