Example #1
0
    def test_created_element_show_in_regulation_ea_field(self, driver, field_type, new_window):
        link = MainFunc.take_DNSID(URLs.DIRECTORY_VED_LINK, driver.current_url)
        page = DirectoryVEDPage(driver, link)
        page.open()
        page.should_be_all_correct_fields()
        page.click_to_add_ea_type_button()
        page.fill_ea_type_fields(field_type)
        page.should_be_сreated_ea_type(field_type)

        link = MainFunc.take_DNSID(URLs.REGULATION_LINK, driver.current_url)
        page = DirectoryVEDPage(driver, link)
        page.open()
        page.ea_type_should_be_in_regulation_document(field_type, new_window)
Example #2
0
    def test_official_mf_add_button(self, driver):
        setup(driver)
        link = MainFunc.take_DNSID(URLs.ENTER_REQUEST_LINK, driver.current_url)
        page = EnterRequestDocumentPage(driver, link)
        page.open()

        page.should_be_request_type_fields(0, 0, True,
                                           EnterRequestValues.OFFICIAL_MF)

        types = [(0, 0), (1, 0), (2, 0)]

        for i in range(len(types)):
            num, parent = types[i][0], types[i][1]

            if i != 0:
                page.enter_request_add_buttons(3)

            page.should_be_request_type_field(num, parent)
            page.should_be_change_type_field(num, parent)
            page.should_be_path_field(num, parent)
            page.should_be_publish_date_field(num, parent)
            page.should_be_responsible_field(num, parent)
            page.should_be_phone_field(num, parent)
            page.should_be_comment_field(num, parent)
            page.should_be_operation_field(num, parent)
            page.should_be_document_field(num, parent)
            page.should_be_application_field(num, parent)
            page.should_be_information_type_field(num, parent)
            page.should_be_info_composition_field(num, parent)

        page.delete_block_locator(1)
Example #3
0
 def test_osmf_information_correct_fields(self, driver):
     link = MainFunc.take_DNSID(URLs.OSMF_INFORMATION_LINK,
                                driver.current_url)
     page = OSMFInformationSettings(driver, link)
     page.open()
     page.should_be_osmf_information_correct_fields(
         'Справочник "Вид информации"')
     page.back_osmf_information_button()
Example #4
0
 def test_osmf_information_place_correct_fields(self, driver):
     link = MainFunc.take_DNSID(URLs.OSMF_INFORMATION_PLACE_LINK,
                                driver.current_url)
     page = OSMFInformationSettings(driver, link)
     page.open()
     page.should_be_osmf_information_correct_fields(
         'Справочник "Состав информации, размещаемой на ОСМФ"')
     page.back_osmf_information_button()
Example #5
0
def setup(driver, root=None):
    link = URLs.AUTH_LINK
    page = AuthPage(driver, link)
    page.open()
    page.enter_in_account(root)
    yield
    link = MainFunc.take_DNSID(URLs.DIRECTORY_VED_LINK, driver.current_url)
    page = DirectoryVEDPage(driver, link)
    page.open()
    page.delete_created_ea_type()
Example #6
0
    def test_enter_requests(self, driver, num, with_del):
        setup(driver)
        link = MainFunc.take_DNSID(URLs.ENTER_REQUEST_LINK, driver.current_url)
        page = EnterRequestDocumentPage(driver, link)
        page.open()
        page.enter_reqests_fields(num, True, False)
        page.enter_reqests_fields(num, False, False)
        page.enter_reqests_fields(num, True, True)
        page.enter_reqests_fields(num, False, True)
        page.create_and_send_agree_sheet(delete=with_del)
        doc_id = page.save_document_id()

        setup(driver, "a")
        link = MainFunc.create_doc_link(
            MainFunc.take_DNSID(URLs.OPENED_DOCUMENT_LINK, driver.current_url),
            doc_id)
        EnterRequestDocumentPage(driver, link).open()
        AllDocumentFieldPage(driver).register_doc(
            EnterRequestValues.ENTER_REQUEST_TITLE)
