Skip to content

Commit

Permalink
GITBOOK-273: change request with no subject merged in GitBook
Browse files Browse the repository at this point in the history
  • Loading branch information
axelniklasson authored and gitbook-bot committed Apr 13, 2023
1 parent e3baab1 commit 92ae525
Show file tree
Hide file tree
Showing 17 changed files with 69 additions and 75 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ appId: com.apple.MobileAddressBook
## Resources
* Blog Post: [**Introducing: Maestro — Painless Mobile UI Automation**](https://blog.mobile.dev/introducing-maestro-painless-mobile-ui-automation-bee4992d13c1)
* GitHub Repository: [**https://github.com/mobile-dev-inc/maestro**](https://github.com/mobile-dev-inc/maestro)****
* GitHub Repository: [**https://github.com/mobile-dev-inc/maestro**](https://github.com/mobile-dev-inc/maestro)
* Public Slack Channel: [**Join the workspace**](https://docsend.com/view/3r2sf8fvvcjxvbtk), then head to the `#maestro` channel

## Get Started
Expand Down
1 change: 1 addition & 0 deletions SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
* [Configuration](api-reference/configuration/README.md)
* [Workspace configuration](api-reference/configuration/workspace-configuration.md)
* [Flow configuration](api-reference/configuration/flow-configuration.md)
* [Selectors](api-reference/selectors.md)

## Advanced

Expand Down
8 changes: 1 addition & 7 deletions api-reference/commands/assertnotvisible.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,7 @@ To assert whether an element is **visible**, use the following command that take

This command will wait for view to disappear if it is currently visible.

Please refer to the `tapOn` documentation for a full list of parameters:

{% content-ref url="tapon.md" %}
[tapon.md](tapon.md)
{% endcontent-ref %}

In particular, you are most likely going to be using the following properties:
You are most likely going to be using the following properties, but please refer to the [Selectors](../selectors.md) page for an exhaustive list of all available selectors:

* `text` - text in a view
* `id` - id of a view
Expand Down
8 changes: 1 addition & 7 deletions api-reference/commands/assertvisible.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,7 @@ To assert whether an element is **visible**, use the following command that take

This command will wait for view to appear if it is not visible yet.

Please refer to the `tapOn` documentation for a full list of parameters:

{% content-ref url="tapon.md" %}
[tapon.md](tapon.md)
{% endcontent-ref %}

In particular, you are most likely going to be using the following properties:
You are most likely going to be using the following properties, but please refer to the [Selectors](../selectors.md) page for an exhaustive list of all available selectors:

* `text` - text in a view
* `id` - id of a view
Expand Down
20 changes: 1 addition & 19 deletions api-reference/commands/copytextfrom.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,6 @@
# copyTextFrom

You can copy text from an element and save it in-memory, to paste later. To find the element, use the syntax below:

```yaml
- copyTextFrom:
text: "Text" # (optional) Finds element with text that matches regexp
id: "id" # (optional) Finds element with id that matches regexp
index: 0 # (optional) 0-based index of the view to select among those that match all other criteria
width: 100 # (optional) Finds element of a given width
height: 100 # (optional) Finds element of a given height
tolerance: 10 # (optional) Tolerance to apply when comparing width and height
enabled: true # (optional) Searches for view with a given "enabled" state
optional: false # (default: false) If set to true, test won't fail if view can't be found
below: "View above that has this text" # This will match view *above* that has the given text
above:
id: "view_below_id" # This will match a view *below* that has the given id
leftOf: "View to the right has this text"
rightOf: "View to the left has this text"
containsChild: "Text in a child view" # This will match a view that has a *direct* child view with the given text
```
You can copy text from an element and save it in-memory, to paste later. To find the element you wish to copy text from you can use Selectors. For a full list of what selectors are available, please refer to the [Selectors](../selectors.md) page.

### Usage Example

Expand Down
12 changes: 9 additions & 3 deletions api-reference/commands/extendedwaituntil.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
# extendedWaitUntil

Waits until an element becomes visible. Fails if the element is not visible after the timeout expires. This command will complete as soon as element becomes visible and is not going to wait for timeout to expire.
Waits until an element becomes visible. Fails if the element is not visible after the timeout expires. This command will complete as soon as element becomes visible and is not going to wait for timeout to expire. 

For an exhaustive list of selectors that can be used, please refer to the [Selectors](../selectors.md) page.

Example usage:

```yaml
- extendedWaitUntil:
visible: Element # Same input as in assertVisible or tapOn
visible:
id: "elementId" # or any other selector
timeout: 10000 # Timeout in milliseconds
```
Similarly, it can wait until an element disappears:
```yaml
- extendedWaitUntil:
notVisible: Element
notVisible:
id: "elementId" # or any other selector
timeout: 10000
```
2 changes: 1 addition & 1 deletion api-reference/commands/inputtext.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ Inputs text (regardless of whether any text field is currently focused or not)
```
{% hint style="warning" %}
Unfortunately unicode characters are not supported yet. Follow [GitHub issue](https://github.com/mobile-dev-inc/maestro/issues/146) for status updates.
Unfortunately unicode characters are not supported yet. Follow the [GitHub issue](https://github.com/mobile-dev-inc/maestro/issues/146) for status updates.
{% endhint %}
5 changes: 3 additions & 2 deletions api-reference/commands/scrolluntilvisible.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ To scroll towards a direction until an element becomes visible in the view hiera

<pre class="language-yaml"><code class="lang-yaml"><strong>- scrollUntilVisible:
</strong> element:
id: "viewId" # (optional) Finds view with id that matches regexp
text: "MyElementText" # (optional) Finds view with text that matches regexp
id: "viewId" # or any other selector
direction: DOWN # DOWN|UP|LEFT|RIGHT (optional, default: DOWN)
timeout: 50000 # (optional, default: 20000ms)
speed: 40 # 0-100 (optional, default: 40) Scroll speed. Higher values scroll faster.
visibilityPercentage: 100 # 0-100 (optional, default 100) Percentage of element visible in viewport
</code></pre>

Please refer to the [Selectors](../selectors.md) page for a full list of supported selectors.

#### Direction

The scroll will move towards the direction specified `DOWN|UP|LEFT|RIGHT`. For example, if `DOWN` is specified then it will start scrolling towards the bottom of the screen.
Expand Down
4 changes: 3 additions & 1 deletion api-reference/commands/swipe.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,13 @@ You can also specify elements as a starting point for swipe commands. It will sw
```yaml
- swipe:
from:
id: "feeditem_identifier" # From (x, y) center of element
id: "feeditem_identifier" # From (x, y) center of element
direction: UP # To (50% of width, 10% of height)

```
Note that you can use any selector here to target an element to swipe from. Please refer to the [Selectors](../selectors.md) page for a full list of available selectors.
#### **Swiping Coordinates**
You can also specify start and end points for the swipe to have more control:
Expand Down
26 changes: 3 additions & 23 deletions api-reference/commands/tapon.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,15 @@
# tapOn

Taps on a view on the screen:
Taps on a view on the screen using a selector:

```yaml
- tapOn:
text: "Text" # (optional) Finds text that matches regexp
id: "id" # (optional) Finds id that matches regexp
index: 0 # (optional) 0-based index of the view to select among those that match all other criteria
width: 100 # (optional) Finds element of a given width
height: 100 # (optional) Finds element of a given height
tolerance: 10 # (optional) Tolerance to apply when comparing width and height
enabled: true # (optional) Searches for view with a given "enabled" state
checked: true # (optional) Searches for view with a given "checked" state
focused: true # (optional) Searches for view with a given "focused" state
selected: true # (optional) Searches for view with a given "selected" state
optional: false # (default: false) If set to true, test won't fail if view can't be found
# or any other selector
```

### Relative Position
Maestro is also able to select views using their relative position (i.e. "below another view", or "contains child")
```yaml
- tapOn:
below: "View above that has this text" # This will match view *above* that has the given text
above:
id: "view_below_id" # This will match a view *below* that has the given id
leftOf: "View to the right has this text"
rightOf: "View to the left has this text"
containsChild: "Text in a child view" # This will match a view that has a *direct* child view with the given text
```
For a full list of selectors, please refer to the [Selectors](../selectors.md) page.

### Tapping on a specific point on the screen

Expand Down
34 changes: 34 additions & 0 deletions api-reference/selectors.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Selectors

Commands that interact with a view,&#x20;

For commands that interact with a view, such as tapOn, assertVisible, copyTextFrom among others, require the view to be found using what is called a _selector_. There are many different selectors available for usage:

```yaml
- tapOn: # or any other command that works with selectors
text: "Text" # (optional) Finds text that matches regexp
id: "id" # (optional) Finds id that matches regexp
index: 0 # (optional) 0-based index of the view to select among those that match all other criteria
width: 100 # (optional) Finds element of a given width
height: 100 # (optional) Finds element of a given height
tolerance: 10 # (optional) Tolerance to apply when comparing width and height
enabled: true # (optional) Searches for view with a given "enabled" state
checked: true # (optional) Searches for view with a given "checked" state
focused: true # (optional) Searches for view with a given "focused" state
selected: true # (optional) Searches for view with a given "selected" state
optional: false # (default: false) If set to true, test won't fail if view can't be found
```
### Relative Position selectors
Apart from the selectors mentioned above, Maestro is also able to select views using their relative position (i.e. "below another view", or "contains child")
```yaml
- tapOn: # or any other command that works with selectors
below: "View above that has this text" # This will match view *above* that has the given text
above:
id: "view_below_id" # This will match a view *below* that has the given id
leftOf: "View to the right has this text"
rightOf: "View to the left has this text"
containsChild: "Text in a child view" # This will match a view that has a *direct* child view with the given text
```
6 changes: 3 additions & 3 deletions cli/cloud.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

### Maestro Cloud

The easiest way to test your Flows in CI is to run your Flows on Maestro Cloud. Since your flows run in the cloud there's no need to configure any simulators or emulators on your end. Check out the [**Maestro Cloud Documentation**](https://app.gitbook.com/o/zCVYm3M93B0sOcjR1Oj4/s/svtyylAfMzJBiYhqoqHt/) to get started in less than 5 minutes:
The easiest way to test your Flows in CI is to run your Flows on Maestro Cloud. Since your flows run in the cloud there's no need to configure any simulators or emulators on your end. Check out the [**Maestro Cloud Documentation**](http://localhost:5000/o/zCVYm3M93B0sOcjR1Oj4/s/svtyylAfMzJBiYhqoqHt/) to get started in less than 5 minutes:

{% content-ref url="https://app.gitbook.com/o/zCVYm3M93B0sOcjR1Oj4/s/svtyylAfMzJBiYhqoqHt/" %}
[Maestro Cloud Documentation](https://app.gitbook.com/o/zCVYm3M93B0sOcjR1Oj4/s/svtyylAfMzJBiYhqoqHt/)
{% content-ref url="http://localhost:5000/o/zCVYm3M93B0sOcjR1Oj4/s/svtyylAfMzJBiYhqoqHt/" %}
[Maestro Cloud Documentation](http://localhost:5000/o/zCVYm3M93B0sOcjR1Oj4/s/svtyylAfMzJBiYhqoqHt/)
{% endcontent-ref %}
4 changes: 2 additions & 2 deletions cli/tags.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,5 @@ maestro test --include-tags=tagA --exclude-tags=tagB workspaceFolder/

The following behaviour should be expected:

* Only flows that have _both_ `tagA` __ **and **_****_ `tagNameToInclude` are going to run
* Flows that have _either_ `tagB` _ **or**_ `tagNameToExclude` are not going to run (regardless of whether they have both `tagA` and `tagNameToInclude`)
* Only flows that have _both_ `tagA` **and** `tagNameToInclude` are going to run
* Flows that have _either_ `tagB` _**or**_ `tagNameToExclude` are not going to run (regardless of whether they have both `tagA` and `tagNameToInclude`)
2 changes: 1 addition & 1 deletion getting-started/build-and-install-your-app/ios.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

Maestro currently supports iOS Simulator builds (**.app**), AppStore distribution device builds (**.ipa**) are not currently supported. The easiest way to get an app installed on the simulator is by building and running it from Xcode (make sure that simulator target is selected):

<figure><img src="../../.gitbook/assets/Screenshot 2023-02-15 at 13.46.55.png" alt=""><figcaption></figcaption></figure>
<figure><img src="../../.gitbook/assets/Screenshot 2023-02-15 at 13.46.55 (2).png" alt=""><figcaption></figcaption></figure>

## Default build location

Expand Down
2 changes: 1 addition & 1 deletion getting-started/installing-maestro/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ brew tap facebook/fb
brew install facebook/fb/idb-companion
```

__


_Note: At the moment, Maestro does not support real iOS devices_
{% endtab %}
Expand Down
6 changes: 3 additions & 3 deletions getting-started/running-flows-on-ci.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

### Maestro Cloud

The easiest way to test your Flows in CI is to run your Flows on Maestro Cloud. Since your flows run in the cloud there's no need to configure any simulators or emulators on your end. Check out the [**Maestro Cloud Documentation**](https://app.gitbook.com/o/zCVYm3M93B0sOcjR1Oj4/s/svtyylAfMzJBiYhqoqHt/) to get started in less than 5 minutes:
The easiest way to test your Flows in CI is to run your Flows on Maestro Cloud. Since your flows run in the cloud there's no need to configure any simulators or emulators on your end. Check out the [**Maestro Cloud Documentation**](http://localhost:5000/o/zCVYm3M93B0sOcjR1Oj4/s/svtyylAfMzJBiYhqoqHt/) to get started in less than 5 minutes:

{% content-ref url="https://app.gitbook.com/o/zCVYm3M93B0sOcjR1Oj4/s/svtyylAfMzJBiYhqoqHt/" %}
[Maestro Cloud Documentation](https://app.gitbook.com/o/zCVYm3M93B0sOcjR1Oj4/s/svtyylAfMzJBiYhqoqHt/)
{% content-ref url="http://localhost:5000/o/zCVYm3M93B0sOcjR1Oj4/s/svtyylAfMzJBiYhqoqHt/" %}
[Maestro Cloud Documentation](http://localhost:5000/o/zCVYm3M93B0sOcjR1Oj4/s/svtyylAfMzJBiYhqoqHt/)
{% endcontent-ref %}

### Alternatives
Expand Down
2 changes: 1 addition & 1 deletion platform-support/ios-swiftui.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ In addition to iOS UIKit apps it is possible to write maestro flows for the apps

First lets start with some basic flow for FoodTruck app. Almost every SwiftUI native element is identifiable with maestro studio. For instance here is how the first step of [first\_flow.yaml](https://github.com/artem888/sample-food-truck/blob/main/.mobiledev/first\_flow.yaml) was generated:

<figure><img src="../.gitbook/assets/Screenshot 2023-01-12 at 21.48.45.png" alt=""><figcaption></figcaption></figure>
<figure><img src="../.gitbook/assets/Screenshot 2023-01-12 at 21.48.45 (1).png" alt=""><figcaption></figcaption></figure>

`index: 0` can be omitted and the first step of the flow looks like that:

Expand Down

0 comments on commit 92ae525

Please sign in to comment.