Skip to content

Commit

Permalink
narrative doc updates for installation
Browse files Browse the repository at this point in the history
  • Loading branch information
bcpeinhardt committed Jan 9, 2023
1 parent 4f5b1e3 commit 9d63a58
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 28 deletions.
14 changes: 4 additions & 10 deletions narrative_docs/src/basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,14 @@ To ensure point number 1, SchnauzerUI smart swaps elements for given commands. L
## Error Handling
UI tests can be brittle. Sometimes you simply want to write a long
test flow (even when testing gurus tell you not too) without it bailing at the first slow page load. For this, SchnauzerUI
provides the `catch-error:` command for gracefully recovering from errors and resuming test runs. We can improve the
previous test example like so
provides the `catch-error:` command for gracefully recovering from errors and resuming test runs:
```SchnauzerUI
# Type in username (located by labels)
locate "Username" and type "[email protected]"
# Type in password (located by placeholder)
locate "Password" and type "Password123!"
# Click the submit button (located by element text)
locate "Submit" and click
...
# This page is quite slow to load, so we'll try again if something goes wrong
catch-error: screenshot and refresh and try-again
...
................
```
Here, the `catch-error:` command gives us the chance to reset the page by refreshing
Expand Down
22 changes: 6 additions & 16 deletions narrative_docs/src/installation.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,14 @@
# Installation

**** *Heads up, these instructions are a bit technical. If you don't feel confident installing
this on your own, check out the youtube installation tutorial: todo create youtube install tutorial* ****

Note: SchnauzerUI executes against running chromedriver and geckodriver processes, but handles downloading,
running and stopping them itself. You should be able to do everything with just SchnauzerUI and the browser
you want to test in. Just make sure to have ports 4444 and 9515 open. If you don't know what that means,
then you're probably good to go.

To install SchnauzerUI, check [github](https://github.com/bcpeinhardt/schnauzerUI) for a
download link for your operating system. Be sure to save it somewhere in your PATH.
download link for your operating system. Be sure to add it to your PATH.
Alternatively, if you have the rust toolchain installed, you can build it from source by running
`cargo install https://github.com/bcpeinhardt/schnauzerUI`
Also, go ahead and add `$HOME/.webdrivers` to your path as well. This is where chromedriver
and geckodriver will be downloaded to.
`cargo install --git https://github.com/bcpeinhardt/schnauzerUI`

Hopefully, a browser opened up on your computer. In the terminal, you will be prompted for a name for your script.
Once you've done that, you'll be prompted for a command. Try `url "https://youtube.com"`.
The browser should navigate to youtube, and once the page has loaded, the terminal will ask whether you want to save
the step. Just hit enter to auto save and keep going.
To verify proper installation, try running `sui -i` from a terminal.
Hopefully, a chrome browser opened up on your computer. In the terminal, follow the prompts
until you're asked for a command. Try `url "https://youtube.com"`, and the open chrome browser
should navigate to youtube. Hit enter to save the command after it executes.

Congrats! You're all set up. To quit, type `exit` in the terminal and hit enter. It should close the browser for you,
but not before asking if you want to save your script. Type "N" to discard the script.
4 changes: 2 additions & 2 deletions narrative_docs/src/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ locate "Search" and type "cats" and press "Enter"
```

This is the only code necessary to write in order to run the test in a live
browser and generate a test report. You can place this code in a file called `yt.sui`
and run the test with `sui -f ./yt.sui`. It will launch chrome, perform
browser and generate a test report. You can place this code in a file called `myTest.sui`
and run the test with `sui -f ./myTest.sui`. It will launch chrome, perform
the search, and produce an html test report as well as json output.

This works
Expand Down

0 comments on commit 9d63a58

Please sign in to comment.