def test_invoice_report_amount()

in issues/208/user_tool.py [0:0]


def test_invoice_report_amount():
    with sync_playwright() as p:
        browser = p.chromium.launch(headless=True, args=[
            "--ignore-certificate-errors",
            "--disable-web-security",
            "--disable-features=IsolateOrigins,site-per-process"
        ])
        context = browser.new_context()
        context.tracing.start(screenshots=True, snapshots=True, sources=True)
        page = context.new_page()
        
        try:
            user = UserLogin()
            user.new_dot_login(page, EMAIL)
            page.wait_for_timeout(2000)


            page.get_by_label("My settings").click()
            page.locator("div:nth-child(2) > div:nth-child(2) > div > div > div > div > div > div > div > div:nth-child(2) > .css-view-175oi2r").click()


            page.wait_for_timeout(1000)
            page.get_by_label("New workspace").first.click()
            page.locator("div:nth-child(2) > div:nth-child(5) > div > div > div > div > div > div > div > div > div:nth-child(2) > div").click()
            page.get_by_test_id("selection-list-text-input").click()
            page.get_by_test_id("selection-list-text-input").press("CapsLock")
            page.wait_for_timeout(1000)
            page.get_by_test_id("selection-list-text-input").fill("K")
            page.get_by_test_id("selection-list-text-input").press("CapsLock")
            page.wait_for_timeout(1000)
            page.get_by_test_id("selection-list-text-input").fill("Kes")
            page.get_by_test_id("selection-list").get_by_label("KES - KSh").click()
            page.get_by_text("Members").click()
            page.wait_for_timeout(1000)
            page.get_by_role("button", name="Invite member").click()
            page.get_by_test_id("selection-list-text-input").fill("test@gmail.com")
            page.wait_for_timeout(2000)
            

            page.locator("[id=\"\\31 78516\"]").get_by_label("Joanna Cheng").click()
            page.get_by_role("button", name="Next").click()
            page.wait_for_timeout(1000)
            page.get_by_test_id("WorkspaceInviteMessagePage").get_by_role("button", name="Invite").click()
            page.get_by_text("More features").click()
            page.get_by_label("Send and receive invoices.").click()
            page.wait_for_timeout(1000)
        

            page.get_by_label("Back").click()
            page.get_by_label("Inbox").click()
            page.get_by_label("Start chat (Floating action)").click()
            page.wait_for_timeout(1000)


            page.get_by_text("Send invoice").click()
            page.get_by_label("Select a currency").click()
            page.get_by_test_id("selection-list-text-input").press("CapsLock")
            page.wait_for_timeout(1000)
            page.get_by_test_id("selection-list-text-input").fill("K")
            page.get_by_test_id("selection-list-text-input").press("CapsLock")
            page.wait_for_timeout(1000)
            page.get_by_test_id("selection-list-text-input").fill("Kes ")
            page.get_by_label("KES - KSh").click()
            page.get_by_placeholder("0").fill("100")
            page.get_by_role("button", name="Next").click()
            page.wait_for_timeout(1000)


            page.get_by_test_id("selection-list-text-input").fill("test@gmail.com")
            page.wait_for_timeout(2000)
            page.get_by_test_id("selection-list").get_by_label("Joanna Cheng").click()
            page.get_by_role("button", name="Next").click()
            page.get_by_role("textbox", name="Your company name").press("CapsLock")
            page.wait_for_timeout(1000)
            page.get_by_role("textbox", name="Your company name").fill("JTL")
            page.get_by_role("textbox", name="Your company website").click()
            page.get_by_role("textbox", name="Your company website").fill("https://qa-trainer-jschool.web.app/")
            page.wait_for_timeout(2000)


            page.get_by_role("button", name="Send KES 100.00 invoice").click()
            page.wait_for_timeout(2000)
            page.get_by_label("View details").click()
            

            page.locator("div:nth-child(2) > div > div:nth-child(3) > div > div > div > div > div > div > div > div > div > div > .css-view-175oi2r").click()
            page.get_by_label("Select a currency").click()
            page.get_by_test_id("selection-list-text-input").fill("USD")
            page.wait_for_timeout(2000)
            page.get_by_label("USD - $").click()
            page.wait_for_timeout(2000)
            page.get_by_role("button", name="Save").click()
            page.wait_for_timeout(3000)


            expect(page.get_by_text("TotalKES 0.00Out-of-pocket")).not_to_be_visible()

        except Exception as e:
            print(f"An error occurred during the test: {e}")
            raise e
        finally:
            context.tracing.stop(path="/app/expensify/user_tool/output_browser1.zip")
            trace_cleaner("/app/expensify/user_tool/output_browser1.zip")
            browser.close()