⏱️ Duration: 271.42s
❌ Error:
mobile_page = <Page url='https://promo.com/planner/my-calendar#ai-generation'>
base_url = 'https://promo.com'
def test_m05_generate_single_ai_post_mobile(mobile_page: Page, base_url: str) -> None:
"""M05: Verify mobile single AI post button for unauthenticated user (Sign up prompt),
then sign up and generate a single AI post.
"""
auto = AutopilotPage(mobile_page)
signup = SignUpPage(mobile_page)
# Part 1: verify mobile AI button prompts signup for unauthenticated user
auto.go_to_my_calendar(base_url)
mobile_page.wait_for_load_state("domcontentloaded")
_dismiss_cookies(mobile_page)
mobile_page.locator('[data-qaid="new-video-mobile-button"]').wait_for(
state="visible", timeout=15_000
)
mobile_page.locator('[data-qaid="new-video-mobile-button"]').click()
# Unauthenticated users see a Sign up CTA
mobile_page.locator('button:has-text("Sign up")').wait_for(state="visible", timeout=10_000)
# Part 2: sign up via standard /signup page
email = random_email()
signup.create_account(base_url, email, fullname, random_password)
signup.skip_survey()
# Close AI onboarding if the URL input panel is visible
try:
mobile_page.locator(auto.WEBSITE_TOPIC_URL_INPUT).wait_for(state="visible", timeout=8_000)
mobile_page.locator(signup.AI_ONBOARDING_X_BTN).click()
except PlaywrightTimeoutError:
pass
# Part 3: generate a single AI post on mobile (now logged in)
auto.go_to_my_calendar(base_url)
_dismiss_cookies(mobile_page)
mobile_page.locator('[data-qaid="new-video-mobile-button"]').wait_for(
state="visible", timeout=15_000
)
mobile_page.locator('[data-qaid="new-video-mobile-button"]').click(force=True)
# Description input — exact class match to avoid strict-mode collisi