class WebPageUser(HttpLocust): host = "" task_set = WebPageTasks min_wait = 10 max_wait = 30 file_path = "httprunner/django_get_users.yaml" tests = prepare_locust_tests(file_path)
class WebPageUser(HttpLocust): host = "" task_set = WebPageTasks min_wait = 10 max_wait = 30 file_path = "testsuites/login_with_parameters.yml" tests = prepare_locust_tests(file_path)
class WebPageUser(HttpLocust): host = "" task_set = WebPageTasks min_wait = 10 max_wait = 30 file_path = "testcases/integration_test/test_make_an_order_on_web_stag_with_stripe.yml" tests = prepare_locust_tests(file_path)
class WebPageUser(HttpLocust): host = "" task_set = WebPageTasks min_wait = 10 max_wait = 30 file_path = "./testcases/login.yml" tests = prepare_locust_tests(file_path)
class WebPageUser(HttpLocust): host = "" task_set = WebPageTasks min_wait = 10 max_wait = 30 file_path = "testdata.yaml" tests = prepare_locust_tests(file_path)
def test_prepare_locust_tests(self): path = os.path.join(os.getcwd(), 'tests/locust_tests/demo_locusts.yml') locust_tests = prepare_locust_tests(path) self.assertEqual(len(locust_tests), 2 + 3) name_list = [ "create user 1000 and check result.", "create user 1001 and check result." ] self.assertIn(locust_tests[0]["config"]["name"], name_list) self.assertIn(locust_tests[4]["config"]["name"], name_list)
class WebPageUser(HttpLocust): task_set = WebPageTasks min_wait = 10 max_wait = 30 file_path = "/Users/apple/api_test/testcases/test_sp_login.yaml" locust_tests = prepare_locust_tests(file_path) functions = locust_tests["functions"] tests = locust_tests["tests"] config = {} host = config.get('base_url', '')