Test the finishing touches on your skill!
# Add polish to your skill project
spruce setup.polish
Your skills polish script can be found at src/{{namespace}}.polish.ts
The default script has a working example of a polish run for the heartwood skill.
# Running polish
yarn polish
If all steps have passed the command will return 0
, otherwise it will return 1
BASE_URL
- Base url defaults to:https://spruce.bot
HEADLESS
- set to HEADLESS=false to watch the steps as they are performed
# Example Usage
BASE_URL=https://dev.spruce.bot HEADLESS=false yarn polish
- Click
# to click a button
{
click: {
target: [['Button', 'primary']],
},
},
# to click a dialog confirm
{
click: {
target: [['Dialog', 'primary']],
},
},
# to click the navMenu calendar icon
{
click: {
target: [['NavMenu', 'calendar']],
},
},
# to click a link on a navMenu
{
click: {
target: [['NavLink', 'appointments']],
},
},
- Redirect
# to redirect to a different skill view controller
{
redirect: {
id: 'calendar.root',
},
},
- Type Text
# To type text into an input field named 'firstName'
{
typeText: {
target: [['Field', 'firstName']],
text: 'Spruce',
},
},
# to assert a text input value
{
assert: {
target: [['Field', 'firstName']],
inputValue: {
equals: 'Spruce',
},
},
},
# to assert title on the present slide
{
assert: {
target: ['Card'],
presentSlide: {
titleEquals: 'Select armor',
},
},
},
# to assert the zero based slideIdx on the present slide
{
assert: {
target: ['Card'],
presentSlide: {
slideIdx: 1,
},
},
},
# to assert both a title & slideIdx on the present slide
{
assert: {
target: ['Card'],
presentSlide: {
titleEquals: 'Select armor',
slideIdx: 1,
},
},
},