Skip to content

Commit

Permalink
Add documentation for wait-for-property-false command
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Sep 27, 2024
1 parent 0afaa70 commit 5c03947
Showing 1 changed file with 51 additions and 1 deletion.
52 changes: 51 additions & 1 deletion goml-script.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ Here's the command list:
* [`wait-for-position`](#wait-for-position)
* [`wait-for-position-false`](#wait-for-position-false)
* [`wait-for-property`](#wait-for-property)
* [`wait-for-property-false`](#wait-for-property-false)
* [`wait-for-text`](#wait-for-text)
* [`wait-for-size`](#wait-for-size)
* [`wait-for-window-property`](#wait-for-window-property)
Expand Down Expand Up @@ -2173,7 +2174,7 @@ wait-for-property: ("//*[@id='element']", {"scrollTop": 10, "name": "hello"})
wait-for-property: ("#element", {"key"."sub-key": "value"})
```

If you want to check that a property doesn't exist, you can use `null`:
If you want to wait for a property to be removed, you can use `null`:

```
// Checking that "property-name" doesn't exist.
Expand All @@ -2200,6 +2201,55 @@ wait-for-property: (
)
```

If you want to wait for any of the properties to not be the provided ones, take a look at [`wait-for-property-false`](#wait-for-property-false).

#### wait-for-property-false

**wait-for-property-false** command waits for any of the given element(s) to not have the expected values for the given properties. It'll wait up to 30 seconds by default before failing (can be changed with the [`timeout`](#timeout) command).

Examples:

```
wait-for-property-false: ("#element", {"scrollTop": 10})
wait-for-property-false: ("#element", {"scrollTop": 10, "name": "hello"})
// Same with an XPath:
wait-for-property-false: ("//*[@id='element']", {"scrollTop": 10})
wait-for-property-false: ("//*[@id='element']", {"scrollTop": 10, "name": "hello"})
// You can also use object-paths:
wait-for-property-false: ("#element", {"key"."sub-key": "value"})
```

If you want to wait for a property to be created, you can use `null`:

```
// Checking that "property-name" doesn't exist.
wait-for-property-false: ("#id > .class", {"property-name": null})
```

You can use more specific checks as well by using one of the following identifiers: "ALL", "CONTAINS", "ENDS_WITH", "STARTS_WITH" or "NEAR".

```
wait-for-property-false: (
"#id",
{"className": "where", "title": "a title"},
STARTS_WITH,
)
```

You can even combine the checks:

```
wait-for-property-false: (
"#id",
{"className": "where", "title": "a title"},
[STARTS_WITH, ENDS_WITH, ALL],
)
```

If you want to wait for all properties to have the expected values, take a look at [`wait-for-property`](#wait-for-property).

#### wait-for-size

**wait-for-size** command wait for the given element(s) that either the "width" or the "height" (or both) have the expected value. Examples:
Expand Down

0 comments on commit 5c03947

Please sign in to comment.