-
Notifications
You must be signed in to change notification settings - Fork 5
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
Conversation
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,)) |
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.
'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( |
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.
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 + '");' |
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.
'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) {' |
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.
'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];' |
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.
'var target = document.getElementsByClassName("' + class_name + '")[0];' | |
f'var target = document.getElementsByClassName("{class_name}")[0];' |
Closes #781
Closes #772
Closes #771
Closes #696