-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add day29 for httprunner parameters data driven test
- Loading branch information
Showing
9 changed files
with
72 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
base_url=https://www.google.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
reports/* | ||
__pycache__/* | ||
*.pyc | ||
.python-version | ||
logs/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
name: google search | ||
base_url: ${ENV(base_url)} | ||
variables: | ||
keyword: httprunner in api | ||
request: | ||
url: /search | ||
method: GET | ||
params: | ||
q: $keyword | ||
validate: | ||
- eq: ["status_code", 200] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
keyword | ||
YApi | ||
httprunner | ||
testcafe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
|
||
import time | ||
|
||
def sleep(n_secs): | ||
time.sleep(n_secs) | ||
|
||
def get_keyword(): | ||
return [ | ||
{"keyword": "YApi"}, | ||
{"keyword": "httprunner"} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
config: | ||
name: testcase validate search result | ||
base_url: ${ENV(base_url)} | ||
variables: | ||
keyword: httprunner in testcase | ||
|
||
teststeps: | ||
- name: validate title "$keyword" | ||
api: api/google_search.yml | ||
extract: | ||
- title: "<title>(.*)</title>" | ||
validate: | ||
- startswith: ["$title", "$keyword"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
config: | ||
name: "testsuite google search" | ||
base_url: ${ENV(base_url)} | ||
|
||
testcases: | ||
- name: call validate_title | ||
testcase: testcases/validate_title.yml | ||
parameters: | ||
keyword: ${P(data/keyword.csv)} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
config: | ||
name: "testsuite google search" | ||
base_url: ${ENV(base_url)} | ||
|
||
testcases: | ||
- name: call validate_title | ||
testcase: testcases/validate_title.yml | ||
parameters: | ||
keyword: ${get_keyword()} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
config: | ||
name: "testsuite google search" | ||
base_url: ${ENV(base_url)} | ||
|
||
testcases: | ||
- name: call validate_title | ||
testcase: testcases/validate_title.yml | ||
parameters: | ||
keyword: ["httprunner", "testcafe"] |