コード例 #1
0
    def testEditScene(self):
        auth.checkIfUserIsLoggedIn(self.driver, 1, 'CRUDO')
        commonFunctions.navIcon(self.driver)
        if WebDriverWait(self.driver, 60).until(
                EC.presence_of_element_located(
                    (By.ID, "com.view.viewglass:id/navigation_scenesTV"))):
            self.driver.find_element_by_id(
                "com.view.viewglass:id/navigation_scenesTV").click()
        else:
            raiseExceptions("Scenes option in navigation menu is missing")

        WebDriverWait(self.driver, 20).until(
            EC.presence_of_element_located(
                (By.ID, "com.view.viewglass:id/scene_headertext")))
        firstScene = self.driver.find_elements(
            By.ID, "com.view.viewglass:id/parent_scene_item")[0]
        firstScene.click()

        WebDriverWait(self.driver, 20).until(
            EC.presence_of_element_located(
                (By.ID, "com.view.viewglass:id/scene_Detail")))
        if len(
                self.driver.find_elements(
                    By.ID, "com.view.viewglass:id/editbtn_sceneTV")) <= 0:
            raiseExceptions("Edit button in Scenes Detail screen is missing")
        else:
            commonFunctions.editbutton(self.driver)

        self.driver.find_element_by_id(
            "com.view.viewglass:id/name_scene_editETV").send_keys("abc")
        commonFunctions.goback(self.driver)
        commonFunctions.goback(self.driver)
コード例 #2
0
ファイル: LiveView.py プロジェクト: eputh/ViewTestAutomation
    def testAtLeastOneSunsetEntryInUI(self):
        """
        Open any LiveView for zone and verify at lease one entry with reason Sunset is displayed to user
        """
        auth.checkIfUserIsLoggedIn(self.driver, 1, 'CRUDO')
        if len(
                self.driver.find_elements(
                    By.ID, "com.view.viewglass:id/title_LiveViewTV")) <= 0:
            commonFunctions.navIcon(self.driver)
            if WebDriverWait(self.driver, 10).until(
                    EC.presence_of_element_located(
                        (By.ID,
                         "com.view.viewglass:id/navigation_live_viewTV"))):
                self.driver.find_element_by_id(
                    "com.view.viewglass:id/navigation_live_viewTV").click()
            else:
                raiseExceptions(
                    "LiveView option in navigation menu is missing")
        commonFunctions.checkLiveViewAccess(self.driver)

        hasSunsetEntry = False
        if WebDriverWait(self.driver, 10).until(
                EC.presence_of_element_located(
                    (By.ID, "com.view.viewglass:id/tintReason_liveViewTV"))):
            for element in self.driver.find_elements(
                    By.ID, "com.view.viewglass:id/tintReason_liveViewTV"):
                if element == "Sunset":
                    hasSunsetEntry = True
        else:
            raiseExceptions("Bug: there are no tint activities in the list")

        if not hasSunsetEntry:
            raiseExceptions("Bug: No Sunset entry in UI")
コード例 #3
0
ファイル: LiveView.py プロジェクト: eputh/ViewTestAutomation
    def testUIAccessAfterSunset(self):
        """
        Login to app after sunset time and verify the accessibility of LiveView
        """
        now = datetime.now()
        sunset = datetime.strptime("06:00 PM", '%I:%M %p')
        if now < sunset:
            print("Cannot test because it is not after sunset yet")
        else:
            auth.checkIfUserIsLoggedIn(self.driver, 1, 'CRUDO')
            if len(
                    self.driver.find_elements(
                        By.ID, "com.view.viewglass:id/title_LiveViewTV")) <= 0:
                commonFunctions.navIcon(self.driver)
                if WebDriverWait(self.driver, 10).until(
                        EC.presence_of_element_located(
                            (By.ID,
                             "com.view.viewglass:id/navigation_live_viewTV"))):
                    self.driver.find_element_by_id(
                        "com.view.viewglass:id/navigation_live_viewTV").click(
                        )
                else:
                    raiseExceptions(
                        "LiveView option in navigation menu is missing")

            if len(
                    self.driver.find_elements(
                        By.ID, "com.view.viewglass:id/title_LiveViewTV")) <= 0:
                raiseExceptions("Unable to access LiveView after sunset")
コード例 #4
0
    def testCreateWeeklySceneSchedule(self):
        auth.checkIfUserIsLoggedIn(self.driver, 1, 'CRUDO')
        commonFunctions.navIcon(self.driver)
        if WebDriverWait(self.driver, 60).until(
                EC.presence_of_element_located(
                    (By.ID, "com.view.viewglass:id/navigation_scenesTV"))):
            self.driver.find_element_by_id(
                "com.view.viewglass:id/navigation_scenesTV").click()
        else:
            raiseExceptions("Scenes option in navigation menu is missing")

        WebDriverWait(self.driver, 20).until(
            EC.presence_of_element_located(
                (By.ID, "com.view.viewglass:id/scene_headertext")))
        selectedScene = self.driver.find_elements(
            By.ID, "com.view.viewglass:id/parent_scene_item")[0]
        selectedScene.click()

        if WebDriverWait(self.driver, 20).until(
                EC.presence_of_element_located(
                    (By.ID, "com.view.viewglass:id/schedule_scene_TV"))):
            self.driver.find_element_by_id(
                "com.view.viewglass:id/schedule_scene_TV").click()
        else:
            raiseExceptions("Schedule Scene button is missing")

        self.driver.find_element_by_id(
            "com.view.viewglass:id/repeats_schdSceneTintTV").click()
        self.driver.find_element_by_xpath(
            "//android.widget.TextView[@text='Weekly']").click()
        commonFunctions.savebutton(self.driver)
コード例 #5
0
    def testSendFeedback(self):
        auth.checkIfUserIsLoggedIn(self.driver, 1, 'CRUDO')
        commonFunctions.navIcon(self.driver)
        if WebDriverWait(self.driver, 20).until(
                EC.presence_of_element_located(
                    (By.ID, "com.view.viewglass:id/username_navigationTV"))):
            self.driver.find_element_by_id(
                "com.view.viewglass:id/username_navigationTV").click()
        else:
            raiseExceptions("Profile option in navigation menu is missing")

        if WebDriverWait(self.driver, 20).until(
                EC.presence_of_element_located(
                    (By.ID, "com.view.viewglass:id/title_myProfileTV"))):
            pass
        else:
            raiseExceptions("Profile heading is missing")

        if len(
                self.driver.find_elements(
                    By.ID, "com.view.viewglass:id/startup_myProfileTV")) > 0:
            self.driver.find_element_by_id(
                "com.view.viewglass:id/startup_myProfileTV").click()
        if WebDriverWait(self.driver, 20).until(
                EC.presence_of_element_located(
                    (By.XPATH,
                     "//android.widget.TextView[@text='Send Device Logs...']"
                     ))):
            pass
        else:
            raiseExceptions("Send Device Logs panel is missing")
