Ejemplo n.º 1
0
 def _navigate(self):
     try:
         # already on the page?
         self._assertUrl()
     except AssertionError as e:
         SE.get(SE.current_url + self._sub_url)
         self._assertUrl()
 def _navigate(self):
     try:
         # already on the page?
         self._assertUrl()
     except AssertionError as e:
         SE.get(SE.current_url + self._sub_url)
         self._assertUrl()
    def setUpClass(cls):
        super(NewFilterTestE2ECase, cls).setUpClass()
        import pageobjects.namespace
        # details to be filled in the new filter menu
        cls.filter_details = pageobjects.namespace.load_ns({
            'filter_name':
            cls.__name__ + "_test",
            'filter_description':
            cls.__name__ + "_description",
            'hours_menu': {
                'hours_field': "24"
            },
            'status_field':
            "Current",
            'organizations_field':
            "ACME_Corporation",
            'lifecycle_field':
            "Active"
        })

        # apply the filter details to the new_filter_menu
        pageobjects.namespace.setattr_ns(cls.filters.new_filter_menu,
                                         cls.filter_details)
        # submit the new filter
        cls.filters.new_filter_menu.submit()
        cls.the_filter = cls.filters.get_filter(cls.filter_details.filter_name)
        SE.refresh()
 def splice_check_report(typeinstance, days_start=None, days_end=None, past_hours=None, state=[u'Active', u'Inactive', u'Deleted'], current=0, invalid=0, insufficient=0, organizations=[u'Testing Org']):
     report_page = None
     KATELLO = typeinstance.KATELLO
     SE.reset(url=KATELLO.url)
     if days_start is not None and days_end is not None:
         # date-range mode
         start_date, end_date = report.date_ago(days_start), report.date_ago(days_end)
         filter_name = report.dates_filter_name(start_date, end_date, state)
         with typeinstance._env_ctx(KATELLO.url, KATELLO.user, KATELLO.password, organizations[0]):
             with filter_date_range_ctx(
                     name=filter_name,
                     start_date=start_date,
                     end_date=end_date,
                     organizations=organizations,
                     lifecycle_states=state
                 ) as (filters_page, report_filter):
                 report_page = report_filter.run_report()
                 # assert the values
                 nose.tools.assert_equal(report_page.current_subscriptions.count.text, unicode(current))
                 nose.tools.assert_equal(report_page.insufficient_subscriptions.count.text, unicode(insufficient))
                 nose.tools.assert_equal(report_page.invalid_subscriptions.count.text, unicode(invalid))
                             
     elif past_hours is not None:
         # hours-based operation
         filter_name = report.hours_filter_name(past_hours, state)
         with typeinstance._env_ctx(KATELLO.url, KATELLO.user, KATELLO.password, organizations[0]):
             with filter_hours_ctx(
                     name=filter_name,
                     hours=past_hours,
                     organizations=organizations,
                     lifecycle_states=state
                 ) as (filters_page, report_filter):
                 report_page = report_filter.run_report()
                 # assert the values
                 nose.tools.assert_equal(report_page.current_subscriptions.count.text, unicode(current))
                 nose.tools.assert_equal(report_page.insufficient_subscriptions.count.text, unicode(insufficient))
                 nose.tools.assert_equal(report_page.invalid_subscriptions.count.text, unicode(invalid))
     else:
         # Wrong usage
         assert False, "Wrong usage"
         return # not reached
    def setUpClass(cls):
        super(NewFilterTestE2ECase, cls).setUpClass()
        import pageobjects.namespace
        # details to be filled in the new filter menu
        cls.filter_details = pageobjects.namespace.load_ns({
            'filter_name': cls.__name__ + "_test",
            'filter_description': cls.__name__ + "_description",
            'hours_menu': {
                'hours_field': "24"
            },
            'status_field': "Current",
            'organizations_field': "ACME_Corporation",
            'lifecycle_field': "Active"
        })

        # apply the filter details to the new_filter_menu
        pageobjects.namespace.setattr_ns(cls.filters.new_filter_menu, cls.filter_details)
        # submit the new filter
        cls.filters.new_filter_menu.submit()
        cls.the_filter = cls.filters.get_filter(cls.filter_details.filter_name)
        SE.refresh()
 def test_3_LoginCtx(self):
     with current_url(KATELLO.url):
         with login_ctx(KATELLO.username, KATELLO.password):
             SE.get(KATELLO.url + "/sam")
 def setUp(self):
     SE.get(KATELLO.url)
     self.verificationErrors = []
 def setUpClass(cls):
     # reset SE driver 
     SE.reset(driver=SELENIUM.driver, url=KATELLO.url)
    def splice_check_report(typeinstance,
                            days_start=None,
                            days_end=None,
                            past_hours=None,
                            state=[u'Active', u'Inactive', u'Deleted'],
                            current=0,
                            invalid=0,
                            insufficient=0,
                            organizations=[u'Testing Org']):
        report_page = None
        KATELLO = typeinstance.KATELLO
        SE.reset(url=KATELLO.url)
        if days_start is not None and days_end is not None:
            # date-range mode
            start_date, end_date = report.date_ago(
                days_start), report.date_ago(days_end)
            filter_name = report.dates_filter_name(start_date, end_date, state)
            with typeinstance._env_ctx(KATELLO.url, KATELLO.user,
                                       KATELLO.password, organizations[0]):
                with filter_date_range_ctx(
                        name=filter_name,
                        start_date=start_date,
                        end_date=end_date,
                        organizations=organizations,
                        lifecycle_states=state) as (filters_page,
                                                    report_filter):
                    report_page = report_filter.run_report()
                    # assert the values
                    nose.tools.assert_equal(
                        report_page.current_subscriptions.count.text,
                        unicode(current))
                    nose.tools.assert_equal(
                        report_page.insufficient_subscriptions.count.text,
                        unicode(insufficient))
                    nose.tools.assert_equal(
                        report_page.invalid_subscriptions.count.text,
                        unicode(invalid))

        elif past_hours is not None:
            # hours-based operation
            filter_name = report.hours_filter_name(past_hours, state)
            with typeinstance._env_ctx(KATELLO.url, KATELLO.user,
                                       KATELLO.password, organizations[0]):
                with filter_hours_ctx(
                        name=filter_name,
                        hours=past_hours,
                        organizations=organizations,
                        lifecycle_states=state) as (filters_page,
                                                    report_filter):
                    report_page = report_filter.run_report()
                    # assert the values
                    nose.tools.assert_equal(
                        report_page.current_subscriptions.count.text,
                        unicode(current))
                    nose.tools.assert_equal(
                        report_page.insufficient_subscriptions.count.text,
                        unicode(insufficient))
                    nose.tools.assert_equal(
                        report_page.invalid_subscriptions.count.text,
                        unicode(invalid))
        else:
            # Wrong usage
            assert False, "Wrong usage"
            return  # not reached
