2017-12-03 15:02:14 +00:00
|
|
|
from pages.base_page import BasePageObject
|
|
|
|
from pages.base_element import *
|
2018-01-24 10:58:58 +00:00
|
|
|
from tests import test_data
|
2017-12-03 15:02:14 +00:00
|
|
|
|
|
|
|
class BountiesHeader(BaseText):
|
|
|
|
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(BountiesHeader, self).__init__(driver)
|
|
|
|
self.locator = self.Locator.css_selector('.open-bounties-header')
|
|
|
|
|
|
|
|
|
|
|
|
class TopHuntersHeader(BaseText):
|
|
|
|
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(TopHuntersHeader, self).__init__(driver)
|
|
|
|
self.locator = self.Locator.css_selector('.top-hunters-header')
|
|
|
|
|
2018-01-24 10:58:58 +00:00
|
|
|
class BountyTitles(BaseText):
|
|
|
|
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(BountyTitles, self).__init__(driver)
|
|
|
|
self.locator = self.Locator.css_selector('.open-bounty-item-content .header')
|
|
|
|
|
|
|
|
|
|
|
|
class BountyItemRows(BaseText):
|
|
|
|
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(BountyItemRows, self).__init__(driver)
|
|
|
|
self.locator = self.Locator.css_selector('.open-bounty-item-content .bounty-item-row')
|
|
|
|
|
|
|
|
class BountyFooters(BaseText):
|
|
|
|
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(BountyFooters, self).__init__(driver)
|
|
|
|
self.locator = self.Locator.css_selector('.open-bounty-item-content .footer-row')
|
|
|
|
|
2017-12-03 15:02:14 +00:00
|
|
|
|
2018-04-06 11:58:07 +00:00
|
|
|
class BountyClaimsAmount(BaseText):
|
|
|
|
|
|
|
|
def __init__(self, driver, issue_title, claims_text):
|
|
|
|
super(BaseText, self).__init__(driver)
|
|
|
|
self.locator = self.Locator.xpath_selector(
|
|
|
|
'//div[@class="header"]/a[contains(.,"' + issue_title +'")]/../../div[@class="footer-row"]/span[contains(.,"' + claims_text + '")]')
|
|
|
|
|
|
|
|
|
2017-12-03 15:02:14 +00:00
|
|
|
class BountiesPage(BasePageObject):
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(BountiesPage, self).__init__(driver)
|
2018-01-24 10:58:58 +00:00
|
|
|
|
2017-12-03 15:02:14 +00:00
|
|
|
self.driver = driver
|
|
|
|
|
|
|
|
self.bounties_header = BountiesHeader(self.driver)
|
|
|
|
self.top_hunters_header = TopHuntersHeader(self.driver)
|
2018-01-24 10:58:58 +00:00
|
|
|
self.bounty_titles = BountyTitles(self.driver)
|
|
|
|
self.bounty_item_rows = BountyItemRows(self.driver)
|
|
|
|
self.bounty_footers = BountyFooters(self.driver)
|
|
|
|
|
|
|
|
def get_bounties_page(self):
|
|
|
|
self.driver.get(test_data.config['Common']['url'] + 'app')
|
|
|
|
|
2018-04-06 11:58:07 +00:00
|
|
|
def check_bounty_claims_amount(self, issue_title, claims_text):
|
|
|
|
logging.info('Check that bounty "' + issue_title + '" has "' + claims_text + '"')
|
|
|
|
BountyClaimsAmount(self.driver, issue_title, claims_text).find_element()
|
|
|
|
|