refactor: use HttpRunner as testcase base class

This commit is contained in:
debugtalk
2020-05-15 20:05:17 +08:00
parent 80a600bccc
commit 2cd9eba6a3
12 changed files with 71 additions and 363 deletions

View File

@@ -1,8 +1,8 @@
# NOTICE: Generated By HttpRunner. DO'NOT EDIT!
from httprunner import HttpRunner, TConfig, TStep, TestCase
from httprunner import HttpRunner, TConfig, TStep
class TestCaseHardcode(TestCase):
class TestCaseHardcode(HttpRunner):
config = TConfig(
**{
"name": "request methods testcase in hardcode",
@@ -72,5 +72,6 @@ class TestCaseHardcode(TestCase):
),
]
def test_start(self):
HttpRunner(self.config, self.teststeps).run()
if __name__ == "__main__":
TestCaseHardcode().test_start()

View File

@@ -1,8 +1,8 @@
# NOTICE: Generated By HttpRunner. DO'NOT EDIT!
from httprunner import HttpRunner, TConfig, TStep, TestCase
from httprunner import HttpRunner, TConfig, TStep
class TestCaseRequestWithFunctions(TestCase):
class TestCaseRequestWithFunctions(HttpRunner):
config = TConfig(
**{
"name": "request methods testcase with functions",
@@ -83,5 +83,6 @@ class TestCaseRequestWithFunctions(TestCase):
),
]
def test_start(self):
HttpRunner(self.config, self.teststeps).run()
if __name__ == "__main__":
TestCaseRequestWithFunctions().test_start()

View File

@@ -1,8 +1,8 @@
# NOTICE: Generated By HttpRunner. DO'NOT EDIT!
from httprunner import HttpRunner, TConfig, TStep, TestCase
from httprunner import HttpRunner, TConfig, TStep
class TestCaseRequestWithTestcaseReference(TestCase):
class TestCaseRequestWithTestcaseReference(HttpRunner):
config = TConfig(
**{
"name": "request methods testcase: reference testcase",
@@ -23,5 +23,6 @@ class TestCaseRequestWithTestcaseReference(TestCase):
),
]
def test_start(self):
HttpRunner(self.config, self.teststeps).run()
if __name__ == "__main__":
TestCaseRequestWithTestcaseReference().test_start()

View File

@@ -1,8 +1,8 @@
# NOTICE: Generated By HttpRunner. DO'NOT EDIT!
from httprunner import HttpRunner, TConfig, TStep, TestCase
from httprunner import HttpRunner, TConfig, TStep
class TestCaseRequestWithVariables(TestCase):
class TestCaseRequestWithVariables(HttpRunner):
config = TConfig(
**{
"name": "request methods testcase with variables",
@@ -78,5 +78,6 @@ class TestCaseRequestWithVariables(TestCase):
),
]
def test_start(self):
HttpRunner(self.config, self.teststeps).run()
if __name__ == "__main__":
TestCaseRequestWithVariables().test_start()

View File

@@ -1,8 +1,8 @@
# NOTICE: Generated By HttpRunner. DO'NOT EDIT!
from httprunner import HttpRunner, TConfig, TStep, TestCase
from httprunner import HttpRunner, TConfig, TStep
class TestCaseValidateWithFunctions(TestCase):
class TestCaseValidateWithFunctions(HttpRunner):
config = TConfig(
**{
"name": "request methods testcase: validate with functions",
@@ -38,5 +38,6 @@ class TestCaseValidateWithFunctions(TestCase):
),
]
def test_start(self):
HttpRunner(self.config, self.teststeps).run()
if __name__ == "__main__":
TestCaseValidateWithFunctions().test_start()

View File

@@ -1,8 +1,8 @@
# NOTICE: Generated By HttpRunner. DO'NOT EDIT!
from httprunner import HttpRunner, TConfig, TStep, TestCase
from httprunner import HttpRunner, TConfig, TStep
class TestCaseValidateWithVariables(TestCase):
class TestCaseValidateWithVariables(HttpRunner):
config = TConfig(
**{
"name": "request methods testcase: validate with variables",
@@ -78,5 +78,6 @@ class TestCaseValidateWithVariables(TestCase):
),
]
def test_start(self):
HttpRunner(self.config, self.teststeps).run()
if __name__ == "__main__":
TestCaseValidateWithVariables().test_start()