in issues/295/user_tool.py [0:0]
def test_mobile_get_assistance_page():
with sync_playwright() as p:
browser, context, page = launch_app(p, device="iPhone 12 Pro")
context.tracing.start(title="test_mobile_get_assistance_page", screenshots=True, snapshots=True)
try:
user_email = generate_random_email()
page = login_user(page, user_email, first_name="Bob")
try:
page.locator('button[aria-label="Close"]').click(timeout=3000)
except Exception:
print("Did not find close!")
pass
plus_icon = page.locator('button[aria-label="Start chat (Floating action)"]')
expect(plus_icon).to_be_visible()
plus_icon.click()
new_workspace_button = page.locator('div[aria-label="New workspace"]')
expect(new_workspace_button).to_be_visible()
new_workspace_button.click()
more_features_button = page.locator(
'div[aria-label="More features"][role="menuitem"]'
)
expect(more_features_button).to_be_visible()
more_features_button.click()
workflow_switch = page.locator(
'button[aria-label="Configure how spend is approved and paid."][role="switch"]'
)
expect(workflow_switch).to_be_visible()
workflow_switch.click()
workflows_button = page.locator('div[aria-label="Workflows"][role="menuitem"]')
expect(workflows_button).to_be_visible()
workflows_button.click()
connect_bank_account = page.locator(
'div[aria-label="Connect bank account"][role="menuitem"]'
)
expect(connect_bank_account).to_be_visible()
connect_bank_account.click()
update_to_usd = page.locator(
'button[data-listener="Enter"]', has_text="Update to USD"
)
expect(update_to_usd).to_be_visible()
update_to_usd.click()
page.wait_for_timeout(2000)
get_assistant = page.locator(
'button[aria-label="Get assistance from our team"][role="button"]'
)
expect(get_assistant).to_be_visible()
get_assistant.click()
chat_with_concierge = page.locator(
'div[aria-label="Chat with Concierge"][role="menuitem"]'
)
expect(chat_with_concierge).to_be_visible()
chat_with_concierge.click()
back_arrow_button = page.locator('button[aria-label="Back"]').last
expect(back_arrow_button).to_be_visible()
back_arrow_button.click()
chat_with_concierge = page.locator(
'div[aria-label="Chat with Concierge"][role="menuitem"]'
)
expect(chat_with_concierge).to_be_visible()
except Exception as e:
raise e
finally:
context.tracing.stop(path="/app/expensify/user_tool/output_browser1.zip")
from utils.trace_cleaner import trace_cleaner
trace_cleaner("/app/expensify/user_tool/output_browser1.zip")
browser.close()