def _edit_wiki_setup(self):
     """
     """
     
     # Browse to wiki page
     self.driver.find_element_by_link_text('Wiki').click()
     
     # Get original version and text
     orig_version = util.get_wiki_version(self.driver)
     orig_text = util.get_wiki_text(self.driver) if orig_version else ''
     
     # Click edit button
     util.edit_wiki(self.driver)
     
     return orig_version, orig_text
Example #2
0
 def _edit_wiki_setup(self):
     """
     """
     
     # Browse to wiki page
     self.driver.find_element_by_link_text('Wiki').click()
     
     # Get original version and text
     orig_version = util.get_wiki_version(self.driver)
     orig_text = util.get_wiki_text(self.driver) if orig_version else ''
     
     # Click edit button
     util.edit_wiki(self.driver)
     
     return orig_version, orig_text
Example #3
0
    def test_wiki_changes_log(self):
        """
        test to make sure that wiki_changes log works correctly
        """

        # 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
        self._add_wiki(str(uuid.uuid1())[:20])

        #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,
            u'{} updated wiki page home to version {}'.format(
                self.user_data["fullname"],
                new_version,
            )
        )

        #check the user_url and project_url
        self.assertEqual(
            message_log.log_url[0],
            self.get_user_url()
        )
        self.assertEqual(
            message_log.log_url[1],
            wiki_url
        )
    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)
Example #5
0
    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)
Example #7
0
    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)