Example #7
0
def setup(driver):
    link = URLs.AUTH_LINK
    page = AuthPage(driver, link)
    page.open()
    page.enter_in_account()

    yield
    link = MainFunc.take_DNSID(URLs.SYSTEM_NOTIFY_LINK, driver.current_url)
    page = SystemNotificationPage(driver, link)
    page.open()
    page.delete_notification_email()
 def test_sogls_sign(self, driver, url, req, comment, solution, remark,
                     user):
     setup(driver, "u_ep")
     link = MainFunc.take_DNSID(url, driver.current_url)
     page = AllDocumentFieldPage(driver, link)
     page.open()
     page.fill_in_all_document_required_fields(*req)
     page.should_be_short_content_fields()
     page.fill_short_content_field(comment)
     page.add_files()
     page.should_be_save_button()
     page.save_rcd()
     page.create_and_send_agree_sheet(solution=solution,
                                      with_ep=True,
                                      remark=remark,
                                      add_user=user)
     page.save_and_check_ep(solution)
 def test_out_og_sogl_sign(self, driver, comment, solution, remark):
     setup(driver, "u_ep")
     link = MainFunc.take_DNSID(URLs.OUT_OG_SOGL_LINK, driver.current_url)
     page = AllDocumentFieldPage(driver, link)
     page.open()
     page.fill_in_all_document_required_fields(3, 5, 2, og=True)
     page.should_be_appeal_author_fields()
     page.should_be_review_result_fields()
     page.should_be_short_content_fields()
     page.fill_appeal_author_field()
     page.fill_review_result_field(42)
     page.fill_short_content_field(comment)
     page.add_files()
     page.should_be_save_button()
     page.save_rcd()
     page.create_and_send_agree_sheet(solution=solution,
                                      with_ep=True,
                                      remark=remark)
     page.save_and_check_ep(solution)
 def test_attesting_sign(self, driver):
     setup(driver, "u_ep")
     link = MainFunc.take_DNSID(URLs.OUT_SOGL_LINK, driver.current_url)
     page = AllDocumentFieldPage(driver, link)
     out_sogl_page = OutSogl(driver)
     out_doc_page = OutDocumentsPage(driver)
     page.open()
     page.fill_in_all_document_required_fields(6, 7, 3)
     page.should_be_short_content_fields()
     page.fill_short_content_field("Автотест заверить")
     page.add_files()
     page.should_be_save_button()
     out_sogl_page.fill_document_kind_field(410)
     page.save_rcd(2)
     page.create_and_send_agree_sheet(solution=3)
     page.click_to_register_pictogram()
     page.save_rcd()
     out_doc_page.click_to_attesting_button()
     page.should_be_etalon_el_sign_img()
Example #11
0
    def test_official_mf_rubic_add_button(self, driver):
        setup(driver)
        link = MainFunc.take_DNSID(URLs.ENTER_REQUEST_LINK, driver.current_url)
        page = EnterRequestDocumentPage(driver, link)
        page.open()

        page.should_be_request_type_fields(0, 0, True,
                                           EnterRequestValues.OFFICIAL_MF)
        page.should_be_change_type_fields(0, 0, True,
                                          EnterRequestValues.DOC_CHANGE_RUBIC)

        page.should_be_request_type_field(0, 0)
        page.should_be_change_type_field(0, 0)
        page.should_be_path_field(0, 0)
        page.should_be_responsible_field(0, 0)
        page.should_be_phone_field(0, 0)
        page.should_be_comment_field(0, 0)
        page.should_be_operation_field(0, 0)
        page.should_be_name_field(0, 0)
        page.should_be_application_rubic_field(0, 0, True)
Example #12
0
    def test_created_element_show_in_osmf_field(self, driver):
        create_osmf_info(driver, URLs.OSMF_INFORMATION_LINK,
                         OSMFInformationValues.INFORMATION_TYPE)

        link = MainFunc.take_DNSID(URLs.ENTER_REQUEST_LINK, driver.current_url)
        page = EnterRequestDocumentPage(driver, link)

        page.open()
        page.should_be_request_type_fields(0, 0, True,
                                           EnterRequestValues.OFFICIAL_MF)
        page.should_be_information_type_fields(
            0, 0, True, OSMFInformationValues.INFORMATION_TYPE)

        delete_osmf_info(driver, URLs.OSMF_INFORMATION_LINK,
                         OSMFInformationValues.INFORMATION_TYPE)

        page.open()
        page.should_be_request_type_fields(0, 0, True,
                                           EnterRequestValues.OFFICIAL_MF)
        page.should_be_information_type_fields(
            0, 0, True, OSMFInformationValues.INFORMATION_TYPE, True)
Example #13
0
    def test_enter_provision_software_hardware_add_button(self, driver):
        setup(driver)
        link = MainFunc.take_DNSID(URLs.ENTER_REQUEST_LINK, driver.current_url)
        page = EnterRequestDocumentPage(driver, link)
        page.open()

        page.should_be_request_type_fields(0, 0, True,
                                           EnterRequestValues.PROVISION_SH)

        types = [(0, 0), (1, 0), (2, 0)]

        for i in range(len(types)):
            num, parent = types[i][0], types[i][1]

            if i != 0:
                page.enter_request_add_buttons(4)

            page.should_be_request_type_field(num, parent)
            page.should_be_work_type_field(num, parent)
            page.should_be_remove_from_field(num, parent)
            page.should_be_svt_card_field(num, parent)
            page.should_be_justification_field(num, parent)

        page.delete_block_locator(1)
