issue_list.py 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. from .base import BasePage
  2. from .global_selection import GlobalSelectionPage
  3. from .issue_details import IssueDetailsPage
  4. class IssueListPage(BasePage):
  5. def __init__(self, browser, client):
  6. super().__init__(browser)
  7. self.client = client
  8. self.global_selection = GlobalSelectionPage(browser)
  9. def visit_issue_list(self, org, query=""):
  10. self.browser.get(f"/organizations/{org}/issues/{query}")
  11. self.wait_until_loaded()
  12. def wait_for_stream(self):
  13. self.browser.wait_until('[data-test-id="event-issue-header"]', timeout=20)
  14. def select_issue(self, position):
  15. self.browser.click(f'[data-test-id="group"]:nth-child({position})')
  16. def navigate_to_issue(self, position):
  17. self.browser.click(f'[data-test-id="group"]:nth-child({position}) a')
  18. self.browser.wait_until(".group-detail")
  19. self.issue_details = IssueDetailsPage(self.browser, self.client)
  20. def resolve_issues(self):
  21. self.browser.click('[aria-label="Resolve"]')
  22. def wait_for_issue_removal(self):
  23. self.browser.click_when_visible('[data-test-id="toast-success"]')
  24. self.browser.wait_until_not('[data-test-id="toast-success"]')
  25. def wait_for_issue(self):
  26. self.browser.wait_until('[data-test-id="group"]')
  27. def find_resolved_issues(self):
  28. return self.browser.elements('[data-test-id="resolved-issue"]')
  29. def ignore_issues(self):
  30. self.browser.click('[aria-label="Ignore"]')
  31. def delete_issues(self):
  32. self.browser.click('[aria-label="More issue actions"]')
  33. self.browser.wait_until('[data-test-id="delete"]')
  34. self.browser.click('[data-test-id="delete"]')
  35. self.browser.click('[data-test-id="confirm-button"]')
  36. def merge_issues(self):
  37. self.browser.click('[aria-label="Merge Selected Issues"]')
  38. self.browser.click('[data-test-id="confirm-button"]')
  39. def mark_reviewed_issues(self):
  40. self.browser.click('[aria-label="Mark Reviewed"]')