Ejemplo n.º 1
0
    def run_equipment_view(self, driver, test_log):
        gui_lib = Utils(driver)

        self.login_manager.login()
        test_helper = TestHelper(test_log, driver)
        test_log.start('Equipment View')

        driver.switch_to_default_content()
        prod_description = driver.find_element(By.ID, "top_menu_product_description").text
        # print('prodDescription', prodDescription)
        test_helper.assert_true(len(prod_description) == 0,
                                'Expected Product Name to be > 0 but was ' + str(len(prod_description)),
                                'Ensure Product Name visible')

        driver.switch_to_frame("frame_content")
        time.sleep(5) # added this as I got tired of trying to figure out why it wasn't waiting correctly below
        WebDriverWait(driver, 30).until(
            EC.visibility_of_element_located((By.ID, 'ChassisViewWidget1_container')))

        chassis = gui_lib.find_element_by_id('ChassisViewWidget1_container')
        # driver.execute_script("document.getElementById('ChassisViewWidget1_container').innerHTML=\"\";")
        # WebDriverWait(driver, 20).until(EC.visibility_of_element_located((By.ID, chassis)))
        # print('chassis text', chassis.text)
        test_helper.assert_true(len(chassis.text) == 0, 'Expected chassis to be displayed but was not',
                                'Ensure Chassis displayed')

        self.login_manager.logout()
Ejemplo n.º 2
0
    def run_sensors(self, driver, test_log):
        gui_lib = Utils(driver)
        self.login_manager.login()

        test_log.start('Sensors')
        test_helper = TestHelper(test_log, driver)

        driver.switch_to_default_content()
        gui_lib.click_element('menu_node_sensors')

        driver.switch_to_frame('frame_content')

        title = driver.find_element(By.XPATH, "//body/fieldset/legend").text
        test_helper.assert_true(len(title) == 0, 'Expected page title, got None', 'Test page title is displayed')

        table = gui_lib.find_element_by_id('tableWidget1_table')
        # find the table header as a delay
        driver.find_element_by_id('tableWidget1_table_header')

        table_rows = table.find_elements_by_tag_name('tr')
        print('table_rows', table_rows)
        self.login_manager.logout()