コード例 #6
0
    def testTourPreference(self):
        auth.checkIfUserIsLoggedIn(self.driver, 1, 'CRUDO')
        commonFunctions.navIcon(self.driver)
        if WebDriverWait(self.driver, 20).until(
                EC.presence_of_element_located(
                    (By.ID, "com.view.viewglass:id/username_navigationTV"))):
            self.driver.find_element_by_id(
                "com.view.viewglass:id/username_navigationTV").click()
        else:
            raiseExceptions("Profile option in navigation menu is missing")

        if WebDriverWait(self.driver, 20).until(
                EC.presence_of_element_located(
                    (By.ID, "com.view.viewglass:id/title_myProfileTV"))):
            pass
        else:
            raiseExceptions("Profile heading is missing")

        if len(
                self.driver.find_elements(
                    By.ID,
                    "com.view.viewglass:id/togglebtn_tourPreferenceIV")) > 0:
            self.driver.find_element_by_id(
                "com.view.viewglass:id/togglebtn_tourPreferenceIV").click()
        if self.driver.find_element_by_id(
                "com.view.viewglass:id/togglebtn_tourPreferenceIV"
        ).get_attribute("checked") == "false":
            raiseExceptions("Tour Preference toggle button did not work")
        else:
            self.driver.find_element_by_id(
                "com.view.viewglass:id/togglebtn_tourPreferenceIV").click()
コード例 #7
0
ファイル: Settings.py プロジェクト: eputh/ViewTestAutomation
    def testUIComponentsOfSettingsScreen(self):
        auth.checkIfUserIsLoggedIn(self.driver, 1, 'CRUDO')
        commonFunctions.navIcon(self.driver)

        if WebDriverWait(self.driver, 20).until(
                EC.presence_of_element_located(
                    (By.ID,
                     "com.view.viewglass:id/settingIcon_navigationIV"))):
            self.driver.find_element_by_id(
                "com.view.viewglass:id/settingIcon_navigationIV").click()
        else:
            raiseExceptions("Settings option in navigation menu is missing")

        if WebDriverWait(self.driver, 20).until(
                EC.presence_of_element_located(
                    (By.ID,
                     "com.view.viewglass:id/title_settingScreen_wallSwitchTV"
                     ))):
            pass
        else:
            raiseExceptions("Settings heading is missing")

        if len(
                self.driver.find_elements(
                    By.ID,
                    "com.view.viewglass:id/act_about_wallSwitchTV")) <= 0:
            raiseExceptions("About tab is missing")
        if len(
                self.driver.find_elements(
                    By.ID, "com.view.viewglass:id/legal_wallSwitchTV")) <= 0:
            raiseExceptions("Legal tab is missing")
コード例 #8
0
ファイル: auth.py プロジェクト: eputh/ViewTestAutomation
def checkIfUserIsLoggedIn(driver, loginbool, user):
    """ Check if user needs to be logged in or logged out"""
    # user needs to be logged in
    isLoggedIn = isUserLoggedIn(driver)
    print("Logged in: ", isLoggedIn)
    if loginbool:
        if not isLoggedIn and user == 'RO':
            login(driver, config.users[user]['username'],
                  config.users[user]['password'])
        elif not isLoggedIn:
            loginAndSelectSite(driver, config.users[user]['username'],
                               config.users[user]['password'],
                               config.sites['Default'])

        if common.foundAlert(driver):
            common.respondToAlert(driver, 0)
        if common.foundTour(driver):
            common.exitTour(driver)
        # if len(driver.find_elements(By.ID, "com.view.viewglass:id/view_btnTV")) > 0:
        #     common.navIcon(driver)
    # User needs to be logged out
    else:
        if isLoggedIn:
            if common.foundAlert(driver):
                common.respondToAlert(driver, 0)
            if common.foundTour(driver):
                common.exitTour(driver)
            if len(
                    driver.find_elements(
                        By.ID, "com.view.viewglass:id/view_btnTV")) > 0:
                common.navIcon(driver)
            logout(driver)
            sleep(20)
        else:
            sleep(20)
コード例 #9
0
ファイル: site.py プロジェクト: eputh/ViewTestAutomation
def changeSite(driver, site):
    commonFunctions.navIcon(driver)
    driver.find_element_by_id("username_navigationTV").click()
    WebDriverWait(driver, 10).until(
        EC.presence_of_element_located(
            (By.XPATH, "//android.widget.TextView[@text='Change Site']")))
    driver.find_element_by_xpath(
        "//android.widget.TextView[@text='Change Site']").click()
    if len(driver.find_elements(By.ID,
                                "com.view.viewglass:id/search_layout")) > 0:
        driver.find_element_by_id(
            "com.view.viewglass:id/search_layout").click()
        search = driver.find_element_by_xpath(
            "//android.widget.EditText[@text='Search']")
        search.send_keys(site)
        driver.find_element_by_id(
            "com.view.viewglass:id/zone_item_select_zoneTV").click()
    else:
        raiseExceptions("Missing Search option in Change Site")

    if WebDriverWait(driver, 10).until(
            EC.presence_of_element_located(
                (By.XPATH, "//android.widget.Button[@text='Yes']"))):
        driver.find_element_by_xpath(
            "//android.widget.Button[@text='Yes']").click()
    else:
        raiseExceptions("confirmation message for changing site is missing")
    WebDriverWait(driver, 20).until(
        EC.presence_of_element_located(
            (By.ID, "com.view.viewglass:id/home_btn_myProfileLL")))
    commonFunctions.goback(driver)
    commonFunctions.navIcon(driver)
コード例 #10
0
ファイル: Zones.py プロジェクト: eputh/ViewTestAutomation
    def testRemoveDeleteZoneGroupForRO(self):
        auth.checkIfUserIsLoggedIn(self.driver, 0, 'RO')
        auth.login(self.driver, config.users['RO']['username'],
                   config.users['RO']['password'])
        sleep(20)
        if commonFunctions.foundAlert(self.driver):
            commonFunctions.respondToAlert(self.driver, 0)
        if len(
                self.driver.find_elements(
                    By.ID, "com.view.viewglass:id/view_btnTV")) > 0:
            commonFunctions.navIcon(self.driver)

        commonFunctions.navIcon(self.driver)
        if WebDriverWait(self.driver, 10).until(
                EC.presence_of_element_located(
                    (By.ID, "com.view.viewglass:id/navigation_zonesTV"))):
            self.driver.find_element_by_id(
                "com.view.viewglass:id/navigation_zonesTV").click()
        else:
            raiseExceptions("Zones option in navigation menu is missing")

        if WebDriverWait(self.driver, 10).until(
                EC.presence_of_element_located(
                    (By.ID, "com.view.viewglass:id/title_zonesTV"))):
            pass
        else:
            raiseExceptions("Zones heading is missing")

        foundZonegroupabc = False
        size = 0
        location = 0
        if len(
                self.driver.find_elements(
                    By.ID, "com.view.viewglass:id/listItemNameTV")) > 0:
            zonegroups = self.driver.find_elements(
                By.ID, "com.view.viewglass:id/listItemNameTV")
            for group in zonegroups:
                if group.text == "abc":
                    foundZonegroupabc = True
                    size = group.size
                    location = group.location
                    break
        if foundZonegroupabc:
            startx = location['x'] + size['width']
            endx = location['x'] + size['width'] / 2
            y = location['y'] + size['height'] / 2
            self.driver.swipe(startx, y, endx, y, 3000)
            x = location['x'] + size['width'] - 10
            self.driver.tap([(x, y)])
            sleep(5)

        if len(
                self.driver.find_elements(
                    By.ID, "com.view.viewglass:id/listItemNameTV")) > 0:
            zonegroups = self.driver.find_elements(
                By.ID, "com.view.viewglass:id/listItemNameTV")
            for group in zonegroups:
                if group.text == "abc":
                    raiseExceptions("Zonegroup was not deleted")
