示例#1
0
    def test_ui_multiaccount(self):
        driver = self.driver
        server_url = const.K_URL_1
        user = const.K_USER_1
        password = const.K_PASSWORD_1
        ssl = const.K_SELF_SIGNED_1

        actions.doFirstLoginWith(self, server_url, user, password, ssl)
        actions.assert_is_in_files_view(self)

        settingsButton = driver.find_element_by_xpath(
            filesView.settingsButton_xpath)
        self.assertEqual(settingsButton.get_attribute("name"),
                         filesView.settingsButton_name)
        settingsButton.click()

        addNewAccountButton = driver.find_element_by_xpath(
            settingsView.addNewAccountButton_xpath)
        self.assertEqual(addNewAccountButton.get_attribute("name"),
                         settingsView.addNewAccountButton_name)
        addNewAccountButton.click()

        actions.doLoginWith(self, const.K_URL_2, const.K_USER_2,
                            const.K_PASSWORD_2, const.K_SELF_SIGNED_2)
        actions.assert_is_in_files_view(self)
示例#2
0
    def test_create_folder_ok(self):

        server_url = const.K_URL_1
        user = const.K_USER_1
        password = const.K_PASSWORD_1
        ssl = const.K_SELF_SIGNED_1

        actions.doFirstLoginWith(self,server_url,user,password,ssl)
        sleep(1)
        self.driver.find_element_by_name(filesView.addButton_name).click()
        sleep(1)
        self.driver.find_element_by_name(filesView.createFolder_name).click()
        sleep(1)
        self.driver.find_element_by_xpath(filesView.createFolderTextView_xpath).set_value(const.K_FOLDER_NAME)
        self.driver.find_element_by_name(filesView.saveButton_name).click()
        sleep(30)
        
        cellName = (self.driver.find_element_by_xpath(filesView.filesTableView_xpath).find_elements_by_class_name(filesView.cell_class))[2].get_attribute(filesView.name_attribute)
        allCells = self.driver.find_element_by_xpath(filesView.filesTableView_xpath).find_elements_by_class_name(filesView.cell_class)

        isExistByUserInterface = False
        isExistByWebDav = False

        for currentCell in allCells:

            if const.K_FOLDER_NAME == currentCell.get_attribute(filesView.name_attribute).encode('utf-8'):
                isExistByUserInterface = True

        isExistByWebDav = webdavCommands.isFile(const.K_URL_1, const.K_USER_1, const.K_PASSWORD_1, const.K_FOLDER_NAME)

        if isExistByWebDav and isExistByUserInterface:
            self.assertTrue(True)
        else:
            self.assertTrue(False)
示例#3
0
文件: loginTest.py 项目: 11samype/ios
    def test_ui_login_ok(self):
        server_url = const.K_URL_1
        user = const.K_USER_1
        password = const.K_PASSWORD_1
        ssl = const.K_SELF_SIGNED_1

        actions.doFirstLoginWith(self,server_url,user,password,ssl)
        actions.assert_is_in_files_view(self)
示例#4
0
    def test_ui_login_ok(self):
        server_url = const.K_URL_1
        user = const.K_USER_1
        password = const.K_PASSWORD_1
        ssl = const.K_SELF_SIGNED_1

        actions.doFirstLoginWith(self, server_url, user, password, ssl)
        actions.assert_is_in_files_view(self)
示例#5
0
文件: loginTest.py 项目: 11samype/ios
    def test_ui_login_incorrect_password(self):
        server_url = const.K_URL_1
        user = const.K_USER_1
        password = const.K_PASSWORD_WRONG_1
        ssl = const.K_SELF_SIGNED_1

        actions.doFirstLoginWith(self,server_url,user,password,ssl)
        actions.assert_is_not_in_files_view(self)
        self.assertEqual(self.driver.find_elements_by_class_name(loginView.user_password_field_class)[loginView.user_password_field_index].get_attribute("name"), loginView.user_password_field_name)
示例#6
0
    def test_ui_login_incorrect_password(self):
        server_url = const.K_URL_1
        user = const.K_USER_1
        password = const.K_PASSWORD_WRONG_1
        ssl = const.K_SELF_SIGNED_1

        actions.doFirstLoginWith(self, server_url, user, password, ssl)
        actions.assert_is_not_in_files_view(self)
        self.assertEqual(
            self.driver.find_elements_by_class_name(
                loginView.user_password_field_class)[
                    loginView.user_password_field_index].get_attribute("name"),
            loginView.user_password_field_name)
示例#7
0
文件: loginTest.py 项目: 11samype/ios
    def test_ui_multiaccount(self):
        driver = self.driver
        server_url = const.K_URL_1
        user = const.K_USER_1
        password = const.K_PASSWORD_1
        ssl = const.K_SELF_SIGNED_1

        actions.doFirstLoginWith(self,server_url,user,password,ssl)
        actions.assert_is_in_files_view(self)

        settingsButton =  driver.find_element_by_xpath(filesView.settingsButton_xpath);
        self.assertEqual(settingsButton.get_attribute("name"), filesView.settingsButton_name)
        settingsButton.click();

        addNewAccountButton = driver.find_element_by_xpath(settingsView.addNewAccountButton_xpath)
        self.assertEqual(addNewAccountButton.get_attribute("name"), settingsView.addNewAccountButton_name)
        addNewAccountButton.click()

        actions.doLoginWith(self,const.K_URL_2,const.K_USER_2,const.K_PASSWORD_2,const.K_SELF_SIGNED_2)
        actions.assert_is_in_files_view(self)