summaryrefslogtreecommitdiffstats
path: root/src/tests/e2e
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests/e2e')
-rw-r--r--src/tests/e2e/cases.rs19
-rw-r--r--src/tests/e2e/remote_runner.rs3
-rw-r--r--src/tests/e2e/snapshots/zellij__tests__e2e__cases__send_command_through_the_cli.snap8
3 files changed, 25 insertions, 5 deletions
diff --git a/src/tests/e2e/cases.rs b/src/tests/e2e/cases.rs
index 44551d997..359d74162 100644
--- a/src/tests/e2e/cases.rs
+++ b/src/tests/e2e/cases.rs
@@ -1915,6 +1915,25 @@ pub fn send_command_through_the_cli() {
},
})
.add_step(Step {
+ name: "Initial run of suspended command",
+ instruction: |mut remote_terminal: RemoteTerminal| -> bool {
+ let mut step_is_complete = false;
+ if remote_terminal.snapshot_contains("<Ctrl-c>")
+ && remote_terminal.cursor_position_is(0, 0)
+ // cursor does not appear in
+ // suspend_start panes
+ {
+ remote_terminal.send_key(&SPACE); // run script - here we use SPACE
+ // instead of the default ENTER because
+ // sending ENTER over SSH can be a little
+ // problematic (read: I couldn't get it
+ // to pass consistently)
+ step_is_complete = true
+ }
+ step_is_complete
+ },
+ })
+ .add_step(Step {
name: "Wait for command to run",
instruction: |mut remote_terminal: RemoteTerminal| -> bool {
let mut step_is_complete = false;
diff --git a/src/tests/e2e/remote_runner.rs b/src/tests/e2e/remote_runner.rs
index dd2c800da..9b007989c 100644
--- a/src/tests/e2e/remote_runner.rs
+++ b/src/tests/e2e/remote_runner.rs
@@ -346,7 +346,8 @@ impl RemoteTerminal {
let mut channel = self.channel.lock().unwrap();
channel
.write_all(
- format!("{} run -- \"{}\"\n", ZELLIJ_EXECUTABLE_LOCATION, command).as_bytes(),
+ // note that this is run with the -s flag that suspends the command on startup
+ format!("{} run -s -- \"{}\"\n", ZELLIJ_EXECUTABLE_LOCATION, command).as_bytes(),
)
.unwrap();
channel.flush().unwrap();
diff --git a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__send_command_through_the_cli.snap b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__send_command_through_the_cli.snap
index 84d33a037..0603ac26e 100644
--- a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__send_command_through_the_cli.snap
+++ b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__send_command_through_the_cli.snap
@@ -1,14 +1,14 @@
---
source: src/tests/e2e/cases.rs
-assertion_line: 1968
+assertion_line: 1998
expression: last_snapshot
---
Zellij (e2e-test)  Tab #1 
┌ Pane #1 ─────────────────────────────────────────────────┐┌ /usr/src/zellij/fixtures/append-echo-script.sh ──────────┐
│$ /usr/src/zellij/x86_64-unknown-linux-musl/release/zellij││foo │
-│ run -- "/usr/src/zellij/fixtures/append-echo-script.sh" ││foo │
-│$ ││█ │
-│ ││ │
+│ run -s -- "/usr/src/zellij/fixtures/append-echo-script.sh││foo │
+│" ││█ │
+│$ ││ │
│ ││ │
│ ││ │
│ ││ │