Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#781 #772 #771 #696 disable huckster and implement google ecommerce test #782

Merged
merged 4 commits into from
Mar 20, 2019

Conversation

ArtemijRodionov
Copy link
Contributor

Closes #781
Closes #772
Closes #771
Closes #696

@ArtemijRodionov ArtemijRodionov requested a review from duker33 March 20, 2019 00:05
product_vendor_code = Product.objects.first().vendor_code
self.product_page = reverse('product', args=(product_vendor_code,))
self.category_page = reverse(
'category', args=(Category.objects.first().page.slug,))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'category', args=(Category.objects.first().page.slug,))
'category', args=(Category.objects.first().page.slug,)
)

def setUp(self):
product_vendor_code = Product.objects.first().vendor_code
self.product_page = reverse('product', args=(product_vendor_code,))
self.category_page = reverse(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

category_path or category_url might be more good name. *_path one is the best, because here we mean part or an url without domain

def prevent_default(self, event, selector):
"""Use event.preventDefault() to prevent web page reloading."""
self.browser.execute_script(
'var target = document.querySelector("' + selector + '");'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'var target = document.querySelector("' + selector + '");'
f'var target = document.querySelector("{selector}");'

self.browser.execute_script(
'var target = document.querySelector("' + selector + '");'
'console.log(target);'
'target.on' + event + ' = function(event) {'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'target.on' + event + ' = function(event) {'
f'target.on{event} = function(event) {'

def select_text(self, class_name):
"""Programmatically select text on page."""
self.browser.execute_script(
'var target = document.getElementsByClassName("' + class_name + '")[0];'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'var target = document.getElementsByClassName("' + class_name + '")[0];'
f'var target = document.getElementsByClassName("{class_name}")[0];'

@ArtemijRodionov ArtemijRodionov merged commit 62f3cc9 into master Mar 20, 2019
@ArtemijRodionov ArtemijRodionov deleted the 781-772-771-front-issue branch March 20, 2019 18:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants