Exemplo n.º 1
0
    def LogIN(self, username, password):
        # wait = WebDriverWait(self.w, 10, poll_frequency=1,
        #                      ignored_exceptions=[NoSuchElementException,
        #                                          ElementNotVisibleException,
        #                                          ElementNotSelectableException])
        page = Locator(self.w)

        page.username_text = username
        print(Locator.username_text)
        page.password_text = password

        page.LogIn_button.click()

        wait_page_loaded(self.w)

        assert "АРМ" in self.w.title

        #       time.sleep(1)
        # Кнопка поиск по ШК
        page.barcode_search.click()
        # Ввод номера ШК
        #        time.sleep(1)
        page.search_bc.send_keys('469722' + Keys.RETURN)

        #       time.sleep(1)

        #        wait.until(EC.title_is(self.w.title))
        wait_page_loaded(self.w)
        # Проверка, что документ открылся
        assert "Документ" in self.w.title
Exemplo n.º 2
0
    def LogIN(self, username, password):
        # wait = WebDriverWait(self.w, 10, poll_frequency=1,
        #                      ignored_exceptions=[NoSuchElementException,
        #                                          ElementNotVisibleException,
        #                                          ElementNotSelectableException])
        page = Locator(self.w)

        page.username_text = username
        print(Locator.username_text)
        page.password_text = password

        page.LogIn_button.click()

        wait_page_loaded(self.w)

        assert "АРМ" in self.w.title

        time.sleep(0.5)

        actions = ActionChains(self.w)
        actions.move_to_element(page.mySearch).click().perform()  # Переход в управление моими запросами
        time.sleep(1)
        actions.move_to_element(page.poiskzapr).move_by_offset(-70, 0).click().perform() # развернуть на "+"
        page.zaprosToDel.click() # выбрать созданный по предусловию запрос
        time.sleep(1)
        page.checkBoxFirst.click()  #Первый чекбокс в списке
        time.sleep(3)
        page.butExp.click()  #Кнопка действия с выбором
        time.sleep(1)
        page.butSelExp.click()  # Кнопка действия с выбором
        time.sleep(1)
Exemplo n.º 3
0
    def LogIN(self, username, password):
        # wait = WebDriverWait(self.w, 10, poll_frequency=1,
        #                      ignored_exceptions=[NoSuchElementException,
        #                                          ElementNotVisibleException,
        #                                          ElementNotSelectableException])
        page = Locator(self.w)

        page.username_text = username
        print(Locator.username_text)
        page.password_text = password

        page.LogIn_button.click()

        wait_page_loaded(self.w)

        assert "АРМ" in self.w.title

        time.sleep(0.5)

        # Перейти в уведомления
        page.notification.click()

#        wait.until(EC.title_is(self.w.title))
        wait_page_loaded(self.w)

        # Проверка, что документ открылся

        page.notificationFirst.click()

        assert "Документ" in self.w.title
Exemplo n.º 4
0
    def LogIN(self, username, password):
        # wait = WebDriverWait(self.w, 10, poll_frequency=1,
        #                      ignored_exceptions=[NoSuchElementException,
        #                                          ElementNotVisibleException,
        #                                          ElementNotSelectableException])
        page = Locator(self.w)

        page.username_text = username
        print(Locator.username_text)
        page.password_text = password

        page.LogIn_button.click()

        wait_page_loaded(self.w)

        assert "АРМ" in self.w.title

        time.sleep(0.5)
        actions = ActionChains(self.w)
        actions.move_to_element(
            page.section_allur).click().perform()  # Перейти в строку отчеты
        time.sleep(0.5)
        page.node_ispDisp.click()  # Перейти отчеты по исп дисциплине
        time.sleep(1)
        page.allu_NispDI.click()  # Перейти отчеты с истекшим сроком
        time.sleep(1)
        page.confirm_4.click()  # Перейти отчеты с истекшим сроком
        time.sleep(0.5)
        assert len(
            self.w.window_handles) == 2  # Проверка, что открытось 2 окно