コード例 #11
0
    def testVerifyUIComponentsOfSceneDetailScreen(self):
        auth.checkIfUserIsLoggedIn(self.driver, 1, 'CRUDO')
        commonFunctions.navIcon(self.driver)
        try:
            WebDriverWait(self.driver, 60).until(
                EC.presence_of_element_located(
                    (By.ID, "com.view.viewglass:id/navigation_scenesTV")))
            self.driver.find_element_by_id(
                "com.view.viewglass:id/navigation_scenesTV").click()
        except TimeoutException:
            raiseExceptions("Scenes option in navigation menu is missing")

        try:
            WebDriverWait(self.driver, 20).until(
                EC.presence_of_element_located(
                    (By.ID, "com.view.viewglass:id/scene_headertext")))
            firstScene = self.driver.find_elements(
                By.ID, "com.view.viewglass:id/parent_scene_item")[0]
            firstScene.click()
        except TimeoutException:
            raiseExceptions("Scenes heading is missing")

        try:
            WebDriverWait(self.driver, 20).until(
                EC.presence_of_element_located(
                    (By.ID, "com.view.viewglass:id/scene_Detail")))
        except TimeoutException:
            raiseExceptions("Scene Detail heading is missing")

        if len(
                self.driver.find_elements(
                    By.ID, "com.view.viewglass:id/back_scene_detailLL")) <= 0:
            raiseExceptions("Back button in Scenes Detail screen is missing")
        if len(
                self.driver.find_elements(
                    By.ID, "com.view.viewglass:id/editbtn_sceneTV")) <= 0:
            raiseExceptions("Edit button in Scenes Detail screen is missing")
        if len(
                self.driver.find_elements(
                    By.ID, "com.view.viewglass:id/sceneNameTV")) <= 0:
            raiseExceptions("Name of scene is missing")
        if len(
                self.driver.find_elements(
                    By.ID,
                    "com.view.viewglass:id/tintEvents_scene_detailTV")) <= 0:
            raiseExceptions("Tint Event subheading is missing")
        if len(
                self.driver.find_elements(
                    By.ID, "com.view.viewglass:id/listitemImageIV")) <= 0:
            raiseExceptions("Tint level icon is missing")
        if len(
                self.driver.find_elements(
                    By.ID, "com.view.viewglass:id/listItemNameTV")) <= 0:
            raiseExceptions("Name of zone in scene is missing")
        if len(
                self.driver.find_elements(
                    By.ID, "com.view.viewglass:id/schedule_scene_TV")) <= 0:
            raiseExceptions("Schedule Scene button is missing")
コード例 #12
0
    def testUIComponentsOfProfileScreenForRO(self):
        auth.checkIfUserIsLoggedIn(self.driver, 0, 'RO')
        auth.login(self.driver, config.users['RO']['username'],
                   config.users['RO']['password'])
        sleep(20)
        if len(
                self.driver.find_elements(
                    By.ID, "com.view.viewglass:id/home_controlIV")) > 0:
            pass
        elif len(
                self.driver.find_elements(
                    By.XPATH,
                    "//android.widget.Button[@resource-id='com.view.viewglass:id/button_cancel']"
                )) > 0:
            site.selectSite(self.driver, config.users['RO']['testsite'])
        if commonFunctions.foundAlert(self.driver):
            commonFunctions.respondToAlert(self.driver, 0)

        commonFunctions.navIcon(self.driver)
        if WebDriverWait(self.driver, 20).until(
                EC.presence_of_element_located(
                    (By.ID, "com.view.viewglass:id/username_navigationTV"))):
            self.driver.find_element_by_id(
                "com.view.viewglass:id/username_navigationTV").click()
        else:
            raiseExceptions("Profile option in navigation menu is missing")

        if WebDriverWait(self.driver, 20).until(
                EC.presence_of_element_located(
                    (By.ID, "com.view.viewglass:id/title_myProfileTV"))):
            pass
        else:
            raiseExceptions("Profile heading is missing")

        if len(
                self.driver.find_elements(
                    By.ID, "com.view.viewglass:id/startup_myProfileTV")) <= 0:
            raiseExceptions("Send Feedback tab is missing")
        if len(
                self.driver.find_elements(
                    By.ID,
                    "com.view.viewglass:id/change_appserverIP_myProfileTV")
        ) <= 0:
            raiseExceptions("Change Appserver IP is missing")
        if len(
                self.driver.find_elements(
                    By.ID, "com.view.viewglass:id/tourPreferenceTV")) <= 0:
            raiseExceptions("Tour Preference is missing")
        if len(
                self.driver.find_elements(
                    By.ID, "com.view.viewglass:id/mobiledataTV")) <= 0:
            raiseExceptions("Cellular Data is missing")
        if len(
                self.driver.find_elements(
                    By.ID, "com.view.viewglass:id/signout_myProfileTV")) <= 0:
            raiseExceptions("Sign Out button is missing")
        self.driver.find_element_by_xpath(
            "//android.widget.TextView[@text='Sign Out']").click()
コード例 #13
0
    def testVerifyUIComponentsOfSceneEventScreen(self):
        auth.checkIfUserIsLoggedIn(self.driver, 1, 'CRUDO')
        commonFunctions.navIcon(self.driver)
        if WebDriverWait(self.driver, 60).until(
                EC.presence_of_element_located(
                    (By.ID, "com.view.viewglass:id/navigation_scenesTV"))):
            self.driver.find_element_by_id(
                "com.view.viewglass:id/navigation_scenesTV").click()
        else:
            raiseExceptions("Scenes option in navigation menu is missing")

        WebDriverWait(self.driver, 20).until(
            EC.presence_of_element_located(
                (By.ID, "com.view.viewglass:id/scene_headertext")))
        firstScene = self.driver.find_elements(
            By.ID, "com.view.viewglass:id/parent_scene_item")[0]
        firstScene.click()
        WebDriverWait(self.driver, 20).until(
            EC.presence_of_element_located(
                (By.ID, "com.view.viewglass:id/scene_Detail")))

        commonFunctions.editbutton(self.driver)
        if WebDriverWait(self.driver, 20).until(
                EC.presence_of_element_located(
                    (By.ID, "com.view.viewglass:id/listItemNameTV"))):
            self.driver.find_elements(
                By.ID, "com.view.viewglass:id/listItemNameTV")[0].click()
        else:
            raiseExceptions("Zones in Scene is missing")

        if len(
                self.driver.find_elements(
                    By.ID, "com.view.viewglass:id/title_sceneEventTV")) <= 0:
            raiseExceptions("Scene Detail heading is missing")
        if len(
                self.driver.find_elements(
                    By.ID, "com.view.viewglass:id/back_scene_eventLL")) <= 0:
            raiseExceptions("Back button is missing")
        if len(
                self.driver.find_elements(
                    By.ID, "com.view.viewglass:id/savebtn_sceneEventTV")) <= 0:
            raiseExceptions("Save button is missing")
        if len(
                self.driver.find_elements(
                    By.ID, "com.view.viewglass:id/zone_TintEventTV")) <= 0:
            raiseExceptions("Zone option is missing")
        if len(
                self.driver.find_elements(
                    By.ID,
                    "com.view.viewglass:id/tintLevel_tintEventTV")) <= 0:
            raiseExceptions("Tint Level option is missing")
        if len(
                self.driver.find_elements(
                    By.ID,
                    "com.view.viewglass:id/tintLevel_SceneEventTV")) <= 0:
            raiseExceptions("Tint Level text is missing")
