mirror of
https://github.com/pretix/pretix.git
synced 2026-05-07 15:34:02 +00:00
simplify e2e test iframe check
This commit is contained in:
@@ -874,14 +874,7 @@ def widget_page(page):
|
||||
"""Close the checkout iframe."""
|
||||
close_btn = self.page.locator('.pretix-widget-frame-close button')
|
||||
close_btn.click()
|
||||
# Wait for iframe to close
|
||||
self.page.wait_for_function(
|
||||
"""() => {
|
||||
const frame = document.querySelector('.pretix-widget-frame-shown');
|
||||
return !frame || !frame.classList.contains('pretix-widget-frame-shown');
|
||||
}""",
|
||||
timeout=5000
|
||||
)
|
||||
self.page.locator('.pretix-widget-frame-shown').wait_for(state='detached', timeout=5000)
|
||||
return self
|
||||
|
||||
def expand_variations(self, item_name: str):
|
||||
|
||||
@@ -39,30 +39,11 @@ class TestEventSeriesJourney:
|
||||
iframe.locator('text=/45\\.00/').first
|
||||
).to_be_visible(timeout=15000)
|
||||
|
||||
# Close iframe and go back to list view
|
||||
widget_page.close_iframe()
|
||||
page.locator('a[rel="back"]').click()
|
||||
# widget_page.goto(
|
||||
# live_server_url,
|
||||
# organizer.slug,
|
||||
# event.slug,
|
||||
# **{'list-type': 'list'}
|
||||
# )
|
||||
|
||||
page.locator('.pretix-widget-event-list-entry').nth(1).click()
|
||||
|
||||
# expect(
|
||||
# page.locator('.pretix-widget-item:has-text("Concert Ticket")')
|
||||
# ).to_be_visible(timeout=15000)
|
||||
# widget_page.select_item_quantity('Concert Ticket', 1)
|
||||
|
||||
# Dispatch change event so the widget detects items are selected
|
||||
# (calcItemsSelected listens for 'change', not 'input')
|
||||
# page.locator(
|
||||
# '.pretix-widget-item:has-text("Concert Ticket") '
|
||||
# 'input[type=number]'
|
||||
# ).dispatch_event('change')
|
||||
page.pause()
|
||||
widget_page.click_buy_button()
|
||||
iframe = widget_page.wait_for_iframe_checkout()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user