voip click2calll
This commit is contained in:
1 parent
cb92abbb41
commit
38b1cf06df
18 files changed
+543
-26
No files matched your search
@@ -45,7 +45,13 @@ def test_staff_operations_pages_are_authorized_and_visually_styled(live_server,
|
||||
part = Q(content_type__app_label=app_label, codename__in=codenames)
|
||||
query = part if query is None else query | part
|
||||
unit.permissions.add(*Permission.objects.filter(query))
|
||||
staff = User.objects.create_user(username="e2e-operations", password=PASSWORD, account_type=User.AccountType.STAFF)
|
||||
staff = User.objects.create_user(
|
||||
username="e2e-operations",
|
||||
password=PASSWORD,
|
||||
account_type=User.AccountType.STAFF,
|
||||
voip_extension="300",
|
||||
voip_mobile="09384999655",
|
||||
)
|
||||
StaffProfile.objects.create(user=staff, display_name="کارشناس عملیات", primary_unit=unit)
|
||||
customer = User.objects.create_user(username="e2e-carrier", mobile="09120009121", account_type=User.AccountType.CUSTOMER)
|
||||
profile = CustomerProfile.objects.create(user=customer, first_name="باربری", stakeholder_type=CustomerProfile.StakeholderType.CARRIER)
|
||||
@@ -76,6 +82,22 @@ def test_staff_operations_pages_are_authorized_and_visually_styled(live_server,
|
||||
assert page.evaluate("getComputedStyle(document.querySelector('.operations-page')).display") == "grid"
|
||||
assert page.evaluate("document.documentElement.scrollWidth <= document.documentElement.clientWidth + 1")
|
||||
|
||||
page.goto(f"{live_server.url}{reverse('staff_tickets:contacts')}", wait_until="domcontentloaded")
|
||||
call_trigger = page.locator("[data-voip-call-trigger]").first
|
||||
call_trigger.click()
|
||||
call_menu = page.locator("body > .voip-call-menu:not([hidden])")
|
||||
expect(call_menu).to_be_visible()
|
||||
expect(call_menu.get_by_role("menuitem")).to_have_count(2)
|
||||
assert call_menu.evaluate("menu => menu.parentElement === document.body")
|
||||
assert int(call_menu.evaluate("menu => getComputedStyle(menu).zIndex")) > 100000
|
||||
menu_box = call_menu.bounding_box()
|
||||
assert menu_box is not None
|
||||
assert menu_box["x"] >= 0 and menu_box["y"] >= 0
|
||||
assert menu_box["x"] + menu_box["width"] <= page.viewport_size["width"]
|
||||
assert menu_box["y"] + menu_box["height"] <= page.viewport_size["height"]
|
||||
page.keyboard.press("Escape")
|
||||
expect(call_menu).to_be_hidden()
|
||||
|
||||
page.goto(f"{live_server.url}{reverse('staff_tickets:dispatch_create')}", wait_until="domcontentloaded")
|
||||
expect(page).to_have_title("ردیابی E2E")
|
||||
expect(page.locator(".staff-brand-copy b")).to_have_text("مرکز عملیات E2E")
|
||||
|
||||
Reference in new issue
Block a user