Example #1
0
 def setUp(self):
     super(ActivationKey, self).setUp()
     # Make sure to use the Class' org_name instance
     if ActivationKey.org_name is None:
         ActivationKey.org_name = generate_name(8, 8)
         login = Login(self.browser)
         nav = Navigator(self.browser)
         org = Org(self.browser)
         login.login(self.katello_user, self.katello_passwd)
         nav.go_to_org()
         org.create(ActivationKey.org_name)
         login.logout()
Example #2
0
 def setUp(self):
     super(ContentEnvironment, self).setUp()
     # Make sure to use the Class' org_name instance
     if ContentEnvironment.org_name is None:
         ContentEnvironment.org_name = generate_name(8, 8)
         login = Login(self.browser)
         nav = Navigator(self.browser)
         org = Org(self.browser)
         login.login(self.katello_user, self.katello_passwd)
         nav.go_to_org()
         org.create(ContentEnvironment.org_name)
         login.logout()
Example #3
0
    def setUp(self):  # noqa
        """We do want a new browser instance for every test."""
        if not self.remote:
            if self.driver_name.lower() == 'firefox':
                self.browser = webdriver.Firefox()
            elif self.driver_name.lower() == 'chrome':
                self.browser = webdriver.Chrome()
            elif self.driver_name.lower() == 'ie':
                self.browser = webdriver.Ie()
            elif self.driver_name.lower() == 'phantomjs':
                service_args = ['--ignore-ssl-errors=true']
                self.browser = webdriver.PhantomJS(
                    service_args=service_args
                )
            else:
                self.browser = webdriver.Remote()
        else:
            self.browser = SeleniumFactory().createWebDriver(
                job_name=self.id(), show_session_id=True)

        self.browser.maximize_window()
        self.browser.get(get_server_url())

        # Library methods
        self.activationkey = ActivationKey(self.browser)
        self.architecture = Architecture(self.browser)
        self.compute_resource = ComputeResource(self.browser)
        self.configgroups = ConfigGroups(self.browser)
        self.contentenv = ContentEnvironment(self.browser)
        self.content_views = ContentViews(self.browser)
        self.domain = Domain(self.browser)
        self.environment = Environment(self.browser)
        self.gpgkey = GPGKey(self.browser)
        self.hardwaremodel = HardwareModel(self.browser)
        self.hostgroup = Hostgroup(self.browser)
        self.hosts = Hosts(self.browser)
        self.location = Location(self.browser)
        self.login = Login(self.browser)
        self.medium = Medium(self.browser)
        self.navigator = Navigator(self.browser)
        self.user = User(self.browser)
        self.operatingsys = OperatingSys(self.browser)
        self.org = Org(self.browser)
        self.partitiontable = PartitionTable(self.browser)
        self.puppetclasses = PuppetClasses(self.browser)
        self.products = Products(self.browser)
        self.repository = Repos(self.browser)
        self.role = Role(self.browser)
        self.settings = Settings(self.browser)
        self.subnet = Subnet(self.browser)
        self.subscriptions = Subscriptions(self.browser)
        self.sync = Sync(self.browser)
        self.syncplan = Syncplan(self.browser)
        self.systemgroup = SystemGroup(self.browser)
        self.template = Template(self.browser)
        self.user = User(self.browser)
        self.usergroup = UserGroup(self.browser)
Example #4
0
def make_org(session, **kwargs):
    """Creates an organization"""

    create_args = {
        u'org_name': None,
        u'label': None,
        u'desc': None,
        u'users': None,
        u'proxies': None,
        u'subnets': None,
        u'resources': None,
        u'medias': None,
        u'templates': None,
        u'domains': None,
        u'envs': None,
        u'hostgroups': None,
        u'locations': None,
        u'select': True,
    }
    page = session.nav.go_to_org
    core_factory(create_args, kwargs, session, page)
    Org(session.browser).create(**create_args)