Exemplo n.º 5
0
    def LogIN(self, username, password):
        # wait = WebDriverWait(self.w, 10, poll_frequency=1,
        #                      ignored_exceptions=[NoSuchElementException,
        #                                          ElementNotVisibleException,
        #                                          ElementNotSelectableException])
        page = Locator(self.w)

        page.username_text = username
        #print(Locator.username_text)
        page.password_text = password

        page.LogIn_button.click()

        wait_page_loaded(self.w)

        assert "АРМ" in self.w.title

        time.sleep(0.5)

        actions = ActionChains(self.w)
        actions.move_to_element(page.myWork).click().perform(
        )  # Переход в управление моими запросами
        time.sleep(0.5)
        page.WorkImmid.click()  # выбрать в моей работе срочные
        time.sleep(0.5)
        page.checkBoxFirst.click()  #Девятый документ в списке
        time.sleep(1)
        page.butExp_2.click()  # Кнопка действия с выбором
        time.sleep(1)
        page.butSelExp.click()  # Кнопка действия с выбором
Exemplo n.º 6
0
    def LogIN(self, username, password):
        # wait = WebDriverWait(self.w, 10, poll_frequency=1,
        #                      ignored_exceptions=[NoSuchElementException,
        #                                          ElementNotVisibleException,
        #                                          ElementNotSelectableException])
        page = Locator(self.w)

        page.username_text = username
        #print(Locator.username_text)
        page.password_text = password

        page.LogIn_button.click()

        wait_page_loaded(self.w)

        assert "АРМ" in self.w.title

        time.sleep(0.5)

        actions = ActionChains(self.w)
        actions.move_to_element(page.myWork).click().perform()  # Переход в управление моими запросами
        time.sleep(1)
        page.WorkImmid.click() # выбрать в моей работе срочные
        time.sleep(1)
        page.oneDocInList.click() #Первый документ в списке
        time.sleep(1)
        assert "Документ" in self.w.title # Проверка, что документ открылся
Exemplo n.º 7
0
    def LogIN(self, username, password):

        page = Locator(self.w)

        page.username_text = username

        page.password_text = password

        page.LogIn_button.click()

        wait_page_loaded(self.w)
Exemplo n.º 8
0
    def LogIN(self, username, password):
        # wait = WebDriverWait(self.w, 10, poll_frequency=1,
        #                      ignored_exceptions=[NoSuchElementException,
        #                                          ElementNotVisibleException,
        #                                          ElementNotSelectableException])
        page = Locator(self.w)

        page.username_text = username
        print(Locator.username_text)
        page.password_text = password

        page.LogIn_button.click()

        wait_page_loaded(self.w)
Exemplo n.º 9
0
    def Absence(self):
        wait = WebDriverWait(self.w,
                             10,
                             poll_frequency=1,
                             ignored_exceptions=[
                                 NoSuchElementException,
                                 ElementNotVisibleException,
                                 ElementNotSelectableException
                             ])

        page = Locator(self.w)

        page.autoAnswerText.clear()
        page.autoAnswerText.send_keys('Навстречу злоключениям...')

        page.btnCreateDoc.click()

        wait_page_loaded(self.w)

        assert "Логика ECM.Мой профиль" in self.w.title

        assert wait.until(
            EC.visibility_of_element_located(
                (By.XPATH, KSEDLocators.btnCancelAbsence)))

        # Отменим отсутствие
        page.btnCancelAbsence.click()

        page.btnYes.click()

        wait_page_loaded(self.w)

        assert wait.until(
            EC.visibility_of_element_located(
                (By.XPATH, KSEDLocators.btnCreateDoc)))
Exemplo n.º 10
0
    def StatAllureTemDocO(self):
        wait = WebDriverWait(self.w,
                             1,
                             poll_frequency=1,
                             ignored_exceptions=[
                                 NoSuchElementException,
                                 ElementNotVisibleException,
                                 ElementNotSelectableException
                             ])
        actions = ActionChains(self.w)
        page = Locator(self.w)

        #self.w.execute_script("arguments[0].scrollIntoView();", page.navigation)
        # Раскрываем раздел "Отчеты"
        page.section_allur.click()

        time.sleep(0.5)
        #actions.move_to_element(page.navigation).move_by_offset(0, 10).click().perform()
        # Кликаем по "Статические отчеты"
        page.node_Statis.click()
        time.sleep(0.5)
        # Открываем отчет
        page.edsBySubjectStatO.click()
        time.sleep(2)

        page.btnOKform.click()

        time.sleep(1)
        assert (len(self.w.window_handles) == 2)
