def test_build_packages(self, register_webhook):
     '''This test perform a package addtion and check whether a build
      started for the same.
      1. Create a session cookie for given user. We are using a existing
            # user 'brandon' which is already added as fixture.
      2. Try to create a package.
      3. Poll the task for package creation. Polling should start the build
      4. Verify that Building started and it is visible via GUI'''
     sourcePage = SourcePage(self.driver)
     self.create_login_session('brandon')
     # test whether sources page opens after user logs in
     sourcePage.driver.get(self.live_server_url)
     sourcePage.sources_button.click()
     git_url = "https://github.com/aaSemble/python-aasemble.django.git"
     sourcePage.create_new_package_source(git_url=git_url, branch='master', series='brandon/aasemble')
     self.assertEqual(sourcePage.verify_package_source(git_url=git_url), True, 'Package not created')
     from .models import PackageSource
     # Only one package is added with this url
     P = PackageSource.objects.filter(git_url=git_url)[0]
     try:
         poll_one(P.id)
     except:
         # Marking Pass even if we got some exception during package build.
         # Our verification is limited to UI inteface. Form UI, It should
         # be visible (even if it has just started)
         pass
     finally:
         buildPage = BuildPage(self.driver)
         buildPage.driver.get(self.live_server_url)
         buildPage.build_button.click()
         self.assertEqual(buildPage.verify_build_displayed(packageName='python-aasemble.django.git'), True, 'Build not started')
Exemplo n.º 2
0
 def test_build_packages(self, register_webhook):
     '''This test perform a package addtion and check whether a build
      started for the same.
      1. Create a session cookie for given user. We are using a existing
            # user 'brandon' which is already added as fixture.
      2. Try to create a package.
      3. Poll the task for package creation. Polling should start the build
      4. Verify that Building started and it is visible via GUI'''
     sourcePage = SourcePage(self.driver)
     self.create_login_session('brandon')
     # test whether sources page opens after user logs in
     sourcePage.driver.get(self.live_server_url)
     sourcePage.sources_button.click()
     git_url = "https://github.com/aaSemble/python-aasemble.django.git"
     sourcePage.create_new_package_source(git_url=git_url,
                                          branch='master',
                                          series='brandon/aasemble')
     self.assertEqual(sourcePage.verify_package_source(git_url=git_url),
                      True, 'Package not created')
     from .models import PackageSource
     # Only one package is added with this url
     P = PackageSource.objects.filter(git_url=git_url)[0]
     try:
         poll_one(P.id)
     except:
         # Marking Pass even if we got some exception during package build.
         # Our verification is limited to UI inteface. Form UI, It should
         # be visible (even if it has just started)
         pass
     finally:
         buildPage = BuildPage(self.driver)
         buildPage.driver.get(self.live_server_url)
         buildPage.build_button.click()
         self.assertEqual(
             buildPage.verify_build_displayed(
                 packageName='python-aasemble.django.git'), True,
             'Build not started')
 def test_source_package(self, register_webhook):
     '''This test performs a basic package addition and deletion.
        This test consists of following steps:
        1. Create a session cookie for given user. We are using a existing
            user 'Dennis' which is already added as fixture.
        2. Try to create a package.
        3. Verify if the package has been created.
        4. Try to delete the package
        5. Verify if the package has been deleted'''
     sourcePage = SourcePage(self.driver)
     self.create_login_session('brandon')
     # test whether sources page opens after user logs in
     sourcePage.driver.get(self.live_server_url)
     sourcePage.sources_button.click()
     git_url = "https://github.com/aaSemble/python-aasemble.django.git"
     sourcePage.create_new_package_source(git_url=git_url, branch='master', series='brandon/aasemble')
     self.assertEqual(sourcePage.verify_package_source(git_url=git_url), True, 'Package not created')
     register_webhook.assert_called_with()
     sourcePage.delete_package_source()
     self.assertEqual(sourcePage.verify_package_source(git_url=git_url), False, 'Package not deleted')
 def test_source_package(self, register_webhook):
     '''This test performs a basic package addition and deletion.
        This test consists of following steps:
        1. Create a session cookie for given user. We are using a existing
            user 'Dennis' which is already added as fixture.
        2. Try to create a package.
        3. Verify if the package has been created.
        4. Try to delete the package
        5. Verify if the package has been deleted'''
     sourcePage = SourcePage(self.driver)
     self.create_login_session('brandon')
     # test whether sources page opens after user logs in
     sourcePage.driver.get(self.live_server_url)
     sourcePage.sources_button.click()
     git_url = "https://github.com/aaSemble/python-aasemble.django.git"
     sourcePage.create_new_package_source(git_url=git_url,
                                          branch='master',
                                          series='brandon/aasemble')
     self.assertEqual(sourcePage.verify_package_source(git_url=git_url),
                      True, 'Package not created')
     register_webhook.assert_called_with()
     sourcePage.delete_package_source()
     self.assertEqual(sourcePage.verify_package_source(git_url=git_url),
                      False, 'Package not deleted')