Example #5
0
def make_org(session, **kwargs):
    create_args = {
        'org_name': None,
        'parent_org': None,
        'label': None,
        'desc': None,
        'users': None,
        'proxies': None,
        'subnets': None,
        'resources': None,
        'medias': None,
        'templates': None,
        'domains': None,
        'envs': None,
        'hostgroups': None,
        'locations': None,
        'edit': False,
        'select': True,
    }
    create_args = update_dictionary(create_args, kwargs)
    create_args.update(kwargs)

    session.nav.go_to_org()
    Org(session.browser).create(**create_args)
Example #6
0
    def setUp(self):  # noqa
        """We do want a new browser instance for every test."""
        if settings.browser == 'docker':
            self._docker_browser = DockerBrowser()
            self._docker_browser.start()
            self.browser = self._docker_browser.webdriver
            self.addCleanup(self._docker_browser.stop)
        else:
            self.browser = browser()
            self.addCleanup(self.browser.quit)
        self.browser.maximize_window()
        self.browser.get(settings.server.get_url())

        self.addCleanup(self._saucelabs_test_result)
        self.addCleanup(self.take_screenshot)

        # Library methods
        self.activationkey = ActivationKey(self.browser)
        self.architecture = Architecture(self.browser)
        self.bookmark = Bookmark(self.browser)
        self.container = Container(self.browser)
        self.compute_profile = ComputeProfile(self.browser)
        self.compute_resource = ComputeResource(self.browser)
        self.configgroups = ConfigGroups(self.browser)
        self.content_views = ContentViews(self.browser)
        self.content_search = ContentSearch(self.browser)
        self.domain = Domain(self.browser)
        self.discoveredhosts = DiscoveredHosts(self.browser)
        self.discoveryrules = DiscoveryRules(self.browser)
        self.environment = Environment(self.browser)
        self.gpgkey = GPGKey(self.browser)
        self.hardwaremodel = HardwareModel(self.browser)
        self.hostcollection = HostCollection(self.browser)
        self.hostgroup = Hostgroup(self.browser)
        self.hosts = Hosts(self.browser)
        self.ldapauthsource = LdapAuthSource(self.browser)
        self.lifecycleenvironment = LifecycleEnvironment(self.browser)
        self.location = Location(self.browser)
        self.login = Login(self.browser)
        self.medium = Medium(self.browser)
        self.navigator = Navigator(self.browser)
        self.user = User(self.browser)
        self.operatingsys = OperatingSys(self.browser)
        self.org = Org(self.browser)
        self.oscapcontent = OpenScapContent(self.browser)
        self.oscappolicy = OpenScapPolicy(self.browser)
        self.oscapreports = OpenScapReports(self.browser)
        self.partitiontable = PartitionTable(self.browser)
        self.puppetclasses = PuppetClasses(self.browser)
        self.products = Products(self.browser)
        self.registry = Registry(self.browser)
        self.repository = Repos(self.browser)
        self.rhai = RHAI(self.browser)
        self.role = Role(self.browser)
        self.settings = Settings(self.browser)
        self.subnet = Subnet(self.browser)
        self.subscriptions = Subscriptions(self.browser)
        self.sync = Sync(self.browser)
        self.syncplan = Syncplan(self.browser)
        self.systemgroup = SystemGroup(self.browser)
        self.template = Template(self.browser)
        self.trend = Trend(self.browser)
        self.user = User(self.browser)
        self.usergroup = UserGroup(self.browser)
