2017-12-03 15:02:14 +00:00
|
|
|
import pytest
|
|
|
|
from os import environ
|
|
|
|
from pages.openbounty.landing import LandingPage
|
2018-01-24 10:58:58 +00:00
|
|
|
from pages.openbounty.bounties import BountiesPage
|
2017-12-03 15:02:14 +00:00
|
|
|
from tests.basetestcase import BaseTestCase
|
2018-01-24 10:58:58 +00:00
|
|
|
from tests import test_data
|
2017-12-03 15:02:14 +00:00
|
|
|
|
|
|
|
|
|
|
|
@pytest.mark.sanity
|
|
|
|
class TestLogin(BaseTestCase):
|
|
|
|
|
|
|
|
def test_deploy_new_contract(self):
|
2018-01-24 10:58:58 +00:00
|
|
|
self.cleanup = True
|
2017-12-03 15:02:14 +00:00
|
|
|
landing = LandingPage(self.driver)
|
|
|
|
landing.get_landing_page()
|
2018-01-24 10:58:58 +00:00
|
|
|
|
|
|
|
# Sign Up to SOB
|
2017-12-03 15:02:14 +00:00
|
|
|
github = landing.login_button.click()
|
2018-01-24 10:58:58 +00:00
|
|
|
github.sign_in(test_data.config['ORG']['gh_login'],
|
|
|
|
test_data.config['ORG']['gh_password'])
|
2017-12-03 15:02:14 +00:00
|
|
|
assert github.permission_type.text == 'Personal user data'
|
|
|
|
bounties_page = github.authorize_sob.click()
|
2018-01-24 10:58:58 +00:00
|
|
|
|
|
|
|
# SOB Plugin installation and navigate to "Open bounties"
|
2017-12-03 15:02:14 +00:00
|
|
|
github.install_sob_plugin()
|
|
|
|
assert bounties_page.bounties_header.text == 'Bounties'
|
2018-01-22 16:19:05 +00:00
|
|
|
assert bounties_page.top_hunters_header.text == 'Top 5 hunters'
|
2018-01-24 10:58:58 +00:00
|
|
|
|
|
|
|
# Waiting for deployed contract; test_data.issue created here
|
2017-12-03 15:02:14 +00:00
|
|
|
github.create_new_bounty()
|
|
|
|
github.get_deployed_contract()
|
2018-01-24 10:58:58 +00:00
|
|
|
|
|
|
|
# Navigate and check top bounty in "Open bounties"
|
|
|
|
bounties_page = BountiesPage(self.driver)
|
|
|
|
bounties_page.get_bounties_page()
|
|
|
|
titles = bounties_page.bounty_titles.find_elements()
|
|
|
|
assert titles[0].text == test_data.issue['title']
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|