Exemplo n.º 1
0
 def change_theme(self, theme):
     self.open()
     wait_for_element_by_selector(
         self.driver,
         self.THEME_CONTAINER.format(theme.split()[0])).click()
     wait_for_element_by_selector(
         self.driver, self.THEME_SELECTOR.format(theme)).click()
Exemplo n.º 2
0
 def auth(self):
     self.open()
     form = AuthForm(self.driver)
     wait_for_element_by_selector(self.driver, self.FORM)
     form.set_login(os.environ['LOGIN'])
     form.set_password(os.environ['PASSWORD'])
     form.submit()
     wait_for_url(self.driver, VIRUSMUSIC_BASE_URL)
Exemplo n.º 3
0
 def change_color(self):
     currentColor = wait_for_element_by_selector(self.driver, self.COLOR_EDIT)
     currentColor.click()
     for color in self.driver.find_elements_by_css_selector(self.COLORS):
         if (color.get_attribute('style') != currentColor.get_attribute('style') and color.get_attribute('style') not in FORBIDDEN_COLORS):
             style = color.get_attribute('style')
             color.click()
             return style
Exemplo n.º 4
0
 def set_name(self, name):
     nameElement = wait_for_element_by_selector(self.driver, self.NAME)
     nameElement.click()
     actionChains = ActionChains(self.driver)
     actionChains.key_down(Keys.CONTROL).send_keys('a').key_up(
         Keys.CONTROL).key_down(Keys.BACKSPACE).key_up(
             Keys.BACKSPACE).perform()
     actionChains.send_keys(name + Keys.ENTER).perform()
Exemplo n.º 5
0
 def get_description(self):
     return wait_for_element_by_selector(self.driver, self.DESCRIPTION).get_attribute('innerText')
Exemplo n.º 6
0
 def change_description(self, description):
     wait_for_element_by_selector(self.driver, self.DESCRIPTION_EDIT).click()
     actionChains = ActionChains(self.driver)
     actionChains.key_down(Keys.CONTROL).send_keys('a').key_up(Keys.CONTROL).key_down(Keys.BACKSPACE).key_up(Keys.BACKSPACE).perform()
     actionChains.send_keys(description + Keys.ENTER).perform()
Exemplo n.º 7
0
 def share(self):
     share = wait_for_element_by_selector(self.driver, self.SHARE)
     share.click()
Exemplo n.º 8
0
 def submit(self):
     wait_for_element_by_selector(self.driver, self.SUBMIT).click()
Exemplo n.º 9
0
 def set_new_password_confirm(self, password):
     newPasswordConfirmInput = wait_for_element_by_selector(
         self.driver, self.NEW_PASSWORD_CONFIRM)
     newPasswordConfirmInput.clear()
     newPasswordConfirmInput.send_keys(password)
Exemplo n.º 10
0
 def set_description(self, description):
     descriptionElement = wait_for_element_by_selector(
         self.driver, self.DESCRIPTION)
     descriptionElement.clear()
     descriptionElement.send_keys(description)
Exemplo n.º 11
0
 def open_modal(self):
     wait_for_element_by_selector(self.driver, self.SETTINGS).click()
     wait_for_element_by_xpath(self.driver, self.EDIT).click()
Exemplo n.º 12
0
 def create_playlist(self, name):
     self.open()
     input = wait_for_element_by_selector(self.driver, self.NAME_INPUT)
     input.clear()
     input.send_keys(name + Keys.ENTER)
Exemplo n.º 13
0
 def set_password(self, password):
     wait_for_element_by_selector(self.driver,
                                  self.PASSWORD).send_keys(password)
Exemplo n.º 14
0
 def next(self):
     wait_for_element_by_selector(self.driver, self.NEXT).click()
Exemplo n.º 15
0
 def set_login(self, login):
     wait_for_element_by_selector(self.driver, self.LOGIN).send_keys(login)
Exemplo n.º 16
0
 def create_list(self, name):
     wait_for_element_by_selector(self.driver, self.LIST_NAME_INPUT).send_keys(name + Keys.ENTER)
Exemplo n.º 17
0
 def set_name(self, name):
     nameInput = wait_for_element_by_selector(self.driver, self.NAME)
     nameInput.clear()
     nameInput.send_keys(name)
Exemplo n.º 18
0
 def set_email(self, email):
     emailInput = wait_for_element_by_selector(self.driver, self.EMAIL)
     emailInput.clear()
     emailInput.send_keys(email)
Exemplo n.º 19
0
 def delete(self):
     wait_for_element_by_selector(self.driver, self.SETTINGS).click()
     wait_for_element_by_xpath(self.driver, self.DELETE).click()
Exemplo n.º 20
0
 def get_playlist_id(self, name):
     return wait_for_element_by_selector(self.driver, self.CARD.format(name)).get_attribute('a-id')
Exemplo n.º 21
0
 def wait_for_playlist(self, name):
     wait_for_element_by_selector(self.driver, self.CARD.format(name))
Exemplo n.º 22
0
 def delete_playlist(self, name):
     self.edit()
     delete = wait_for_element_by_selector(self.driver, self.DELETE.format(name))
     delete.click()
Exemplo n.º 23
0
 def set_new_password(self, password):
     newPasswordInput = wait_for_element_by_selector(
         self.driver, self.NEW_PASSWORD)
     newPasswordInput.clear()
     newPasswordInput.send_keys(password)
Exemplo n.º 24
0
 def get_navbar_login(self):
     return wait_for_element_by_selector(
         self.driver, self.NAVBAR_LOGIN).get_attribute('innerText')
Exemplo n.º 25
0
 def set_password(self, password):
     passwordInput = wait_for_element_by_selector(self.driver,
                                                  self.PASSWORD)
     passwordInput.clear()
     passwordInput.send_keys(password)
Exemplo n.º 26
0
 def vk_share(self):
     self.open()
     self.share()
     vkShare = wait_for_element_by_selector(self.driver, self.VK_SHARE)
     vkShare.click()
Exemplo n.º 27
0
 def edit(self):
     edit = wait_for_element_by_selector(self.driver, self.EDIT)
     edit.click()
Exemplo n.º 28
0
 def delete(self):
     self.open()
     delete = wait_for_element_by_selector(self.driver, self.DELETE)
     delete.click()
Exemplo n.º 29
0
 def get_navbar_email(self):
     return wait_for_element_by_selector(self.driver, self.NAVBAR_EMAIL).get_attribute('innerText')
Exemplo n.º 30
0
 def get_name(self):
     return wait_for_element_by_selector(self.driver, self.NAME).get_attribute('innerText')