Skip to content

Commit

Permalink
add examples
Browse files Browse the repository at this point in the history
Signed-off-by: josecarlos <hola@josecarlos.me>
  • Loading branch information
JoseCarlosGarcia95 committed Mar 1, 2022
1 parent 2180c06 commit b300a4d
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 0 deletions.
30 changes: 30 additions & 0 deletions content/en/docs/Scenarios/browser.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,33 @@ Run test using Google Chrome.
|:----------|:-------------|
| selector | Where to search? |
| text | Search for a text string |

# Example
```yaml
name: browser_test
description: test browser
scrapeInterval: 1m
timeout: 1s
tags:
sla: dev
scenario:
kind: browser
steps:
- type: navigateTo
timeout: 1m
params:
url: "https://hidra.cloud/"
- type: waitVisible
params:
selector: "#td-cover-block-0 > div > div > div > div > div > div > a.btn.btn-lg.btn-primary.mr-3.mb-4"
- type: click
params:
selector: "#td-cover-block-0 > div > div > div > div > div > div > a.btn.btn-lg.btn-primary.mr-3.mb-4"
- type: urlShouldBe
params:
url: "https://hidra.cloud/docs/"
- type: textShouldBe
params:
selector: 'body > div > div > div > main > div > div.pageinfo.pageinfo-primary > p'
text: Welcome to the Hidra documentation!
```
28 changes: 28 additions & 0 deletions content/en/docs/Scenarios/ftp.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,31 @@ weight: 1
| Param | Description |
|:----------|:-------------|
| test-file | File to delete |

# Example
```yaml
name: ftp_basic_example
description: Test that google.com has a TLS certificate
scrapeInterval: 1m
scenario:
kind: ftp
steps:
- type: connectTo
params:
to: ftp.dlptest.com:21
- type: login
params:
user: dlpuser
password: rNrKYTX9g7z3RgJRmxWuGHbeu
- type: write
params:
data: "test"
test-file: test-file.txt
- type: read
params:
test-file: test-file.txt
data: "test"
- type: delete
params:
test-file: test-file.txt
```

0 comments on commit b300a4d

Please sign in to comment.