def test_996(self): page = BookingQuestionsPage() # STEP2 page.open() time.sleep(3) assert page.my_questions_question[0].get_attribute( 'textContent') == question1edited_text assert page.my_questions_question[1].get_attribute( 'textContent') == question2edited_text assert page.my_questions_question[2].get_attribute( 'textContent') == question3edited_text page.my_questions_edit_button.click() # STEP3 assert page.question1_title.get_attribute( 'textContent') == 'Question 1' assert page.question2_title.get_attribute( 'textContent') == 'Question 2' assert page.question3_title.get_attribute( 'textContent') == 'Question 3' assert page.is_element_present('add_question_plus_button') == True assert page.is_element_present('remove_button') == True assert len(page.remove_button) == 3 assert page.question_text[0].get_attribute( 'value') == question1edited_text assert page.question_text[1].get_attribute( 'value') == question2edited_text assert page.question_text[2].get_attribute( 'value') == question3edited_text select = Select(page.answer_type[0]) assert select.first_selected_option.text == 'Dropdown' assert page.answer_type_msg[0].get_attribute( 'textContent' ) == 'Guests will only select one of the options below.' select = Select(page.applies_to[0]) assert select.first_selected_option.text == 'Entire Booking' assert page.applies_to_msg[0].get_attribute( 'textContent') == 'This question will relate to the whole booking.' select = Select(page.answer_type[1]) assert select.first_selected_option.text == 'Checklist' assert page.answer_type_msg[1].get_attribute( 'textContent') == 'Guests may select one or several options below.' select = Select(page.applies_to[1]) assert select.first_selected_option.text == 'Entire Booking' assert page.applies_to_msg[1].get_attribute( 'textContent') == 'This question will relate to the whole booking.' assert page.is_element_present('add_option_button') == False assert len(page.add_option_button) == 3 assert page.add_option_button[0].is_displayed() assert page.add_option_button[1].is_displayed() assert page.is_element_present('dropdown_fields') == False assert len(page.dropdown_fields) == 6 assert page.dropdown_fields[0].is_displayed() assert page.dropdown_fields[1].is_displayed() assert page.dropdown_fields[2].is_displayed() assert page.dropdown_fields[3].is_displayed() select = Select(page.answer_type[2]) assert select.first_selected_option.text == 'Text Input' assert page.answer_type_msg[2].get_attribute( 'textContent' ) == 'Guests will write out their own answer to this question.' select = Select(page.applies_to[2]) assert select.first_selected_option.text == 'Entire Booking' assert page.applies_to_msg[2].get_attribute( 'textContent') == 'This question will relate to the whole booking.' assert page.dropdown_fields[0].get_attribute('value') == 'US' assert page.dropdown_fields[1].get_attribute('value') == 'Belarus' assert page.dropdown_fields[2].get_attribute('value') == 'Beer' assert page.dropdown_fields[3].get_attribute('value') == 'Milk' page.remove_button[2].click() # STEP4 time.sleep(2) assert page.is_element_present('question3_title') == False assert len(page.dropdown_fields) == 4 assert len(page.answer_type) == 2 assert len(page.answer_type_msg) == 2 page.remove_button[1].click() # STEP5 time.sleep(2) assert page.is_element_present('question2_title') == False assert len(page.dropdown_fields) == 2 assert len(page.answer_type) == 1 assert len(page.answer_type_msg) == 1 get_driver().execute_script("window.scrollTo(0, 0)") time.sleep(5) page.remove_button[0].click() # STEP6 time.sleep(2) assert page.is_element_present('question1_title') == False assert len(page.dropdown_fields) == 0 assert len(page.answer_type) == 0 assert len(page.answer_type_msg) == 0 assert page.add_question_plus_button.is_displayed() page.save_changes_button.click() # STEP7 time.sleep(3) assert page.my_questions_no_questions_msg.get_attribute( 'innerText' ) == "You don't have any questions added! Click Edit below to add some." assert len(page.my_questions_question) == 0 page.my_questions_edit_button.click() # STEP8 time.sleep(2) assert page.add_question_plus_button.is_displayed()
def test_993(self): page = BookingQuestionsPage() #STEP2 page.open() page.add_question_plus_button.click() #STEP3 assert page.question1_title.get_attribute( 'textContent') == 'Question 1' assert page.is_element_present('remove_button') == True assert page.question_text[0].get_attribute('value') == '' select = Select(page.answer_type[0]) assert select.first_selected_option.text == '' assert page.is_element_present('add_option_button') == True select = Select(page.applies_to[0]) assert select.first_selected_option.text == 'Entire Booking' assert page.applies_to_msg[0].get_attribute( 'textContent') == 'This question will relate to the whole booking.' assert page.is_element_present('add_question_plus_button') == True page.question_text[0].send_keys(question1_text) #STEP4 select = Select(page.answer_type[0]) #STEP5 select.select_by_visible_text('Text Input') assert page.is_element_present('add_option_button') == False assert page.answer_type_msg[0].get_attribute( 'textContent' ) == 'Guests will write out their own answer to this question.' select = Select(page.applies_to[0]) #STEP6 select.select_by_visible_text('Each Ticket') assert page.applies_to_msg[0].get_attribute( 'textContent' ) == 'This question will be asked of each ticket buyer.' page.add_question_plus_button.click() #STEP7 assert page.question2_title.get_attribute( 'textContent') == 'Question 2' assert len(page.remove_button) == 2 assert len(page.question_text) == 2 assert page.question_text[1].get_attribute('value') == '' assert len(page.answer_type) == 2 select = Select(page.answer_type[1]) assert select.first_selected_option.text == '' assert len(page.add_option_button) == 2 assert page.is_element_present('add_option_button') == False assert page.add_option_button[1].is_displayed() select = Select(page.applies_to[1]) assert select.first_selected_option.text == 'Entire Booking' assert page.applies_to_msg[1].get_attribute( 'textContent') == 'This question will relate to the whole booking.' assert page.is_element_present('add_question_plus_button') == True page.question_text[1].send_keys(question2_text) # STEP8 select = Select(page.answer_type[1]) # STEP9 select.select_by_visible_text('Dropdown') assert page.add_option_button[1].is_displayed() assert page.is_element_present('add_option_button') == False assert page.answer_type_msg[1].get_attribute( 'textContent' ) == 'Guests will only select one of the options below.' assert len(page.dropdown_fields) == 4 assert page.dropdown_fields[2].is_displayed() assert page.dropdown_fields[3].is_displayed() page.dropdown_fields[2].send_keys('QA') # STEP10 page.dropdown_fields[3].send_keys('DEV') page.add_option_button[1].click() # STEP11 assert len(page.dropdown_fields) == 5 assert page.dropdown_fields[4].is_displayed() page.dropdown_fields[4].send_keys('PM') # STEP12 select = Select(page.applies_to[1]) # STEP13 select.select_by_visible_text('Each Ticket') assert page.applies_to_msg[1].get_attribute( 'textContent' ) == 'This question will be asked of each ticket buyer.' page.add_question_plus_button.click() # STEP14 assert page.question3_title.get_attribute( 'textContent') == 'Question 3' assert len(page.remove_button) == 3 assert len(page.question_text) == 3 assert page.question_text[2].get_attribute('value') == '' assert len(page.answer_type) == 3 select = Select(page.answer_type[2]) assert select.first_selected_option.text == '' assert len(page.add_option_button) == 3 assert page.is_element_present('add_option_button') == False assert page.add_option_button[2].is_displayed() select = Select(page.applies_to[2]) assert select.first_selected_option.text == 'Entire Booking' assert page.applies_to_msg[2].get_attribute( 'textContent') == 'This question will relate to the whole booking.' assert page.is_element_present('add_question_plus_button') == True page.question_text[2].send_keys(question3_text) # STEP15 select = Select(page.answer_type[2]) # STEP16 select.select_by_visible_text('Checklist') assert page.add_option_button[2].is_displayed() assert page.is_element_present('add_option_button') == False assert page.answer_type_msg[2].get_attribute( 'textContent') == 'Guests may select one or several options below.' assert len(page.dropdown_fields) == 7 assert page.dropdown_fields[5].is_displayed() assert page.dropdown_fields[6].is_displayed() page.dropdown_fields[5].send_keys('Good') # STEP17 page.dropdown_fields[6].send_keys('Not Bad') select = Select(page.applies_to[2]) # STEP18 select.select_by_visible_text('Each Ticket') assert page.applies_to_msg[2].get_attribute( 'textContent' ) == 'This question will be asked of each ticket buyer.' page.save_changes_button.click() #STEP19 time.sleep(3) assert page.my_questions_msg.get_attribute( 'textContent' ) == 'Guests will answer these questions while booking for all activities.' assert len(page.my_questions_question) == 3 assert page.my_questions_question[0].get_attribute( 'textContent') == question1_text assert page.my_questions_question[1].get_attribute( 'textContent') == question2_text assert page.my_questions_question[2].get_attribute( 'textContent') == question3_text
def test_994(self): page = BookingQuestionsPage() # STEP2 page.open() page.my_questions_edit_button.click() # STEP3 time.sleep(2) assert page.question1_title.get_attribute( 'textContent') == 'Question 1' assert page.question2_title.get_attribute( 'textContent') == 'Question 2' assert page.question3_title.get_attribute( 'textContent') == 'Question 3' assert page.is_element_present('add_question_plus_button') == True assert page.is_element_present('remove_button') == True assert len(page.remove_button) == 3 assert page.question_text[0].get_attribute('value') == question1_text assert page.question_text[1].get_attribute('value') == question2_text assert page.question_text[2].get_attribute('value') == question3_text select = Select(page.answer_type[0]) assert select.first_selected_option.text == 'Text Input' assert page.answer_type_msg[0].get_attribute( 'textContent' ) == 'Guests will write out their own answer to this question.' select = Select(page.applies_to[0]) assert select.first_selected_option.text == 'Each Ticket' assert page.applies_to_msg[0].get_attribute( 'textContent' ) == 'This question will be asked of each ticket buyer.' select = Select(page.answer_type[1]) assert select.first_selected_option.text == 'Dropdown' assert page.answer_type_msg[1].get_attribute( 'textContent' ) == 'Guests will only select one of the options below.' select = Select(page.applies_to[1]) assert select.first_selected_option.text == 'Each Ticket' assert page.applies_to_msg[1].get_attribute( 'textContent' ) == 'This question will be asked of each ticket buyer.' assert page.is_element_present('add_option_button') == False assert len(page.add_option_button) == 3 assert page.add_option_button[1].is_displayed() assert page.add_option_button[2].is_displayed() assert page.is_element_present('dropdown_fields') == False assert len(page.dropdown_fields) == 7 assert page.dropdown_fields[2].is_displayed() assert page.dropdown_fields[3].is_displayed() assert page.dropdown_fields[4].is_displayed() assert page.dropdown_fields[5].is_displayed() assert page.dropdown_fields[6].is_displayed() select = Select(page.answer_type[2]) assert select.first_selected_option.text == 'Checklist' assert page.answer_type_msg[2].get_attribute( 'textContent') == 'Guests may select one or several options below.' select = Select(page.applies_to[2]) assert select.first_selected_option.text == 'Each Ticket' assert page.applies_to_msg[2].get_attribute( 'textContent' ) == 'This question will be asked of each ticket buyer.' assert page.dropdown_fields[2].get_attribute('value') == 'QA' assert page.dropdown_fields[3].get_attribute('value') == 'DEV' assert page.dropdown_fields[4].get_attribute('value') == 'PM' assert page.dropdown_fields[5].get_attribute('value') == 'Good' assert page.dropdown_fields[6].get_attribute('value') == 'Not Bad' page.question_text[0].clear() # STEP4 page.question_text[0].send_keys('New question number ONE') select = Select(page.answer_type[0]) # STEP5 select.select_by_visible_text('Checklist') assert page.add_option_button[0].is_displayed() assert page.is_element_present('add_option_button') == True assert page.answer_type_msg[0].get_attribute( 'textContent') == 'Guests may select one or several options below.' assert page.dropdown_fields[0].is_displayed() assert page.dropdown_fields[1].is_displayed() page.dropdown_fields[0].send_keys( 'First Answer for 1st question') # STEP6 page.dropdown_fields[1].send_keys('2nd Answer for question nubmer 1') select = Select(page.applies_to[0]) # STEP7 select.select_by_visible_text('Entire Booking') assert page.applies_to_msg[0].get_attribute( 'textContent') == 'This question will relate to the whole booking.' page.question_text[1].clear() # STEP8 page.question_text[1].send_keys('2nd NEW question') select = Select(page.answer_type[1]) # STEP9 select.select_by_visible_text('Text Input') assert page.is_element_present('add_option_button') == False assert page.answer_type_msg[1].get_attribute( 'textContent' ) == 'Guests will write out their own answer to this question.' select = Select(page.applies_to[1]) # STEP10 select.select_by_visible_text('Entire Booking') assert page.applies_to_msg[1].get_attribute( 'textContent') == 'This question will relate to the whole booking.' page.question_text[2].clear() # STEP11 page.question_text[2].send_keys('NEW QUESTION #3') select = Select(page.answer_type[2]) # STEP12 select.select_by_visible_text('Dropdown') assert page.add_option_button[2].is_displayed() assert page.is_element_present('add_option_button') == False assert page.answer_type_msg[2].get_attribute( 'textContent' ) == 'Guests will only select one of the options below.' assert len(page.dropdown_fields) == 7 assert page.dropdown_fields[5].is_displayed() assert page.dropdown_fields[6].is_displayed() page.dropdown_fields[5].clear() page.dropdown_fields[6].clear() page.dropdown_fields[5].send_keys( '3rd question - 1st answer') # STEP13 page.dropdown_fields[6].send_keys('2nd Answer for question nubmer 3') select = Select(page.applies_to[2]) # STEP14 select.select_by_visible_text('Entire Booking') assert page.applies_to_msg[2].get_attribute( 'textContent') == 'This question will relate to the whole booking.' page.remove_button[2].click() # STEP15 assert page.is_element_present('question3_title') == False assert len(page.dropdown_fields) == 5 assert len(page.answer_type) == 2 assert len(page.answer_type_msg) == 2 page.cancel_button.click() # STEP 16 time.sleep(3) assert page.my_questions_msg.get_attribute( 'textContent' ) == 'Guests will answer these questions while booking for all activities.' assert len(page.my_questions_question) == 3 assert page.my_questions_question[0].get_attribute( 'textContent') == question1_text assert page.my_questions_question[1].get_attribute( 'textContent') == question2_text assert page.my_questions_question[2].get_attribute( 'textContent') == question3_text
def test_1000(self): page = BookingQuestionsPage()#STEP2 page.open() time.sleep(15) assert page.is_element_present('my_questions_no_questions_msg') == False assert page.custom_questions_edit_buttons[-1].is_displayed() page.custom_questions_edit_buttons[-1].click() #STEP3 time.sleep(5) assert page.question_set_name.get_attribute('value') == question_set3_name # assert len(page.selected_activities_lists) == 3 # select = Select(page.selected_activities_lists[0]) # assert select.first_selected_option.text == activity3_name # select = Select(page.selected_activities_lists[1]) # assert select.first_selected_option.text == activity4_name assert page.edit_custom_questions_titles[-3].get_attribute('textContent') == 'Question 1' assert page.edit_custom_questions_titles[-2].get_attribute('textContent') == 'Question 2' assert page.edit_custom_questions_titles[-1].get_attribute('textContent') == 'Question 3' assert page.is_element_present('add_question_plus_button') == True assert page.is_element_present('remove_button') == True assert len(page.remove_button) == 3 assert page.question_text[0].get_attribute('value') == question1edited_text assert page.question_text[1].get_attribute('value') == question2edited_text assert page.question_text[2].get_attribute('value') == question3edited_text assert len(page.add_option_button) == 3 assert page.is_element_present('add_option_button') == False select = Select(page.answer_type[0]) select.select_by_visible_text('Checklist') assert page.add_option_button[0].is_displayed() assert page.answer_type_msg[0].get_attribute('textContent') == 'Guests may select one or several options below.' select = Select(page.applies_to[0]) assert select.first_selected_option.text == 'Each Ticket' assert page.applies_to_msg[0].get_attribute( 'textContent') == 'This question will be asked of each ticket buyer.' select = Select(page.answer_type[1]) assert select.first_selected_option.text == 'Text Input' assert page.answer_type_msg[1].get_attribute( 'textContent') == 'Guests will write out their own answer to this question.' select = Select(page.applies_to[1]) assert select.first_selected_option.text == 'Each Ticket' assert page.applies_to_msg[1].get_attribute( 'textContent') == 'This question will be asked of each ticket buyer.' assert page.is_element_present('add_option_button') == False select = Select(page.answer_type[2]) assert select.first_selected_option.text == 'Dropdown' assert page.add_option_button[2].is_displayed() assert page.answer_type_msg[2].get_attribute('textContent') == 'Guests will only select one of the options below.' select = Select(page.applies_to[2]) assert select.first_selected_option.text == 'Each Ticket' assert page.applies_to_msg[2].get_attribute( 'textContent') == 'This question will be asked of each ticket buyer.' assert page.dropdown_fields[0].get_attribute('value') == 'US' assert page.dropdown_fields[1].get_attribute('value') == 'Not US' assert page.dropdown_fields[4].get_attribute('value') == 'Teacher' assert page.dropdown_fields[5].get_attribute('value') == 'Builder' page.remove_button[2].click() # STEP4 time.sleep(2) assert page.edit_custom_questions_titles[-2].get_attribute('textContent') == 'Question 1' assert page.edit_custom_questions_titles[-1].get_attribute('textContent') == 'Question 2' assert len(page.dropdown_fields) == 4 assert len(page.answer_type) == 2 assert len(page.answer_type_msg) == 2 page.remove_button[1].click() # STEP5 time.sleep(2) assert page.edit_custom_questions_titles[-1].get_attribute('textContent') == 'Question 1' assert len(page.dropdown_fields) == 2 assert len(page.answer_type) == 1 assert len(page.answer_type_msg) == 1 page.save_changes_button.click() # STEP6 time.sleep(3) get_driver().refresh() time.sleep(15) assert page.custom_questions_msg.get_attribute('textContent') == 'Create an additional set of questions that can be asked for selected activities.' assert page.custom_questions_titles[-1].is_displayed() assert page.custom_questions_titles[-1].get_attribute('textContent') == question_set3_name assert page.my_questions_question[-1].get_attribute('textContent') == question1edited_text page.custom_questions_edit_buttons[-1].click() # STEP7 time.sleep(5) assert page.question_set_name.get_attribute('value') == question_set3_name assert page.edit_custom_questions_titles[-1].get_attribute('textContent') == 'Question 1' assert page.is_element_present('add_question_plus_button') == True assert page.is_element_present('remove_button') == True assert len(page.remove_button) == 1 assert page.question_text[0].get_attribute('value') == question1edited_text assert len(page.add_option_button) == 1 assert page.is_element_present('add_option_button') == True select = Select(page.answer_type[0]) select.select_by_visible_text('Checklist') assert page.add_option_button[0].is_displayed() assert page.answer_type_msg[0].get_attribute('textContent') == 'Guests may select one or several options below.' select = Select(page.applies_to[0]) assert select.first_selected_option.text == 'Each Ticket' assert page.applies_to_msg[0].get_attribute( 'textContent') == 'This question will be asked of each ticket buyer.' assert page.dropdown_fields[0].get_attribute('value') == 'US' assert page.dropdown_fields[1].get_attribute('value') == 'Not US' page.remove_button[0].click() # STEP8 time.sleep(2) assert page.is_element_present('edit_custom_questions_titles') == False assert len(page.dropdown_fields) == 0 assert len(page.answer_type) == 0 assert len(page.answer_type_msg) == 0 assert page.add_question_plus_button.is_displayed() page.save_changes_button.click() # STEP9 time.sleep(3) assert page.is_element_present('my_questions_no_questions_msg') == True assert page.my_questions_no_questions_msg.get_attribute( 'innerText') == "You don't have any questions added! Click Edit below to add some." page.delete_buttons[-1].click() time.sleep(5) get_driver().refresh() if len (page.custom_questions_titles)>0: assert page.custom_questions_titles[-1].get_attribute('textContent') != question_set3_name assert page.is_element_present('my_questions_no_questions_msg') == False
def test_999(self): page = BookingQuestionsPage() # STEP2 page.open() time.sleep(10) page.custom_questions_edit_buttons[-1].click()# STEP3 time.sleep(2) assert page.question_set_name.get_attribute('value') == question_set1_name select = Select(page.selected_activities_list) assert select.first_selected_option.text == activity_name assert len(page.selected_activities_lists) == 2 assert page.edit_custom_questions_titles[-3].get_attribute('textContent') == 'Question 1' assert page.edit_custom_questions_titles[-2].get_attribute('textContent') == 'Question 2' assert page.edit_custom_questions_titles[-1].get_attribute('textContent') == 'Question 3' assert page.is_element_present('add_question_plus_button') == True assert page.is_element_present('remove_button') == True assert len(page.remove_button) == 3 assert page.question_text[0].get_attribute('value') == question1_text assert page.question_text[1].get_attribute('value') == question2_text assert page.question_text[2].get_attribute('value') == question3_text select = Select(page.answer_type[0]) assert select.first_selected_option.text == 'Text Input' assert page.answer_type_msg[0].get_attribute( 'textContent') == 'Guests will write out their own answer to this question.' select = Select(page.applies_to[0]) assert select.first_selected_option.text == 'Entire Booking' assert page.applies_to_msg[0].get_attribute( 'textContent') == 'This question will relate to the whole booking.' select = Select(page.answer_type[1]) assert select.first_selected_option.text == 'Dropdown' assert page.answer_type_msg[1].get_attribute( 'textContent') == 'Guests will only select one of the options below.' select = Select(page.applies_to[1]) assert select.first_selected_option.text == 'Entire Booking' assert page.applies_to_msg[1].get_attribute( 'textContent') == 'This question will relate to the whole booking.' assert page.is_element_present('add_option_button') == False assert len(page.add_option_button) == 3 assert page.add_option_button[1].is_displayed() assert page.add_option_button[2].is_displayed() assert page.is_element_present('dropdown_fields') == False assert len(page.dropdown_fields) == 7 assert page.dropdown_fields[2].is_displayed() assert page.dropdown_fields[3].is_displayed() assert page.dropdown_fields[4].is_displayed() assert page.dropdown_fields[5].is_displayed() assert page.dropdown_fields[6].is_displayed() select = Select(page.answer_type[2]) assert select.first_selected_option.text == 'Checklist' assert page.answer_type_msg[2].get_attribute('textContent') == 'Guests may select one or several options below.' select = Select(page.applies_to[2]) assert select.first_selected_option.text == 'Entire Booking' assert page.applies_to_msg[2].get_attribute( 'textContent') == 'This question will relate to the whole booking.' assert page.dropdown_fields[2].get_attribute('value') == 'QA' assert page.dropdown_fields[3].get_attribute('value') == 'DEV' assert page.dropdown_fields[4].get_attribute('value') == 'Good' assert page.dropdown_fields[5].get_attribute('value') == 'Not bad' assert page.dropdown_fields[6].get_attribute('value') == 'Fine, thanks' page.question_set_name.clear() # STEP4 page.question_set_name.send_keys(question_set3_name) select = Select(page.selected_activities_lists[0])#STEP5 select.select_by_visible_text(activity3_name) assert len(page.selected_activities_lists) == 2 time.sleep(2) select = Select(page.selected_activities_lists[1]) select.select_by_visible_text(activity4_name) assert len(page.selected_activities_lists) == 3 time.sleep(2) page.question_text[0].clear() # STEP6 page.question_text[0].send_keys(question1edited_text) select = Select(page.answer_type[0]) # STEP7 select.select_by_visible_text('Checklist') assert page.add_option_button[0].is_displayed() assert page.is_element_present('add_option_button') == True assert page.answer_type_msg[0].get_attribute('textContent') == 'Guests may select one or several options below.' assert len(page.dropdown_fields) == 7 assert page.dropdown_fields[0].is_displayed() assert page.dropdown_fields[1].is_displayed() page.dropdown_fields[0].send_keys('US')# STEP8 page.dropdown_fields[1].send_keys('Not US') select = Select(page.applies_to[0]) # STEP9 select.select_by_visible_text('Each Ticket') assert page.applies_to_msg[0].get_attribute( 'textContent') == 'This question will be asked of each ticket buyer.' page.question_text[1].clear() # STEP10 page.question_text[1].send_keys(question2edited_text) select = Select(page.answer_type[1]) # STEP11 select.select_by_visible_text('Text Input') assert page.is_element_present('add_option_button') == False assert page.answer_type_msg[1].get_attribute( 'textContent') == 'Guests will write out their own answer to this question.' select = Select(page.applies_to[1]) # STEP12 select.select_by_visible_text('Each Ticket') assert page.applies_to_msg[1].get_attribute( 'textContent') == 'This question will be asked of each ticket buyer.' page.question_text[2].clear() # STEP13 page.question_text[2].send_keys(question3edited_text) select = Select(page.answer_type[2]) # STEP14 select.select_by_visible_text('Dropdown') assert page.answer_type_msg[2].get_attribute( 'textContent') == 'Guests will only select one of the options below.' assert len(page.dropdown_fields) == 7 assert page.is_element_present('dropdown_fields') == False assert page.dropdown_fields[4].is_displayed() assert page.dropdown_fields[5].is_displayed() assert page.dropdown_fields[6].is_displayed() assert page.dropdown_fields[4].get_attribute('value') == 'Good' assert page.dropdown_fields[5].get_attribute('value') == 'Not bad' assert page.dropdown_fields[6].get_attribute('value') == 'Fine, thanks' page.remove_answer_button[4].click() # STEP 15 assert len(page.dropdown_fields) == 6 assert page.dropdown_fields[4].get_attribute('value') == 'Not bad' assert page.dropdown_fields[5].get_attribute('value') == 'Fine, thanks' page.dropdown_fields[4].clear() # STEP 16 page.dropdown_fields[4].send_keys('Teacher') page.dropdown_fields[5].clear() page.dropdown_fields[5].send_keys('Builder') select = Select(page.applies_to[2]) # STEP17 select.select_by_visible_text('Each Ticket') assert page.applies_to_msg[2].get_attribute( 'textContent') == 'This question will be asked of each ticket buyer.' page.save_changes_button.click() # STEP18 time.sleep(3) get_driver().refresh() time.sleep(10) assert page.custom_questions_msg.get_attribute('textContent') == 'Create an additional set of questions that can be asked for selected activities.' assert page.custom_questions_titles[-1].get_attribute('textContent') == question_set3_name assert page.my_questions_question[-3].get_attribute('textContent') == question1edited_text assert page.my_questions_question[-2].get_attribute('textContent') == question2edited_text assert page.my_questions_question[-1].get_attribute('textContent') == question3edited_text page.custom_questions_edit_buttons[-1].click() # STEP19 assert page.question_set_name.get_attribute('value') == question_set3_name assert len(page.selected_activities_lists) == 3 select = Select(page.selected_activities_lists[0]) assert select.first_selected_option.text == activity3_name select = Select(page.selected_activities_lists[1]) assert select.first_selected_option.text == activity4_name assert page.edit_custom_questions_titles[-3].get_attribute('textContent') == 'Question 1' assert page.edit_custom_questions_titles[-2].get_attribute('textContent') == 'Question 2' assert page.edit_custom_questions_titles[-1].get_attribute('textContent') == 'Question 3' assert page.is_element_present('add_question_plus_button') == True assert page.is_element_present('remove_button') == True assert len(page.remove_button) == 3 assert page.question_text[0].get_attribute('value') == question1edited_text assert page.question_text[1].get_attribute('value') == question2edited_text assert page.question_text[2].get_attribute('value') == question3edited_text assert len(page.add_option_button) == 3 assert page.is_element_present('add_option_button') == False select = Select(page.answer_type[0]) select.select_by_visible_text('Checklist') assert page.add_option_button[0].is_displayed() assert page.answer_type_msg[0].get_attribute('textContent') == 'Guests may select one or several options below.' select = Select(page.applies_to[0]) assert select.first_selected_option.text == 'Each Ticket' assert page.applies_to_msg[0].get_attribute( 'textContent') == 'This question will be asked of each ticket buyer.' select = Select(page.answer_type[1]) assert select.first_selected_option.text == 'Text Input' assert page.answer_type_msg[1].get_attribute( 'textContent') == 'Guests will write out their own answer to this question.' select = Select(page.applies_to[1]) assert select.first_selected_option.text == 'Each Ticket' assert page.applies_to_msg[1].get_attribute( 'textContent') == 'This question will be asked of each ticket buyer.' assert page.is_element_present('add_option_button') == False select = Select(page.answer_type[2]) assert select.first_selected_option.text == 'Dropdown' assert page.add_option_button[2].is_displayed() assert page.answer_type_msg[2].get_attribute('textContent') == 'Guests will only select one of the options below.' select = Select(page.applies_to[2]) assert select.first_selected_option.text == 'Each Ticket' assert page.applies_to_msg[2].get_attribute( 'textContent') == 'This question will be asked of each ticket buyer.' assert page.dropdown_fields[0].get_attribute('value') == 'US' assert page.dropdown_fields[1].get_attribute('value') == 'Not US' assert page.dropdown_fields[4].get_attribute('value') == 'Teacher' assert page.dropdown_fields[5].get_attribute('value') == 'Builder'
def test_997(self): get_driver().maximize_window() page = loginpage() page.open() page.login_field.send_keys(admin_login) page.password_field.send_keys(admin_password) page.button.click() page = BookingQuestionsPage()#STEP1 page.open() time.sleep(12) page.custom_questions_add_question_set_plus_button.click()#STEP2 time.sleep(2) assert page.is_element_present('question_set_name') == True assert page.is_element_present('selected_activities_list') == True assert page.is_element_present('add_question_plus_button') == True page.question_set_name.send_keys(question_set1_name)#STEP3 select = Select(page.selected_activities_list)#STEP4 select.select_by_visible_text(activity_name) assert len(page.selected_activities_lists) == 2 page.add_question_plus_button.click()#STEP5 time.sleep(2) assert page.question1_custom_title.get_attribute('textContent') == 'Question 1' assert page.is_element_present('remove_button') == True assert page.question_text[0].get_attribute('value') == '' select = Select(page.answer_type[0]) assert select.first_selected_option.text == '' assert page.is_element_present('add_option_button') == True select = Select(page.applies_to[0]) assert select.first_selected_option.text == 'Entire Booking' assert page.applies_to_msg[0].get_attribute('textContent') == 'This question will relate to the whole booking.' assert page.is_element_present('add_question_plus_button') == True page.question_text[0].send_keys(question1_text) # STEP6 select = Select(page.answer_type[0])#STEP7 select.select_by_visible_text('Text Input') assert page.is_element_present('add_option_button') == False assert page.answer_type_msg[0].get_attribute('textContent') == 'Guests will write out their own answer to this question.' select = Select(page.applies_to[0])#STEP8 assert select.first_selected_option.text == 'Entire Booking' assert page.applies_to_msg[0].get_attribute('textContent') == 'This question will relate to the whole booking.' page.add_question_plus_button.click()#STEP9 assert page.question2_custom_title.get_attribute('textContent') == 'Question 2' assert len(page.remove_button) == 2 assert len(page.question_text) == 2 assert page.question_text[1].get_attribute('value') == '' assert len(page.answer_type) == 2 select = Select(page.answer_type[1]) assert select.first_selected_option.text == '' assert len(page.add_option_button) == 2 assert page.is_element_present('add_option_button') == False assert page.add_option_button[1].is_displayed() select = Select(page.applies_to[1]) assert select.first_selected_option.text == 'Entire Booking' assert page.applies_to_msg[1].get_attribute('textContent') == 'This question will relate to the whole booking.' assert page.is_element_present('add_question_plus_button') == True page.question_text[1].send_keys(question2_text) #STEP10 select = Select(page.answer_type[1]) # STEP11 select.select_by_visible_text('Dropdown') assert page.add_option_button[1].is_displayed() assert page.is_element_present('add_option_button') == False assert page.answer_type_msg[1].get_attribute('textContent') == 'Guests will only select one of the options below.' assert len(page.dropdown_fields) == 4 assert page.dropdown_fields[2].is_displayed() assert page.dropdown_fields[3].is_displayed() page.dropdown_fields[2].send_keys('QA') # STEP12 page.dropdown_fields[3].send_keys('DEV') select = Select(page.applies_to[1]) # STEP13 assert select.first_selected_option.text == 'Entire Booking' assert page.applies_to_msg[1].get_attribute('textContent') == 'This question will relate to the whole booking.' page.add_question_plus_button.click() # STEP14 assert page.question3_custom_title.get_attribute('textContent') == 'Question 3' assert len(page.remove_button) == 3 assert len(page.question_text) == 3 assert page.question_text[2].get_attribute('value') == '' assert len(page.answer_type) == 3 select = Select(page.answer_type[2]) assert select.first_selected_option.text == '' assert len(page.add_option_button) == 3 assert page.is_element_present('add_option_button') == False assert page.add_option_button[2].is_displayed() select = Select(page.applies_to[2]) assert select.first_selected_option.text == 'Entire Booking' assert page.applies_to_msg[2].get_attribute('textContent') == 'This question will relate to the whole booking.' assert page.is_element_present('add_question_plus_button') == True page.question_text[2].send_keys(question3_text) # STEP15 select = Select(page.answer_type[2]) # STEP16 select.select_by_visible_text('Checklist') assert page.add_option_button[2].is_displayed() assert page.is_element_present('add_option_button') == False assert page.answer_type_msg[2].get_attribute('textContent') == 'Guests may select one or several options below.' assert len(page.dropdown_fields) == 6 assert page.dropdown_fields[4].is_displayed() assert page.dropdown_fields[5].is_displayed() page.add_option_button[2].click()# STEP17 assert len(page.dropdown_fields) == 7 assert page.dropdown_fields[6].is_displayed() page.dropdown_fields[4].send_keys('Good') # STEP18 page.dropdown_fields[5].send_keys('Not bad') page.dropdown_fields[6].send_keys('Fine, thanks') select = Select(page.applies_to[2]) # STEP19 assert select.first_selected_option.text == 'Entire Booking' assert page.applies_to_msg[2].get_attribute('textContent') == 'This question will relate to the whole booking.' page.save_changes_button.click()# STEP20 time.sleep(3) get_driver().refresh() time.sleep(15) assert page.custom_questions_msg.get_attribute('textContent') == 'Create an additional set of questions that can be asked for selected activities.' assert page.custom_questions_titles[-1].get_attribute('textContent') == question_set1_name assert page.my_questions_question[-3].get_attribute('textContent') == question1_text assert page.my_questions_question[-2].get_attribute('textContent') == question2_text assert page.my_questions_question[-1].get_attribute('textContent') == question3_text
def test_998(self): page = BookingQuestionsPage() # STEP2 page.open() time.sleep(10) page.custom_questions_edit_buttons[-1].click()# STEP3 time.sleep(2) assert page.question_set_name.get_attribute('value') == question_set1_name select = Select(page.selected_activities_list) assert select.first_selected_option.text == activity_name assert page.edit_custom_questions_titles[-3].get_attribute('textContent') == 'Question 1' assert page.edit_custom_questions_titles[-2].get_attribute('textContent') == 'Question 2' assert page.edit_custom_questions_titles[-1].get_attribute('textContent') == 'Question 3' assert page.is_element_present('add_question_plus_button') == True assert page.is_element_present('remove_button') == True assert len(page.remove_button) == 3 assert page.question_text[0].get_attribute('value') == question1_text assert page.question_text[1].get_attribute('value') == question2_text assert page.question_text[2].get_attribute('value') == question3_text select = Select(page.answer_type[0]) assert select.first_selected_option.text == 'Text Input' assert page.answer_type_msg[0].get_attribute( 'textContent') == 'Guests will write out their own answer to this question.' select = Select(page.applies_to[0]) assert select.first_selected_option.text == 'Entire Booking' assert page.applies_to_msg[0].get_attribute( 'textContent') == 'This question will relate to the whole booking.' select = Select(page.answer_type[1]) assert select.first_selected_option.text == 'Dropdown' assert page.answer_type_msg[1].get_attribute( 'textContent') == 'Guests will only select one of the options below.' select = Select(page.applies_to[1]) assert select.first_selected_option.text == 'Entire Booking' assert page.applies_to_msg[1].get_attribute( 'textContent') == 'This question will relate to the whole booking.' assert page.is_element_present('add_option_button') == False assert len(page.add_option_button) == 3 assert page.add_option_button[1].is_displayed() assert page.add_option_button[2].is_displayed() assert page.is_element_present('dropdown_fields') == False assert len(page.dropdown_fields) == 7 assert page.dropdown_fields[2].is_displayed() assert page.dropdown_fields[3].is_displayed() assert page.dropdown_fields[4].is_displayed() assert page.dropdown_fields[5].is_displayed() assert page.dropdown_fields[6].is_displayed() select = Select(page.answer_type[2]) assert select.first_selected_option.text == 'Checklist' assert page.answer_type_msg[2].get_attribute('textContent') == 'Guests may select one or several options below.' select = Select(page.applies_to[2]) assert select.first_selected_option.text == 'Entire Booking' assert page.applies_to_msg[2].get_attribute( 'textContent') == 'This question will relate to the whole booking.' assert page.dropdown_fields[2].get_attribute('value') == 'QA' assert page.dropdown_fields[3].get_attribute('value') == 'DEV' assert page.dropdown_fields[4].get_attribute('value') == 'Good' assert page.dropdown_fields[5].get_attribute('value') == 'Not bad' assert page.dropdown_fields[6].get_attribute('value') == 'Fine, thanks' page.question_set_name.clear() # STEP4 page.question_set_name.send_keys(question_set2_name) select = Select(page.selected_activities_list)#STEP5 select.select_by_visible_text(activity2_name) assert len(page.selected_activities_lists) == 2 time.sleep(10) page.question_text[0].clear() # STEP6 page.question_text[0].send_keys('New question number ONE') select = Select(page.answer_type[0]) # STEP7 select.select_by_visible_text('Dropdown') assert page.add_option_button[0].is_displayed() assert page.is_element_present('add_option_button') == True assert page.answer_type_msg[0].get_attribute('textContent') == 'Guests will only select one of the options below.' assert page.dropdown_fields[0].is_displayed() assert page.dropdown_fields[1].is_displayed() page.dropdown_fields[0].send_keys('First Answer for 1st question') # STEP8 page.dropdown_fields[1].send_keys('2nd Answer for question nubmer 1') select = Select(page.applies_to[0]) # STEP9 select.select_by_visible_text('Each Ticket') assert page.applies_to_msg[0].get_attribute( 'textContent') == 'This question will be asked of each ticket buyer.' page.question_text[1].clear() # STEP10 page.question_text[1].send_keys('2nd NEW question') select = Select(page.answer_type[1]) # STEP11 select.select_by_visible_text('Checklist') assert page.add_option_button[1].is_displayed() assert page.is_element_present('add_option_button') == True assert page.answer_type_msg[1].get_attribute('textContent') == 'Guests may select one or several options below.' assert page.dropdown_fields[2].get_attribute('value') == 'QA' assert page.dropdown_fields[3].get_attribute('value') == 'DEV' page.dropdown_fields[2].clear()# STEP12 page.dropdown_fields[2].send_keys('PM') page.dropdown_fields[3].clear() page.dropdown_fields[3].send_keys('CEO') select = Select(page.applies_to[1]) # STEP13 select.select_by_visible_text('Each Ticket') assert page.applies_to_msg[1].get_attribute( 'textContent') == 'This question will be asked of each ticket buyer.' page.question_text[2].clear() # STEP14 page.question_text[2].send_keys('NEW QUESTION #3') select = Select(page.answer_type[2]) # STEP15 select.select_by_visible_text('Text Input') assert page.is_element_present('add_option_button') == False assert page.answer_type_msg[2].get_attribute( 'textContent') == 'Guests will write out their own answer to this question.' select = Select(page.applies_to[2]) # STEP16 select.select_by_visible_text('Each Ticket') assert page.applies_to_msg[2].get_attribute( 'textContent') == 'This question will be asked of each ticket buyer.' page.remove_button[2].click() # STEP17 time.sleep(7) assert page.is_element_present('edit_custom_questions_titles') == False assert len(page.dropdown_fields) == 4 assert len(page.answer_type) == 2 assert len(page.answer_type_msg) == 2 page.cancel_button.click() # STEP 18 time.sleep(5) get_driver().refresh() time.sleep(15) assert page.custom_questions_msg.get_attribute('textContent') == 'Create an additional set of questions that can be asked for selected activities.' assert page.custom_questions_titles[-1].get_attribute('textContent') == question_set1_name assert page.my_questions_question[-3].get_attribute('textContent') == question1_text assert page.my_questions_question[-2].get_attribute('textContent') == question2_text assert page.my_questions_question[-1].get_attribute('textContent') == question3_text page.custom_questions_edit_buttons[-1].click() # STEP19 time.sleep(2) assert page.question_set_name.get_attribute('value') == question_set1_name select = Select(page.selected_activities_list) assert select.first_selected_option.text == activity_name assert page.edit_custom_questions_titles[-3].get_attribute('textContent') == 'Question 1' assert page.edit_custom_questions_titles[-2].get_attribute('textContent') == 'Question 2' assert page.edit_custom_questions_titles[-1].get_attribute('textContent') == 'Question 3' assert page.is_element_present('add_question_plus_button') == True assert page.is_element_present('remove_button') == True assert len(page.remove_button) == 3 assert page.question_text[0].get_attribute('value') == question1_text assert page.question_text[1].get_attribute('value') == question2_text assert page.question_text[2].get_attribute('value') == question3_text select = Select(page.answer_type[0]) assert select.first_selected_option.text == 'Text Input' assert page.answer_type_msg[0].get_attribute( 'textContent') == 'Guests will write out their own answer to this question.' select = Select(page.applies_to[0]) assert select.first_selected_option.text == 'Entire Booking' assert page.applies_to_msg[0].get_attribute( 'textContent') == 'This question will relate to the whole booking.' select = Select(page.answer_type[1]) assert select.first_selected_option.text == 'Dropdown' assert page.answer_type_msg[1].get_attribute( 'textContent') == 'Guests will only select one of the options below.' select = Select(page.applies_to[1]) assert select.first_selected_option.text == 'Entire Booking' assert page.applies_to_msg[1].get_attribute( 'textContent') == 'This question will relate to the whole booking.' assert page.is_element_present('add_option_button') == False assert len(page.add_option_button) == 3 assert page.add_option_button[1].is_displayed() assert page.add_option_button[2].is_displayed() assert page.is_element_present('dropdown_fields') == False assert len(page.dropdown_fields) == 7 assert page.dropdown_fields[2].is_displayed() assert page.dropdown_fields[3].is_displayed() assert page.dropdown_fields[4].is_displayed() assert page.dropdown_fields[5].is_displayed() assert page.dropdown_fields[6].is_displayed() select = Select(page.answer_type[2]) assert select.first_selected_option.text == 'Checklist' assert page.answer_type_msg[2].get_attribute('textContent') == 'Guests may select one or several options below.' select = Select(page.applies_to[2]) assert select.first_selected_option.text == 'Entire Booking' assert page.applies_to_msg[2].get_attribute( 'textContent') == 'This question will relate to the whole booking.' assert page.dropdown_fields[2].get_attribute('value') == 'QA' assert page.dropdown_fields[3].get_attribute('value') == 'DEV' assert page.dropdown_fields[4].get_attribute('value') == 'Good' assert page.dropdown_fields[5].get_attribute('value') == 'Not bad' assert page.dropdown_fields[6].get_attribute('value') == 'Fine, thanks'