-
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.
Add notes for useful Maestro techniques
- Loading branch information
1 parent
8bf0ee9
commit 9ef5ddb
Showing
1 changed file
with
52 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,52 @@ | ||
[Cross platform techniques](https://blog.mobile.dev/best-practices-for-cross-platform-maestro-ui-testing-for-android-and-ios-98d1c471a838) | ||
|
||
## Platform specific init scripts | ||
|
||
Specify platform specific IDs. | ||
|
||
In a test.yaml | ||
|
||
```yaml | ||
- runScript: | ||
when: | ||
platform: iOS | ||
file: ios/init.js | ||
|
||
#... more runScripts (for other platforms) | ||
|
||
- tapOn: | ||
id: ${output.wallpapers.wallpaperItem} | ||
index: 0 | ||
``` | ||
ios/init.js | ||
```js | ||
output.wallpapers = { | ||
wallpaperItem: 'imageItem', | ||
} | ||
``` | ||
|
||
## Run platform specific flows | ||
|
||
In a test.yaml this runs `Date.yaml` only on iOS. `Date.yaml` is expected to specify tests. | ||
|
||
```yaml | ||
- runFlow: | ||
when: | ||
platform: iOS | ||
file: Date.yaml | ||
``` | ||
See further down page on how to test platform share window. | ||
## Inline platform specific tests | ||
```yaml | ||
- runFlow: | ||
when: | ||
platform: Android | ||
commands: | ||
- assertVisible: | ||
id: "setWallpaperIconButton" | ||
``` |