class HomePage(BasePage): PRODUCTS_LABEL = Element.label( name='Products', ios_query=(AppiumBy.XPATH, '//XCUIElementTypeStaticText[@name="PRODUCTS"]'), android_query=(AppiumBy.ANDROID_UIAUTOMATOR, get_text('PRODUCTS')), web_query=(SeleniumBy.XPATH, '/html/body/div[2]/header')) USERNAME_LABEL = Element.label( name='Username', ios_query=(AppiumBy.NAME, 'Username'), android_query=(AppiumBy.ANDROID_UIAUTOMATOR, get_description('test-Username')), web_query=(SeleniumBy.XPATH, '/html/body/div[2]/header')) def __init__(self, context): super().__init__(context) @property def previous_screen(self): from pages import LoginPage return LoginPage(self.context) @property def trait(self) -> Element: return self.PRODUCTS_LABEL @property def path_switcher(self): pass
from appium.webdriver.common.mobileby import MobileBy as By # It's importing the BasePage class, who has all the definitions that are using the Appium driver. from support.pages.base import BasePage # It's importing the way to search elements through ANDROID_UIAUTOMATOR from support.android.ui_automator import get_text, get_description # It's importing the constants file from support.constants.hawaiianmilles import switch locators = { 'label': { switch.get('JOINHAWAIIAN_LABEL'): { 'ios': (By.ACCESSIBILITY_ID, 'PageTitle'), 'android': (By.ANDROID_UIAUTOMATOR, get_text('Join HawaiianMiles')) }, switch.get('BODY_LABEL'): { 'ios': (By.ACCESSIBILITY_ID, 'PageTitle'), 'android': (By.ANDROID_UIAUTOMATOR, get_text( 'Open the Hawaiian Airlines website in browser and join Hawaiian Miles?' )) } }, 'button': { switch.get('CANCEL_BUTTON'): { 'ios': (By.ACCESSIBILITY_ID, 'SignInButton'), 'android': (By.ANDROID_UIAUTOMATOR, get_text('Cancel')) }, switch.get('OPENBROWSER_BUTTON'): { 'ios': (By.ACCESSIBILITY_ID, 'My Trips'), 'android': (By.ANDROID_UIAUTOMATOR, get_text('Open Browser'))
locators = { 'label': { switch.get('MORE_LABEL'): { 'ios': (By.ACCESSIBILITY_ID, 'PageTitle'), 'android': (By.ACCESSIBILITY_ID, 'PageTitle') } }, 'button': { switch.get('SIGNIN_BUTTON'): { 'ios': (By.ACCESSIBILITY_ID, 'SignInButton'), 'android': (By.ANDROID_UIAUTOMATOR, get_text('Sign In')) }, switch.get('MORE_BUTTON'): { 'ios': (By.ACCESSIBILITY_ID, 'More'), 'android': (By.ACCESSIBILITY_ID, 'More') } }, 'section': { } } class MorePage(BasePage):
from appium.webdriver.common.mobileby import MobileBy as By # It's importing the BasePage class, who has all the definitions that are using the Appium driver. from support.pages.base import BasePage # It's importing the way to search elements through ANDROID_UIAUTOMATOR from support.android.ui_automator import get_text, get_description # It's importing the constants file from support.constants.forgotusername import switch locators = { 'label': { switch.get('FORGOTUSERNAME_LABEL'): { 'ios': (By.ACCESSIBILITY_ID, 'PageTitle'), 'android': (By.ANDROID_UIAUTOMATOR, get_text('Forgot username?')) }, switch.get('BODY_LABEL'): { 'ios': (By.ACCESSIBILITY_ID, 'PageTitle'), 'android': (By.ANDROID_UIAUTOMATOR, get_text( 'Open the Hawaiian Airlines website in browser to retrieve your Username?' )) } }, 'button': { switch.get('CANCEL_BUTTON'): { 'ios': (By.ACCESSIBILITY_ID, 'SignInButton'), 'android': (By.ANDROID_UIAUTOMATOR, get_text('Cancel')) }, switch.get('OPENBROWSER_BUTTON'): { 'ios': (By.ACCESSIBILITY_ID, 'My Trips'), 'android': (By.ANDROID_UIAUTOMATOR, get_text('Open Browser'))
from appium.webdriver.common.mobileby import MobileBy as By # It's importing the BasePage class, who has all the definitions that are using the Appium driver. from support.pages.base import BasePage # It's importing the way to search elements through ANDROID_UIAUTOMATOR from support.android.ui_automator import get_text, get_description # It's importing the constants file from support.constants.home import switch locators = { 'label': { switch.get('ALOHA_LABEL'): { 'ios': (By.NAME, 'PRODUCTS'), 'android': (By.ANDROID_UIAUTOMATOR, get_text('Aloha\nAhiahi')) }, switch.get('LAST_LABEL'): { 'ios': (By.XPATH, '//android.view.ViewGroup[@content-desc="HomePage"]/android.view.ViewGroup/android.view.ViewGroup/android.widget.ScrollView/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup[1]/android.view.ViewGroup[2]/android.view.ViewGroup[5]/android.widget.TextView' ), 'android': (By.XPATH, '//android.view.ViewGroup[@content-desc="HomePage"]/android.view.ViewGroup/android.view.ViewGroup/android.widget.ScrollView/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup[1]/android.view.ViewGroup[2]/android.view.ViewGroup[5]/android.widget.TextView' ) } }, 'button': { switch.get('CHECKIN_BUTTON'): { 'ios': (By.ACCESSIBILITY_ID, 'HomeCheckIn'), 'android': (By.ACCESSIBILITY_ID, 'HomeCheckIn') }, switch.get('SIGNIN_BUTTON'): {
from appium.webdriver.common.mobileby import MobileBy as By # It's importing the BasePage class, who has all the definitions that are using the Appium driver. from support.pages.base import BasePage # It's importing the way to search elements through ANDROID_UIAUTOMATOR from support.android.ui_automator import get_text, get_description # It's importing the constants file from support.constants.forgotpassword import switch locators = { 'label': { switch.get('FORGOTPASSWORD_LABEL'): { 'ios': (By.ACCESSIBILITY_ID, 'PageTitle'), 'android': (By.ANDROID_UIAUTOMATOR, get_text('Forgot password?')) }, switch.get('BODY_LABEL'): { 'ios': (By.ACCESSIBILITY_ID, 'PageTitle'), 'android': (By.ANDROID_UIAUTOMATOR, get_text( 'Open the Hawaiian Airlines website in browser to reset your password?' )) } }, 'button': { switch.get('CANCEL_BUTTON'): { 'ios': (By.ACCESSIBILITY_ID, 'SignInButton'), 'android': (By.ANDROID_UIAUTOMATOR, get_text('Cancel')) }, switch.get('OPENBROWSER_BUTTON'): { 'ios': (By.ACCESSIBILITY_ID, 'My Trips'), 'android': (By.ANDROID_UIAUTOMATOR, get_text('Open Browser'))