use serial_test::serial;
mod common;
use crate::common::run_script_against;
#[tokio::test]
#[serial]
async fn locate_by_text() {
run_script_against("locate \"Text\"", "
Text ").await;
}
#[tokio::test]
#[serial]
async fn locate_by_partial_text() {
run_script_against("locate \"Te\"", "Text ").await;
}
#[tokio::test]
#[serial]
async fn locate_by_placeholder() {
run_script_against(
"locate \"A Placeholder\"",
" ",
)
.await;
}
#[tokio::test]
#[serial]
async fn locate_by_partial_placeholder() {
run_script_against(
"locate \"A Place\"",
" ",
)
.await;
}
#[tokio::test]
#[serial]
async fn locate_by_title() {
run_script_against(
"locate \"test title\"",
"Text ",
)
.await;
}
#[tokio::test]
#[serial]
async fn locate_by_aria_label() {
run_script_against(
"locate \"test label\"",
"Text ",
)
.await;
}
#[tokio::test]
#[serial]
async fn locate_by_id() {
run_script_against("locate \"test-id\"", "Text ").await;
}
#[tokio::test]
#[serial]
async fn locate_by_name() {
run_script_against("locate \"test-name\"", "Text ").await;
}
#[tokio::test]
#[serial]
async fn locate_by_class() {
run_script_against(
"locate \"test-class\"",
"Text ",
)
.await;
}
#[tokio::test]
#[serial]
async fn locate_by_tag_name() {
run_script_against("locate \"h1\"", "Text ").await;
}
#[tokio::test]
#[serial]
async fn locate_by_xpath() {
run_script_against(
"locate \"//h1[@name='test-name']\"",
"Text ",
)
.await;
}
#[tokio::test]
#[serial]
async fn locate_by_partial_text_adjacent_to_element() {
run_script_against(
"locate \"Add Provider Data File\" and click",
"
Add Provider Data File "
).await;
}