Example #14
0
    def test_change_info_add_button(self, driver):
        setup(driver)
        link = MainFunc.take_DNSID(URLs.ENTER_REQUEST_LINK, driver.current_url)
        page = EnterRequestDocumentPage(driver, link)
        page.open()

        types = [((None), (0, 0)), ((1, 0), (1, 0)), ((2, 0), (0, 1)),
                 ((1, 1), (1, 1))]

        for i in range(len(types)):
            num, parent = types[i][1][0], types[i][1][1]

            if i != 0:
                page.enter_request_add_buttons(types[i][0][0], types[i][0][1])

            page.should_be_request_type_field(num, parent)
            page.should_be_information_field(num, parent)
            page.should_be_fio_field(num, parent)
            page.should_be_information_resource_field(num, parent)
            page.should_be_action_type_field(num, parent)
            page.should_be_functional_role_field(num, parent)

        page.delete_block_locator(2)
        page.delete_block_locator(2)
Example #15
0
    def test_regulation_notification_document(self, driver, npa_number,
                                              regulation_type, field_name,
                                              date):
        link = MainFunc.take_DNSID(URLs.SYSTEM_NOTIFY_LINK, driver.current_url)
        page = SystemNotificationPage(driver, link)
        page.open()
        page.enter_email_notification(field_name)
        page.click_to_save_button()

        link = MainFunc.take_DNSID(URLs.REGULATION_LINK, driver.current_url)
        page = RegulationDocumentPage(driver, link)
        page.open()
        page.regulation_doc(npa_number, regulation_type,
                            TestRegulationNotification.NPA_ID, False, True)
        page.create_and_send_agree_sheet()
        doc_id = page.save_document_id()

        self.enter_in_acc(driver, "a")
        link = MainFunc.create_doc_link(
            MainFunc.take_DNSID(URLs.OPENED_DOCUMENT_LINK, driver.current_url),
            doc_id)
        page = RegulationDocumentPage(driver, link)
        page.open()
        page.register_and_send_enter_regulation_document()
        page.send_medo()

        TestRegulationNotification.NPA_ID = page.create_and_send_answer(
            page.modify_npa_type(regulation_type, 1),
            TestRegulationNotification.NPA_ID, True)

        self.enter_in_acc(driver)
        link = MainFunc.take_DNSID(URLs.REGULATION_CONTROL_LINK,
                                   driver.current_url)
        page = RegulationControlPage(driver, link)
        page.open()
        page.enter_npa_identificator_field(TestRegulationNotification.NPA_ID)
        page.send_message_key_date(date, field_name)

        link = MainFunc.take_DNSID(URLs.SYSTEM_NOTIFY_LINK, driver.current_url)
        page = SystemNotificationPage(driver, link)
        page.open()
        page.write_in_doc(TestRegulationNotification.NPA_ID, field_name,
                          regulation_type, date)
Example #16
0
def delete_osmf_info(driver, osmf_type, text):
    link = MainFunc.take_DNSID(osmf_type, driver.current_url)
    page = OSMFInformationSettings(driver, link)
    page.open()
    page.delete_information_type(text)
Example #17
0
from pages.main_functions import MainFunc

SERVER = MainFunc.config()


class URLs:
    # Все документы
    AUTH_LINK = SERVER + "/auth.php"
    OPENED_DOCUMENT_LINK = SERVER + "/document.card.php?"

    # Regulation документы
    REGULATION_LINK = OPENED_DOCUMENT_LINK + "category=6&r_category=4&card_type=2&version_id=2"
    CHANGE_INFO_LINK = OPENED_DOCUMENT_LINK + "category=6&r_category=4&card_type=2&request_type=59"

    # Внутренние заявки
    ENTER_REQUEST_LINK = OPENED_DOCUMENT_LINK + "category=6&r_category=4&card_type=1"

    # СОГЛы
    OUT_SOGL_LINK = OPENED_DOCUMENT_LINK + "category=6&r_category=1"
    OUT_OG_SOGL_LINK = OPENED_DOCUMENT_LINK + "category=6&r_category=3"
    ENTER_SOGL_LINK = OPENED_DOCUMENT_LINK + "category=6&r_category=4"
    ORD_SOGL_LINK = OPENED_DOCUMENT_LINK + "category=6&r_category=5"

    # Настройки
    SETTINGS_LINK = SERVER + "/settings.php?"

    # Настройки/Настройка системных уведомлений
    SYSTEM_NOTIFY_LINK = SERVER + "/public/notify/system/?"

    # Настройки/Администрирование заявок Regulation
    ADMINISTRATION_REGULATION_REQUEST = SERVER + "/public/regulation/settings/?"