コード例 #14
0
ファイル: Zones.py プロジェクト: eputh/ViewTestAutomation
    def testCreateZoneGroupForRUO(self):
        auth.checkIfUserIsLoggedIn(self.driver, 0, 'RUO')
        auth.loginAndSelectSite(self.driver, config.users['RUO']['username'],
                                config.users['RUO']['password'],
                                config.sites['Default'])

        commonFunctions.navIcon(self.driver)
        if WebDriverWait(self.driver, 10).until(
                EC.presence_of_element_located(
                    (By.ID, "com.view.viewglass:id/navigation_zonesTV"))):
            self.driver.find_element_by_id(
                "com.view.viewglass:id/navigation_zonesTV").click()
        else:
            raiseExceptions("Zones option in navigation menu is missing")

        if WebDriverWait(self.driver, 10).until(
                EC.presence_of_element_located(
                    (By.ID, "com.view.viewglass:id/title_zonesTV"))):
            pass
        else:
            raiseExceptions("Zones heading is missing")

        commonFunctions.addbutton(self.driver)
        if WebDriverWait(self.driver, 10).until(
                EC.presence_of_element_located(
                    (By.ID, "com.view.viewglass:id/title_createZoneGrpTV"))):
            pass
        else:
            raiseExceptions("Add button led to the wrong screen")

        if len(
                self.driver.find_elements(
                    By.ID,
                    "com.view.viewglass:id/name_createZoneGrp_addETV")) > 0:
            self.driver.find_element_by_id(
                "com.view.viewglass:id/name_createZoneGrp_addETV").send_keys(
                    "abc")
            firstZone = self.driver.find_elements(
                By.ID, "com.view.viewglass:id/zone_item_select_zoneTV")[0]
            firstZone.click()
            commonFunctions.savebutton(self.driver)
        else:
            raiseExceptions("Name text field is missing")

        foundCreatedZonegroup = False
        if len(
                self.driver.find_elements(
                    By.ID, "com.view.viewglass:id/listItemNameTV")) > 0:
            zonegroups = self.driver.find_elements(
                By.ID, "com.view.viewglass:id/listItemNameTV")
            for group in zonegroups:
                if group.text == "abc":
                    foundCreatedZonegroup = True
        if not foundCreatedZonegroup:
            raiseExceptions("Zonegroup 'abc' was not created")
コード例 #15
0
    def testAddNewSceneWithMultipleTintEvents(self):
        auth.checkIfUserIsLoggedIn(self.driver, 0, 'CRUDO')
        auth.loginAndSelectSite(self.driver, config.users['CRUDO']['username'],
                                config.users['CRUDO']['password'],
                                config.sites['Default'])

        commonFunctions.navIcon(self.driver)
        if WebDriverWait(self.driver, 60).until(
                EC.presence_of_element_located(
                    (By.ID, "com.view.viewglass:id/navigation_scenesTV"))):
            self.driver.find_element_by_id(
                "com.view.viewglass:id/navigation_scenesTV").click()
        else:
            raiseExceptions("Scenes option in navigation menu is missing")

        WebDriverWait(self.driver, 10).until(
            EC.presence_of_element_located(
                (By.ID, "com.view.viewglass:id/scene_headertext")))
        commonFunctions.addbutton(self.driver)
        if WebDriverWait(self.driver, 10).until(
                EC.presence_of_element_located(
                    (By.ID, "com.view.viewglass:id/title_scene_addTV"))):
            self.driver.find_element_by_id(
                "com.view.viewglass:id/name_scene_addETV").send_keys(
                    "newscene")
            self.driver.find_element_by_id(
                "com.view.viewglass:id/no_tint_eventTV").click()
        else:
            raiseExceptions("Add New Scene heading is missing")

        for i in range(0, 2):
            self.driver.find_element_by_id(
                "com.view.viewglass:id/add_tint_eventTV").click()
            self.driver.find_element_by_id(
                "com.view.viewglass:id/zone_add_TintEventTV").click()
            if WebDriverWait(self.driver, 10).until(
                    EC.presence_of_element_located(
                        (By.ID, "com.view.viewglass:id/title_repeatTV"))):
                self.driver.find_elements(
                    By.ID, "com.view.viewglass:id/listItemNameTV")[0].click()
            else:
                raiseExceptions("Zone option led to the wrong screen")
            self.driver.find_element_by_id(
                "com.view.viewglass:id/tintLevel_scene_TintEventTV").click()
            if WebDriverWait(self.driver, 10).until(
                    EC.presence_of_element_located(
                        (By.ID,
                         "com.view.viewglass:id/title_scene_selectTintTV"))):
                zones_and_scenes.selectRandomTint(self.driver)
            else:
                raiseExceptions("Tint Level option led to the wrong screen")
            commonFunctions.savebutton(self.driver)
        commonFunctions.savebutton(self.driver)
        if commonFunctions.foundAlert(self.driver):
            commonFunctions.respondToAlert(self.driver, 1)
コード例 #16
0
    def testVerifyUIComponentsOfEditSceneScreen(self):
        auth.checkIfUserIsLoggedIn(self.driver, 1, 'CRUDO')
        commonFunctions.navIcon(self.driver)
        if WebDriverWait(self.driver, 60).until(
                EC.presence_of_element_located(
                    (By.ID, "com.view.viewglass:id/navigation_scenesTV"))):
            self.driver.find_element_by_id(
                "com.view.viewglass:id/navigation_scenesTV").click()
        else:
            raiseExceptions("Scenes option in navigation menu is missing")

        WebDriverWait(self.driver, 20).until(
            EC.presence_of_element_located(
                (By.ID, "com.view.viewglass:id/scene_headertext")))
        firstScene = self.driver.find_elements(
            By.ID, "com.view.viewglass:id/parent_scene_item")[0]
        firstScene.click()

        WebDriverWait(self.driver, 20).until(
            EC.presence_of_element_located(
                (By.ID, "com.view.viewglass:id/scene_Detail")))
        if len(
                self.driver.find_elements(
                    By.ID, "com.view.viewglass:id/editbtn_sceneTV")) <= 0:
            raiseExceptions("Edit button in Scenes Detail screen is missing")
        else:
            commonFunctions.editbutton(self.driver)

        if len(
                self.driver.find_elements(
                    By.ID, "com.view.viewglass:id/scene_Detail")) <= 0:
            raiseExceptions("Edit Scene heading is missing")
        if len(
                self.driver.find_elements(
                    By.ID, "com.view.viewglass:id/editbtn_sceneTV")) <= 0:
            raiseExceptions("Save button is missing")
        if len(
                self.driver.find_elements(
                    By.ID, "com.view.viewglass:id/add_tint_eventTV")) <= 0:
            raiseExceptions("Add Tint Event button is missing")
        if self.driver.find_element_by_id(
                "com.view.viewglass:id/name_scene_editETV").text == "":
            raiseExceptions("Name of Scene is missing")
        if len(
                self.driver.find_elements(
                    By.ID,
                    "com.view.viewglass:id/tintEvents_scene_detailTV")) <= 0:
            raiseExceptions("Tint Event subheading is missing")
        if len(
                self.driver.find_elements(
                    By.ID, "com.view.viewglass:id/listItemNameTV")) <= 0:
            raiseExceptions("Name of tint event is missing")
