issue_list.py 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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('[data-test-id="resolved-issue"]')
  28. def wait_for_issue_removal(self):
  29. self.browser.click_when_visible('[data-test-id="toast-success"]')
  30. self.browser.wait_until_not('[data-test-id="toast-success"]')
  31. def wait_for_issue(self):
  32. self.browser.wait_until('[data-test-id="group"]')
  33. def find_resolved_issues(self):
  34. return self.browser.elements('[data-test-id="resolved-issue"]')
  35. def ignore_issues(self):
  36. self.browser.click('[aria-label="Ignore"]')
  37. def delete_issues(self):
  38. self.browser.click('[aria-label="More issue actions"]')
  39. self.browser.wait_until('[data-test-id="delete"]')
  40. self.browser.click('[data-test-id="delete"]')
  41. self.browser.click('[data-test-id="confirm-button"]')
  42. def merge_issues(self):
  43. self.browser.click('[aria-label="Merge Selected Issues"]')
  44. self.browser.click('[data-test-id="confirm-button"]')
  45. def mark_reviewed_issues(self):
  46. self.browser.click('[aria-label="Mark Reviewed"]')