feat: set testcase and request timeout in seconds

This commit is contained in:
lilong.129
2023-05-03 12:48:20 +08:00
parent d27729edc6
commit 4ee3b43d1f
4 changed files with 106 additions and 79 deletions

View File

@@ -164,7 +164,7 @@ func TestRunCaseWithTimeout(t *testing.T) {
// global timeout
testcase1 := &TestCase{
Config: NewConfig("TestCase1").
SetTimeout(10 * time.Second). // set global timeout to 10s
SetRequestTimeout(10). // set global timeout to 10s
SetBaseURL("https://httpbin.org"),
TestSteps: []IStep{
NewStep("step1").
@@ -180,7 +180,7 @@ func TestRunCaseWithTimeout(t *testing.T) {
testcase2 := &TestCase{
Config: NewConfig("TestCase2").
SetTimeout(10 * time.Second). // set global timeout to 10s
SetRequestTimeout(10). // set global timeout to 10s
SetBaseURL("https://httpbin.org"),
TestSteps: []IStep{
NewStep("step1").
@@ -197,7 +197,7 @@ func TestRunCaseWithTimeout(t *testing.T) {
// step timeout
testcase3 := &TestCase{
Config: NewConfig("TestCase3").
SetTimeout(10 * time.Second).
SetRequestTimeout(10).
SetBaseURL("https://httpbin.org"),
TestSteps: []IStep{
NewStep("step2").