コード例 #17
0
    def testUIComponentsOfProfileScreenForCRUDO(self):
        auth.checkIfUserIsLoggedIn(self.driver, 0, 'CRUDO')
        auth.loginAndSelectSite(self.driver, config.users['CRUDO']['username'],
                                config.users['CRUDO']['password'],
                                config.sites['Default'])
        commonFunctions.navIcon(self.driver)

        if WebDriverWait(self.driver, 20).until(
                EC.presence_of_element_located(
                    (By.ID, "com.view.viewglass:id/username_navigationTV"))):
            self.driver.find_element_by_id(
                "com.view.viewglass:id/username_navigationTV").click()
        else:
            raiseExceptions("Profile option in navigation menu is missing")

        if WebDriverWait(self.driver, 20).until(
                EC.presence_of_element_located(
                    (By.ID, "com.view.viewglass:id/title_myProfileTV"))):
            pass
        else:
            raiseExceptions("Profile heading is missing")

        if len(
                self.driver.find_elements(
                    By.ID, "com.view.viewglass:id/startup_myProfileTV")) <= 0:
            raiseExceptions("Send Feedback tab is missing")
        if len(
                self.driver.find_elements(
                    By.ID,
                    "com.view.viewglass:id/change_site_myProfileTV")) <= 0:
            raiseExceptions("Change Site is missing")
        if len(
                self.driver.find_elements(
                    By.ID,
                    "com.view.viewglass:id/change_appserverIP_myProfileTV")
        ) <= 0:
            raiseExceptions("Change Appserver IP is missing")
        if len(
                self.driver.find_elements(
                    By.ID, "com.view.viewglass:id/tourPreferenceTV")) <= 0:
            raiseExceptions("Tour Preference is missing")
        if len(
                self.driver.find_elements(
                    By.ID, "com.view.viewglass:id/mobiledataTV")) <= 0:
            raiseExceptions("Cellular Data is missing")
        if len(
                self.driver.find_elements(
                    By.ID, "com.view.viewglass:id/signout_myProfileTV")) <= 0:
            raiseExceptions("Sign Out button is missing")
        self.driver.find_element_by_xpath(
            "//android.widget.TextView[@text='Sign Out']").click()
コード例 #18
0
    def testChangeSite(self):
        auth.checkIfUserIsLoggedIn(self.driver, 0, 'CRUDO')
        auth.loginAndSelectSite(self.driver, config.users['CRUDO']['username'],
                                config.users['CRUDO']['password'],
                                config.sites['Default'])
        commonFunctions.navIcon(self.driver)

        if WebDriverWait(self.driver, 20).until(
                EC.presence_of_element_located(
                    (By.ID, "com.view.viewglass:id/username_navigationTV"))):
            self.driver.find_element_by_id(
                "com.view.viewglass:id/username_navigationTV").click()
        else:
            raiseExceptions("Profile option in navigation menu is missing")

        if WebDriverWait(self.driver, 20).until(
                EC.presence_of_element_located(
                    (By.ID, "com.view.viewglass:id/title_myProfileTV"))):
            pass
        else:
            raiseExceptions("Profile heading is missing")

        if len(
                self.driver.find_elements(
                    By.ID,
                    "com.view.viewglass:id/change_site_myProfileTV")) > 0:
            self.driver.find_element_by_id(
                "com.view.viewglass:id/change_site_myProfileTV").click()
        if len(
                self.driver.find_elements(
                    By.ID, "com.view.viewglass:id/search_layout")) > 0:
            self.driver.find_element_by_id(
                "com.view.viewglass:id/search_layout").click()
            search = self.driver.find_element_by_xpath(
                "//android.widget.EditText[@text='Search']")
            search.send_keys(config.site[1])
            self.driver.find_element_by_id(
                "com.view.viewglass:id/zone_item_select_zoneTV").click()
        else:
            raiseExceptions("Missing Search option in Change Site")

        if WebDriverWait(self.driver, 10).until(
                EC.presence_of_element_located(
                    (By.XPATH, "//android.widget.Button[@text='Yes']"))):
            self.driver.find_element_by_xpath(
                "//android.widget.Button[@text='Yes']").click()
        else:
            raiseExceptions(
                "confirmation message for changing site is missing")
コード例 #19
0
    def testAddTintEvent(self):
        auth.checkIfUserIsLoggedIn(self.driver, 1, 'CRUDO')
        commonFunctions.navIcon(self.driver)
        if WebDriverWait(self.driver, 60).until(
                EC.presence_of_element_located(
                    (By.ID, "com.view.viewglass:id/navigation_scenesTV"))):
            self.driver.find_element_by_id(
                "com.view.viewglass:id/navigation_scenesTV").click()
        else:
            raiseExceptions("Scenes option in navigation menu is missing")

        WebDriverWait(self.driver, 10).until(
            EC.presence_of_element_located(
                (By.ID, "com.view.viewglass:id/scene_headertext")))
        firstScene = self.driver.find_elements(
            By.ID, "com.view.viewglass:id/parent_scene_item")[0]
        firstScene.click()
        WebDriverWait(self.driver, 10).until(
            EC.presence_of_element_located(
                (By.ID, "com.view.viewglass:id/scene_Detail")))

        commonFunctions.editbutton(self.driver)
        if WebDriverWait(self.driver, 10).until(
                EC.presence_of_element_located(
                    (By.ID, "com.view.viewglass:id/add_tint_eventTV"))):
            self.driver.find_element_by_id(
                "com.view.viewglass:id/add_tint_eventTV").click()
        else:
            raiseExceptions("Add Tint Event button is missing")

        self.driver.find_element_by_id(
            "com.view.viewglass:id/zone_add_TintEventTV").click()
        if WebDriverWait(self.driver, 10).until(
                EC.presence_of_element_located(
                    (By.ID, "com.view.viewglass:id/title_repeatTV"))):
            self.driver.find_elements(
                By.ID, "com.view.viewglass:id/listItemNameTV")[0].click()
        else:
            raiseExceptions("Zone option led to the wrong screen")
        self.driver.find_element_by_id(
            "com.view.viewglass:id/tintLevel_scene_TintEventTV").click()
        if WebDriverWait(self.driver, 10).until(
                EC.presence_of_element_located(
                    (By.ID,
                     "com.view.viewglass:id/title_scene_selectTintTV"))):
            zones_and_scenes.selectRandomTint(self.driver)
        else:
            raiseExceptions("Tint Level option led to the wrong screen")
        commonFunctions.savebutton(self.driver)