Ejemplo n.º 10
0
 def setUpClass(cls):
     # reset SE driver
     SE.reset(driver=SELENIUM.driver, url=KATELLO.url)
Ejemplo n.º 11
0
 def tearDownClass(cls):
     '''logout'''
     SE.get(KATELLO.url)
     logout()
Ejemplo n.º 12
0
 def test_3_LoginCtx(self):
     with current_url(KATELLO.url):
         with login_ctx(KATELLO.username, KATELLO.password):
             SE.get(KATELLO.url + "/sam")
 def tearDownClass(cls):
     '''logout'''
     SE.get(KATELLO.url)
     logout()
 def tearDownClass(cls):
     # have to remove the filter through the cls.filters attribute instead of cls.the_filter
     # to access the filters/reports page before accessing the_filter
     SE.get(KATELLO.url)
     cls.filters.get_filter(cls.filter_details.filter_name).remove()
     super(NewFilterTestE2ECase, cls).tearDownClass()
 def tearDownClass(cls):
     # have to remove the filter through the cls.filters attribute instead of cls.the_filter
     # to access the filters/reports page before accessing the_filter
     SE.get(KATELLO.url)
     cls.filters.get_filter(cls.filter_details.filter_name).remove()
     super(NewFilterTestE2ECase, cls).tearDownClass()
Ejemplo n.º 16
0
 def setUpClass(cls):
     super(SamDashboardPageTestCase, cls).setUpClass()
     SE.get(KATELLO.url + '/' + pages.dashboard.url)
     cls.page = SamPageObject()
 def setUpClass(cls):
     super(SamDashboardPageTestCase, cls).setUpClass()
     SE.get(KATELLO.url + '/' + pages.dashboard.url)
     cls.page = SamPageObject()
 def setUpClass(cls):
     SE.reset(driver='firefox', url="http://en.wikipedia.org")
Ejemplo n.º 19
0
 def setUpClass(cls):
     '''all these test cases require user logged in'''
     SE.reset(driver=SELENIUM.driver, url=KATELLO.url)
     SE.maximize_window()
     with restore_url():
         login(KATELLO.username, KATELLO.password)
 def setUpClass(cls):
     # override default in order not to do login --- done within the contexts here
     SE.reset(driver=SELENIUM.driver, url=KATELLO.url)
     SE.maximize_window()
     cls.details = filters.DEFAULT_FILTER_DETAILS
Ejemplo n.º 21
0
 def setUp(self):
     SE.get(KATELLO.url)
     self.verificationErrors = []
 def setUpClass(cls):
     # override default in order not to do login --- done within the contexts here
     SE.reset(driver=SELENIUM.driver, url=KATELLO.url)
     SE.maximize_window()
     cls.details = filters.DEFAULT_FILTER_DETAILS
 def setUpClass(cls):
     '''all these test cases require user logged in'''
     SE.reset(driver=SELENIUM.driver, url=KATELLO.url)
     SE.maximize_window()
     with restore_url():
         login(KATELLO.username, KATELLO.password)