Exemplo n.º 11
0
    def addPunkt(self, ):
        page = Locator(self.w)

        wait = WebDriverWait(self.w, 10)

        # Кликнем по "Показать общую карточку"
        time.sleep(1)
        page.show.click()

        # Кликнем по вкладке "Пункты"
        WebDriverWait(self.w, 10).until(
            EC.element_to_be_clickable((By.XPATH, KSEDLocators.punkti)))
        page.punkti.click()

        # Кликнем по кнопке "Добавить пункт"
        WebDriverWait(self.w, 10).until(
            EC.element_to_be_clickable((By.XPATH, KSEDLocators.addPunkt)))
        page.addPunkt.click()

        # Заполним поле "Текст пункта РД"
        page.textPunktaRD.send_keys("Произвольный текст")

        # Добавим ответственного исполнителя
        time.sleep(0.5)
        self.w.execute_script("arguments[0].scrollIntoView();",
                              page.otvetstv_ispolnVpunktahRD)
        #WebDriverWait(self.w, 10).until(EC.element_to_be_clickable((By.XPATH, KSEDLocators.otvetstv_ispolnVpunktahRD)))
        page.otvetstv_ispolnVpunktahRD.send_keys("Строганов" + Keys.RETURN)

        time.sleep(1)
        # Нажмем на кнопку "Сохранить и закрыть"
        self.w.execute_script("arguments[0].scrollIntoView();", page.btnOKform)
        page.btnOKform.click()
Exemplo n.º 12
0
    def attachment(self, ):
        page = Locator(self.w)

        wait = WebDriverWait(self.w, 10)

        self.w.find_element_by_tag_name('body').send_keys(Keys.CONTROL +
                                                          Keys.HOME)
        time.sleep(1)

        actions = ActionChains(self.w)
        actions.move_to_element(page.vlozheniya).perform()
        time.sleep(0.5)
        page.attachments.click()

        #        time.sleep(0.5)
        # wait.until(EC.element_to_be_clickable((By.XPATH, '//div[contains(@id, "default-dialog")]')))
        time.sleep(0.5)
        wait.until(
            EC.element_to_be_clickable((By.XPATH, KSEDLocators.fileUpload)))
        page.fileUpload.click()

        time.sleep(3)
        #wait.until(EC.element_to_be_clickable((By.XPATH, KSEDLocators.files)))
        # wait.until(EC.element_to_be_clickable((By.XPATH, '//div[contains(@id, "default-dialog")]')))
        page.files.send_keys('D:\\test.txt')
Exemplo n.º 13
0
    def ViewTheDocumentCard(self):
        wait = WebDriverWait(self.w, 1, poll_frequency=1,
                             ignored_exceptions=[NoSuchElementException,
                                                 ElementNotVisibleException,
                                                 ElementNotSelectableException])
        actions = ActionChains(self.w)
        page = Locator(self.w)

        self.w.execute_script("arguments[0].scrollIntoView();", page.navigation)
        page.navigation.click()

        time.sleep(0.5)
        actions.move_to_element(page.navigation).move_by_offset(0, 10).click().perform()

#        d = len(page.subordinate)
#        print(str(d))

        time.sleep(1)

        page.oneDocInList.click()
    

        wait_page_loaded(self.w)

        assert "Документ" in self.w.title
Exemplo n.º 14
0
    def addPoruchenie(self, ):
        page = Locator(self.w)

        wait = WebDriverWait(self.w, 10)

        time.sleep(1)
        page.show.click()

        WebDriverWait(self.w, 10).until(
            EC.element_to_be_clickable((By.XPATH, KSEDLocators.punkti)))
        page.punkti.click()

        WebDriverWait(self.w, 10).until(
            EC.element_to_be_clickable((By.XPATH, KSEDLocators.punktiBtn)))
        page.punktiBtn.click()

        page.punktPoruch.click()

        page.textPoruch.send_keys("Произвольный текст")

        page.tipPoruch.send_keys("Поручение по пункту РД" + Keys.RETURN)

        page.otvetstv_ispolnVpunktah.send_keys("Главный" + Keys.RETURN)

        dd = datetime.date.today().strftime('%d%m%Y')
        page.srokIspoln.send_keys(dd)

        page.btnOKform.click()
