Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
TalhaFaisalglor committed Aug 1, 2024
2 parents d125e46 + dea3ea1 commit f8fd180
Show file tree
Hide file tree
Showing 7 changed files with 1,208 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/pages/concepts/events.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Events are very robust, especially when compared to standard verb based HTTP req

## Event File Structure

When you register an event as a skill (see "Registering an Event" below), the following files will be created:
When you register an event as a skill (see ["Registering an Event"](#registering-an-event) below), the following files will be created:

```
>ls src/events/{eventName}/v2024_01_01
Expand Down
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
Loading

0 comments on commit f8fd180

Please sign in to comment.