aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests/e2e
diff options
context:
space:
mode:
authorJae-Heon Ji <32578710+jaeheonji@users.noreply.github.com>2022-02-01 02:19:21 +0900
committerGitHub <noreply@github.com>2022-02-01 02:19:21 +0900
commit1d2e303926fbf1b4b39507ae246e8557a4916e7b (patch)
treee0fef9ed587aeb86fead9a19e6f454872f080b06 /src/tests/e2e
parentdocs(changelog): warn on active empty mode (diff)
downloadsl0ppij-1d2e303926fbf1b4b39507ae246e8557a4916e7b.tar.gz
sl0ppij-1d2e303926fbf1b4b39507ae246e8557a4916e7b.tar.xz
sl0ppij-1d2e303926fbf1b4b39507ae246e8557a4916e7b.zip
feat: add focus attribute in layout (#958)
* feat(layout): add focus attribute in layout * feat: add state of focus to tab * chore: i love clippy * test(layout): update focus options * feat: add focus pane * feat: apply focus-pane when layout is only loaded * change the instruction name for focus-on-tab * chore: apply cargo-fmt * test: add e2e testcase
Diffstat (limited to 'src/tests/e2e')
-rw-r--r--src/tests/e2e/cases.rs37
-rw-r--r--src/tests/e2e/snapshots/zellij__tests__e2e__cases__focus_tab_with_layout.snap29
2 files changed, 66 insertions, 0 deletions
diff --git a/src/tests/e2e/cases.rs b/src/tests/e2e/cases.rs
index 3fb0d44d..807d71e8 100644
--- a/src/tests/e2e/cases.rs
+++ b/src/tests/e2e/cases.rs
@@ -1663,3 +1663,40 @@ pub fn bracketed_paste() {
};
assert_snapshot!(last_snapshot);
}
+
+#[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 #3")
+ && 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);
+}
diff --git a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__focus_tab_with_layout.snap b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__focus_tab_with_layout.snap
new file mode 100644
index 00000000..fc4ff6d4
--- /dev/null
+++ b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__focus_tab_with_layout.snap
@@ -0,0 +1,29 @@
+---
+source: src/tests/e2e/cases.rs
+expression: last_snapshot
+
+---
+ Zellij (e2e-test)  Tab #1  Tab #2  Tab #3  Tab #4  Tab #5  Tab #6  Tab #7  Tab #8  Tab #9 
+┌ Pane #1 ─────────────────────────────────────────────────┐┌ Pane #2 ─────────────────────────────────────────────────┐
+│$ ││$ █ │
+│ ││ │
+│ ││ │
+│ ││ │
+│ ││ │
+│ ││ │
+│ ││ │
+│ ││ │
+│ ││ │
+│ ││ │
+│ ││ │
+│ ││ │
+│ ││ │
+│ ││ │
+│ ││ │
+│ ││ │
+│ ││ │
+│ ││ │
+│ ││ │
+└──────────────────────────────────────────────────────────┘└──────────────────────────────────────────────────────────┘
+ Ctrl + <g> LOCK  <p> PANE  <t> TAB  <n> RESIZE  <h> MOVE  <s> SCROLL  <o> SESSION  <q> QUIT 
+ Tip: Alt + <n> => new pane. Alt + <[] or hjkl> => navigate. Alt + <+-> => resize pane.