Exemplo n.º 15
0
    def LogIN(self, username, password):
        # wait = WebDriverWait(self.w, 10, poll_frequency=1,
        #                      ignored_exceptions=[NoSuchElementException,
        #                                          ElementNotVisibleException,
        #                                          ElementNotSelectableException])
        page = Locator(self.w)

        page.username_text = username
        print(Locator.username_text)
        page.password_text = password

        page.LogIn_button.click()

        wait_page_loaded(self.w)

        assert "АРМ" in self.w.title

        time.sleep(0.5)

        # Перейти в строку созданного запроса
        actions = ActionChains(self.w)

        actions.move_to_element(page.mySearch).click().perform()

        # wait.until(EC.title_is(self.w.title))
        wait_page_loaded(self.w)

        page.ControlZapr.click()  # Переход в управление поисковыми запросами
        page.listChange.click()  # Переход в выпадающий список
        time.sleep(0.5)
        page.listChangeSZ.click(
        )  # Выбор служебной записки в выпадающем списке
        time.sleep(0.5)
        page.butSave.click()  # Кнопка сохранить
        time.sleep(0.5)
        page.nameZap.send_keys('ToDel' +
                               Keys.RETURN)  # Сохранить с наименованием
        time.sleep(0.5)
        actions = ActionChains(self.w)
        actions.move_to_element(page.mySearch).click().perform(
        )  # Переход в управление моими запросами
        time.sleep(1)
        actions.move_to_element(page.poiskzapr).move_by_offset(
            -70, 0).click().perform()  # развернуть на "+"
        time.sleep(1)
        assert page.zaprosToDel.is_displayed(
        )  # Проверка, что есть сохраненный элемент
Exemplo n.º 16
0
    def Creat(self, ):
        # wait = WebDriverWait(self.w, 10, poll_frequency=1,
        #                      ignored_exceptions=[NoSuchElementException,
        #                                          ElementNotVisibleException,
        #                                          ElementNotSelectableException])

        page = Locator(self.w)

        wait = WebDriverWait(self.w, 10)

        page.newDoc_button.click()

        page.rd.click()

        assert "Страница создания документа" in self.w.title

        time.sleep(1)
        # Атрибуты документа

        # Заголовок
        page.title.send_keys(u'Документ')

        # Категория документа
        page.category_doc.send_keys(u'Открытый' + Keys.RETURN)

        # Преамбула
        page.preambula.send_keys(u'Преамбула')

        # Вид документа
        page.wid_doc.click()
        page.wid_doc_rasp.click()
        time.sleep(5)
        # Подписант
        page.podpisant.send_keys(u'Строганов' + Keys.RETURN)

        time.sleep(1)
        # Общий контроль
        page.obcontrol.send_keys(u'Строганов' + Keys.RETURN)

        time.sleep(0.5)

        # Кнопка "Создать"
        self.w.execute_script("arguments[0].scrollIntoView();",
                              page.btnCreateDoc)
        wait.until(
            EC.element_to_be_clickable((By.XPATH, KSEDLocators.btnCreateDoc)))
        page.btnCreateDoc.click()

        #        wait.until(EC.number_of_windows_to_be(2))

        wait_page_loaded(self.w)
        #        self.w.set_page_load_timeout(30)
        #        time.sleep(2)

        #
        #        wait.until(EC.title_is(self.w.title))
        time.sleep(3)
        assert "Документ" in self.w.title
Exemplo n.º 17
0
    def LogIN(self, username, password):
        # wait = WebDriverWait(self.w, 10, poll_frequency=1,
        #                      ignored_exceptions=[NoSuchElementException,
        #                                          ElementNotVisibleException,
        #                                          ElementNotSelectableException])
        page = Locator(self.w)

        page.username_text = username
        print(Locator.username_text)
        page.password_text = password

        page.LogIn_button.click()

        wait_page_loaded(self.w)

        assert "АРМ" in self.w.title

        time.sleep(0.5)

        actions = ActionChains(self.w)
        actions.move_to_element(page.mySearch).click().perform(
        )  # Переход в управление моими запросами
        time.sleep(1)
        actions.move_to_element(page.poiskzapr).move_by_offset(
            -70, 0).click().perform()  # развернуть на "+"
        page.zaprosToDel.click()  # выбрать созданный по предусловию запрос
        time.sleep(1)
        page.butRed.click()
        time.sleep(1)
        page.listChange.click()  # Переход в выпадающий список
        time.sleep(0.5)
        page.listChangeRD.click(
        )  # Выбор служебной записки в выпадающем списке
        time.sleep(2)
        page.butSave.click()  # Кнопка сохранить
        time.sleep(0.5)
        page.nameZap.send_keys(Keys.RETURN)  # Сохранить с наименованием
        actions = ActionChains(self.w)
        actions.move_to_element(page.mySearch).click().perform(
        )  # Переход в управление моими запросами
        time.sleep(1)
        actions.move_to_element(page.poiskzapr).move_by_offset(
            -70, 0).click().perform()  # развернуть на "+"
        time.sleep(1)
        assert page.zaprosToDel.is_displayed()  # Проверка, что отображается