コード例 #20
0
ファイル: Zones.py プロジェクト: eputh/ViewTestAutomation
    def testFunctionalityOfSearching(self):
        auth.checkIfUserIsLoggedIn(self.driver, 1, 'CRUDO')
        commonFunctions.navIcon(self.driver)
        if WebDriverWait(self.driver, 10).until(
                EC.presence_of_element_located(
                    (By.ID, "com.view.viewglass:id/navigation_zonesTV"))):
            self.driver.find_element_by_id(
                "com.view.viewglass:id/navigation_zonesTV").click()
        else:
            raiseExceptions("Zones option in navigation menu is missing")

        if WebDriverWait(self.driver, 10).until(
                EC.presence_of_element_located(
                    (By.ID, "com.view.viewglass:id/search_zonesIV"))):
            self.driver.find_element_by_id(
                "com.view.viewglass:id/search_zonesIV").click()
        else:
            raiseExceptions("Search icon is missing")
        if len(
                self.driver.find_elements(
                    By.ID, "com.view.viewglass:id/searchEditTV")) > 0:
            self.driver.find_element_by_id(
                "com.view.viewglass:id/searchEditTV").send_keys("z")
        else:
            raiseExceptions("Search text field is missing")
        if len(
                self.driver.find_elements(
                    By.ID, "com.view.viewglass:id/exapdChildTitle")) > 0:
            searchResults = self.driver.find_elements(
                By.ID, "com.view.viewglass:id/exapdChildTitle")
            for result in searchResults:
                if not ("z" in result.text or "Z" in result.text):
                    raiseExceptions("Bug: found incorrect result ",
                                    result.text)
        elif len(
                self.driver.find_elements(
                    By.ID, "com.view.viewglass:id/exapdChildTitle")) == 0:
            self.driver.find_element_by_xpath(
                "//android.widget.TextView[@text='0 SEARCH RESULT']")
        else:
            raiseExceptions(
                "Missing exception handling for unmatching search results")
        if len(
                self.driver.find_elements(
                    By.ID, "com.view.viewglass:id/searchCancelTV")) > 0:
            self.driver.find_element_by_id(
                "com.view.viewglass:id/searchCancelTV").click()
        else:
            raiseExceptions("Cancel button is missing")
コード例 #21
0
ファイル: LiveView.py プロジェクト: eputh/ViewTestAutomation
    def testUICaratMoveAfterSunset(self):
        """
        Login to app after sunset time and select the entry after sunset from table and
        verify that user is unable to move carat after sunset but should be able to move carat any
        time between sunrise and sunset for that day
        """
        now = datetime.now()
        sunset = datetime.strptime("06:00 PM", '%I:%M %p')
        if now < sunset:
            print("Cannot test because it is not after sunset yet")
        else:
            auth.checkIfUserIsLoggedIn(self.driver, 1, 'CRUDO')
            if len(
                    self.driver.find_elements(
                        By.ID, "com.view.viewglass:id/title_LiveViewTV")) <= 0:
                commonFunctions.navIcon(self.driver)
                if WebDriverWait(self.driver, 10).until(
                        EC.presence_of_element_located(
                            (By.ID,
                             "com.view.viewglass:id/navigation_live_viewTV"))):
                    self.driver.find_element_by_id(
                        "com.view.viewglass:id/navigation_live_viewTV").click(
                        )
                else:
                    raiseExceptions(
                        "LiveView option in navigation menu is missing")
            commonFunctions.checkLiveViewAccess(self.driver)

            if len(
                    self.driver.find_elements(
                        By.ID, "com.view.viewglass:id/GraphOver")) > 0:
                self.driver.find_element_by_id(
                    "com.view.viewglass:id/GraphOver").click()
            else:
                raiseExceptions("Graph is missing")

            if len(
                    self.driver.find_elements(By.CLASS_NAME,
                                              "android.widget.SeekBar")) > 0:
                size = self.driver.find_element_by_class_name(
                    "android.widget.SeekBar").size
                location = self.driver.find_element_by_class_name(
                    "android.widget.SeekBar").location
                self.driver.swipe(location['x'], location['y'],
                                  location['x'] + size['width'], location['y'],
                                  3000)
            else:
                raiseExceptions("Seek bar is missing")
コード例 #22
0
ファイル: Zones.py プロジェクト: eputh/ViewTestAutomation
    def testEditZoneGroupForRO(self):
        auth.checkIfUserIsLoggedIn(self.driver, 0, 'RO')
        auth.login(self.driver, config.users['RO']['username'],
                   config.users['RO']['password'])
        sleep(20)
        if commonFunctions.foundAlert(self.driver):
            commonFunctions.respondToAlert(self.driver, 0)
        if len(
                self.driver.find_elements(
                    By.ID, "com.view.viewglass:id/view_btnTV")) > 0:
            commonFunctions.navIcon(self.driver)

        commonFunctions.navIcon(self.driver)
        if WebDriverWait(self.driver, 10).until(
                EC.presence_of_element_located(
                    (By.ID, "com.view.viewglass:id/navigation_zonesTV"))):
            self.driver.find_element_by_id(
                "com.view.viewglass:id/navigation_zonesTV").click()
        else:
            raiseExceptions("Zones option in navigation menu is missing")

        if WebDriverWait(self.driver, 10).until(
                EC.presence_of_element_located(
                    (By.ID, "com.view.viewglass:id/title_zonesTV"))):
            pass
        else:
            raiseExceptions("Zones heading is missing")

        if zones_and_scenes.findZonegroup(self.driver, "abc") == False:
            zones_and_scenes.quickCreateZonegroup(self.driver, "abc")
            zones_and_scenes.findZonegroup(self.driver, "abc")

        if WebDriverWait(self.driver, 10).until(
                EC.presence_of_element_located(
                    (By.XPATH, "//android.widget.TextView[@text='abc']"))):
            commonFunctions.editbutton(self.driver)
        if WebDriverWait(self.driver, 10).until(
                EC.presence_of_element_located(
                    (By.ID, "com.view.viewglass:id/title_createZoneGrpTV"))):
            zones = self.driver.find_elements(
                By.ID, "com.view.viewglass:id/zone_item_select_zoneTV")
            zones[2].click()
            zones[3].click()
            commonFunctions.savebutton(self.driver)
        else:
            raiseExceptions("Edit button led to the wrong screen")
