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