def test_hypervisor_kvm(self): """Create environment with KVM hypervisor Scenario: 1. Create environment with KVM hypervisor 2. Click on created environment 3. Open settings tab 4. Verify KVM hypervisor is selected """ with Wizard() as w: w.name.send_keys(OPENSTACK_CENTOS) w.release.select_by_visible_text(OPENSTACK_RELEASE_CENTOS) w.next.click() w.next.click() w.hypervisor_kvm.click() for i in range(4): w.next.click() w.create.click() w.wait_until_exists() cb = Environments().create_cluster_boxes[0] cb.click() Tabs().settings.click() with Settings() as s: self.assertTrue(s.hypervisor_kvm. find_element_by_tag_name('input').is_selected())
def test_storage_ceph(self): """Create environment with Ceph storage Scenario: 1. Create environment with Ceph storage for Cinder and Glance 2. Click on created environment 3. Open settings tab 4. Verify that Cinder for volumes, Ceph for volumes and images are selected, Ceph for rados isn't selected """ with Wizard() as w: w.name.send_keys(OPENSTACK_CENTOS) w.release.select_by_visible_text(OPENSTACK_RELEASE_CENTOS) for i in range(4): w.next.click() w.storage_cinder_ceph.click() w.storage_glance_ceph.click() w.next.click() w.next.click() w.create.click() w.wait_until_exists() cb = Environments().create_cluster_boxes[0] cb.click() Tabs().settings.click() with Settings() as s: self.assertTrue(s.ceph_for_volumes. find_element_by_tag_name('input').is_selected()) self.assertTrue(s.ceph_for_images. find_element_by_tag_name('input').is_selected()) self.assertFalse(s.ceph_rados_gw. find_element_by_tag_name('input').is_selected())
def _test_text_field(self, text_field, value): def_value = None with Settings() as s: def_value = getattr(s, text_field).get_attribute('value') getattr(s, text_field).clear() getattr(s, text_field).send_keys(value) s.save_settings.click() time.sleep(1) self.refresh() with Settings() as s: self.assertEqual( getattr(s, text_field).get_attribute('value'), value) s.load_defaults.click() time.sleep(1) self.assertEqual( getattr(s, text_field).get_attribute('value'), def_value, "load defaults value")
def _test_tumbler_field(self, tumbler_field): def_value = None with Settings() as s: def_value = getattr(s, tumbler_field).\ find_element_by_tag_name('input').is_selected() getattr(s, tumbler_field).click() s.save_settings.click() time.sleep(1) self.refresh() with Settings() as s: self.assertEqual( getattr(s, tumbler_field).find_element_by_tag_name( 'input').is_selected(), not def_value) s.load_defaults.click() time.sleep(1) self.assertEqual( getattr(s, tumbler_field).find_element_by_tag_name( 'input').is_selected(), def_value, "load defaults value")
def _test_radio_group(self, radios): radios.reverse() for radio in radios: with Settings() as s: getattr(s, radio).click() s.save_settings.click() time.sleep(1) self.refresh() self.assertTrue( getattr(Settings(), radio).find_element_by_tag_name('input').is_selected()) # Set group to not default state random_radio = radios[random.randint(0, len(radios) - 2)] with Settings() as s: getattr(s, random_radio).click() s.load_defaults.click() time.sleep(1) self.assertTrue( getattr(s, radios[-1]).find_element_by_tag_name( 'input').is_selected(), "load defaults value")
def test_ceph_for_volumes(self): """Enable 'Ceph for volumes' Scenario: 1. Click on 'Ceph for volumes' checkbox 2. Save settings 3. Verify that 'Ceph for volumes' checkbox is selected 4. Click Load defaults 5. Verify that 'Ceph for volumes' checkbox is not selected """ Settings().cinder_for_volumes.click() self._test_tumbler_field('ceph_for_volumes')
def test_vlan_splinters(self): """Enable VSwitch VLAN splinters Scenario: 1. Select 'OVS VLAN splinters soft trunks' radio button 2. Save settings 3. Verify that 'OVS VLAN splinters soft trunks' is selected 4. Click Load defaults 5. Verify that 'Disabled' is selected """ Settings().vlan_splinters.click() self._test_radio_group(['vlan_splinters_soft', 'vlan_splinters_hard'], nodefault=True)
def test_default_settings(self): """Create default environment Scenario: 1. Create environment with default values 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 5. Verify all info on Networks and Settings tab """ with Wizard() as w: w.name.send_keys(OPENSTACK_CENTOS) w.release.select_by_visible_text(OPENSTACK_RELEASE_CENTOS) for i in range(6): w.next.click() w.create.click() w.wait_until_exists() cb = Environments().create_cluster_boxes[0] self.assertIn(OPENSTACK_CENTOS, cb.text) cb.click() with Nodes() as n: time.sleep(1) self.assertEqual(n.env_name.text, OPENSTACK_CENTOS) n.info_icon.click() self.assertIn('display: block;', n.env_details.get_attribute('style')) self.assertIn(OPENSTACK_CENTOS, n.env_details.text) self.assertIn('New', n.env_details.text) self.assertIn('Multi-node', n.env_details.text) self.assertNotIn('with HA', n.env_details.text) n.info_icon.click() self.assertIn('display: none;', n.env_details.get_attribute('style')) Tabs().networks.click() with Networks() as n: self.assertTrue(n.flatdhcp_manager. find_element_by_tag_name('input').is_selected()) Tabs().settings.click() with Settings() as s: self.assertFalse(s.install_savanna. find_element_by_tag_name('input').is_selected()) self.assertFalse(s.install_murano. find_element_by_tag_name('input').is_selected()) self.assertFalse(s.install_ceilometer. find_element_by_tag_name('input').is_selected()) self.assertTrue(s.hypervisor_qemu. find_element_by_tag_name('input').is_selected()) pass
def test_password_show(self): """Show password feature Scenario: 1. Click show password button 2. Verify that text of the password is displayed 3. Click on show password button again 4. Verify that password text isn't displayed """ with Settings() as s: s.show_password.click() self.assertEqual(s.password.get_attribute('type'), 'text') s.show_password.click() self.assertEqual(s.password.get_attribute('type'), 'password')
def test_services(self): """Create environment with Sahara, Murano, Ceilometer selected Scenario: 1. Create environment with Install Sahara, Murano, Ceilometer selected 2. Click on created environment 3. Open settings tab 4. Verify that Install Sahara, Murano, Ceilometer checkboxes are selected """ with Wizard() as w: w.name.send_keys(OPENSTACK_CENTOS) w.release.select_by_visible_text(OPENSTACK_RELEASE_CENTOS) for i in range(3): w.next.click() w.network_neutron_gre.click() w.next.click() w.next.click() w.install_sahara.click() w.install_murano.click() w.install_ceilometer.click() w.next.click() w.create.click() w.wait_until_exists() Tabs().settings.click() with Settings() as s: self.assertTrue( s.install_sahara.find_element_by_tag_name( 'input').is_selected()) self.assertTrue( s.install_murano.find_element_by_tag_name( 'input').is_selected()) self.assertTrue( s.install_ceilometer.find_element_by_tag_name( 'input').is_selected())