Appearance
Write a test in plain words
In plain words
Once StepTrails has seen your website, you can describe a new test in everyday words, such as "log in, open Orders, search for shoes". StepTrails turns the words into a test using only buttons and fields it has already seen. If it is not sure what you mean, it stops and tells you. It never guesses. This page is for people comfortable with a terminal.
Before you begin
StepTrails needs to have learned your website first. It learns from recordings you already made: see Screen memory. In short:
bash
node bin/memory.js learn steptrails-recording.json --system shopshop is just a short name you choose for the website. Use small letters. The more recordings you teach it, the more it knows.
Write the test
bash
node bin/memory.js author --system shop --base-url https://shop.example.com --steps "log in, open Orders, search for shoes" --out orders.json--systemis the name you chose above.--base-urlis the web address to test. It goes into the test file. The memory itself never keeps addresses.--stepsis what to do, separated by commas.--outis the file to make. Leave it out to just see the test on the screen.
You should see what StepTrails understood, then the name of the new file:
text
Understood:
1. Click "Log in" (on /login)
2. Click "Orders" (on /dashboard)
3. Type "shoes" into "Search" (on /orders)
Wrote orders.json (4 steps). Play it with: node bin/replay.js orders.jsonPlay it back like any other recording: node bin/replay.js orders.json.
What you can say
| You write | What it means |
|---|---|
click Log in or just log in | Click the button or link called "Log in" |
open Orders | Click the link called "Orders". If there is none, go to the screen called "Orders" |
go to /orders | Go to that screen |
type "raj@example.com" into Email | Type into the field called "Email" |
fill Email with raj@example.com | The same |
search for shoes | Type "shoes" into the field called "Search" |
select India from Country | Choose an option in a drop-down list |
tick Accept terms or untick Accept terms | Tick or untick a box |
hover over Products | Rest the pointer on something |
press Enter in Search or just press Enter | Press a key. A bare "press Enter" uses the field you typed into last |
Put a value in quotes when it has a comma in it: type "red, blue" into Search. You can also start a step on a certain screen: search for shoes on /orders.
If a step needs a screen that is not the one you are on, StepTrails adds the clicks it has seen work to get there, and tells you which ones.
It does not guess
StepTrails only uses a name that matches exactly (small or capital letters do not matter). Say Log in, not login. A name that only looks similar is offered as a suggestion, and the whole test is not made until you fix the step. For example:
text
Nothing was written, because one step could not be matched:
Step 2 "click pay now": I could not find something to click called "pay now" in the memory. Did you mean "Pay with card" (click on /orders)?This is on purpose. A guess that is slightly wrong gives you a test that looks fine but checks the wrong thing.
Other reasons a step stops the test:
- The same name is on more than one screen. Add
on /ordersto say which one. - The name is not in the memory yet. Record a flow that uses it, and teach it with
learn. - A screen has a number in its address, such as an order number. StepTrails cannot open that directly, so start from a screen without one.
Passwords stay out
If a field looks like a secret (a password, a card number, a code), StepTrails does not write the value you typed. It writes *** and tells you so. It also hides the value in everything it shows you. Give the real value when you play the test back, with the setting STEPTRAILS_SECRETS: see Environment settings.
What it does not do yet
- It cannot write checks such as "the page says Thank you". Add them when you review a recording.
- It understands the steps in the table above, in English. It does not use an AI, so it costs nothing and sends nothing anywhere.
- It does not change the memory. Reading it is safe to do as often as you like.