def _edit_wiki_teardown(self, expected_version, expected_text): """ """ # Test preview text preview_text = util.get_wiki_preview(self.driver) self.assertEqual(preview_text, expected_text) # Click submit button util.submit_wiki_text(self.driver) # Get updated version and text new_version = util.get_wiki_version(self.driver) new_text = util.get_wiki_text(self.driver) if new_version else '' # Test version and text self.assertEqual(new_version, expected_version) self.assertEqual(new_text, expected_text) # Check version on dashboard self._check_dashboard(expected_version)
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)