Ejemplo n.º 1
0
 def run(self):
     bot = Browser(showWindow=True)
     bot.go_to(self.login_url)
     print("went to home page")
     print("checking for login")
     bot.maximize_window()
     # if(bot.exists(text="LOGIN")):
     #     bot.click("LOGIN")
     # else:
     #     print("didn't find login")
     #     bot.click("EUW")
     bot.click("EUW")
     bot.click("LOGIN")
     print("click login")
     time.sleep(5)
     bot.type(self.username, into="Username")
     bot.type(self.password, into="Password")
     bot.click("SIGN IN")
     print("clicked sign in")
     time.sleep(5)
     print("signed in")
     bot.go_to(self.watch_url)
     time.sleep(10)
     self.mission_confirmation(bot)
     bot.quit()
Ejemplo n.º 2
0
 def run(self):
     bot = Browser(showWindow = True)
     bot.go_to(self.link)
     print("went to home page")
     print("checking for login")
     bot.maximize_window()
     bot.click("EUW")
     bot.click("LOGIN")
     print("click login")
     time.sleep(5)
     bot.type(self.username, into="Username")
     bot.type(self.password, into = "Password")
     bot.click("SIGN IN")
     print("clicked sign in")
     time.sleep(5)
     print("signed in")
     i = 0
     for url in self.URLS:
         print(url)
         bot.go_to('https://watch.lolesports.com'+str(url))
         time.sleep(3)
         bot.click("JUMP")
         time.sleep(80)
         temp = self.URLS.pop(i)
         self.DONE.append(temp)
     time.sleep(10)
     print("ok")
     self.save()
     bot.quit()
Ejemplo n.º 3
0
 def run(self):
     bot = Browser(showWindow=True)
     bot.go_to(self.login_url)
     print("went to home page")
     print("checking for login")
     bot.maximize_window()
     # if(bot.exists(text="LOGIN")):
     #     bot.click("LOGIN")
     # else:
     #     print("didn't find login")
     #     bot.click("EUW")
     bot.click("EUW")
     bot.click("LOGIN")
     print("click login")
     time.sleep(5)
     bot.type(self.username, into="Username")
     bot.type(self.password, into="Password")
     bot.click("SIGN IN")
     print("clicked sign in")
     time.sleep(5)
     print("signed in")
     bot.go_to(
         'https://raptor.rewards.lolesports.com/v1/missions/free?locale=en_US'
     )
Ejemplo n.º 4
0
                            if web.exists('OK') == True:
                                web.click('OK')  #
                                time.sleep(2)  #chargement de la page

                                if web.exists('Send to Transfer List') == True:
                                    web.click('Send to Transfer List')  #

    if web.exists('Home') == True:
        web.click(classname='Home')  #

    print('sleep')
    time.sleep(random.randint(1, 30))  #chargement de la page


web = Browser("--disable-dev-shm-usage")
web.maximize_window()

try:
    login(web)
except:
    print('error loggin')

if web.exists(classname='view-navbar-currency-coins'
              ) == True:  #on recupere les coins
    coins = web.driver.find_element_by_class_name(
        'view-navbar-currency-coins').text
    a_coins = int((coins.replace(',', '')).replace(' ', ''))
    print('on commence avec : ', a_coins)
else:
    a_coins = 1001
Ejemplo n.º 5
0
class WebbotManager:
    web = None
    _passwords = Passwords()

    def __init__(self, download_path=None):
        self.web = Browser(showWindow=True, downloadPath=download_path)
        self.web.maximize_window()

    def __del__(self):
        self.web.quit()

    def download_seis(self):
        """
        Navigates to the seis website, logs in, and downloads the seis summative export. Not the one for TOMS,
        the first one which provides us with more data like the case manager.
        """
        self.web.go_to("https://seis.org/reports/toms")
        self.web.type(self._passwords.seis_login_information['username'],
                      id="username")
        self.web.type(self._passwords.seis_login_information['password'],
                      id="password")
        self.web.click("Login")
        sleep(3)
        self.web.click(
            xpath='//*[@id="form"]/div/div/div/div/div[1]/div/div/button')
        sleep(30)
        self.web.click("XLSX", number=1)

    def cleanup_seis(self):
        """
        Deletes the SEIS report that was just downloaded.
        """
        self.web.click(classname='seis-icon-delete')
        self.web.click(xpath="/html/body/div[3]/div/div/div[3]/button[1]")

    def sign_in_to_caaspp(self):
        """
        Navigates to the TOMS system and logs in. TOMS thinks it's a new device logging in so it asks for a login
        code which it emails to me and the login manager grabs.
        """
        self.web.go_to("https://mytoms.ets.org/")
        self.web.type(self._passwords.caaspp_login_information['username'],
                      id="username")
        self.web.type(self._passwords.caaspp_login_information['password'],
                      id="password")
        self.web.click("Secure Logon")
        self.web.type(EmailManager().retrieve_login_code(), id="emailcode")
        self.web.click("Submit")
        self.web.click(xpath='//*[@id="roleOrgSelect"]/optgroup/option[2]')
        self.web.click(xpath='//*[@id="okButton"]')

    def upload_test_settings(self, filepath: str):
        self.web.go_to("https://mytoms.ets.org/mt/dt/uploadaccoms.htm")
        self.web.click("Next")
        self.web.type(filepath, xpath='//*[@id="uploadfilepath"]')
        self.web.click("Next")

    def upload_is_valid(self) -> bool:
        print(
            f"File is processing. Will check at {(datetime.now() + timedelta(0, 120)).strftime('%m/%d/%Y %I:%M:%S %p')}"
        )
        sleep(120)
        loops = 20
        while loops >= 0:
            elements = self.web.find_elements(tag='td')
            validation_data = {
                'datetime':
                datetime.strptime(elements[1].text, '%b %d, %Y, %I:%M %p'),
                'status':
                elements[3],  # .text
                'action':
                elements[4]
            }
            if validation_data['status'].text.startswith('Errors'):
                validation_data['action'].click()
                return False
            elif validation_data['status'].text.startswith('Validated'):
                validation_data['action'].click()
                return True
            else:
                print(
                    f"Still processing. Will re-try at {(datetime.now() + timedelta(0, 120)).strftime('%m/%d/%Y %I:%M:%S %p')}"
                )
                loops -= 1
                sleep(120)
                # Had initially used recursion but I didn't want to risk running into the stack loop limit.

        # If managed to get out of loop, report error.
        EmailManager().send_email(
            subject="TOMS Settings Upload Validation Failed Error",
            body=
            "Something went wrong with trying to validate the TOMS Settings Upload file in TOMS."
        )
        exit()