Skip to content

Commit

Permalink
Remove Remote driver for mobile tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ArtemijRodionov committed Mar 13, 2019
1 parent ad0400e commit baf3c25
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion shopelectro/tests/tests_analytics.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def test_google_ecommerce_purchase(self):
order_page.make_order()

success_page = selenium.SuccessPage(self.browser)
assert success_page.is_success()
self.assertTrue(success_page.is_success())

order = Order.objects.order_by('-created').first()
reached = self.browser.execute_script('return gaObject.results;')
Expand Down
2 changes: 1 addition & 1 deletion shopelectro/tests/tests_selenium.py
Original file line number Diff line number Diff line change
Expand Up @@ -934,7 +934,7 @@ def buy_product(self):

def go_to_cart(self):
self.click(self.CART_LOCATOR)
self.wait.until(EC.url_to_be(self.order_page_url))
self.wait.until(EC.url_contains(self.order_page_url))

def test_download_header_price(self):
"""User clicks Download price button in site's header."""
Expand Down
12 changes: 8 additions & 4 deletions shopelectro/tests/tests_selenium_mobile.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait

from shopelectro.selenium import SiteDriver
from shopelectro.models import Product


Expand All @@ -31,14 +32,17 @@ def setUpClass(cls):
'deviceName': 'Apple iPhone 5',
},
}
cls.browser = webdriver.Remote(
command_executor=settings.SELENIUM_URL,
desired_capabilities=capabilities
cls.browser = SiteDriver(
site_url=cls.live_server_url,
desired_capabilities=capabilities,
)
cls.wait = WebDriverWait(cls.browser, 120)
cls.browser.set_window_size(400, 800)
cls.browser.implicitly_wait(10)

@property
def wait(self):
return self.browser.wait

@classmethod
def tearDownClass(cls):
"""Close selenium session."""
Expand Down

0 comments on commit baf3c25

Please sign in to comment.