def test_private_component_contributor_access(self):
        page = helpers.get_new_component()
        user = helpers.create_user()

        page.add_contributor(user)

        self._test_can_access(page, user)
    def test_private_component_title_change_contributor(self):
        page = helpers.get_new_component()

        page.title = 'changed'

        page.reload()

        self.assertEqual(page.title, 'changed')

        page.close()
    def test_public_component_title_change_anonymous(self):
        page = helpers.get_new_component()
        page.public = True
        _url = page.driver.current_url
        page.log_out()

        page.driver.get(_url)

        with self.assertRaises(NoSuchElementException):
            page.title = 'changed'

        page.close()
    def test_public_component_title_anonymous(self):
        page = helpers.get_new_component()
        page.public = True

        _url = page.driver.current_url

        page.log_out()
        page.driver.get(_url)

        page = ProjectPage(driver=page.driver)

        self._test_title(page, can_modify=False)
    def test_public_component_title_non_contributor(self):
        page = helpers.get_new_component()
        page.public = True

        _url = page.driver.current_url
        page.close()

        page = LoginPage().log_in(user=helpers.create_user())
        page.driver.get(_url)

        page = ProjectPage(driver=page.driver)

        self._test_title(page, can_modify=False)
    def test_public_component_title_change_non_contributor(self):
        page = helpers.get_new_component()
        page.public = True
        _url = page.driver.current_url
        page.log_out()
        page.close()

        page = LoginPage()
        page.log_in(helpers.create_user())

        page.driver.get(_url)
        page = ProjectPage(driver=page.driver)

        with self.assertRaises(NoSuchElementException):
            page.title = 'changed'

        page.close()
 def test_component_add_contributors_access(self):
     self._test_add_contributor_access(helpers.get_new_component())
 def test_component_add_contributors_listed(self):
     self._test_add_contributor_listed(helpers.get_new_component())
    def test_public_component_anonymous_access(self):
        page = helpers.get_new_component()
        page.public = True

        self._test_can_access(page)
    def test_public_component_non_contributor_access(self):
        page = helpers.get_new_component()
        user = helpers.create_user()
        page.public = True

        self._test_can_access(page, user)
    def test_private_component_anonymous_access(self):
        page = helpers.get_new_component()

        self._test_can_access(page, can_access=False)
    def test_private_component_anonymous_access(self):
        page = helpers.get_new_component()

        self._test_can_access(page, can_access=False)
    def test_private_component_non_contributor_access(self):
        page = helpers.get_new_component()
        user = helpers.create_user()

        self._test_can_access(page, user, False)
예제 #14
0
 def test_public_component_title_contributor(self):
     page = helpers.get_new_component()
     page.public = True
     self._test_title(page, can_modify=True)
예제 #15
0
 def test_private_component_title_contributor(self):
     self._test_title(
         page=helpers.get_new_component(),
         can_modify=True
     )
예제 #16
0
    def test_component_key_creation(self):
        page = helpers.get_new_component()
        key = page.settings.add_api_key()
        page.close()

        self.assertIsInstance(key, ApiKey)