forked from mobile-dev-inc/maestro
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
More e2e tests (mobile-dev-inc#2124)
* Add additional failure e2e tests for different assert commands * Add additional failure e2e tests for launching apps * Add e2e test to tour commands * Fix escaping of structured logging in e2e tests * Allow e2e-tests longer to run * Relax timings on extendedWaitUntil e2e test * Relax tap retries when waiting for repaint
- Loading branch information
1 parent
ad5fbe7
commit 45eb40e
Showing
29 changed files
with
462 additions
and
4 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
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
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,13 @@ | ||
appId: com.example.example | ||
--- | ||
|
||
- launchApp # For idempotence of sections | ||
|
||
- assertNotVisible: 'kwyjibo' | ||
|
||
- assertNotVisible: | ||
text: 'kwyjibo' | ||
|
||
- assertNotVisible: | ||
text: 'Form Test' | ||
enabled: false |
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,12 @@ | ||
appId: com.example.example | ||
--- | ||
|
||
- launchApp # For idempotence of sections | ||
|
||
- assertTrue: ${"test" == "test"} | ||
|
||
- assertTrue: | ||
condition: ${12 < 20} | ||
|
||
- assertTrue: | ||
condition: ${THING == "five"} # Using the env at the top of the file |
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,12 @@ | ||
appId: com.example.example | ||
--- | ||
|
||
- launchApp # For idempotence of sections | ||
|
||
- assertVisible: 'Form Test' | ||
|
||
- assertVisible: | ||
text: 'Form Test' | ||
|
||
- assertVisible: | ||
id: 'fabAddIcon' |
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,8 @@ | ||
appId: com.example.example | ||
--- | ||
- launchApp # For idempotence of sections | ||
|
||
- tapOn: 'Form Test' | ||
- assertVisible: 'Login' | ||
- back | ||
- assertVisible: 'Form Test' |
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,10 @@ | ||
appId: com.example.example | ||
--- | ||
- launchApp # For idempotence of sections | ||
|
||
- tapOn: | ||
id: 'fabAddIcon' | ||
retryTapIfNoChange: false | ||
- copyTextFrom: | ||
text: '\d+' | ||
- assertTrue: ${maestro.copiedText == '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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
appId: com.example.example | ||
--- | ||
- launchApp # For idempotence of sections | ||
|
||
- tapOn: 'Form Test' | ||
- tapOn: 'Email' | ||
- inputText: 'foo' | ||
- assertVisible: 'foo' | ||
- eraseText | ||
- assertNotVisible: 'foo' | ||
|
||
- inputText: 'testing' | ||
- assertVisible: 'testing' | ||
- eraseText: 3 | ||
- assertNotVisible: 'testing' | ||
- assertVisible: | ||
text: 'test' | ||
optional: true # FIXME: This still takes an extra character sometimes, even after #2123 |
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,7 @@ | ||
appId: com.example.example | ||
--- | ||
|
||
- launchApp # For idempotence of sections | ||
|
||
- evalScript: ${output.test = 'foo'} | ||
- assertTrue: ${output.test == 'foo'} |
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,13 @@ | ||
appId: com.example.example | ||
--- | ||
- launchApp # For idempotence of sections | ||
|
||
- extendedWaitUntil: | ||
timeout: 10000 | ||
visible: | ||
text: 'Swipe Test' | ||
|
||
- extendedWaitUntil: | ||
timeout: 100 | ||
notVisible: | ||
text: 'Non Existent Text' |
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,11 @@ | ||
appId: com.example.example | ||
--- | ||
- launchApp # For idempotence of sections | ||
|
||
- tapOn: 'Form Test' | ||
- tapOn: 'Email' | ||
- assertVisible: | ||
id: com.google.android.inputmethod.latin:id/key_pos_shift # The shift key on the Android keyboard | ||
- hideKeyboard | ||
- assertNotVisible: | ||
id: com.google.android.inputmethod.latin:id/key_pos_shift |
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,9 @@ | ||
appId: com.example.example | ||
--- | ||
- launchApp # For idempotence of sections | ||
|
||
- tapOn: 'Input Test' | ||
- tapOn: | ||
id: 'textInput' | ||
- inputRandomEmail | ||
- assertVisible: '.+@.+' |
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,18 @@ | ||
appId: com.example.example | ||
--- | ||
- launchApp # For idempotence of sections | ||
|
||
- tapOn: 'Input Test' | ||
- tapOn: | ||
id: 'textInput' | ||
- inputRandomNumber | ||
- assertVisible: | ||
text: '\d{8}' # The default length is 8 | ||
id: 'textInput' | ||
|
||
- eraseText | ||
- inputRandomNumber: | ||
length: 4 | ||
- assertVisible: | ||
text: '\d{4}' | ||
id: 'textInput' |
11 changes: 11 additions & 0 deletions
11
e2e/workspaces/demo_app/commands/inputRandomPersonName.yaml
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,11 @@ | ||
appId: com.example.example | ||
--- | ||
- launchApp # For idempotence of sections | ||
|
||
- tapOn: 'Input Test' | ||
- tapOn: | ||
id: 'textInput' | ||
- inputRandomPersonName | ||
- assertVisible: | ||
text: '[A-Z][a-z]+ [A-Z][a-z]+' | ||
id: 'textInput' |
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,18 @@ | ||
appId: com.example.example | ||
--- | ||
- launchApp # For idempotence of sections | ||
|
||
- tapOn: 'Input Test' | ||
- tapOn: | ||
id: 'textInput' | ||
- inputRandomText | ||
- assertVisible: | ||
text: '[a-z0-9]{8}' # The default length is 8 | ||
id: 'textInput' | ||
|
||
- eraseText | ||
- inputRandomText: | ||
length: 4 | ||
- assertVisible: | ||
text: '[a-z0-9]{4}' | ||
id: 'textInput' |
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,9 @@ | ||
appId: com.example.example | ||
--- | ||
- launchApp # For idempotence of sections | ||
|
||
- tapOn: 'Input Test' | ||
- tapOn: | ||
id: 'textInput' | ||
- inputText: 'foo' | ||
- assertVisible: 'foo' |
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,7 @@ | ||
appId: com.example.example | ||
--- | ||
|
||
- launchApp | ||
- assertVisible: 'Form Test' | ||
- killApp | ||
- assertNotVisible: 'Form Test' |
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,14 @@ | ||
appId: com.example.example | ||
--- | ||
- launchApp: | ||
appId: com.example.example | ||
clearState: true | ||
clearKeychain: true | ||
stopApp: true | ||
permissions: | ||
all: allow | ||
- assertVisible: 'Form Test' | ||
|
||
- stopApp | ||
- launchApp | ||
- assertVisible: 'Form Test' |
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,13 @@ | ||
appId: com.example.example | ||
--- | ||
- launchApp # For idempotence of sections | ||
|
||
- evalScript: ${maestro.copiedText = 'foo'} | ||
- tapOn: 'Input Test' | ||
- tapOn: | ||
id: 'textInput' | ||
- inputText: 'foo' | ||
- copyTextFrom: | ||
id: 'textInput' | ||
- pasteText | ||
- assertVisible: 'foofoo' |
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,15 @@ | ||
appId: com.example.example | ||
--- | ||
- launchApp | ||
|
||
- assertVisible: 'Form Test' | ||
- pressKey: 'Home' | ||
- assertNotVisible: 'Form Test' | ||
|
||
- launchApp | ||
|
||
- assertVisible: 'Form Test' | ||
- tapOn: 'Form Test' | ||
- assertNotVisible: 'Form Test' | ||
- pressKey: 'Back' | ||
- assertVisible: 'Form Test' |
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,19 @@ | ||
appId: com.example.example | ||
--- | ||
- launchApp # For idempotence of sections | ||
|
||
- assertVisible: '0' | ||
- repeat: | ||
times: 3 | ||
commands: | ||
- tapOn: | ||
id: 'fabAddIcon' | ||
- assertVisible: '3' | ||
- assertNotVisible: '0' | ||
|
||
- evalScript: ${output.counter = 0} | ||
- repeat: | ||
while: | ||
true: ${output.counter < 3} | ||
commands: | ||
- evalScript: ${output.counter = output.counter + 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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
appId: com.example.example | ||
--- | ||
|
||
# runFlow with file: isn't included since it's in the root flow | ||
|
||
- launchApp # For idempotence of sections | ||
|
||
- runFlow: | ||
commands: | ||
- evalScript: ${output.test = 'bar'} | ||
- assertTrue: ${output.test == 'bar'} | ||
- tapOn: | ||
id: 'fabAddIcon' | ||
- assertVisible: '1' | ||
|
||
- runFlow: | ||
env: | ||
THIS_THING: "six" | ||
commands: | ||
- assertTrue: ${THIS_THING == "six"} |
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,5 @@ | ||
if (THIS_THING == "six"){ | ||
output.something = "foo" | ||
} else { | ||
output.something = "bar" | ||
} |
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,23 @@ | ||
appId: com.example.example | ||
--- | ||
|
||
- launchApp # For idempotence of sections | ||
|
||
- evalScript: ${output.something = 'baz'} | ||
|
||
- runScript: runScript.js | ||
- assertTrue: ${output.something == 'bar'} | ||
|
||
- evalScript: ${output.something = 'baz'} | ||
|
||
- runScript: | ||
file: runScript.js | ||
- assertTrue: ${output.something == 'bar'} | ||
|
||
- evalScript: ${output.something = 'baz'} | ||
|
||
- runScript: | ||
env: | ||
THIS_THING: "six" | ||
file: runScript.js | ||
- assertTrue: ${output.something == 'foo'} |
Oops, something went wrong.