當前位置: 首頁>>代碼示例>>Python>>正文


Python base.PageObject類代碼示例

本文整理匯總了Python中pageobjects.base.PageObject的典型用法代碼示例。如果您正苦於以下問題:Python PageObject類的具體用法?Python PageObject怎麽用?Python PageObject使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了PageObject類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_delete_node

    def test_delete_node(self):
        """Delete one node and deploy changes

        Scenario:
            1. Add controller and compute node
            2. Deploy changes
            3. Delete one node
            4. Deploy changes
            5. Verify that only one node is present
        """
        self.test_add_nodes()

        with Nodes() as n:
            n.nodes[1].checkbox.click()
            n.delete_nodes.click()
        with DeleteNodePopup() as p:
            p.delete.click()
            p.wait_until_exists()
            time.sleep(1)

        self.assertEqual("pending deletion", Nodes().nodes[1].status.text.lower(), "Node status is Pending Deletion")

        Nodes().deploy_changes.click()
        DeployChangesPopup().deploy.click()
        PageObject.click_element(TaskResultAlert(), "close")

        with Nodes() as n:
            self.assertEqual(1, len(n.nodes), "Nodes amount")
            for node in n.nodes:
                self.assertEqual("ready", node.status.text.lower(), "Node status is READY")
開發者ID:Fiware,項目名稱:ops.Fuel-main-dev,代碼行數:30,代碼來源:test_deploy.py

示例2: reset_env

 def reset_env(cls):
     PageObject.click_element(Actions(), 'reset')
     PageObject.wait_element(Actions(), 'reset_popup')
     time.sleep(2)
     PageObject.click_element(Actions(), 'reset_popup')
     PageObject.click_element(Tabs(), 'nodes')
     PageObject.long_wait_element(Actions(), 'pending_nodes')
開發者ID:Fiware,項目名稱:ops.Fuel-main-dev,代碼行數:7,代碼來源:actions.py

示例3: test_rhsm

    def test_rhsm(self):
        """Download RHEL and RHOS by RHSM

        Scenario:
            1. Enter environment name
            2. Select RHOS in release list
            3. Enter Redhat username and password
            4. Click next till the end and click create
            5. Open releases tab
            6. Verify that RHOS status is active
        """
        with Wizard() as w:
            w.name.send_keys(OPENSTACK_RELEASE_REDHAT)
            w.release.select_by_visible_text(OPENSTACK_RELEASE_REDHAT)
            w.license_rhsm.click()
            w.redhat_username.send_keys(REDHAT_USERNAME)
            w.redhat_password.send_keys(REDHAT_PASSWORD)
            for i in range(6):
                w.next.click()
            w.create.click()
            w.wait_until_exists()
        Header().releases.click()
        with Releases() as r:
            PageObject.wait_until_exists(
                r.dict[OPENSTACK_REDHAT].download_progress, timeout=20)
            self.assertEqual(
                'Active', r.dict[OPENSTACK_REDHAT].status.text,
                'RHOS status is active')
開發者ID:Fiware,項目名稱:ops.Fuel-main-dev,代碼行數:28,代碼來源:test_env_wizard.py

示例4: test_rhn_satellite

    def test_rhn_satellite(self):
        """Download RHEL and RHOS by RHN satellite

        Scenario:
            1. Enter environment name
            2. Select RHOS in release list
            3. Select RHN option
            4. Enter Redhat username and password, satellite
               hostname and activation key
            5. Click next till the end and click create
            6. Open releases tab
            7. Verify that RHOS status is active
        """
        with Wizard() as w:
            w.name.send_keys(OPENSTACK_RELEASE_REDHAT)
            w.release.select_by_visible_text(OPENSTACK_RELEASE_REDHAT)
            w.license_rhn.click()
            w.redhat_username.send_keys(REDHAT_USERNAME)
            w.redhat_password.send_keys(REDHAT_PASSWORD)
            w.redhat_satellite.send_keys(REDHAT_SATELLITE)
            w.redhat_activation_key.send_keys(REDHAT_ACTIVATION_KEY)
            for i in range(6):
                w.next.click()
            w.create.click()
            w.wait_until_exists()
        Header().releases.click()
        with Releases() as r:
            PageObject.wait_until_exists(
                r.dict[OPENSTACK_REDHAT].download_progress, timeout=20)
            self.assertEqual(
                'Active', r.dict[OPENSTACK_REDHAT].status.text,
                'RHOS status is active')
開發者ID:Fiware,項目名稱:ops.Fuel-main-dev,代碼行數:32,代碼來源:test_env_wizard.py

