Skip to content

Commit

Permalink
Remove tests that contain a relative mouse move
Browse files Browse the repository at this point in the history
  • Loading branch information
pentamassiv committed Aug 13, 2024
1 parent 9ad9877 commit 714a571
Showing 1 changed file with 2 additions and 26 deletions.
28 changes: 2 additions & 26 deletions src/tests/mouse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,8 @@ fn unit_scroll() {
);
}
}
/*

#[ignore] // Contains a relative mouse move so it does not work on Windows
#[test]
// Press down and drag the mouse
fn unit_mouse_drag() {
Expand All @@ -276,28 +277,3 @@ fn unit_mouse_drag() {
thread::sleep(delay);
enigo.button(Button::Left, Release).unwrap();
}
*/

#[test]
// Print the locations to estimate the error
fn unit_print_move_mouse_rel() {
let start = (0, 0);

let mut enigo = Enigo::new(&Settings::default()).unwrap();

let delay = super::get_delay();
thread::sleep(delay);
// Github runner display is 1024x768

for i in 0..=768 {
let rel_move = (0, i);
enigo.move_mouse(start.0, start.1, Abs).unwrap(); // Move to absolute start position
println!("Relatively move by ({}, {})", rel_move.0, rel_move.1);
enigo.move_mouse(rel_move.0, rel_move.1, Rel).unwrap();
thread::sleep(delay);
let (x_res, y_res) = enigo.location().unwrap();

println!("New location: ({x_res}, {y_res})");
thread::sleep(delay);
}
}

0 comments on commit 714a571

Please sign in to comment.