locustfile_frontend.py 798 B

12345678910111213141516171819202122232425
  1. from locust import HttpUser, between, task
  2. class ServicePilotFrontendUser(HttpUser):
  3. wait_time = between(1, 2)
  4. pages = [
  5. ("/dashboard", "页面-工作台"),
  6. ("/tickets", "页面-工单管理"),
  7. ("/sla", "页面-SLA管理"),
  8. ("/knowledge", "页面-知识库"),
  9. ("/files", "页面-附件管理"),
  10. ("/reviews", "页面-满意度"),
  11. ("/test-plan", "页面-测试计划"),
  12. ]
  13. @task
  14. def visit_business_pages(self):
  15. for path, name in self.pages:
  16. with self.client.get(path, name=name, catch_response=True) as response:
  17. if response.status_code == 200:
  18. response.success()
  19. else:
  20. response.failure(f"{path} status={response.status_code}")