コード例 #1
0
ファイル: main_page.py プロジェクト: tech-QA-n1/homework-4
 def remove_from_queue(self, track_id):
     track = utils.wait_for_element_by_xpath(
         self.driver, self.TRACK_IN_QUEUE.format(track_id))
     ActionChains(self.driver).move_to_element(track).perform()
     utils.wait_for_element_by_xpath(
         self.driver,
         self.REMOVE_FROM_QUEUE_BUTTON.format(track_id)).click()
コード例 #2
0
ファイル: main_page.py プロジェクト: tech-QA-n1/homework-4
 def queue_contains(self, track_id):
     try:
         utils.wait_for_element_by_xpath(
             self.driver, self.TRACK_IN_QUEUE.format(track_id))
         return True
     except:
         return False
コード例 #3
0
ファイル: search_form.py プロジェクト: tech-QA-n1/homework-4
 def search_result(self, type, name):
     if type == "artist":
         utils.wait_for_element_by_xpath(
             self.driver, self.SEARCH_ARTIST_RESULT.format(name)).click()
     else:
         utils.wait_for_element_by_xpath(
             self.driver,
             self.SEARCH_ALBUM_OR_TRACK_RESULT.format(name, type)).click()
コード例 #4
0
ファイル: main_page.py プロジェクト: tech-QA-n1/homework-4
 def is_add_visible(self, track_id):
     track = utils.wait_for_element_by_xpath(
         self.driver, self.TRACK_BY_ID.format(track_id))
     ActionChains(self.driver).move_to_element(track).perform()
     try:
         utils.wait_for_element_by_xpath(
             self.driver, self.ADD_BUTTON_BY_ID.format(track_id))
         return True
     except:
         return False
コード例 #5
0
ファイル: main_page.py プロジェクト: tech-QA-n1/homework-4
 def is_liked(self, track_id):
     track = utils.wait_for_element_by_xpath(
         self.driver, self.TRACK_BY_ID.format(track_id))
     ActionChains(self.driver).move_to_element(track).perform()
     like_class = self.driver.find_element_by_xpath(
         self.LIKE_BUTTON_BY_ID.format(track_id)).get_attribute(self.CLASS)
     if like_class == self.NOT_LIKED_CLASS:
         return False
     else:
         return True
コード例 #6
0
ファイル: main_page.py プロジェクト: tech-QA-n1/homework-4
 def press_add_to_playlist(self, track_id, playlist_name, playlist_id):
     utils.wait_for_element_by_xpath(self.driver,
                                     self.TRACK_BY_ID.format(track_id))
     ActionChains(self.driver).move_to_element(self.driver.find_element_by_xpath(self.TRACK_BY_ID.format(track_id))) \
         .perform()
     utils.wait_for_element_by_xpath(
         self.driver, self.ADD_BUTTON_BY_ID.format(track_id)).click()
     playlist = utils.wait_for_element_by_xpath(
         self.driver, self.PLAYLIST_BY_ID.format(playlist_id))
     ActionChains(
         self.driver).move_to_element(playlist).click(playlist).perform()
     is_included = playlist.get_attribute("is-include")
     utils.wait_for_element_by_xpath(self.driver, self.CLOSE_WINDOW).click()
     return is_included
コード例 #7
0
ファイル: main_page.py プロジェクト: tech-QA-n1/homework-4
 def press_track_like_button(self, track_id):
     track = utils.wait_for_element_by_xpath(
         self.driver, self.TRACK_BY_ID.format(track_id))
     ActionChains(self.driver).move_to_element(track).click(
         self.driver.find_element_by_xpath(
             self.LIKE_BUTTON_BY_ID.format(track_id))).perform()
コード例 #8
0
ファイル: main_page.py プロジェクト: tech-QA-n1/homework-4
 def get_first_track_id(self):
     return utils.wait_for_element_by_xpath(
         self.driver, self.FIRST_TRACK_IN_LIST).get_attribute(self.TRACK_ID)
コード例 #9
0
ファイル: main_page.py プロジェクト: tech-QA-n1/homework-4
 def wait_for_not_found_search(self):
     utils.wait_for_element_by_xpath(self.driver, self.CLASS_NOT_FOUND)
コード例 #10
0
ファイル: main_page.py プロジェクト: tech-QA-n1/homework-4
 def play_prev(self):
     utils.wait_for_element_by_xpath(self.driver, self.PLAYER_PREV).click()
コード例 #11
0
ファイル: search_form.py プロジェクト: tech-QA-n1/homework-4
 def search(self):
     utils.wait_for_element_by_xpath(self.driver,
                                     self.SEARCH_BUTTON).click()
コード例 #12
0
ファイル: main_page.py プロジェクト: tech-QA-n1/homework-4
 def get_current_id(self):
     return utils.wait_for_element_by_xpath(
         self.driver, self.CURRENT_MAKER).get_attribute("current-id")
コード例 #13
0
ファイル: main_page.py プロジェクト: tech-QA-n1/homework-4
 def wrap_player(self):
     ActionChains(self.driver).move_to_element(utils.wait_for_element_by_xpath(self.driver, self.TRIGGER_BUTTON)) \
         .click(self.driver.find_element_by_xpath(self.PLAYER_ARROW)).perform()
コード例 #14
0
ファイル: main_page.py プロジェクト: tech-QA-n1/homework-4
 def get_player_pos(self):
     pos = utils.wait_for_element_by_xpath(
         self.driver, self.TRIGGER_BUTTON).get_attribute("style")
     return pos
コード例 #15
0
ファイル: main_page.py プロジェクト: tech-QA-n1/homework-4
 def play_track_in_queue(self, track_num):
     utils.wait_for_element_by_xpath(
         self.driver,
         self.PLAY_TRACK_BY_NUM_BUTTON.format(track_num)).click()
コード例 #16
0
ファイル: main_page.py プロジェクト: tech-QA-n1/homework-4
 def play(self, track_id):
     utils.wait_for_element_by_xpath(
         self.driver, self.PLAY_BUTTON_BY_ID.format(track_id)).click()
コード例 #17
0
ファイル: search_form.py プロジェクト: tech-QA-n1/homework-4
 def enter_string(self, string):
     utils.wait_for_element_by_xpath(self.driver,
                                     self.SEARCH_FIELD).send_keys(string)