Example #7
0
    def __enter__(self):
        if settings.browser == 'docker':
            self._docker_browser = DockerBrowser(name=self.test.id())
            self._docker_browser.start()
            self.browser = self._docker_browser.webdriver
        else:
            self.browser = browser()

        # for compatibility purposes
        self.test.browser = self.browser

        self.browser.foreman_user = self.test.foreman_user
        self.browser.foreman_password = self.test.foreman_password

        if self._user is None:
            self._user = getattr(self.browser, 'foreman_user',
                                 settings.server.admin_username)

        if self._password is None:
            self._password = getattr(self.browser, 'foreman_password',
                                     settings.server.admin_password)

        self.browser.maximize_window()
        self.browser.get(settings.server.get_url())
        # Workaround 'Certificate Error' screen on Microsoft Edge
        if (self.test.driver_name == 'edge'
                and 'Certificate Error' in self.browser.title
                or 'Login' not in self.browser.title):
            self.browser.get(
                "javascript:document.getElementById('invalidcert_continue')"
                ".click()")

        self.test.addCleanup(self.test._saucelabs_test_result,
                             self.browser.session_id)

        # Library methods
        self.activationkey = ActivationKey(self.browser)
        self.architecture = Architecture(self.browser)
        self.bookmark = Bookmark(self.browser)
        self.container = Container(self.browser)
        self.compute_profile = ComputeProfile(self.browser)
        self.compute_resource = ComputeResource(self.browser)
        self.contenthost = ContentHost(self.browser)
        self.configgroups = ConfigGroups(self.browser)
        self.content_views = ContentViews(self.browser)
        self.dashboard = Dashboard(self.browser)
        self.dockertag = DockerTag(self.browser)
        self.domain = Domain(self.browser)
        self.errata = Errata(self.browser)
        self.discoveredhosts = DiscoveredHosts(self.browser)
        self.discoveryrules = DiscoveryRules(self.browser)
        self.environment = Environment(self.browser)
        self.gpgkey = GPGKey(self.browser)
        self.hardwaremodel = HardwareModel(self.browser)
        self.hostcollection = HostCollection(self.browser)
        self.hostgroup = Hostgroup(self.browser)
        self.hosts = Hosts(self.browser)
        self.job = Job(self.browser)
        self.jobtemplate = JobTemplate(self.browser)
        self.ldapauthsource = LdapAuthSource(self.browser)
        self.lifecycleenvironment = LifecycleEnvironment(self.browser)
        self.location = Location(self.browser)
        self.login = Login(self.browser)
        self.medium = Medium(self.browser)
        self.my_account = MyAccount(self.browser)
        self.navigator = Navigator(self.browser)
        self.nav = self.navigator  # for compatibility purposes
        self.user = User(self.browser)
        self.operatingsys = OperatingSys(self.browser)
        self.org = Org(self.browser)
        self.oscapcontent = OpenScapContent(self.browser)
        self.oscappolicy = OpenScapPolicy(self.browser)
        self.oscapreports = OpenScapReports(self.browser)
        self.package = Package(self.browser)
        self.partitiontable = PartitionTable(self.browser)
        self.puppetclasses = PuppetClasses(self.browser)
        self.puppetmodule = PuppetModule(self.browser)
        self.products = Products(self.browser)
        self.registry = Registry(self.browser)
        self.repository = Repos(self.browser)
        self.rhai = RHAI(self.browser)
        self.role = Role(self.browser)
        self.settings = Settings(self.browser)
        self.sc_parameters = SmartClassParameter(self.browser)
        self.smart_variable = SmartVariable(self.browser)
        self.subnet = Subnet(self.browser)
        self.subscriptions = Subscriptions(self.browser)
        self.sync = Sync(self.browser)
        self.syncplan = Syncplan(self.browser)
        self.task = Task(self.browser)
        self.template = Template(self.browser)
        self.trend = Trend(self.browser)
        self.usergroup = UserGroup(self.browser)

        # for compatibility purposes
        for attr in ('activationkey', 'architecture', 'bookmark', 'container',
                     'compute_profile', 'compute_resource', 'contenthost',
                     'configgroups', 'content_views', 'dashboard', 'dockertag',
                     'domain', 'errata', 'discoveredhosts', 'discoveryrules',
                     'environment', 'gpgkey', 'hardwaremodel',
                     'hostcollection', 'hostgroup', 'hosts', 'job',
                     'jobtemplate', 'ldapauthsource', 'lifecycleenvironment',
                     'location', 'login', 'medium', 'my_account', 'navigator',
                     'nav', 'user', 'operatingsys', 'org', 'oscapcontent',
                     'oscappolicy', 'oscapreports', 'package',
                     'partitiontable', 'puppetclasses', 'puppetmodule',
                     'products', 'registry', 'repository', 'rhai', 'role',
                     'settings', 'sc_parameters', 'smart_variable', 'subnet',
                     'subscriptions', 'sync', 'syncplan', 'task', 'template',
                     'trend', 'usergroup'):
            setattr(self.test, attr, getattr(self, attr))

        self.login.login(self._user, self._password)
        return self
