diff options
author | Aram Drevekenin <aram@poor.dev> | 2022-10-05 07:44:00 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-05 07:44:00 +0200 |
commit | 79bf6ab868cbdab1f9a3827c9b70198f54548b44 (patch) | |
tree | 2d6fc4c1d8a79ebd727a1a5f8b6406617dd0de55 /src/tests/e2e/cases.rs | |
parent | 917e9b2ff0f583183c0155060d243afd295770b9 (diff) |
feat(config): switch to kdl (#1759)
* chore(config): default kdl keybindings config
* tests
* work
* refactor(config): move stuff around
* work
* tab merge layout
* work
* work
* layouts working
* work
* layout tests
* work
* work
* feat(parsing): kdl layouts without config
* refactor(kdl): move stuff around
* work
* tests(layout): add cases and fix bugs
* work
* fix(kdl): various bugs
* chore(layouts): move all layouts to kdl
* feat(kdl): shared keybidns
* fix(layout): do not count fixed panes toward percentile
* fix(keybinds): missing keybinds and actions
* fix(config): adjust default tips
* refactor(config): move stuff around
* fix(tests): make e2e tests pass
* fix(kdl): add verbose parsing errors
* fix(kdl): focused tab
* fix(layout): corret default_tab_template behavior
* style(code): fix compile warnings
* feat(cli): send actions through the cli
* fix(cli): exit only when action is done
* fix(cli): open embedded pane from floating pane
* fix(cli): send actions to other sessions
* feat(cli): command alias
* feat(converter): convert old config
* feat(converter): convert old layout and theme files
* feat(kdl): pretty errors
* feat(client): convert old YAML files on startup
* fix: various bugs and styling issues
* fix: e2e tests
* fix(screen): propagate errors after merge
* style(clippy): lower clippy level
* fix(tests): own session_name variable
* style(fmt): rustfmt
* fix(cli): various action fixes
* style(fmt): rustfmt
* fix(themes): loading of theme files
* style(fmt): rustfmt
* fix(tests): theme fixtures
* fix(layouts): better errors on unknown nodes
* fix(kdl): clarify valid node terminator error
* fix(e2e): adjust close tab test
* fix(e2e): adjust close tab test again
* style(code): cleanup some comments
Diffstat (limited to 'src/tests/e2e/cases.rs')
-rw-r--r-- | src/tests/e2e/cases.rs | 80 |
1 files changed, 4 insertions, 76 deletions
diff --git a/src/tests/e2e/cases.rs b/src/tests/e2e/cases.rs index 7457ed544..63e2d6778 100644 --- a/src/tests/e2e/cases.rs +++ b/src/tests/e2e/cases.rs @@ -458,9 +458,8 @@ pub fn close_tab() { name: "Wait for tab to close", instruction: |mut remote_terminal: RemoteTerminal| -> bool { let mut step_is_complete = false; - if remote_terminal.cursor_position_is(3, 2) + if remote_terminal.snapshot_contains("Tab #1") && !remote_terminal.snapshot_contains("Tab #2") - && remote_terminal.tip_appears() { // cursor is in the first tab again step_is_complete = true; @@ -475,7 +474,8 @@ pub fn close_tab() { break last_snapshot; } }; - assert_snapshot!(last_snapshot); + assert!(last_snapshot.contains("Tab #1")); + assert!(!last_snapshot.contains("Tab #2")); } #[test] @@ -950,47 +950,12 @@ pub fn detach_and_attach_session() { #[test] #[ignore] -pub fn accepts_basic_layout() { - let fake_win_size = Size { - cols: 120, - rows: 24, - }; - let layout_file_name = "three-panes-with-nesting.yaml"; - let mut test_attempts = 10; - let last_snapshot = loop { - RemoteRunner::kill_running_sessions(fake_win_size); - let mut runner = RemoteRunner::new_with_layout(fake_win_size, layout_file_name); - runner.run_all_steps(); - let last_snapshot = runner.take_snapshot_after(Step { - name: "Wait for app to load", - instruction: |remote_terminal: RemoteTerminal| -> bool { - let mut step_is_complete = false; - if remote_terminal.cursor_position_is(3, 1) - && remote_terminal.snapshot_contains("$ █ ││$") - && remote_terminal.snapshot_contains("$ ") { - step_is_complete = true; - } - step_is_complete - }, - }); - if runner.test_timed_out && test_attempts > 0 { - test_attempts -= 1; - continue; - } else { - break last_snapshot; - } - }; - assert_snapshot!(last_snapshot); -} - -#[test] -#[ignore] pub fn status_bar_loads_custom_keybindings() { let fake_win_size = Size { cols: 120, rows: 24, }; - let config_file_name = "changed_keys.yaml"; + let config_file_name = "changed_keys.kdl"; let mut test_attempts = 10; let last_snapshot = loop { RemoteRunner::kill_running_sessions(fake_win_size); @@ -1720,43 +1685,6 @@ pub fn toggle_floating_panes() { #[test] #[ignore] -pub fn focus_tab_with_layout() { - let fake_win_size = Size { - cols: 120, - rows: 24, - }; - let layout_file_name = "focus-tab-layout.yaml"; - let mut test_attempts = 10; - let last_snapshot = loop { - RemoteRunner::kill_running_sessions(fake_win_size); - let mut runner = RemoteRunner::new_with_layout(fake_win_size, layout_file_name); - runner.run_all_steps(); - let last_snapshot = runner.take_snapshot_after(Step { - name: "Wait for app to load", - instruction: |remote_terminal: RemoteTerminal| -> bool { - let mut step_is_complete = false; - if remote_terminal.status_bar_appears() - && remote_terminal.tip_appears() - && remote_terminal.snapshot_contains("Tab #9") - && remote_terminal.cursor_position_is(63, 2) - { - step_is_complete = true; - } - step_is_complete - }, - }); - if runner.test_timed_out && test_attempts > 0 { - test_attempts -= 1; - continue; - } else { - break last_snapshot; - } - }; - assert_snapshot!(last_snapshot); -} - -#[test] -#[ignore] pub fn tmux_mode() { let fake_win_size = Size { cols: 120, |