def test_operator_queue_successful(self, config, teardown): operator = random_user(UserRoles.OPERATOR) user = GkrUserSteps(config) db_user = GkrDbSteps(config) queue_page = QueuePage(config) ticket_data_dialog = TicketDataDialog(config) db_user.create_user(operator) global queue_operator_mobile queue_operator_mobile = operator.customers_data.mobile_phone day = (datetime.now() + timedelta(days=1)).strftime('%Y-%m-%d') print_day = (datetime.now() + timedelta(days=1)).strftime('%d.%m.%Y') locality = 'с. Александровка' street = 'ул. Виноградная' house = rand_num(2) flat = rand_num(2) user.login(operator.customers_data.mobile_phone, operator.password) user.should_see_element(queue_page) customer = user.fill_random_operator_queue() global queue_customer_by_operator_mobile queue_customer_by_operator_mobile = customer.mobile_phone user.chooses_from_select(queue_page.SERVICE, Services.DEAL_REGISTER.name) user.chooses_from_select(queue_page.OBJECT_TYPE, ObjectTypes.STROI_OBJECT.name) user.chooses_from_select(queue_page.CITY, Departments.BEL_DEP.short_name) user.enters_suggest(queue_page.LOCALITY, locality) user.enters_suggest(queue_page.STREET, street) user.enters_text(queue_page.HOUSE, house) user.enters_text(queue_page.FLAT, flat) user.set_calendar_date(queue_page.CALENDAR, day) user.set_calendar_time(queue_page.CALENDAR, None) time = queue_page.CALENDAR.time_list[0].text user.clicks(queue_page.SUBMIT) user.waits_for_element_displayed(ticket_data_dialog) user.should_see_element_with_text(ticket_data_dialog.TICKET_TIME, (print_day + ' ' + time)) user.should_see_element_with_text(ticket_data_dialog.TICKET_SERVICE, Services.DEAL_REGISTER.name) user.should_see_element_with_text(ticket_data_dialog.TICKET_DEP, Departments.BEL_DEP.name) user.should_see_element_with_text( ticket_data_dialog.TICKET_CUSTOMER, customer.surname + " " + customer.name + " " + customer.patronymic) user.should_see_element_with_text( ticket_data_dialog.TICKET_ADDRESS, Departments.BEL_DEP.short_name + " " + locality + " " + street + " д. " + house + " кв. " + flat) db_user.should_see_service_group_id( ticket_data_dialog.TICKET_NUMBER.element.text, UserTypes.CUSTOMER.id)
def test_customer_queue_successful(self, config, teardown): customer = random_user(UserRoles.CUSTOMER) user = GkrUserSteps(config) db_user = GkrDbSteps(config) profile_page = ProfilePage(config) queue_page = QueuePage(config) ticket_data_dialog = TicketDataDialog(config) db_user.create_user(customer) global queue_mobile queue_mobile = customer.customers_data.mobile_phone day = (datetime.now() + timedelta(days=1)).strftime('%Y-%m-%d') print_day = (datetime.now() + timedelta(days=1)).strftime('%d.%m.%Y') locality = 'с. Александровка' street = 'ул. Виноградная' house = rand_num(2) + '/1a' flat = rand_num(2) + 'б' user.login(customer.customers_data.mobile_phone, customer.password) user.should_see_element(profile_page) user.selects_from_main_menu(MainMenu.QUEUE) user.waits_for_element_displayed(queue_page) user.chooses_from_select(queue_page.SERVICE, Services.SINGLE_WINDOW.name) user.chooses_from_select(queue_page.OBJECT_TYPE, ObjectTypes.DOMOVLADENIE.name) user.chooses_from_select(queue_page.CITY, Departments.BEL_DEP.short_name) user.enters_suggest(queue_page.LOCALITY, locality) user.enters_suggest(queue_page.STREET, street) user.enters_text(queue_page.HOUSE, house) user.enters_text(queue_page.FLAT, flat) user.enters_text(queue_page.CAPTCHA, '11111') user.clicks(queue_page.SUBMIT) user.waits_for_element_displayed(queue_page.CALENDAR) user.set_calendar_date(queue_page.CALENDAR, day) user.set_calendar_time(queue_page.CALENDAR, None) time = queue_page.CALENDAR.time_list[0].text user.clicks(queue_page.SUBMIT) user.waits_for_element_displayed(ticket_data_dialog) ticket_id = ticket_data_dialog.TICKET_NUMBER.element.text user.should_see_element_with_text(ticket_data_dialog.TICKET_TIME, (print_day + ' ' + time)) user.should_see_element_with_text(ticket_data_dialog.TICKET_SERVICE, Services.SINGLE_WINDOW.name) user.should_see_element_with_text(ticket_data_dialog.TICKET_DEP, Departments.BEL_DEP.name) user.should_see_element_with_text( ticket_data_dialog.TICKET_CUSTOMER, customer.customers_data.surname + " " + customer.customers_data.name + " " + customer.customers_data.patronymic) user.should_see_element_with_text( ticket_data_dialog.TICKET_ADDRESS, Departments.BEL_DEP.short_name + " " + locality + " " + street + " д. " + house + " кв. " + flat) db_user.should_see_service_group_id(ticket_id, UserTypes.CUSTOMER.id) user.close(ticket_data_dialog) user.selects_from_main_menu(MainMenu.QUEUE) user.waits_for_element_displayed(queue_page) user.clicks(queue_page.SUBMIT) user.waits_for_element_displayed = user.waits_for_element_displayed( queue_page.ERROR_TEXT) user.should_see_text_in_list( queue_page.ERROR_TEXT, ErrorMessages.CUSTOMER_REGISTRATION_LIMIT.text % (customer.customers_data.serial, customer.customers_data.no, ticket_id)) user.opens(Urls.PROFILE) history_item = profile_page.TICKETS_HISTORY.get_history_by_id( ticket_id) user.should_see_history_services(history_item, ticket_id, Services.SINGLE_WINDOW.name, print_day + ' ' + time)