Exemplo n.º 18
0
    def LogIN(self, username, password):
        wait = WebDriverWait(self.w,
                             10,
                             poll_frequency=1,
                             ignored_exceptions=[
                                 NoSuchElementException,
                                 ElementNotVisibleException,
                                 ElementNotSelectableException
                             ])
        page = Locator(self.w)

        page.username_text = username
        print(Locator.username_text)
        page.password_text = password

        page.LogIn_button.click()

        wait_page_loaded(self.w)

        assert "АРМ" in self.w.title

        time.sleep(0.5)

        actions = ActionChains(self.w)
        actions.move_to_element(page.mySearch).click().perform(
        )  # Переход в управление моими запросами
        time.sleep(1)
        actions.move_to_element(page.poiskzapr).move_by_offset(
            -70, 0).click().perform()  # развернуть на "+"
        page.zaprosToDel.click()  # выбрать созданный по предусловию запрос
        time.sleep(1)
        page.butDel.click()
        time.sleep(1)
        page.butDelAc.click()
        time.sleep(1)
        actions = ActionChains(self.w)
        actions.move_to_element(page.mySearch).click().perform(
        )  # Переход в управление моими запросами
        time.sleep(1)
        actions.move_to_element(page.poiskzapr).move_by_offset(
            -70, 0).click().perform()  # развернуть на "+"
        time.sleep(1)
        assert wait.until(
            EC.invisibility_of_element_located(
                (By.XPATH, KSEDLocators.zaprosToDel)))
Exemplo n.º 19
0
    def getMyprofile(self, ):
        page = Locator(self.w)

        page.user_menu.click()

        page.my_profile.click()

        wait_page_loaded(self.w)

        assert "Профиль пользователя" in self.w.title
Exemplo n.º 20
0
    def getLogicESM(self, ):
        page = Locator(self.w)

        page.user_menu.click()

        page.logic_ESM.click()

        wait_page_loaded(self.w)

        assert "Логика ECM.Мой профиль" in self.w.title
Exemplo n.º 21
0
    def creation_of_the_approval_route(self):
        page = Locator(self.w)

        wait = WebDriverWait(self.w, 10)

        # time.sleep(1)
        # # "Показать общую карточку" клик
        # page.show.click()

        # "Согласование" вкладка
        self.w.find_element_by_tag_name('body').send_keys(Keys.CONTROL +
                                                          Keys.HOME)
        time.sleep(1)
        #self.w.execute_script("arguments[0].scrollIntoView();", page.soglasovanieWkladka)
        WebDriverWait(self.w, 10).until(
            EC.element_to_be_clickable(
                (By.XPATH, KSEDLocators.soglasovanieWkladka)))
        page.soglasovanieWkladka.click()

        # "Создать маршрут" клик по кнопке
        WebDriverWait(self.w, 10).until(
            EC.element_to_be_clickable((By.XPATH, KSEDLocators.createRuleBtn)))
        page.createRuleBtn.click()

        # Выберем "Индивидуальный маршрут"
        page.createRuleIndivid.click()

        # Появилась форма "Редактирование маршрута" нажмем "ОК"
        WebDriverWait(self.w, 10).until(
            EC.element_to_be_clickable((By.XPATH, KSEDLocators.btnOKform)))
        page.btnOKform.click()

        # Нажмем кнопку "Добавить этап"
        WebDriverWait(self.w, 10).until(
            EC.element_to_be_clickable((By.XPATH, KSEDLocators.addEtap)))
        page.addEtap.click()

        time.sleep(1.5)
        # Заполним "Вид этапа"
        self.w.execute_script("arguments[0].scrollIntoView();", page.tipeEtap)
        page.tipeEtap.send_keys("Согласование РД" + Keys.ENTER)
        time.sleep(0.5)

        # Заполним "Согласующие"
        page.soglasuychie.send_keys("Строганов" + Keys.ENTER)

        # Нажмем кнопку "ОК" на форме
        time.sleep(1)
        self.w.execute_script("arguments[0].scrollIntoView();",
                              page.btnOKformSogl)
        page.btnOKformSogl.click()
        #time.sleep(5)
        page.btnOKformSogl.click()

        wait_page_loaded(self.w)
