Skip to content

Commit

Permalink
case worker verifying rep
Browse files Browse the repository at this point in the history
  • Loading branch information
osimuka committed Feb 24, 2025
1 parent 1deed26 commit c6be83b
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 2 deletions.
49 changes: 47 additions & 2 deletions e2e/test_verify_reg_of_interest_journey.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,57 @@
import os
import pytest

from playwright.sync_api import expect

from e2e.utils import get_base_url, retry
from e2e.utils import get_base_url, retry, login_user

BASE_URL = get_base_url()

@retry()
@pytest.mark.order(2)
def test_verify_reg_interest_journey(page):
pass

email = os.environ.get("TEST_USER_EMAIL")
password = os.environ.get("TEST_USER_PASSWORD")
case_id = os.environ.get("TEST_REPR_INVITE_CASE_ID")
company_name = os.environ.get("TEST_PEPR_COMPANY_NAME")

login_user(page, email, password)

page.wait_for_timeout(200)

page.get_by_role("link", name=case_id).click()

# go to the reps menu
page.locator("#menu-bar > div:nth-child(3)").click()

page.get_by_role("link", name=company_name, exact=True).click()
page.get_by_role("link", name="Registration of Interest").click()
page.get_by_role("button", name="Verification process").click()
page.get_by_role("link", name=f"Verify {company_name}").click()
page.locator("input[name=\"deficiency_notice_params_org_verify\"]").first.check()
page.locator("input[name=\"deficiency_notice_params_org_verify\"]").nth(1).check()
page.get_by_role("button", name="Save").click()
page.get_by_role("link", name="Choose to accept into case").click()
page.locator("#accepted-radio").check()
page.get_by_role("combobox").select_option("domestic_producer")
page.get_by_role("button", name="Save").click()
page.get_by_role("button", name="OK").click()
page.get_by_role("button", name="Exit").click()
page.get_by_role("button", name="OK").click()
page.get_by_text("Original information request6").click()
page.get_by_role("link", name="Expand deficiency documents").click()
page.get_by_role("button", name="Verification process").click()
page.get_by_role("link", name="Notify contact").click()
page.get_by_role("button", name="Send the notification").click()
page.get_by_role("button", name="OK").click()
page.get_by_role("button", name="Exit").click()
page.get_by_role("link", name="Notify contact").click()
page.get_by_role("button", name="Send the notification").click()







10 changes: 10 additions & 0 deletions e2e/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,13 @@ def generate_test_address():
def genetrate_test_postcode():
"""Generate a random postcode."""
return ''.join(random.choices(string.ascii_uppercase + string.digits, k=7))


def login_user(page, email, password, base_url):
"""Login a user with the given email and password."""
page.goto(base_url)
page.get_by_label("Email").click()
page.get_by_label("Email").fill(email)
page.get_by_label("Password").click()
page.get_by_label("Password").fill(password)
page.get_by_role("button", name="Log in").click()

0 comments on commit c6be83b

Please sign in to comment.