new migration in apps.applets to seed wallet applet models; many expanded styles in wallet.js, chiefly concerned w. wallet-oriented FTs tbh; some intermittent Windows cache errors quashed in dash view ITs; apps.dash.views & .urls now support wallet applets; apps.lyric.models now discerns tithe coins (available for purchase soon); new styles across many scss files, again many concerning wallet applets but also applets more generally and also unorthodox media query parameters to make UX more usable; a slew of new wallet partials
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
@@ -81,6 +81,16 @@ class FunctionalTest(StaticLiveServerTestCase):
|
||||
@wait
|
||||
def wait_for(self, fn):
|
||||
return fn()
|
||||
|
||||
def wait_for_slow(self, fn, timeout=30):
|
||||
start_time = time.time()
|
||||
while True:
|
||||
try:
|
||||
return fn()
|
||||
except (AssertionError, WebDriverException) as e:
|
||||
if time.time() - start_time > timeout:
|
||||
raise e
|
||||
time.sleep(0.5)
|
||||
|
||||
def create_pre_authenticated_session(self, email):
|
||||
if self.test_server:
|
||||
|
||||
@@ -9,6 +9,15 @@ class WalletDisplayTest(FunctionalTest):
|
||||
def setUp(self):
|
||||
super().setUp()
|
||||
Applet.objects.get_or_create(slug="wallet", defaults={"name": "Wallet"})
|
||||
for slug, name, cols, rows in [
|
||||
("wallet-balances", "Wallet Balances", 3, 3),
|
||||
("wallet-tokens", "Wallet Tokens", 3, 3),
|
||||
("wallet-payment", "Payment Methods", 6, 2),
|
||||
]:
|
||||
Applet.objects.get_or_create(
|
||||
slug=slug,
|
||||
defaults={"name": name, "grid_cols": cols, "grid_rows": rows, "context": "wallet"},
|
||||
)
|
||||
|
||||
def test_new_user_wallet_shows_starting_balances(self):
|
||||
# 1. Log in as new user
|
||||
@@ -45,14 +54,10 @@ class WalletDisplayTest(FunctionalTest):
|
||||
ActionChains(self.browser).move_to_element(coin).perform()
|
||||
self.wait_for(
|
||||
lambda: self.assertTrue(
|
||||
self.browser.find_element(
|
||||
By.CSS_SELECTOR, "#id_coin_on_a_string .token-tooltip"
|
||||
).is_displayed()
|
||||
self.browser.find_element(By.ID, "id_tooltip_portal").is_displayed()
|
||||
)
|
||||
)
|
||||
coin_tooltip = self.browser.find_element(
|
||||
By.CSS_SELECTOR, "#id_coin_on_a_string .token-tooltip"
|
||||
).text
|
||||
coin_tooltip = self.browser.find_element(By.ID, "id_tooltip_portal").text
|
||||
self.assertIn("Coin-on-a-String", coin_tooltip)
|
||||
self.assertIn("Admit 1 Entry", coin_tooltip)
|
||||
self.assertIn("no expiry", coin_tooltip)
|
||||
@@ -62,14 +67,10 @@ class WalletDisplayTest(FunctionalTest):
|
||||
ActionChains(self.browser).move_to_element(free_token).perform()
|
||||
self.wait_for(
|
||||
lambda: self.assertTrue(
|
||||
self.browser.find_element(
|
||||
By.CSS_SELECTOR, "#id_free_token_0 .token-tooltip"
|
||||
).is_displayed()
|
||||
self.browser.find_element(By.ID, "id_tooltip_portal").is_displayed()
|
||||
)
|
||||
)
|
||||
free_tooltip = self.browser.find_element(
|
||||
By.CSS_SELECTOR, "#id_free_token_0 .token-tooltip"
|
||||
).text
|
||||
free_tooltip = self.browser.find_element(By.ID, "id_tooltip_portal").text
|
||||
self.assertIn("Free Token", free_tooltip)
|
||||
self.assertIn("Admit 1 Entry", free_tooltip)
|
||||
self.assertIn("Expires", free_tooltip)
|
||||
@@ -125,10 +126,15 @@ class WalletDisplayTest(FunctionalTest):
|
||||
).send_keys("42424")
|
||||
# 6. Return to main doc & submit form
|
||||
self.browser.switch_to.default_content()
|
||||
self.wait_for(
|
||||
lambda: self.assertFalse(
|
||||
self.browser.find_element(By.ID, "id_save_payment_method").get_attribute("hidden")
|
||||
)
|
||||
)
|
||||
self.browser.find_element(By.ID, "id_save_payment_method").click()
|
||||
# 7. Wait for saved card to appear in payment methods list
|
||||
# Assert last 4 digits shown
|
||||
self.wait_for(
|
||||
# Assert last 4 digits shown (Stripe confirmSetup + server round-trip can be slow)
|
||||
self.wait_for_slow(
|
||||
lambda: self.assertIn(
|
||||
"4242",
|
||||
self.browser.find_element(By.ID, "id_payment_methods").text,
|
||||
|
||||
Reference in New Issue
Block a user