⏱️ Duration: 16.52s
❌ Error:
self = <tests.test_pricing.TestPricing object at 0x7fd988eb2d40>
pricing_page = <pages.pricing_page.PricingPage object at 0x7fd988e9d840>
base_url = 'https://promo.com'
def test_p05_anonymous_user_sees_correct_currency(
self, pricing_page, base_url
):
"""
P05 Anonymous user sees a consistent currency on pricing & the upgrade page
Feature scenario:
When I open pricing page
Then I verify a correct currency is displayed
When I open the upgrade page with url
Then I verify a correct currency is displayed
Currency is decided server-side from the real connecting IP — nothing in
this framework (or the source Selenium suite) can force a specific one,
so instead of asserting a hardcoded expected symbol, this reads whatever
currency the pricing page actually shows and asserts the upgrade page
shows the same one.
"""
pricing_page.go_to_pricing_page(base_url)
pricing_page.skip_cookies()
displayed_symbol = pricing_page.get_displayed_currency_symbol()
pricing_page.assert_currency_displayed(displayed_symbol)
pricing_page.go_to_upgrade_page(base_url)
> pricing_page.assert_currency_displayed(displayed_symbol)
tests/test_pricing.py:108:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pages.pricing_page.PricingPage object at 0x7fd988e9d840>
expected_symbol = '$'
def assert_currency_displayed(self, expected_symbol: str = "$"):
"""
Verifies at least one currency element on the page shows the expected
symbol. Mirrors: currencies_check(browser) from newcancellation_page.py
"""
locator = self.page.locator(
f'{self.CURRENCY_SYMBOL}:has-text("{expected_symbol}")'
)
try:
locator.first.wait_for(state="visible", timeout=self.T_LOAD)
except PlaywrightTimeoutError:
📸 Failure Screenshot: