Skip to content

Commit

Permalink
fix(test): Correct secrets.
Browse files Browse the repository at this point in the history
  • Loading branch information
vinci1it2000 committed Mar 13, 2024
1 parent bb5165b commit 7453b21
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions tests/utils/test_form.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def setUpClass(cls):
options = webdriver.ChromeOptions()
options.add_argument("--incognito")
cls.driver = driver = webdriver.Chrome(options=options)
driver.implicitly_wait(60)
driver.implicitly_wait(2)
cls.form_dir = form_dir = osp.abspath(osp.join(
osp.dirname(__file__), '..', '..', 'examples', 'length_converter'
))
Expand Down Expand Up @@ -153,10 +153,16 @@ def stripe_event_handler(event):

driver = self.driver
driver.get('%s/' % self.stripe_site.url)
time.sleep(10)
assert False, driver.page_source.encode("utf-8")

def send_payment(card):
driver.switch_to.frame(
driver.find_element(By.NAME, "embedded-checkout")
WebDriverWait(driver, 30).until(
EC.visibility_of_element_located((
By.NAME, 'embedded-checkout'
))
)
)
driver.find_element(By.ID, 'email').send_keys('[email protected]')
driver.find_element(By.ID, 'cardNumber').send_keys(card)
Expand All @@ -170,7 +176,7 @@ def send_payment(card):

for card in ('4000000000000002',):
send_payment(card)
self.assertTrue(bool(WebDriverWait(driver, 60).until(
self.assertTrue(bool(WebDriverWait(driver, 30).until(
EC.visibility_of_element_located((
By.XPATH,
'//input[contains(@class, "CheckoutInput--invalid")]'
Expand Down

0 comments on commit 7453b21

Please sign in to comment.