コード例 #23
0
ファイル: Zones.py プロジェクト: eputh/ViewTestAutomation
    def testVerifyUIComponentsOfCreateZoneGroupScreen(self):
        auth.checkIfUserIsLoggedIn(self.driver, 1, 'CRUDO')
        commonFunctions.navIcon(self.driver)
        if WebDriverWait(self.driver, 10).until(
                EC.presence_of_element_located(
                    (By.ID, "com.view.viewglass:id/navigation_zonesTV"))):
            self.driver.find_element_by_id(
                "com.view.viewglass:id/navigation_zonesTV").click()
        else:
            raiseExceptions("Zones option in navigation menu is missing")

        if WebDriverWait(self.driver, 10).until(
                EC.presence_of_element_located(
                    (By.ID, "com.view.viewglass:id/actZone_addIV"))):
            self.driver.find_element_by_id(
                "com.view.viewglass:id/actZone_addIV").click()
        else:
            raiseExceptions("Add icon is missing")
        if len(
                self.driver.find_elements(
                    By.ID,
                    "com.view.viewglass:id/title_createZoneGrpTV")) <= 0:
            raiseExceptions("Add icon led to the wrong screen.")
        if len(
                self.driver.find_elements(
                    By.ID, "com.view.viewglass:id/save_zoneGrpTV")) <= 0:
            raiseExceptions("Save button is missing")
        if len(
                self.driver.find_elements(
                    By.ID,
                    "com.view.viewglass:id/name_createZoneGrp_addETV")) <= 0:
            raiseExceptions("Name text field is missing")
        if len(
                self.driver.find_elements(
                    By.ID,
                    "com.view.viewglass:id/zone_item_select_zoneTV")) <= 0:
            raiseExceptions("Names of available zones is missing")
        if len(
                self.driver.find_elements(
                    By.ID, "com.view.viewglass:id/back_btn_create_newZoneGrpIV"
                )) <= 0:
            raiseExceptions("Back button is missing")
        else:
            self.driver.find_element_by_id(
                "com.view.viewglass:id/back_btn_create_newZoneGrpIV").click()
コード例 #24
0
ファイル: auth.py プロジェクト: eputh/ViewTestAutomation
def logout(driver):
    if common.foundAlert(driver):
        common.respondToAlert(driver, 0)
    common.navIcon(driver)
    if len(
            driver.find_elements(
                By.ID, "com.view.viewglass:id/username_navigationTV")) > 0:
        driver.find_element_by_id(
            "com.view.viewglass:id/username_navigationTV").click()
    else:
        raiseExceptions("Missing user profile option in navigation bar")
    if len(
            driver.find_elements(
                By.XPATH, "//android.widget.TextView[@text='Sign Out']")) > 0:
        driver.find_element_by_xpath(
            "//android.widget.TextView[@text='Sign Out']").click()
    else:
        raiseExceptions("Missing Sign Out button")
コード例 #25
0
ファイル: Zones.py プロジェクト: eputh/ViewTestAutomation
    def testFunctionalityOfUIComponentsForZonesScreen(self):
        auth.checkIfUserIsLoggedIn(self.driver, 1, 'CRUDO')
        commonFunctions.navIcon(self.driver)
        if WebDriverWait(self.driver, 10).until(
                EC.presence_of_element_located(
                    (By.ID, "com.view.viewglass:id/navigation_zonesTV"))):
            self.driver.find_element_by_id(
                "com.view.viewglass:id/navigation_zonesTV").click()
        else:
            raiseExceptions("Zones option in navigation menu is missing")

            WebDriverWait(self.driver, 10).until(
                EC.presence_of_element_located(
                    (By.ID, "com.view.viewglass:id/actZone_addIV")))
            self.driver.find_element_by_id(
                "com.view.viewglass:id/actZone_addIV").click()
            if len(
                    self.driver.find_elements(
                        By.ID,
                        "com.view.viewglass:id/title_createZoneGrpTV")) <= 0:
                raiseExceptions("Add icon led to the wrong screen.")
            if len(
                    self.driver.find_elements(
                        By.ID,
                        "com.view.viewglass:id/back_btn_create_newZoneGrpIV")
            ) > 0:
                self.driver.find_element_by_id(
                    "com.view.viewglass:id/back_btn_create_newZoneGrpIV"
                ).click()

            WebDriverWait(self.driver, 10).until(
                EC.presence_of_element_located(
                    (By.ID, "com.view.viewglass:id/search_zonesIV")))
            self.driver.find_element_by_id(
                "com.view.viewglass:id/search_zonesIV").click()
            if len(
                    self.driver.find_elements(
                        By.ID, "com.view.viewglass:id/serachParentLL")) <= 0:
                raiseExceptions("Search icon led to the wrong screen.")
            if len(
                    self.driver.find_elements(
                        By.ID, "com.view.viewglass:id/searchCancelTV")) > 0:
                self.driver.find_element_by_id(
                    "com.view.viewglass:id/searchCancelTV").click()
コード例 #26
0
ファイル: Zones.py プロジェクト: eputh/ViewTestAutomation
    def testOverrideZoneGroupTint(self):
        auth.checkIfUserIsLoggedIn(self.driver, 1, 'CRUDO')
        commonFunctions.navIcon(self.driver)
        if WebDriverWait(self.driver, 10).until(
                EC.presence_of_element_located(
                    (By.ID, "com.view.viewglass:id/navigation_zonesTV"))):
            self.driver.find_element_by_id(
                "com.view.viewglass:id/navigation_zonesTV").click()
        else:
            raiseExceptions("Zones option in navigation menu is missing")

        if WebDriverWait(self.driver, 10).until(
                EC.presence_of_element_located(
                    (By.ID, "com.view.viewglass:id/title_zonesTV"))):
            pass
        else:
            raiseExceptions("Zones heading is missing")

        zones_and_scenes.selectTopZonegroup(self.driver)
        tint = 0
        if len(
                self.driver.find_elements(
                    By.ID,
                    "com.view.viewglass:id/setTintBtn_zngrpdetailTV")) <= 0:
            raiseExceptions("Override button is missing")
        else:
            commonFunctions.overridebutton(self.driver)
            WebDriverWait(self.driver, 10).until(
                EC.presence_of_element_located(
                    (By.ID, "com.view.viewglass:id/Control_headingTV")))
            tint = control.selectRandomTint(self.driver)
            commonFunctions.overridebutton(self.driver)
        if tint != 0:
            commonFunctions.navIcon(self.driver)
            self.driver.find_element_by_id(
                "com.view.viewglass:id/navigation_zonesTV").click()
            zones_and_scenes.selectTopZonegroup(self.driver)
        else:
            raiseExceptions("unable to override tint")
        currentTint = self.driver.find_element_by_id(
            "com.view.viewglass:id/tint_level_zngrpdetailTV").text
        if str(tint) not in currentTint:
            raiseExceptions("Control screen is not in sync with Zones screen")
