class WebPageUser(HttpLocust):
    host = ""
    task_set = WebPageTasks
    min_wait = 10
    max_wait = 30

    # file_path is generated on locusts startup
    file_path = "testcases/login.yml"
    tests = prepare_locust_tests(file_path)
Beispiel #2
0
class WebPageUser(HttpLocust):
    host = ""
    task_set = WebPageTasks
    min_wait = 10
    max_wait = 30

    # file_path is generated on locusts startup
    file_path = "testsuites\获取搜索商品接口测试计划.json"
    tests = prepare_locust_tests(file_path)
Beispiel #3
0
class WebPageUser(HttpLocust):
    host = ""
    task_set = WebPageTasks
    min_wait = 10
    max_wait = 30

    # file_path is generated on locusts startup
    file_path = "$TESTCASE_FILE"
    tests = prepare_locust_tests(file_path)
Beispiel #4
0
 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)