def goto_league(self, league): """Go to the specified League's page. Arguments ---------- * league (str): the name of the League. Examples ---------- - goto_league('NA LCS') - goto_league('World Championship') """ self.basemap.main_navbar_tab('MORE COMPETITIONS').hover() self._driver.find_element(by.xpath(f'//a[text()="{league}"]')).click()
def main_navbar_tab(self, tabname): """Get the Main Navbar tab by name. tabname is case-sensitive since not all tab names are uppercase. To validate the tab name, inspect the tab copy its text. Arguments ---------- * tabname (str): the name of the tab as shown in the DOM. Examples ---------- - home_tab = main_navbar_tab("HOME") - tickets_tab = main_navbar_tab("Tickets") """ return self._driver.find_element( by.xpath(f'//ul[@class="main-nav-menu"]/li/a[text()="{tabname}"]'))
def region_language(self, region_abbr, language): """Get the Region Language by the region's abbreviation and language. To validate these values, inspect the language option in the DOM and copy its region-id and text. NOTE: * region_abbr is not case-sensitive * language is case-sensitive Arguments ---------- * region_abbr (str): the region abbreviaton as shown in the DOM. * language (str): the language as shown in the DOM or website Examples ---------- - north_america_english = region_language('na', 'English') - eu_nordic_and_east_polski = region_language('eune', 'Polski') """ return self._driver.find_element( by.xpath(f"//div[@id='riotbar-languages-{region_abbr.lower()}'] \ //a[contains(text()='{language}')]"))
def schedule_tab(self): return self._driver.find_element( by.xpath( '(//a[@href="/en_US/na-lcs/na_2018_summer/schedule"])[2]'))
def team_standings_tab(self): return self._driver.find_element( by.xpath("(//a[text()='TEAMS & STANDINGS'])[last()]"))
def select_split_by_name(self, name): """Selects the Split from the Split dropdown.""" self.map.split_dropdown.click() self._driver.find_element( by.xpath(f"//a[text()='{name.lower()}']")).click()