Initial template commit

This commit is contained in:
2025-03-07 17:16:08 +02:00
commit 11f391964b
68 changed files with 1632 additions and 0 deletions

16
tests/Cargo.toml Normal file
View File

@@ -0,0 +1,16 @@
[package]
name = "template-e2e"
version.workspace = true
authors.workspace = true
categories.workspace = true
edition.workspace = true
keywords.workspace = true
license.workspace = true
readme.workspace = true
repository.workspace = true
resolver = "2"
description.workspace = true
[dependencies]
thirtyfour.workspace = true
tokio.workspace = true

47
tests/src/main.rs Normal file
View File

@@ -0,0 +1,47 @@
use std::{
error::Error,
thread::sleep,
time::Duration,
};
use thirtyfour::prelude::*;
use tokio::time::{
Timeout,
timeout,
};
pub const LINK_BTNS: [(&'static str, &'static str); 6] = [
("tauri_link_btn", "https://tauri.app/"),
("leptos_link_btn", "https://leptos.dev/"),
("tailwindcss_link_btn", "https://tailwindcss.com/"),
("daisyui_link_btn", "https://daisyui.com/"),
("helix_link_btn", "https://helix-editor.com/"),
("dprint_link_btn", "https://dprint.dev/"),
];
#[tokio::main]
async fn main() -> Result<(), Box<dyn Error + Send + Sync>> {
// let caps = DesiredCapabilities::chrome();
// let driver = WebDriver::new("http://localhost:9515", caps).await?;
let caps = DesiredCapabilities::firefox();
let driver = WebDriver::new("http://localhost:4444", caps).await?;
driver
.goto("http://127.0.0.1:42069")
.await?;
for link_btn in LINK_BTNS {
let btn = driver.find(By::Id(link_btn.0)).await?;
assert_eq!(
link_btn.1,
btn.prop("href")
.await?
.unwrap_or_default()
);
}
driver.quit().await?;
Ok(())
}