-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
REFACTOR-78: Add e2e test case when filter is enabled
- Loading branch information
1 parent
2ead0b5
commit fa06730
Showing
6 changed files
with
76 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ Type "gg -f temp" | |
Enter | ||
Sleep 100ms | ||
Type "n" | ||
Sleep 100ms | ||
Type "network host" | ||
Down | ||
Ctrl+u | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ Type "gg -f temp" | |
Enter | ||
Sleep 100ms | ||
Type "n" | ||
Sleep 100ms | ||
Type "network host" | ||
Down | ||
Ctrl+u | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ Type "gg -f temp" | |
Enter | ||
Sleep 100ms | ||
Type "n" | ||
Sleep 100ms | ||
Type "network host" | ||
Down | ||
Ctrl+u | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
Set Shell bash | ||
Enter | ||
Type "gg -f temp" | ||
Enter | ||
Sleep 100ms | ||
Type "n" | ||
Sleep 100ms | ||
Type "network host" | ||
Down | ||
Ctrl+u | ||
Type "127.0.0.1" | ||
Down | ||
Type "network host description" | ||
Ctrl+S | ||
Sleep 100ms | ||
Type "c" # create "network host (1)" | ||
Sleep 100ms | ||
Type "c" # create "network host (2)" | ||
Sleep 100ms | ||
Type "c" # create "network host (3)" | ||
Sleep 100ms | ||
Type "c" # create "network host (4)" | ||
Sleep 100ms | ||
Type "c" # create "network host (5)" | ||
Sleep 100ms | ||
Type "/" # enter filter mode | ||
Type "3" # enter "3", so only "network host (3)" is visible | ||
Enter # Accept filter result | ||
Type "d" # ask delete "network host (3)" | ||
Type "y" # say "yes" to "network host (3)" | ||
Sleep 100ms | ||
Type "q" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
- host: | ||
title: network host | ||
description: network host description | ||
address: 127.0.0.1 | ||
- host: | ||
title: network host (1) | ||
description: network host description | ||
address: 127.0.0.1 | ||
- host: | ||
title: network host (2) | ||
description: network host description | ||
address: 127.0.0.1 | ||
- host: | ||
title: network host (4) | ||
description: network host description | ||
address: 127.0.0.1 | ||
- host: | ||
title: network host (5) | ||
description: network host description | ||
address: 127.0.0.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,35 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -x | ||
set -e | ||
|
||
# cd to this file location | ||
cd $(dirname "$(readlink -f "$0")") | ||
|
||
export VHS_PUBLISH=false # disable "Host your GIF on vhs.charm.sh: vhs publish <file>.gif" message | ||
TMP_HOME=temp | ||
HOSTS_FILE="${TMP_HOME}"/hosts.yaml | ||
|
||
function clean() { | ||
function cleanup() { | ||
rm -f out.gif "${TMP_HOME}"/* | ||
} | ||
|
||
mkdir -p "${TMP_HOME}" | ||
clean | ||
function cleanup_or_die() { | ||
local exit_code="$1" | ||
local file_name="$2" | ||
|
||
vhs 1_create.tape > /dev/null | ||
diff "${HOSTS_FILE}" expected/1_create.yaml || (echo Failed: 1_create.tape; exit 1) | ||
clean | ||
if [ "$exit_code" -ne 0 ]; then | ||
echo "Failed: ${file_name}!" | ||
exit 1; | ||
fi | ||
|
||
vhs 2_copy.tape > /dev/null | ||
diff "${HOSTS_FILE}" expected/2_copy.yaml || (echo Failed: 2_copy.tape; exit 1) | ||
clean | ||
cleanup | ||
} | ||
|
||
mkdir -p "${TMP_HOME}" | ||
cleanup | ||
|
||
vhs 3_delete.tape > /dev/null | ||
diff "${HOSTS_FILE}" expected/3_delete.yaml || (echo Failed: 3_delete.tape; exit 1) | ||
clean | ||
for file in *.tape; do | ||
vhs "$file" > /dev/null | ||
diff "${HOSTS_FILE}" "expected/${file%.*}.yaml" # file extension removed | ||
cleanup_or_die $? "$file" | ||
done |