def _test_wiki_delete(self): # Get original values and open edit box orig_version, orig_text = self._edit_wiki_setup() # Clear text util.clear_wiki_text(self.driver) # Update expected version and text expected_version = orig_version + 1 expected_text = '' # Submit changes and check results self._edit_wiki_teardown(expected_version, expected_text)
def test_node_wiki_changes_log(self): """ test to make sure that project log works correctly on a node wiki change """ # Browse to wiki page self.driver.find_element_by_link_text('Wiki').click() # Get original version number orig_version = util.get_wiki_version(self.driver) # edit the wiki util.edit_wiki(self.driver) util.clear_wiki_text(self.driver) util.add_wiki_text(self.driver, str(uuid.uuid1())[:20]) util.submit_wiki_text(self.driver) #get wiki_url wiki_url = self.driver.current_url #get log util.goto_project(self.driver) message_log = self.get_log() #assert the time self._assert_time(message_log.log_time) #assert the log new_version = str(orig_version + 1) self.assertEqual(message_log.log_text, self.user_data["fullname"] + " updated wiki page home to version " + new_version) #check the user_url and node_url self.assertEqual(message_log.log_url[0], self.get_user_url()) self.assertEqual(message_log.log_url[1], wiki_url)
def test_node_wiki_changes_log(self): """ test to make sure that project log works correctly on a node wiki change """ # Browse to wiki page self.driver.find_element_by_link_text('Wiki').click() # Get original version number orig_version = util.get_wiki_version(self.driver) # edit the wiki util.edit_wiki(self.driver) util.clear_wiki_text(self.driver) util.add_wiki_text(self.driver, str(uuid.uuid1())[:20]) util.submit_wiki_text(self.driver) #get wiki_url wiki_url = self.driver.current_url #get log util.goto_project(self.driver) message_log = self.get_log() #assert the time self._assert_time(message_log.log_time) #assert the log new_version = str(orig_version + 1) self.assertEqual( message_log.log_text, self.user_data["fullname"] + " updated wiki page home to version " + new_version) #check the user_url and node_url self.assertEqual(message_log.log_url[0], self.get_user_url()) self.assertEqual(message_log.log_url[1], wiki_url)
def _add_wiki(self,text): #help function to add the wiki "text" util.edit_wiki(self.driver) util.clear_wiki_text(self.driver) util.add_wiki_text(self.driver, text) util.submit_wiki_text(self.driver)
def _add_wiki(self, text): #help function to add the wiki "text" util.edit_wiki(self.driver) util.clear_wiki_text(self.driver) util.add_wiki_text(self.driver, text) util.submit_wiki_text(self.driver)