126 lines
3.5 KiB
Plaintext
126 lines
3.5 KiB
Plaintext
|
|
- console:
|
|
name: Console creation
|
|
console_name: term
|
|
doc: Opening the console
|
|
key: $(test)_PASS
|
|
steps:
|
|
- open:
|
|
protocol: terminal
|
|
terminal_path: $(test_directory)
|
|
{% if os == "Linux" %}
|
|
- writeln: echo "endOfOpen"
|
|
{% endif %}
|
|
|
|
- console:
|
|
name: Console read_until with timeout
|
|
console_name: term
|
|
key: $(test)_PASS
|
|
steps:
|
|
{% if os == "Linux" %}
|
|
- read_until: {expected: endOfOpen, timeout: 5}
|
|
{% else %}
|
|
- read_until: {expected: $(terminal_prompt), timeout: 5}
|
|
{% endif %}
|
|
|
|
- console:
|
|
name: Console write
|
|
console_name: term
|
|
key: $(test)_PASS
|
|
steps:
|
|
- writeln: echo 0
|
|
|
|
- sleep:
|
|
name: sleep item
|
|
timeout: 1
|
|
|
|
- console:
|
|
name: Console read_until immediate
|
|
console_name: term
|
|
key: $(test)_PASS
|
|
steps:
|
|
{% if os == "Windows" %}
|
|
- read_until: {expected: "echo 0", timeout: 0}
|
|
{% endif %}
|
|
- read_until: {expected: "0", timeout: 0}
|
|
|
|
- console:
|
|
name: Console write
|
|
console_name: term
|
|
key: $(test)_PASS
|
|
steps:
|
|
- writeln: echo "HelloConsole"
|
|
|
|
- console:
|
|
name: Console read_until fail
|
|
console_name: term
|
|
key: $(test)_FAIL
|
|
steps:
|
|
- read_until: {expected: "Something never prints", timeout: 1}
|
|
|
|
- console:
|
|
name: Console write
|
|
console_name: term
|
|
key: $(test)_PASS
|
|
steps:
|
|
- writeln: echo "HelloConsole"
|
|
|
|
- console:
|
|
name: Console read_until no_fail
|
|
console_name: term
|
|
key: $(test)_PASS
|
|
steps:
|
|
- read_until: {expected: Something never prints, timeout: 1, no_fail: true}
|
|
|
|
- console:
|
|
name: Console read_until muted
|
|
console_name: term
|
|
key: $(test)_PASS
|
|
steps:
|
|
- writeln: echo "HelloConsole"
|
|
{% if os == "Windows" %}
|
|
- read_until: {expected: echo "HelloConsole", timeout: 1, mute: true}
|
|
{% endif %}
|
|
- read_until: {expected: HelloConsole, timeout: 1, mute: true}
|
|
|
|
- console:
|
|
name: Console read_until float timeout
|
|
console_name: term
|
|
key: $(test)_PASS
|
|
steps:
|
|
- writeln: echo "HelloConsole"
|
|
{% if os == "Windows" %}
|
|
- read_until: {expected: echo "HelloConsole", timeout: 0.2}
|
|
{% endif %}
|
|
- read_until: {expected: HelloConsole, timeout: 0.2}
|
|
|
|
- console:
|
|
name: Console read_until process result
|
|
console_name: term
|
|
key: $(test)_PASS
|
|
steps:
|
|
- writeln: echo "HelloConsole is PASS" && echo "endOfCmd"
|
|
{% if os == "Windows" %}
|
|
- read_until: {expected: echo "endOfCmd", timeout: 1}
|
|
{% endif %}
|
|
- read_until: {expected: endOfCmd, timeout: 1, process_result: "'Hello' in r'''$(result)''' and 'PASS' in r'''$(result)''' "}
|
|
|
|
{% if os == "Linux" %}
|
|
- console:
|
|
name: Console runs on host (not the Flatpak sandbox)
|
|
doc: Regression guard for the 0.2.1 Flatpak bug (term console spawned inside the sandbox instead of on the host). /.flatpak-info exists only inside the sandbox, so the host-only marker is emitted (and matched by read_until) ONLY when the shell really runs on the host. On a broken Flatpak the marker never appears, read_until times out and the item FAILS. The marker is built at runtime ($M) so it is never present in the command line itself. Passes on every other channel.
|
|
console_name: term
|
|
key: $(test)_PASS
|
|
steps:
|
|
- writeln: 'test -e /.flatpak-info && M=SANDBOX || M=HOST; echo "console_host_check_$M"'
|
|
- read_until: {expected: console_host_check_HOST, timeout: 5}
|
|
{% endif %}
|
|
|
|
- console:
|
|
name: Console closure
|
|
execute_on_stop: true
|
|
console_name: term
|
|
key: $(test)_PASS
|
|
steps:
|
|
- close: term
|