GShellAutomator/gui.py

36 lines
1.9 KiB
Python
Raw Normal View History

'''
This classes holds the coordinates for all the elements that need to be clicked on the screen.
All the coordinates are kept as percentages of the screen resolution and are recalculated at runtime
'''
class Gui:
def __init__(self, width, height):
Gui.chrome_gui = Chrome(width, height)
Gui.qwiklabs_gui = Qwiklabs(width, height)
class Chrome(Gui):
SEARCH_BAR_PERCENTAGE = (0.5, 0.1)
def __init__(self, width, height):
Chrome.SEARCH_BAR=width*Chrome.SEARCH_BAR_PERCENTAGE[0], height*Chrome.SEARCH_BAR_PERCENTAGE[1]
class Qwiklabs(Gui):
JOIN_BTN_PERCENTAGE = (0.775, 0.183)
SIGN_IN_BTN_PERCENTAGE = (0.2125, 0.73)
EMAIL_TEXTBOX_PERCENTAGE = (0.5, 0.73)
COURSE_BTN_PERCENTAGE = (0.29, 0.45)
STARTLAB_BTN_PERCENTAGE = (0.125, 0.31)
CAPTCHA_BTN_PERCENTAGE = (0.075, 0.425)
EMAIL_COPY_BTN_PERCENTAGE = (0.3125, 0.7)
PASSWORD_COPY_BTN_PERCENTAGE = (0.3125, 0.82)
def __init__(self, width, height):
Qwiklabs.JOIN_BTN=width*Qwiklabs.JOIN_BTN_PERCENTAGE[0], height*Qwiklabs.JOIN_BTN_PERCENTAGE[1]
Qwiklabs.SIGN_IN_BTN=width*Qwiklabs.SIGN_IN_BTN_PERCENTAGE[0], height*Qwiklabs.SIGN_IN_BTN_PERCENTAGE[1]
Qwiklabs.EMAIL_TEXTBOX=width*Qwiklabs.EMAIL_TEXTBOX_PERCENTAGE[0], height*Qwiklabs.EMAIL_TEXTBOX_PERCENTAGE[1]
Qwiklabs.COURSE_BTN=width*Qwiklabs.COURSE_BTN_PERCENTAGE[0], height*Qwiklabs.COURSE_BTN_PERCENTAGE[1]
Qwiklabs.STARTLAB_BTN=width*Qwiklabs.STARTLAB_BTN_PERCENTAGE[0], height*Qwiklabs.STARTLAB_BTN_PERCENTAGE[1]
Qwiklabs.CAPTCHA_BTN=width*Qwiklabs.CAPTCHA_BTN_PERCENTAGE[0], height*Qwiklabs.CAPTCHA_BTN_PERCENTAGE[1]
Qwiklabs.EMAIL_COPY_BTN=width*Qwiklabs.EMAIL_COPY_BTN_PERCENTAGE[0], height*Qwiklabs.EMAIL_COPY_BTN_PERCENTAGE[1]
Qwiklabs.PASSWORD_COPY_BTN=width*Qwiklabs.PASSWORD_COPY_BTN_PERCENTAGE[0], height*Qwiklabs.PASSWORD_COPY_BTN_PERCENTAGE[1]