-
Notifications
You must be signed in to change notification settings - Fork 467
/
extension_ui_customers.py
42 lines (35 loc) · 1.78 KB
/
extension_ui_customers.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
from selenium.webdriver.common.by import By
from selenium_ui.base_page import BasePage
from selenium_ui.conftest import print_timing
from selenium_ui.jsm.pages.customer_pages import Login
from util.conf import JSM_SETTINGS
def app_specific_action(webdriver, datasets):
page = BasePage(webdriver)
if datasets['custom_issues']:
custom_request_key = datasets['custom_issue_key']
custom_service_desk_id = datasets['custom_service_desk_id']
# To run action as specific user uncomment code bellow.
# NOTE: If app_specific_action is running as specific user, make sure that app_specific_action is running
# just before test_2_selenium_z_log_out action
# @print_timing("selenium_app_specific_user_login")
# def measure():
# def app_specific_user_login(username='admin', password='admin'):
# login_page = Login(webdriver)
# login_page.delete_all_cookies()
# login_page.go_to()
# login_page.set_credentials(username=username, password=password)
# login_page.wait_for_page_loaded()
# app_specific_user_login(username='admin', password='admin')
# measure()
@print_timing("selenium_customer_app_custom_action")
def measure():
@print_timing("selenium_customer_app_custom_action:view_request")
def sub_measure():
page.go_to_url(f"{JSM_SETTINGS.server_url}/servicedesk/customer/portal/"
f"{custom_service_desk_id}/{custom_request_key}")
# Wait for options element visible
page.wait_until_visible((By.CLASS_NAME, 'cv-request-options'))
# Wait for you app-specific UI element by ID selector
page.wait_until_visible((By.ID, "ID_OF_YOUR_APP_SPECIFIC_UI_ELEMENT"))
sub_measure()
measure()