Exemplo n.º 22
0
    def LogIN(self, username, password):
        # wait = WebDriverWait(self.w, 10, poll_frequency=1,
        #                      ignored_exceptions=[NoSuchElementException,
        #                                          ElementNotVisibleException,
        #                                          ElementNotSelectableException])
        page = Locator(self.w)

        page.username_text = username
        print(Locator.username_text)
        page.password_text = password

        page.LogIn_button.click()
        page2 = MPages(self.w, self.w.current_url)

        wait_page_loaded(self.w)

        assert "АРМ" in self.w.title

        #time.sleep(0.5)
        actions = ActionChains(self.w)
        actions.move_to_element(
            page.section_allur).click().perform()  # Перейти в строку отчеты
        time.sleep(0.5)  # без этого ожидания не работает
        WebDriverWait(self.w, 5).until(
            EC.visibility_of_element_located(
                (By.XPATH, KSEDLocators.node_ispDisp)))
        page.node_ispDisp.click()  # Перейти отчеты по исп дисциплине

        page2.melements.click()

        #        time.sleep(1)
        page2.wait_page_loaded()
        page2.m2elements.click()
        #        page.allu_SostIspR.click()  # Перейти в раздел состояние исполнеия резолюций
        #        time.sleep(2)
        WebDriverWait(self.w, 5).until(
            EC.visibility_of_element_located(
                (By.XPATH, KSEDLocators.confirm_3)))
        page.confirm_3.click()  # Кнопка ОК
        time.sleep(0.5)
        assert len(
            self.w.window_handles) == 2  # Проверка, что открытось 2 окно
Exemplo n.º 23
0
    def USER_LOGOUTs(self, ):
        page = Locator(self.w)

        wait = WebDriverWait(self.w, 10)

        page.user_menu.click()

        page.USER_LOGOUT.click()

        wait_page_loaded(self.w)

        assert "Войти" in self.w.title
Exemplo n.º 24
0
    def LogIN(self, username, password):
        # wait = WebDriverWait(self.w, 10, poll_frequency=1,
        #                      ignored_exceptions=[NoSuchElementException,
        #                                          ElementNotVisibleException,
        #                                          ElementNotSelectableException])
        page = Locator(self.w)

        page.username_text = username
        print(Locator.username_text)
        page.password_text = password

        page.LogIn_button.click()
        #page.wait(2)

        # Ожидание
        # select = Select(Locator.username_text)
        # select.select_by_visible_text("текст")

        wait_page_loaded(self.w)

        assert "АРМ" in self.w.title
Exemplo n.º 25
0
    def LogIN(self, username, password):
        # wait = WebDriverWait(self.w, 10, poll_frequency=1,
        #                      ignored_exceptions=[NoSuchElementException,
        #                                          ElementNotVisibleException,
        #                                          ElementNotSelectableException])
        page = Locator(self.w)

        page.username_text = username
        print(Locator.username_text)
        page.password_text = password

        page.LogIn_button.click()

        wait_page_loaded(self.w)

        assert "АРМ" in self.w.title

        time.sleep(0.5)

        actions = ActionChains(self.w)

        actions.move_to_element(page.mySearch).click().perform()
        time.sleep(1)

        actions.move_to_element(page.poiskzapr).move_by_offset(
            -70, 0).click().perform()

        # Перейти в строку созданного запроса
        page.myPoiskZapr.click()

        #        wait.until(EC.title_is(self.w.title))
        wait_page_loaded(self.w)

        # Переход в первый документ в списке
        page.oneDocInList.click()

        # Проверка, что документ открылся

        assert "Документ" in self.w.title
Exemplo n.º 26
0
    def notificationOpen(self):
        page = Locator(self.w)

        wait = WebDriverWait(self.w, 10)

        wait_page_loaded(self.w)

        page.notification.click()

        #       time.sleep(0.5)
        page.notificationProtokol.click()

        wait_page_loaded(self.w)
