mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-23 00:12:15 +00:00
Fixed selenium "Object reference chain is too long" exception.
It seems like it couldn't translate the value returned by the script
This commit is contained in:
@@ -88,7 +88,7 @@ class UserRegistrationTest(LiveServerTestCase):
|
|||||||
initials.send_keys('JS')
|
initials.send_keys('JS')
|
||||||
phone.send_keys('0123456789')
|
phone.send_keys('0123456789')
|
||||||
self.browser.execute_script(
|
self.browser.execute_script(
|
||||||
"return jQuery('#g-recaptcha-response').val('PASSED')")
|
"return function() {jQuery('#g-recaptcha-response').val('PASSED'); return 0}()")
|
||||||
|
|
||||||
# Submit incorrect form
|
# Submit incorrect form
|
||||||
submit = self.browser.find_element_by_xpath("//input[@type='submit']")
|
submit = self.browser.find_element_by_xpath("//input[@type='submit']")
|
||||||
@@ -110,8 +110,9 @@ class UserRegistrationTest(LiveServerTestCase):
|
|||||||
# Correct error
|
# Correct error
|
||||||
password1.send_keys('correcthorsebatterystaple')
|
password1.send_keys('correcthorsebatterystaple')
|
||||||
password2.send_keys('correcthorsebatterystaple')
|
password2.send_keys('correcthorsebatterystaple')
|
||||||
|
self.browser.execute_script("console.log('Hello, world!')")
|
||||||
self.browser.execute_script(
|
self.browser.execute_script(
|
||||||
"return jQuery('#g-recaptcha-response').val('PASSED')")
|
"return function() {jQuery('#g-recaptcha-response').val('PASSED'); return 0}()")
|
||||||
|
|
||||||
# Submit again
|
# Submit again
|
||||||
password2.send_keys(Keys.ENTER)
|
password2.send_keys(Keys.ENTER)
|
||||||
@@ -150,7 +151,7 @@ class UserRegistrationTest(LiveServerTestCase):
|
|||||||
username.send_keys('TestUsername')
|
username.send_keys('TestUsername')
|
||||||
password.send_keys('correcthorsebatterystaple')
|
password.send_keys('correcthorsebatterystaple')
|
||||||
self.browser.execute_script(
|
self.browser.execute_script(
|
||||||
"return jQuery('#g-recaptcha-response').val('PASSED')")
|
"return function() {jQuery('#g-recaptcha-response').val('PASSED'); return 0}()")
|
||||||
password.send_keys(Keys.ENTER)
|
password.send_keys(Keys.ENTER)
|
||||||
|
|
||||||
# Check we are logged in
|
# Check we are logged in
|
||||||
|
|||||||
Reference in New Issue
Block a user