mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-12 02:21:29 +08:00
24 lines
544 B
Plaintext
24 lines
544 B
Plaintext
#coding: utf-8
|
|
import zmq
|
|
from locust import HttpLocust, TaskSet, task
|
|
from ate import runner, exception
|
|
|
|
class WebPageTasks(TaskSet):
|
|
def on_start(self):
|
|
self.test_runner = runner.Runner(self.client)
|
|
|
|
@task
|
|
def test_specified_scenario(self):
|
|
try:
|
|
self.test_runner.run(self.locust.file_path)
|
|
except exception.ValidationError:
|
|
pass
|
|
|
|
class WebPageUser(HttpLocust):
|
|
host = "$HOST"
|
|
task_set = WebPageTasks
|
|
min_wait = 1000
|
|
max_wait = 5000
|
|
|
|
file_path = "$TESTCASE_FILE"
|