diff --git a/test/end-to-end/pages/thirdparty/github.py b/test/end-to-end/pages/thirdparty/github.py index 2585c91..eaf3c84 100644 --- a/test/end-to-end/pages/thirdparty/github.py +++ b/test/end-to-end/pages/thirdparty/github.py @@ -84,7 +84,7 @@ class LabelsButton(BaseButton): class BountyLabel(BaseButton): def __init__(self, driver): super(LabelsButton.BountyLabel, self).__init__(driver) - self.locator = self.Locator.css_selector("[data-name='bounty']") + self.locator = self.Locator.css_selector("[data-name='748942015']") class CrossButton(BaseButton): def __init__(self, driver): diff --git a/test/end-to-end/tests/basetestcase.py b/test/end-to-end/tests/basetestcase.py index 398673b..b658ed1 100644 --- a/test/end-to-end/tests/basetestcase.py +++ b/test/end-to-end/tests/basetestcase.py @@ -39,16 +39,21 @@ class BaseTestCase: desired_caps['captureHtml'] = False return desired_caps + @property + def environment(self): + return pytest.config.getoption('env') + def setup_method(self): self.errors = [] - # options = webdriver.ChromeOptions() - # options.add_argument('--start-fullscreen') - # options.add_extension(path.abspath('/resources/metamask3_12_0.crx')) - - self.driver = webdriver.Remote(self.executor_sauce_lab, - desired_capabilities=self.capabilities_sauce_lab) + if self.environment == 'local': + options = webdriver.ChromeOptions() + options.add_argument('--start-fullscreen') + self.driver = webdriver.Chrome(options=options) + if self.environment == 'sauce': + self.driver = webdriver.Remote(self.executor_sauce_lab, + desired_capabilities=self.capabilities_sauce_lab) self.driver.implicitly_wait(5) def verify_no_errors(self): diff --git a/test/end-to-end/tests/conftest.py b/test/end-to-end/tests/conftest.py index 62f296e..c0abbae 100644 --- a/test/end-to-end/tests/conftest.py +++ b/test/end-to-end/tests/conftest.py @@ -11,6 +11,10 @@ def pytest_addoption(parser): action='store', default=True, help='Display each test step in terminal as plain text: True/False') + parser.addoption('--env', + action='store', + default='sauce', + help='Specify environment, sauce or local') def pytest_configure(config): diff --git a/test/end-to-end/tests/test_contracts.py b/test/end-to-end/tests/test_contracts.py index 68bb4cb..6e617f3 100644 --- a/test/end-to-end/tests/test_contracts.py +++ b/test/end-to-end/tests/test_contracts.py @@ -17,6 +17,6 @@ class TestLogin(BaseTestCase): bounties_page = github.authorize_sob.click() github.install_sob_plugin() assert bounties_page.bounties_header.text == 'Bounties' - assert bounties_page.top_hunters_header.text == 'Top hunters' + assert bounties_page.top_hunters_header.text == 'Top 5 hunters' github.create_new_bounty() github.get_deployed_contract()