issue_list.py 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. self.browser.click('[data-test-id="confirm-button"]')
  23. # TODO(Kelly): update once issue-list-removal-action feature is stable
  24. def resolve_issues_removal(self):
  25. self.browser.click('[aria-label="Resolve"]')
  26. def wait_for_resolved_issue(self):
  27. self.browser.wait_until_not('[data-test-id="toast-loading"]')
  28. self.browser.wait_until('[data-test-id="resolved-issue"]')
  29. def wait_for_issue_removal(self):
  30. self.browser.click_when_visible('[data-test-id="toast-success"]')
  31. self.browser.wait_until_not('[data-test-id="toast-success"]')
  32. def wait_for_issue(self):
  33. self.browser.wait_until('[data-test-id="group"]')
  34. def find_resolved_issues(self):
  35. return self.browser.elements('[data-test-id="resolved-issue"]')
  36. def ignore_issues(self):
  37. self.browser.click('[aria-label="Ignore"]')
  38. def delete_issues(self):
  39. self.browser.click('[aria-label="More issue actions"]')
  40. self.browser.wait_until('[data-test-id="delete"]')
  41. self.browser.click('[data-test-id="delete"]')
  42. self.browser.click('[data-test-id="confirm-button"]')
  43. def merge_issues(self):
  44. self.browser.click('[aria-label="Merge Selected Issues"]')
  45. self.browser.click('[data-test-id="confirm-button"]')
  46. def mark_reviewed_issues(self):
  47. self.browser.click('[aria-label="Mark Reviewed"]')