open-bounty/test/end-to-end/tests/test_contracts.py

44 lines
1.3 KiB
Python
Raw Normal View History

import pytest
from pages.openbounty.bounties import BountiesPage
2018-04-06 11:58:07 +00:00
from pages.openbounty.activity import ActivityPage
from tests.basetestcase import BaseTestCase
from tests import test_data
@pytest.mark.sanity
class TestLogin(BaseTestCase):
2018-04-25 08:46:15 +00:00
def test_deploy_new_contract(self):
# Waiting for deployed contract; test_data.issue created here
self.github_org.create_new_bounty()
self.github_org.get_deployed_contract()
# Navigate and check top bounty in "Open bounties"
bounties_page = BountiesPage(self.driver_dev)
bounties_page.get_bounties_page()
titles = bounties_page.bounty_titles.find_elements()
assert titles[0].text == test_data.issue['title']
2018-04-06 11:58:07 +00:00
def test_new_claim(self):
self.github_dev.create_pr_git('test_branch_%s' % self.github_dev.time_now)
2018-04-25 08:46:15 +00:00
self.github_dev.open_pr_github('Fixes')
# check new claim in "Open bounties"
bounties_page = BountiesPage(self.driver_dev)
bounties_page.get_bounties_page()
bounties_page.check_bounty_claims_amount(test_data.issue['title'], '1 open claim')
# check new claim in "Activity"
activity_page = ActivityPage(self.driver_dev)
activity_page.get_activity_page()
activity_page.check_activity_is_presented('Submitted a claim for ', test_data.issue['title'])
2018-04-06 11:58:07 +00:00