-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Make a mock of google analytics for tests. * Use SiteDriver instead of seleniumrequests.Remote * Fix SiteDriver instantiation * Fix wait * Create test for google ecommerce * Remove Remote driver for mobile tests * Disable celery for GoogleEcommerce test case * Review fixes * Apply linter rules
- Loading branch information
1 parent
394cb2a
commit f97e76b
Showing
9 changed files
with
113 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
from django.test import override_settings, tag | ||
|
||
from shopelectro import selenium | ||
from shopelectro.tests import helpers | ||
from shopelectro.models import CategoryPage, Order | ||
|
||
|
||
@tag('slow') | ||
@helpers.disable_celery | ||
@override_settings(DEBUG=True, INTERNAL_IPS=tuple()) | ||
class GoogleEcommerce(helpers.SeleniumTestCase): | ||
|
||
fixtures = ['dump.json'] | ||
|
||
def test_google_ecommerce_purchase(self): | ||
category_page = selenium.CategoryPage( | ||
self.browser, | ||
CategoryPage.objects.first().slug, | ||
) | ||
category_page.load() | ||
category_page.add_to_cart() | ||
|
||
order_page = selenium.OrderPage(self.browser) | ||
order_page.load() | ||
order_page.fill_contacts() | ||
order_page.make_order() | ||
|
||
success_page = selenium.SuccessPage(self.browser) | ||
success_page.wait_loaded() | ||
self.assertTrue(success_page.is_success()) | ||
|
||
order = Order.objects.order_by('-created').first() # Ignore PyFlakesBear | ||
reached = self.browser.execute_script('return gaObject.results;') # Ignore PyFlakesBear | ||
|
||
# @todo #762:30m Match an order with a transaction of Google eCommerce analytics. | ||
# The transaction must contain correct order data and related products. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
f97e76b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Puzzle
762-c8b88dbe
discovered inshopelectro/tests/tests_js_analytics.py
and submitted as #771. Please, remember that the puzzle was not necessarily added in this particular commit. Maybe it was added earlier, but we discovered it only now.f97e76b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Puzzle
762-afab9051
discovered inshopelectro/tests/tests_selenium.py
and submitted as #772. Please, remember that the puzzle was not necessarily added in this particular commit. Maybe it was added earlier, but we discovered it only now.