def fill_bio(self, bio): """ Fills in bio :param bio: """ log.write_line('Filling in bio with ' + bio) self.wait_until_visible_and_send_keys(self.bio_input, bio)
def fill_location(self, location): """ Fills in location :param location: """ log.write_line('Filling in location with ' + location) self.wait_until_visible_and_send_keys(self.location_input, location)
def click_profile_button(self): """ Clicks on profile buton on left hand navigation bar """ log.write_line( 'Clicking on \'Profile\' button on left hand navigation bar') self.click(self.profile_link)
def get_profile_bio(self): """ Retrieves user bio from profile page :return: - Bio """ log.write_line('Retrieving bio from profile page') self.wait_until_visible(self.bio_field) return self.find_element(self.bio_field).text
def get_profile_location(self): """ Retrieves user location from profile page :return: - location """ log.write_line('Retrieving location from profile page') self.wait_until_visible(self.location_field) return self.find_element(self.location_field).text
def validate_component(self): """ Validates current component :return: True if editor container is visible """ log.write_line('Validating components visibility') self.soft_wait_until_visible(self.timeline) return self.is_visible(self.timeline)
def validate_component(self): """ Validates current component :return: True if cancel button container is visible """ log.write_line('Validating components visibility') self.soft_wait_until_visible(self.nav_bar) return self.is_visible(self.nav_bar)
def is_tweet_button_enabled(self): """ Checks if 'Tweet' button is disabled :return: false if disabled """ log.write_line('Checking whether \'Tweet\' button is disabled') return self.find_element( self.add_post_button).get_attribute('disabled') is None
def click_log_in(self): """ Clicks on log in button """ log.write_line('Clicking on Log In button') if self.is_visible(self.login_button_alt, timeout=1): self.click(self.login_button_alt) else: self.click(self.login_button)
def click_log_in(self): """ Clicks on log in button on static logged out page """ log.write_line('Clicking on Log In button on landing page') if self.is_visible(self.login_btn_alt, timeout=1): self.click(self.login_btn_alt) else: self.click(self.login_button)
def is_tweet_present(self, text, timeout=TestConf.timeout): """ Checks if given tweet by text is present on timeline :param timeout: - timeout in seconds :param text: Tweet text to search for """ log.write_line( 'Checking if given tweet is present on timeline by text: ' + text) return self.is_visible(self.format_locator_for_tweet_by_text(text), timeout=timeout)
def fill_username(self, username): """ Fills in username :param username: """ log.write_line('Filling in username with ' + username) if self.is_visible(self.username_input_alt, timeout=1): self.wait_until_visible_and_send_keys(self.username_input_alt, username) else: self.wait_until_visible_and_send_keys(self.username_input, username)
def fill_password(self, password): """ Fills in password :param password: """ log.write_line('Filling in password with ' + password) if self.is_visible(self.password_input_alt, timeout=1): self.wait_until_visible_and_send_keys(self.password_input_alt, password) else: self.wait_until_visible_and_send_keys(self.password_input, password)
def click_add_post(self): """ Clicks on 'Tweet' button """ log.write_line('Clicking on \'Tweet\' button') self.click(self.add_post_button)
def click_delete_button(self): """ Clicks on delete button on delete confirmation modal """ log.write_line('Clicking on \'delete\' button on delete confirmation modal') self.click(self.delete_button)
def click_tweet_delete_button(self): """ Clicks tweet delete button, will only be visible if menu has been expanded after clicking caret """ log.write_line('Clicking \'Delete\' button on tweet') self.click(self.tweet_delete_button)
def click_save_button(self): """ Clicks on save button on edit profile modal """ log.write_line('Clicking on \'Save\' button on edit profile modal') self.click(self.save_profile_button)
def clear_bio(self): """ Clears bio input """ log.write_line('Clearing bio input') self.clear_field(self.bio_input)
def clear_location(self): """ Clears bio input """ log.write_line('Clearing location input') self.clear_field(self.location_input)
def wait_for_modal_to_close(self): """ Waits for edit profile modal to close """ log.write_line('Waiting for edit profile modal to close') self.wait_until_invisible(self.edit_profile_modal)
def fill_editor(self, text): """ Fills in post create editor """ log.write_line('Filling in post create editor with ' + text) self.wait_until_visible_and_send_keys(self.editor_input, text)
def click_edit_profile(self): """ Clicks on Edit Profile button """ log.write_line('Clicking on edit profile button') self.click(self.edit_profile_button)