示例5: test_rhn_satellite

    def test_rhn_satellite(self):
        """Download RHEL with RHN option

        Scenario:
            1. Open releases tab
            2. Click Configure button in actions column
            3. Select 'RHN' radiobutton
            4. Enter username and password
            5. Enter satellite hostname, activation key and click apply
            6. Check that RHOS status is active
        """
        Releases().rhel_setup.click()
        with RedhatAccountPopup() as p:
            p.license_rhn.click()
            p.redhat_username.send_keys(REDHAT_USERNAME)
            p.redhat_password.send_keys(REDHAT_PASSWORD)
            p.redhat_satellite.send_keys(REDHAT_SATELLITE)
            p.redhat_activation_key.send_keys(REDHAT_ACTIVATION_KEY)
            p.apply.click()
            p.wait_until_exists()
        with Releases() as r:
            PageObject.wait_until_exists(
                r.dict[OPENSTACK_REDHAT].download_progress, timeout=20)
            self.assertEqual(
                'Active', r.dict[OPENSTACK_REDHAT].status.text,
                'RHOS status is active')
開發者ID:Axam,項目名稱:fuel-main,代碼行數:26,代碼來源:test_releases.py

示例6: test_ha_mode

    def test_ha_mode(self):
        """Create environment with HA mode

        Scenario:
            1. Create environment with HA mode
            2. Click on created environment
            3. Verify that correct environment name is displayed
            4. Click on information icon and verify
               all information is displayed correctly
        """
        with Wizard() as w:
            w.name.send_keys(OPENSTACK_CENTOS)
            w.release.select_by_visible_text(OPENSTACK_RELEASE_CENTOS)
            w.next.click()
            w.mode_ha_compact.click()
            for i in range(5):
                w.next.click()
            w.create.click()
            w.wait_until_exists()

        cb = Environments().create_cluster_boxes[0]
        cb.click()

        with Nodes() as n:
            self.assertEqual(PageObject.get_text(n, 'env_name'),
                             OPENSTACK_CENTOS)
            PageObject.click_element(n, 'info_icon')
            self.assertIn(OPENSTACK_CENTOS, PageObject.get_text
                          (n, 'env_details'))
            self.assertIn('Multi-node with HA', n.env_details.text)
開發者ID:Axam,項目名稱:fuel-main,代碼行數:30,代碼來源:test_environment.py

示例7: test_reset_redeploy

    def test_reset_redeploy(self):
        """Reset environment after deploy changes

        Scenario:
            1. Add controller and compute nodes
            2. Click deploy
            3. Add new compute node and deploy changes
            4. Reset environment
            4. Verify that environment is reseted
        """
        Tabs().nodes.click()
        Nodes().add_controller_compute_nodes()
        Nodes().deploy_changes.click()
        DeployChangesPopup().deploy.click()
        TaskResultAlert().close.click()
        Nodes().add_nodes.click()
        Nodes().nodes_discovered[0].checkbox.click()
        RolesPanel().compute.click()
        Nodes().apply_changes.click()
        PageObject.wait_until_exists(Nodes().apply_changes)
        Nodes().deploy_changes.click()
        DeployChangesPopup().deploy.click()
        TaskResultAlert().close.click()
        Tabs().actions.click()
        Actions().reset_env()
        Tabs().nodes.click()
        for node in Nodes().nodes:
            self.assertEqual("pending addition", node.status.text.lower(), "Node status is Pending Addition")
        self.assertTrue(Nodes().deploy_changes.is_enabled())
開發者ID:Fiware,項目名稱:ops.Fuel-main-dev,代碼行數:29,代碼來源:test_environment_actions.py

示例8: test_cancel_button

    def test_cancel_button(self):
        """Cancel environment wizard

        Scenario:
            1. Enter environment name
            2. Select Havana on Ubuntu in release list and click next
            3. Select HA mode and click next
            4. Select KVM hypervisor and click next
            5. Select Neutron with GRE and click next
            6. Select Ceph options for Cinder and Glance and click next
            7. Select install Sahara, Murano and click next
            8. Click cancel button
            9. Click create environment again and check that
               all default values are selected
        """
        with Wizard() as w:
            w.name.send_keys(OPENSTACK_RELEASE_UBUNTU)
            w.release.select_by_visible_text(OPENSTACK_RELEASE_UBUNTU)
            w.next.click()
            w.mode_ha_compact.click()
            w.next.click()
            w.hypervisor_kvm.click()
            w.next.click()
            w.network_neutron_gre.click()
            w.next.click()
            w.storage_cinder_ceph.click()
            w.storage_glance_ceph.click()
            w.next.click()
            w.install_sahara.click()
            w.install_murano.click()
            w.next.click()
            w.cancel.click()
            PageObject.wait_until_exists(w.parent)

        Environments().create_cluster_box.click()
        with Wizard() as w:
            self.assertEqual(w.name.get_attribute('value'), '')
            self.assertEqual(w.release.first_selected_option.text,
                             OPENSTACK_RELEASE_CENTOS)
            w.name.send_keys(OPENSTACK_RELEASE_UBUNTU)
            w.next.click()
            self.assertTrue(w.mode_ha_compact.
                            find_element_by_tag_name('input').is_selected())
            w.next.click()
            self.assertTrue(w.hypervisor_qemu.
                            find_element_by_tag_name('input').is_selected())
            w.next.click()
            self.assertTrue(w.network_nova.
                            find_element_by_tag_name('input').is_selected())
            w.next.click()
            self.assertTrue(w.storage_cinder_default.
                            find_element_by_tag_name('input').is_selected())
            self.assertTrue(w.storage_glance_default.
                            find_element_by_tag_name('input').is_selected())
            w.next.click()
            self.assertFalse(w.install_sahara.
                             find_element_by_tag_name('input').is_selected())
            self.assertFalse(w.install_murano.
                             find_element_by_tag_name('input').is_selected())
