diff --git a/test/end-to-end/pages/thirdparty/github.py b/test/end-to-end/pages/thirdparty/github.py index 0939f7d..9674fe0 100644 --- a/test/end-to-end/pages/thirdparty/github.py +++ b/test/end-to-end/pages/thirdparty/github.py @@ -51,7 +51,7 @@ class InstallButton(BaseButton): class OrganizationButton(BaseButton): def __init__(self, driver): super(OrganizationButton, self).__init__(driver) - self.locator = self.Locator.css_selector('[alt="@Org4"]') + self.locator = self.Locator.css_selector('[alt="@%s"]' % test_data.config['ORG']['gh_org_name']) class AllRepositoriesButton(BaseButton): @@ -297,11 +297,6 @@ class GithubPage(BasePageObject): repo = git.Repo(self.local_repo_path) logging.info(repo.git.status()) logging.info(repo.git.pull('upstream', 'master')) - # repo_url = 'https://%s:%s@github.com/%s/%s.git' % (test_data.config['DEV']['gh_username'], - # test_data.config['DEV']['gh_password'], test_data.config['DEV']['gh_username'], test_data.config['ORG']['gh_repo_name']) - # - # logging.info('Pushing to %s' % repo_url) - # logging.info(repo.git.push(repo_url)) logging.info(repo.git.push('origin', 'master')) logging.info(repo.git.fetch('--all')) repo.git.config('user.email', test_data.config['DEV']['gh_login']) diff --git a/test/end-to-end/tests/config_example.ini b/test/end-to-end/tests/config_example.ini index 6d2f8c3..f321693 100644 --- a/test/end-to-end/tests/config_example.ini +++ b/test/end-to-end/tests/config_example.ini @@ -4,21 +4,19 @@ url = https://openbounty.status.im:444/ ;URL to GH openbounty app sob_test_app = http://github.com/apps/status-open-bounty-app-test gh_login = https://github.com/login -[Paths] -;AbsolutePath to 'end-to-end' folder -tests_absolute = /usr/dir/open-bounty/test/end-to-end/ -[ORG] +[ORG] ;GitHub credentials for organization owner gh_login = login gh_password = password ;GitHub organization path gh_org_profile = https://github.com/organizations/organization/ +;GitHub organization name +gh_org_name = My-org ;GitHub repo path gh_repo = https://github.com/org_name/repo_name/ ;GitHub repo name gh_repo_name = repo_name - ;MetaMask password for organization mm_password = password diff --git a/test/end-to-end/tests/test_contracts.py b/test/end-to-end/tests/test_contracts.py index 70cb9f3..61d6e2f 100644 --- a/test/end-to-end/tests/test_contracts.py +++ b/test/end-to-end/tests/test_contracts.py @@ -8,31 +8,31 @@ from tests import test_data @pytest.mark.sanity class TestLogin(BaseTestCase): - # 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'] + 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'] def test_new_claim(self): self.github_dev.create_pr_git('test_branch_%s' % self.github_dev.time_now) - # 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']) + 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'])