コード例 #27
0
    def tesCreateCurrentSceneSchedule(self):
        auth.checkIfUserIsLoggedIn(self.driver, 1, 'CRUDO')
        commonFunctions.navIcon(self.driver)
        if WebDriverWait(self.driver, 60).until(
                EC.presence_of_element_located(
                    (By.ID, "com.view.viewglass:id/navigation_scenesTV"))):
            self.driver.find_element_by_id(
                "com.view.viewglass:id/navigation_scenesTV").click()
        else:
            raiseExceptions("Scenes option in navigation menu is missing")

        selectedScene = ""
        WebDriverWait(self.driver, 20).until(
            EC.presence_of_element_located(
                (By.ID, "com.view.viewglass:id/scene_headertext")))
        selectedScene = self.driver.find_elements(
            By.ID, "com.view.viewglass:id/parent_scene_item")[0]
        selectedScene.click()

        if WebDriverWait(self.driver, 20).until(
                EC.presence_of_element_located(
                    (By.ID, "com.view.viewglass:id/schedule_scene_TV"))):
            self.driver.find_element_by_id(
                "com.view.viewglass:id/schedule_scene_TV").click()
        else:
            raiseExceptions("Schedule Scene button is missing")

        now = datetime.now()
        hours = [now - timedelta(hours=1), now + timedelta(hours=2)]
        startHour = datetime.strftime(hours[0], '%I:00 %p')
        endHour = datetime.strftime(hours[1], '%I:00 %p')

        self.driver.find_element_by_id(
            "com.view.viewglass:id/starts_schdSceneTintTV").click()
        startPicker = self.driver.find_elements(
            By.ID, "android:id/timePickerLayout")[0]
        startPicker.send_keys(startHour)
        self.driver.find_element_by_id(
            "com.view.viewglass:id/ends_schdSceneTintTV").click()
        endPicker = self.driver.find_elements(By.ID,
                                              "android:id/timePickerLayout")[0]
        endPicker.send_keys(endHour)
        commonFunctions.savebutton(self.driver)
コード例 #28
0
    def testVerifyUIComponentsOfAddNewScene(self):
        auth.checkIfUserIsLoggedIn(self.driver, 1, 'CRUDO')
        commonFunctions.navIcon(self.driver)
        if WebDriverWait(self.driver, 60).until(
                EC.presence_of_element_located(
                    (By.ID, "com.view.viewglass:id/navigation_scenesTV"))):
            self.driver.find_element_by_id(
                "com.view.viewglass:id/navigation_scenesTV").click()
        else:
            raiseExceptions("Scenes option in navigation menu is missing")

        if WebDriverWait(self.driver, 20).until(
                EC.presence_of_element_located(
                    (By.ID, "com.view.viewglass:id/scene_headertext"))):
            commonFunctions.addbutton(self.driver)
        else:
            raiseExceptions("Scenes heading is missing")

        if len(
                self.driver.find_elements(
                    By.ID, "com.view.viewglass:id/title_scene_addTV")) <= 0:
            raiseExceptions("Add New Scene heading is missing")
        if len(
                self.driver.find_elements(
                    By.ID,
                    "com.view.viewglass:id/back_btn_add_newSceneIV")) <= 0:
            raiseExceptions("Back button is missing")
        if len(
                self.driver.find_elements(
                    By.ID, "com.view.viewglass:id/save_scene_addTV")) <= 0:
            raiseExceptions("Save button is missing")
        if len(
                self.driver.find_elements(
                    By.ID, "com.view.viewglass:id/name_scene_addETV")) <= 0:
            raiseExceptions("Name text field is missing")
        if len(
                self.driver.find_elements(
                    By.ID, "com.view.viewglass:id/no_tint_eventTV")) <= 0:
            raiseExceptions("Message: No tint event is available, is missing")
        if len(
                self.driver.find_elements(
                    By.ID, "com.view.viewglass:id/add_tint_eventTV")) <= 0:
            raiseExceptions("Add Tint Event button is missing")
コード例 #29
0
    def testCellularData(self):
        auth.checkIfUserIsLoggedIn(self.driver, 0, 'CRUDO')
        auth.loginAndSelectSite(self.driver, config.users['CRUDO']['username'],
                                config.users['CRUDO']['password'],
                                config.sites['Default'])
        commonFunctions.navIcon(self.driver)

        if WebDriverWait(self.driver, 20).until(
                EC.presence_of_element_located(
                    (By.ID, "com.view.viewglass:id/username_navigationTV"))):
            self.driver.find_element_by_id(
                "com.view.viewglass:id/username_navigationTV").click()
        else:
            raiseExceptions("Profile option in navigation menu is missing")

        if WebDriverWait(self.driver, 20).until(
                EC.presence_of_element_located(
                    (By.ID, "com.view.viewglass:id/title_myProfileTV"))):
            pass
        else:
            raiseExceptions("Profile heading is missing")

        startingCheck = self.driver.find_element_by_id(
            "com.view.viewglass:id/togglebtn_mobiledataIV").get_attribute(
                "checked")
        if startingCheck == "true":
            oppositeCheck = "false"
        else:
            oppositeCheck = "true"
        if WebDriverWait(self.driver, 20).until(
                EC.presence_of_element_located(
                    (By.ID, "com.view.viewglass:id/togglebtn_mobiledataIV"))):
            self.driver.find_element_by_id(
                "com.view.viewglass:id/togglebtn_mobiledataIV").click()
        status = self.driver.find_element_by_id(
            "com.view.viewglass:id/togglebtn_mobiledataIV")
        if status.get_attribute("checked") != oppositeCheck:
            raiseExceptions("Cellular Data toggle button did not work")
        else:
            # return to previous setting
            self.driver.find_element_by_id(
                "com.view.viewglass:id/togglebtn_mobiledataIV").click()
コード例 #30
0
ファイル: Zones.py プロジェクト: eputh/ViewTestAutomation
    def testCreateZoneGroupForRO(self):
        auth.checkIfUserIsLoggedIn(self.driver, 0, 'RO')
        auth.login(self.driver, config.users['RO']['username'],
                   config.users['RO']['password'])
        sleep(20)
        if len(
                self.driver.find_elements(
                    By.ID, "com.view.viewglass:id/home_controlIV")) > 0:
            pass
        elif len(
                self.driver.find_elements(
                    By.XPATH,
                    "//android.widget.Button[@resource-id='com.view.viewglass:id/button_cancel']"
                )) > 0:
            site.selectSite(self.driver, config.users['RO']['testsite'])
        if commonFunctions.foundAlert(self.driver):
            commonFunctions.respondToAlert(self.driver, 0)
        if len(
                self.driver.find_elements(
                    By.ID, "com.view.viewglass:id/view_btnTV")) > 0:
            commonFunctions.navIcon(self.driver)

        commonFunctions.navIcon(self.driver)
        if WebDriverWait(self.driver, 10).until(
                EC.presence_of_element_located(
                    (By.ID, "com.view.viewglass:id/navigation_zonesTV"))):
            self.driver.find_element_by_id(
                "com.view.viewglass:id/navigation_zonesTV").click()
        else:
            raiseExceptions("Zones option in navigation menu is missing")

        if WebDriverWait(self.driver, 10).until(
                EC.presence_of_element_located(
                    (By.ID, "com.view.viewglass:id/title_zonesTV"))):
            pass
        else:
            raiseExceptions("Zones heading is missing")

        if len(
                self.driver.find_elements(
                    By.ID, "com.view.viewglass:id/actZone_addIV")) > 0:
            raiseExceptions("RO user is able to add a zonegroup")