開發者ID:Fiware,項目名稱:ops.Fuel-main-dev,代碼行數:59,代碼來源:test_env_wizard.py

示例9: test_bond_buttons_inactive

    def test_bond_buttons_inactive(self):
        """Check bond buttons are inactive by default

        Scenario:
            1. Verify bond and unbond buttons are disabled
        """
        PageObject.find_element(InterfacesSettings(), 'bond_interfaces')
        self.assertFalse(InterfacesSettings().bond_interfaces.is_enabled())
        self.assertFalse(InterfacesSettings().unbond_interfaces.is_enabled())
開發者ID:shaikapsar,項目名稱:fuel-main,代碼行數:9,代碼來源:test_configure_networks.py

示例10: test_diagnostic_snapshot

    def test_diagnostic_snapshot(self):
        """Generate diagnostic snapshot

        Scenario:
            1. Click generate diagnostic snapshot
            2. Verify that snapshot is available to download
        """
        Support().generate_snapshot.click()
        with Support() as s:
            PageObject.wait_element(s, "download_snapshot")
            self.assertTrue(s.download_snapshot.is_enabled(), '"Diagnostic Snapshot" is displayed')
開發者ID:jcheyer,項目名稱:fuel-main,代碼行數:11,代碼來源:test_support.py

示例11: test_inactive_one_selected

    def test_inactive_one_selected(self):
        """Check bond buttons are inactive if one interface is selected

        Scenario:
            1. Select one interface
            2. Verify bond and unbond buttons are disabled
        """
        with InterfacesSettings() as s:
            PageObject.click_element(s, 'interfaces', 'interface_checkbox', 0)
            self.assertFalse(s.bond_interfaces.is_enabled())
            self.assertFalse(s.unbond_interfaces.is_enabled())
開發者ID:Fiware,項目名稱:ops.Fuel-main-dev,代碼行數:11,代碼來源:test_configure_networks.py

示例12: add_controller_compute_nodes

 def add_controller_compute_nodes(cls):
     PageObject.click_element(Nodes(), 'add_nodes')
     Nodes().nodes_discovered[0].checkbox.click()
     RolesPanel().controller.click()
     Nodes().apply_changes.click()
     PageObject.wait_until_exists(Nodes().apply_changes)
     PageObject.click_element(Nodes(), 'add_nodes')
     PageObject.click_element(Nodes(), 'nodes_discovered', 'checkbox', 0)
     RolesPanel().compute.click()
     Nodes().apply_changes.click()
     PageObject.wait_until_exists(Nodes().apply_changes)
開發者ID:Fiware,項目名稱:ops.Fuel-main-dev,代碼行數:11,代碼來源:nodes.py

示例13: test_capacity_audit

    def test_capacity_audit(self):
        """View capacity audit

        Scenario:
            1. Click view capacity audit
            2. Verify that system information is present
        """
        Support().view_capacity_audit.click()
        PageObject.wait_element(Support(), 'capacity_report')
        self.assertEqual(
            'Home/Support/Capacity',
            Header().breadcrumb.text,
            'Breadcrumb text'
        )
開發者ID:Fiware,項目名稱:ops.Fuel-main-dev,代碼行數:14,代碼來源:test_support.py

示例14: test_cancel_bonding

    def test_cancel_bonding(self):
        """Cancel bonding

        Scenario:
            1. Select two interfaces
            2. Click bond interfaces
            3. Click cancel changes
            4. Verify that interfaces aren't bonded
        """
        with InterfacesSettings() as s:
            PageObject.click_element(s, 'interfaces', 'interface_checkbox', 0)
            s.interfaces[1].interface_checkbox.click()
            s.bond_interfaces.click()
            s.cancel_changes.click()
            self.assertEqual(len(s.interfaces), 3, 'Interfaces amount')
開發者ID:Fiware,項目名稱:ops.Fuel-main-dev,代碼行數:15,代碼來源:test_configure_networks.py

示例15: test_bond_interfaces

    def test_bond_interfaces(self):
        """Bond two interfaces

        Scenario:
            1. Select two interfaces
            2. Click bond interfaces
            3. Verify that interfaces were bonded
        """
        with InterfacesSettings() as s:
            PageObject.click_element(s, 'interfaces', 'interface_checkbox', 0)
            s.interfaces[1].interface_checkbox.click()
            self.assertTrue(s.bond_interfaces.is_enabled())
            s.bond_interfaces.click()
            s.interfaces[0].bond_mode
            self.assertFalse(s.bond_interfaces.is_enabled())
            self.assertFalse(s.unbond_interfaces.is_enabled())
開發者ID:Fiware,項目名稱:ops.Fuel-main-dev,代碼行數:16,代碼來源:test_configure_networks.py


注:本文中的pageobjects.base.PageObject類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。