-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
don't try to checkout if CExp.ADD_TO_CART_JS_ERROR (#580)
end the test at /cart (as no items were added and therefore checkout can't happen)
- Loading branch information
Showing
1 changed file
with
12 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,20 +51,21 @@ def test_checkout(desktop_web_driver, endpoints, batch_size, backend, random, sl | |
|
||
time.sleep(sleep_length()) | ||
|
||
try: | ||
desktop_web_driver.find_element(By.CSS_SELECTOR, 'a[href="/checkout"]').click() | ||
except Exception as err: | ||
sentry_sdk.metrics.incr(key="test_checkout.iteration.abandoned", value=1, tags=dict(query_string, reason=f"no_proceed_to_checkout_btn({err.__class__.__name__})")) | ||
continue | ||
if (ce != CExp.ADD_TO_CART_JS_ERROR): | ||
try: | ||
desktop_web_driver.find_element(By.CSS_SELECTOR, 'a[href="/checkout"]').click() | ||
except Exception as err: | ||
sentry_sdk.metrics.incr(key="test_checkout.iteration.abandoned", value=1, tags=dict(query_string, reason=f"no_proceed_to_checkout_btn({err.__class__.__name__})")) | ||
continue | ||
|
||
time.sleep(sleep_length()) | ||
|
||
desktop_web_driver.find_element(By.CSS_SELECTOR, '#email').send_keys("[email protected]") | ||
time.sleep(sleep_length()) | ||
desktop_web_driver.find_element(By.CSS_SELECTOR, '#email').send_keys("[email protected]") | ||
|
||
desktop_web_driver.find_element(By.CSS_SELECTOR, '.complete-checkout-btn').click() | ||
time.sleep(sleep_length()) | ||
desktop_web_driver.find_element(By.CSS_SELECTOR, '.complete-checkout-btn').click() | ||
time.sleep(sleep_length()) | ||
|
||
sentry_sdk.metrics.incr(key="test_checkout.iteration.completed", value=1, tags=query_string) | ||
sentry_sdk.metrics.incr(key="test_checkout.iteration.completed", value=1, tags=query_string) | ||
|
||
except Exception as err: | ||
sentry_sdk.metrics.incr(key="test_checkout.iteration.abandoned", value=1, tags=dict(query_string, reason=f"other({err.__class__.__name__})")) | ||
|