Skip to content

Commit

Permalink
minor: clicking
Browse files Browse the repository at this point in the history
  • Loading branch information
liquidg3 committed Jul 30, 2024
1 parent e9325f4 commit dea3ea1
Showing 1 changed file with 97 additions and 0 deletions.
97 changes: 97 additions & 0 deletions src/pages/concepts/tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,103 @@

Coming soon...

## Polish

The `Polish` system is built to facilitate front-end automated testing. It is a simple, yet powerful, system that allows you to write "Polish Scripts" quickly and easily.

### Creating your first Polish Script

Assuming you are already in a `Skill` or module, you can create a new Polish Script by running the following command:

```bash
spruce setup.polish
```

### Examples

<details>
<summary>Logging In</summary>

```ts
import { PolishStep } from '@sprucelabs/heartwood-polish'

const script: PolishStep[] = [
{
click: {
target: [['Field', 'phone']],
text: '555-000-0018',
},
},
{
typeText: {
target: [['Field', 'pin']],
value: '0000'
}
}
]

export default script
```
</details>

<details>
<summary>Clicking Buttons</summary>

When you are clicking buttons, you can click by the following:

1. `primary`
2. `descructive`
3. Index (zero based)

```ts
import { PolishStep } from '@sprucelabs/heartwood-polish'

const script: PolishStep[] = [
{
click: {
target: [['button', 'primary']],
},
},
{
click: {
target: [['button', 'destructive']],
},
},
{
click: {
target: [['button', 0]],
},
},
{
click: {
target: [['button', 1]],
},
},
]

export default script
```
</details>

<details>
<summary>Clicking Buttons in Dialogs</summary>

```ts
import { PolishStep } from '@sprucelabs/heartwood-polish'

const script: PolishStep[] = [
{
click: {
target: ['Dialog', ['Button','primary']]
}
}
]

export default script
```

</details>

### Something Missing?

<div class="grid-buttons">
Expand Down

0 comments on commit dea3ea1

Please sign in to comment.