Exemple #1
0
 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)
Exemple #2
0
 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)
Exemple #3
0
 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)
Exemple #4
0
 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
Exemple #5
0
 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)
Exemple #7
0
 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)
Exemple #8
0
 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
Exemple #9
0
 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)
Exemple #12
0
 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)
Exemple #13
0
 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)
Exemple #14
0
 def click_add_post(self):
     """
     Clicks on 'Tweet' button
     """
     log.write_line('Clicking on \'Tweet\' button')
     self.click(self.add_post_button)
Exemple #15
0
 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)
Exemple #17
0
 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)
Exemple #18
0
 def clear_bio(self):
     """
     Clears bio input
     """
     log.write_line('Clearing bio input')
     self.clear_field(self.bio_input)
Exemple #19
0
 def clear_location(self):
     """
     Clears bio input
     """
     log.write_line('Clearing location input')
     self.clear_field(self.location_input)
Exemple #20
0
 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)
Exemple #21
0
 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)
Exemple #22
0
 def click_edit_profile(self):
     """
     Clicks on Edit Profile button
     """
     log.write_line('Clicking on edit profile button')
     self.click(self.edit_profile_button)