Exemplo n.º 27
0
    def Creat(self, ):
        # wait = WebDriverWait(self.w, 10, poll_frequency=1,
        #                      ignored_exceptions=[NoSuchElementException,
        #                                          ElementNotVisibleException,
        #                                          ElementNotSelectableException])

        page = Locator(self.w)

        wait = WebDriverWait(self.w, 10)

        page.newDoc_button.click()

        page.paket_vh.click()

        assert "Страница создания документа" in self.w.title

        time.sleep(1)
        # Атрибуты документа

        # Корреспондент
        self.w.execute_script("arguments[0].scrollIntoView();",
                              page.korrespondent)

        page.korrespondent.send_keys(u'Сибинтек' + Keys.RETURN)
        page.korrespondent.send_keys(Keys.RETURN)

        # Способ доставки
        page.sposob_dost.send_keys(u'КСЭД' + Keys.RETURN)

        # Адресат
        page.adresat.send_keys(u'Строганов' + Keys.RETURN)

        time.sleep(0.5)

        # Кнопка "Создать"
        self.w.execute_script("arguments[0].scrollIntoView();",
                              page.btnCreateDoc)
        wait.until(
            EC.element_to_be_clickable((By.XPATH, KSEDLocators.btnCreateDoc)))
        page.btnCreateDoc.click()

        #        wait.until(EC.number_of_windows_to_be(2))

        wait_page_loaded(self.w)
        #        self.w.set_page_load_timeout(30)
        time.sleep(2)

        #
        #        wait.until(EC.title_is(self.w.title))

        assert "Документ" in self.w.title
Exemplo n.º 28
0
    def creation_of_the_approval_route(self):

        page = Locator(self.w)

        wait = WebDriverWait(self.w, 10)

        time.sleep(1)
        # "Показать общую карточку" клик
        page.show.click()

        # "Согласование" вкладка
        WebDriverWait(self.w, 10).until(
            EC.element_to_be_clickable(
                (By.XPATH, KSEDLocators.soglasovanieWkladka)))
        page.soglasovanieWkladka.click()

        # "Создать маршрут" клик по кнопке
        WebDriverWait(self.w, 10).until(
            EC.element_to_be_clickable((By.XPATH, KSEDLocators.createRuleBtn)))
        page.createRuleBtn.click()

        # Выберем "Индивидуальный маршрут"
        page.createRuleIndivid.click()

        # Появилась форма "Редактирование маршрута" нажмем "ОК"
        WebDriverWait(self.w, 10).until(
            EC.element_to_be_clickable((By.XPATH, KSEDLocators.btnOKform)))
        page.btnOKform.click()

        # Нажмем кнопку "Добавить этап"
        WebDriverWait(self.w, 10).until(
            EC.element_to_be_clickable((By.XPATH, KSEDLocators.addEtap)))
        page.addEtap.click()

        time.sleep(1.5)
        # Заполним "Вид этапа"
        page.tipeEtap.send_keys("Согласование" + Keys.ENTER)
        time.sleep(0.5)
        page.tipeEtap.send_keys(Keys.ENTER)
        time.sleep(1)

        # Заполним "Согласующие"
        page.soglasuychie.send_keys("Яцкин" + Keys.ENTER)

        # Нажмем кнопку "ОК" на форме
        time.sleep(0.5)
        page.btnOKformSogl.click()

        wait_page_loaded(self.w)
Exemplo n.º 29
0
    def NapSoglasovanie(self, ):
        page = Locator(self.w)

        wait = WebDriverWait(self.w, 10)

        page.sendFor_approval.click()

        wait_page_loaded(self.w)

        # Проверим статус документа
        wait.until(
            EC.element_to_be_clickable((By.XPATH, KSEDLocators.osnSvedeniya)))
        page.osnSvedeniya.click()

        assert "На согласовании" in self.status_Doc.text
Exemplo n.º 30
0
 def printAttach(self):
     wait = WebDriverWait(self.w,
                          2,
                          poll_frequency=1,
                          ignored_exceptions=[
                              NoSuchElementException,
                              ElementNotVisibleException,
                              ElementNotSelectableException
                          ])
     page = Locator(self.w)
     #time.sleep(3)
     page.btnPrint.click()
     #time.sleep(1)
     # w = len(self.w.switch_to_alert())#window_handles)
     # print(w)
     time.sleep(2)