diff --git a/narrative_docs/src/basics.md b/narrative_docs/src/basics.md index 295d466..c416675 100644 --- a/narrative_docs/src/basics.md +++ b/narrative_docs/src/basics.md @@ -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 "test@test.com" - -# 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 diff --git a/narrative_docs/src/installation.md b/narrative_docs/src/installation.md index 4f73fbe..0d1ed2b 100644 --- a/narrative_docs/src/installation.md +++ b/narrative_docs/src/installation.md @@ -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. diff --git a/narrative_docs/src/introduction.md b/narrative_docs/src/introduction.md index 0f317a1..8f27805 100644 --- a/narrative_docs/src/introduction.md +++ b/narrative_docs/src/introduction.md @@ -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