Example #8
0
    def setUp(self):  # noqa
        """We do want a new browser instance for every test."""
        super(UITestCase, self).setUp()
        if settings.browser == 'docker':
            self._docker_browser = DockerBrowser(name=self.id())
            self._docker_browser.start()
            self.browser = self._docker_browser.webdriver
            self.addCleanup(self._docker_browser.stop)
        else:
            self.browser = browser()
            self.addCleanup(self.browser.quit)
        self.browser.maximize_window()
        self.browser.get(settings.server.get_url())
        # Workaround 'Certificate Error' screen on Microsoft Edge
        if (self.driver_name == 'edge'
                and 'Certificate Error' in self.browser.title
                or 'Login' not in self.browser.title):
            self.browser.get(
                "javascript:document.getElementById('invalidcert_continue')"
                ".click()")

        self.browser.foreman_user = self.foreman_user
        self.browser.foreman_password = self.foreman_password

        self.addCleanup(self._saucelabs_test_result)
        self.addCleanup(self.take_screenshot)

        # Library methods
        self.activationkey = ActivationKey(self.browser)
        self.architecture = Architecture(self.browser)
        self.bookmark = Bookmark(self.browser)
        self.container = Container(self.browser)
        self.compute_profile = ComputeProfile(self.browser)
        self.compute_resource = ComputeResource(self.browser)
        self.contenthost = ContentHost(self.browser)
        self.configgroups = ConfigGroups(self.browser)
        self.content_views = ContentViews(self.browser)
        self.dashboard = Dashboard(self.browser)
        self.dockertag = DockerTag(self.browser)
        self.domain = Domain(self.browser)
        self.errata = Errata(self.browser)
        self.discoveredhosts = DiscoveredHosts(self.browser)
        self.discoveryrules = DiscoveryRules(self.browser)
        self.environment = Environment(self.browser)
        self.gpgkey = GPGKey(self.browser)
        self.hardwaremodel = HardwareModel(self.browser)
        self.hostcollection = HostCollection(self.browser)
        self.hostgroup = Hostgroup(self.browser)
        self.hosts = Hosts(self.browser)
        self.job = Job(self.browser)
        self.jobtemplate = JobTemplate(self.browser)
        self.ldapauthsource = LdapAuthSource(self.browser)
        self.lifecycleenvironment = LifecycleEnvironment(self.browser)
        self.location = Location(self.browser)
        self.login = Login(self.browser)
        self.medium = Medium(self.browser)
        self.my_account = MyAccount(self.browser)
        self.navigator = Navigator(self.browser)
        self.user = User(self.browser)
        self.operatingsys = OperatingSys(self.browser)
        self.org = Org(self.browser)
        self.oscapcontent = OpenScapContent(self.browser)
        self.oscappolicy = OpenScapPolicy(self.browser)
        self.oscapreports = OpenScapReports(self.browser)
        self.package = Package(self.browser)
        self.partitiontable = PartitionTable(self.browser)
        self.puppetclasses = PuppetClasses(self.browser)
        self.puppetmodule = PuppetModule(self.browser)
        self.products = Products(self.browser)
        self.registry = Registry(self.browser)
        self.repository = Repos(self.browser)
        self.rhai = RHAI(self.browser)
        self.role = Role(self.browser)
        self.settings = Settings(self.browser)
        self.smart_variable = SmartVariable(self.browser)
        self.subnet = Subnet(self.browser)
        self.subscriptions = Subscriptions(self.browser)
        self.sync = Sync(self.browser)
        self.syncplan = Syncplan(self.browser)
        self.systemgroup = SystemGroup(self.browser)
        self.template = Template(self.browser)
        self.trend = Trend(self.browser)
        self.user = User(self.browser)
        self.usergroup = UserGroup(self.browser)