| ... | ... | @@ -38,13 +38,13 @@ fn replay(scratch: &Scratch, notebook: Option<&Path>, steps: &[&str]) -> Vec<Str |
| 38 | 38 | std::fs::copy(entry.path(), dir.join("notebook").join(entry.file_name())).unwrap(); |
| 39 | 39 | } |
| 40 | 40 | } |
| 41 | | let mut script = String::from("wait 500\n"); |
| 41 | let mut script = String::from("settle\n"); |
| 42 | 42 | let mut trees = Vec::new(); |
| 43 | 43 | for step in steps { |
| 44 | 44 | match step.strip_prefix("accessibility ") { |
| 45 | 45 | Some(name) => { |
| 46 | 46 | let path = dir.join(format!("{name}.txt")); |
| 47 | | script += &format!("accessibility {}\nwait 100\n", path.display()); |
| 47 | script += &format!("accessibility {}\n", path.display()); |
| 48 | 48 | trees.push(path); |
| 49 | 49 | } |
| 50 | 50 | None => script += &format!("{step}\n"), |
| ... | ... | @@ -115,6 +115,7 @@ fn each_toolbar_control_has_a_name_of_its_own_at_every_width() { |
| 115 | 115 | let mut steps = Vec::new(); |
| 116 | 116 | for width in ["1600", "1180", "900", "600"] { |
| 117 | 117 | steps.push(format!("resize {width} 760")); |
| 118 | // The window system resizes the window, which settling does not wait for. |
| 118 | 119 | steps.push("wait 300".into()); |
| 119 | 120 | steps.push(format!("accessibility {width}")); |
| 120 | 121 | } |
| ... | ... | @@ -140,17 +141,17 @@ fn the_palette_lists_recent_pages_and_the_actions_a_context_menu_offers() { |
| 140 | 141 | let scratch = Scratch::new("palette-actions"); |
| 141 | 142 | let notebook = |
| 142 | 143 | Path::new(env!("CARGO_MANIFEST_DIR")).join("../../corpus/cross-container/candidate"); |
| 143 | | let palette = ["modifiers command", "key p", "modifiers", "wait 400"]; |
| 144 | | let chord = ["modifiers command", "key k", "modifiers", "wait 400"]; |
| 144 | let palette = ["modifiers command", "key p", "modifiers", "settle"]; |
| 145 | let chord = ["modifiers command", "key k", "modifiers", "settle"]; |
| 145 | 146 | let mut steps = Vec::from(palette); |
| 146 | | steps.extend(["type type over", "wait 200", "key Enter", "wait 800"]); |
| 147 | steps.extend(["type type over", "settle", "key Enter", "settle"]); |
| 147 | 148 | steps.extend(palette); |
| 148 | 149 | steps.push("accessibility recent"); |
| 149 | 150 | steps.extend(chord); |
| 150 | 151 | steps.push("accessibility actions"); |
| 151 | | steps.extend(["key Escape", "wait 400", "accessibility back"]); |
| 152 | | steps.extend(["key Escape", "wait 400", "move 1000 87", "press right"]); |
| 153 | | steps.extend(["release right", "wait 400", "accessibility context"]); |
| 152 | steps.extend(["key Escape", "accessibility back"]); |
| 153 | steps.extend(["key Escape", "settle", "move 1000 87", "press right"]); |
| 154 | steps.extend(["release right", "accessibility context"]); |
| 154 | 155 | let [recent, actions, back, context] = replay(&scratch, Some(&notebook), &steps) |
| 155 | 156 | .try_into() |
| 156 | 157 | .unwrap(); |
| ... | ... | @@ -201,11 +202,11 @@ fn undo_walks_back_through_new_pages_and_their_titles() { |
| 201 | 202 | let notebook = |
| 202 | 203 | Path::new(env!("CARGO_MANIFEST_DIR")).join("../../corpus/cross-container/candidate"); |
| 203 | 204 | let chord = |
| 204 | | |modifiers: &str, key: &str| [modifiers, key, "modifiers", "wait 800"].map(String::from); |
| 205 | |modifiers: &str, key: &str| [modifiers, key, "modifiers", "settle"].map(String::from); |
| 205 | 206 | let mut steps = Vec::new(); |
| 206 | 207 | for title in ["type One", "type Two"] { |
| 207 | 208 | steps.extend(chord("modifiers command", "key n")); |
| 208 | | steps.extend(["settle", title, "wait 300"].map(String::from)); |
| 209 | steps.push(title.into()); |
| 209 | 210 | } |
| 210 | 211 | steps.extend(chord("modifiers command control", "key Left")); |
| 211 | 212 | steps.push("accessibility back".into()); |
| ... | ... | @@ -267,11 +268,7 @@ fn search(query: &str, name: &str) -> Vec<String> { |
| 267 | 268 | ["modifiers command", "key e", "modifiers"] |
| 268 | 269 | .into_iter() |
| 269 | 270 | .map(String::from) |
| 270 | | .chain([ |
| 271 | | format!("type {query}"), |
| 272 | | "wait 2500".into(), |
| 273 | | format!("accessibility {name}"), |
| 274 | | ]) |
| 271 | .chain([format!("type {query}"), format!("accessibility {name}")]) |
| 275 | 272 | .collect() |
| 276 | 273 | } |
| 277 | 274 | |
| ... | ... | @@ -279,13 +276,13 @@ fn search(query: &str, name: &str) -> Vec<String> { |
| 279 | 276 | fn version_menu() -> Vec<String> { |
| 280 | 277 | let mut steps: Vec<String> = ["modifiers command shift", "key p", "modifiers"] |
| 281 | 278 | .into_iter() |
| 282 | | .chain(["type Page Versions", "wait 300", "key Enter", "wait 1000"]) |
| 279 | .chain(["type Page Versions", "settle", "key Enter", "settle"]) |
| 283 | 280 | .map(String::from) |
| 284 | 281 | .collect(); |
| 285 | 282 | // The version row under the page, then the yellow bar above the version. |
| 286 | 283 | for point in ["1003 114", "177 94"] { |
| 287 | 284 | steps.extend([format!("move {point}"), "press".into(), "release".into()]); |
| 288 | | steps.push("wait 1200".into()); |
| 285 | steps.push("settle".into()); |
| 289 | 286 | } |
| 290 | 287 | steps |
| 291 | 288 | } |
| ... | ... | @@ -301,10 +298,10 @@ fn search_finds_what_a_template_put_on_the_page() { |
| 301 | 298 | let scratch = Scratch::new("template-search"); |
| 302 | 299 | let notebook = |
| 303 | 300 | Path::new(env!("CARGO_MANIFEST_DIR")).join("../../corpus/cross-container/candidate"); |
| 304 | | let mut steps: Vec<String> = ["modifiers command", "key n", "modifiers", "wait 1200"] |
| 301 | let mut steps: Vec<String> = ["modifiers command", "key n", "modifiers", "settle"] |
| 305 | 302 | .into_iter() |
| 306 | 303 | // The Meeting tile of the template strip over the new page. |
| 307 | | .chain(["move 615 287", "press", "release", "wait 3000"]) |
| 304 | .chain(["move 615 287", "press", "release", "settle"]) |
| 308 | 305 | .map(String::from) |
| 309 | 306 | .collect(); |
| 310 | 307 | steps.extend(search("Attendees", "found")); |
| ... | ... | @@ -325,7 +322,7 @@ fn search_finds_a_restored_version() { |
| 325 | 322 | Path::new(env!("CARGO_MANIFEST_DIR")).join("../../corpus/page-versions/candidate-restore"); |
| 326 | 323 | let mut steps = version_menu(); |
| 327 | 324 | // Restore Version. |
| 328 | | steps.extend(["key Down", "key Enter", "wait 2000"].map(String::from)); |
| 325 | steps.extend(["key Down", "key Enter", "settle"].map(String::from)); |
| 329 | 326 | steps.extend(search("Second author", "found")); |
| 330 | 327 | let [found] = run(&scratch, &notebook, &steps).try_into().unwrap(); |
| 331 | 328 | assert!(!search_results(&found).is_empty(), "{found}"); |
| ... | ... | @@ -339,8 +336,8 @@ fn a_version_copied_into_its_section_is_listed_and_found() { |
| 339 | 336 | Path::new(env!("CARGO_MANIFEST_DIR")).join("../../corpus/page-versions/candidate-restore"); |
| 340 | 337 | let mut steps = version_menu(); |
| 341 | 338 | // Copy Page To…, then the section itself. |
| 342 | | steps.extend(["key Down", "key Down", "key Down", "key Enter", "wait 600"].map(String::from)); |
| 343 | | steps.extend(["key Down", "key Enter", "wait 2000", "accessibility copied"].map(String::from)); |
| 339 | steps.extend(["key Down", "key Down", "key Down", "key Enter", "settle"].map(String::from)); |
| 340 | steps.extend(["key Down", "key Enter", "accessibility copied"].map(String::from)); |
| 344 | 341 | steps.extend(search("Second author", "found")); |
| 345 | 342 | let [copied, found] = run(&scratch, &notebook, &steps).try_into().unwrap(); |
| 346 | 343 | let pages = page_tabs(&copied); |
| ... | ... | @@ -359,9 +356,9 @@ fn renaming_a_section_from_its_tab_types_into_the_sidebar_at_once() { |
| 359 | 356 | let scratch = Scratch::new("rename-shut-sidebar"); |
| 360 | 357 | let notebook = |
| 361 | 358 | Path::new(env!("CARGO_MANIFEST_DIR")).join("../../corpus/cross-container/candidate"); |
| 362 | | let mut steps = vec!["move 53 53", "press right", "release right", "wait 400"]; |
| 363 | | steps.extend(["key Down", "key Enter", "wait 400"]); |
| 364 | | steps.extend(["type Renamed", "wait 100", "accessibility typed"]); |
| 359 | let mut steps = vec!["move 53 53", "press right", "release right", "settle"]; |
| 360 | steps.extend(["key Down", "key Enter", "settle"]); |
| 361 | steps.extend(["type Renamed", "accessibility typed"]); |
| 365 | 362 | let [typed] = replay(&scratch, Some(&notebook), &steps) |
| 366 | 363 | .try_into() |
| 367 | 364 | .unwrap(); |
| ... | ... | @@ -378,10 +375,10 @@ fn the_find_bar_keeps_room_for_the_query() { |
| 378 | 375 | let scratch = Scratch::new("find-room"); |
| 379 | 376 | let notebook = |
| 380 | 377 | Path::new(env!("CARGO_MANIFEST_DIR")).join("../../corpus/cross-container/candidate"); |
| 381 | | let mut steps = vec!["modifiers command", "key f", "modifiers", "wait 200"]; |
| 382 | | steps.extend(["type Alpha", "wait 400", "move 600 600", "press", "release"]); |
| 383 | | steps.extend(["wait 200", "move 1000 52", "press", "release", "wait 200"]); |
| 384 | | steps.extend(["type zz", "wait 200", "accessibility found"]); |
| 378 | let mut steps = vec!["modifiers command", "key f", "modifiers", "settle"]; |
| 379 | steps.extend(["type Alpha", "settle", "move 600 600", "press", "release"]); |
| 380 | steps.extend(["settle", "move 1000 52", "press", "release", "settle"]); |
| 381 | steps.extend(["type zz", "accessibility found"]); |
| 385 | 382 | let [found] = replay(&scratch, Some(&notebook), &steps) |
| 386 | 383 | .try_into() |
| 387 | 384 | .unwrap(); |
| ... | ... | @@ -417,8 +414,13 @@ fn a_launch_returns_to_the_page_each_notebook_was_left_on() { |
| 417 | 414 | }); |
| 418 | 415 | std::fs::write(scratch.0.join("settings.json"), settings.to_string()).unwrap(); |
| 419 | 416 | // The other notebook's section in the sidebar. |
| 420 | | let mut steps = vec!["accessibility launched", "move 63 104", "press", "release"]; |
| 421 | | steps.extend(["wait 4000", "accessibility other"]); |
| 417 | let steps = [ |
| 418 | "accessibility launched", |
| 419 | "move 63 104", |
| 420 | "press", |
| 421 | "release", |
| 422 | "accessibility other", |
| 423 | ]; |
| 422 | 424 | let shown = |tree: &str| page_tabs(tree).into_iter().find(|tab| tab.starts_with('*')); |
| 423 | 425 | let [launched, other] = replay(&scratch, Some(&source), &steps).try_into().unwrap(); |
| 424 | 426 | assert_eq!( |