Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DONE: Verify Default Check-in and out Date in the Date picker #24

Merged
merged 1 commit into from
Feb 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion features-frontend/flights_hotels.feature.robot
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,6 @@ Scenario: Verify Default Check-in and out Date in the Date picker
[Documentation] Verify that the date picker appears when accessing the Date field,
... with the current date selected by Default
[Tags] Medium
Given I access to the calender
Given I click on the calender button
Then I see the selected dates by default

70 changes: 62 additions & 8 deletions step-definition/frontend/flights_hotels.steps.robot
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,24 @@ I click the clear button for the destination field
The destination field input is cleared
Element Attribute Value Should Be ${DESTINATION_FLIGHT_HOTEL_FIELD} value ${EMPTY}

I access to the calender
Click Element ${DATE_PICKER_FLIGHTS_HOTELS}
I click on the calender button
Click Element ${CALENDER}

I see the selected dates by default
${selected_date} Get Element Attribute ${DATE_PICKER_FLIGHTS_HOTELS} value
Log ${selected_date}
Wait Until Page Contains Element ${SELECTED_DATE_FOR_FLIGHTS_HOTELS}
${selected_dates}= Get WebElements ${SELECTED_DATE_FOR_FLIGHTS_HOTELS}
${length}= Get Length ${selected_dates}

Should Be True ${length} >= 2

FOR ${index} IN RANGE ${length}
${date}= Get From List ${selected_dates} ${index}
${text}= Get Text ${date}
Log Selected date: ${text}
END

${departure_date}= Get Text ${selected_dates[0]}
${return_date}= Get Text ${selected_dates[-1]}

# I click on clear destination button
# Wait Until Element Is Visible ${a} 5s
Expand All @@ -132,10 +144,52 @@ I select a random departure from the list







========== PURUSH ==========

I access sample definition view and add multiple candidats
Wait Until Page Contains Element ${BTN_SAMPLE_DEFINITONS} 10s
Click Button ${BTN_SAMPLE_DEFINITONS}
Wait Until Element Is Visible ${ADD_CANDIDATE_BTN}
Click Element ${ADD_CANDIDATE_BTN}
Sleep 5s
# OTHER TAB: From Line 22 TO Line 23
# Click Element ${OTHER_TAB}
# Sleep 5s

Click Element ${OTHER_TAB}
Sleep 5s
FOR ${i} IN RANGE 0 10
${j} Evaluate ${i}+1
${i} Convert To String ${i}
${FORMULA_DESCRIPTION_DEL_TEMP} Replace In String ${FORMULA_DESCRIPTION_GEN} ${i}
${Value_Input} = Catenate formula description ${j}
Input Text ${FORMULA_DESCRIPTION_DEL_TEMP} ${Value_Input}
Click Element ${ADD_ANOTHER_FORMULA_BTN}
END
Click Element ${ADD_CANDIDATE_DRAWER_BTN}
Sleep 8s
Click Element ${EXIT_CANDIDATE_DRAWER_CROSS}




The Table of the application Sample contains "${Number of Items}" "${Trial No.}" "${Formula Code and Mix Components}" "${Oil availability}" "${Base dosage}" "${Packaging}" "${Actions}"
${Sample_Tab_head_lists}= Create List ${Number of Items} ${Trial No.} ${Formula Code and Mix Components} ${Oil availability} ${Base dosage} ${Packaging} ${Actions}
Wait Until Page Contains Element ${APP_SAMPLES_TAB} 20s
${App_Samples_Tab_Count} Get Element Count ${APP_SAMPLES_TAB}
${App_Samples_Tab_Count} Convert To Integer ${App_Samples_Tab_Count}
${random_table_number} Evaluate random.randint(1,${App_Samples_Tab_Count})
${random_table_number} Convert To String ${random_table_number}
${APP_SAMPLES_HEADER_RANDOM} Replace In String ${APP_SAMPLES_TAB_HEADER} ${random_table_number}
${APP_SAMPLES_HEADER_COUNT} Get Element Count ${APP_SAMPLES_HEADER_RANDOM}
FOR ${index} IN RANGE 1 ${APP_SAMPLES_HEADER_COUNT}+1
${App_Samples_Tab_Heads} Catenate SEPARATOR= ${APP_SAMPLES_HEADER_RANDOM} :nth-child(${index})
${App_Samples_Tab_Head_Text} Get Text ${App_Samples_Tab_Heads}
List Should Contain Value ${Sample_Tab_head_lists} ${App_Samples_Tab_Head_Text}
END


=======



11 changes: 3 additions & 8 deletions step-definition/frontend/webelements.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
DESTINATION_FIELD="//input[contains(@aria-label,'Where are you going?')]"
DESTINATION_LISTBOX="//div[@role='listbox']//ul//li"
DESTINATION_CITIES="//ul/li//div[contains(@class, 'a3332d346a')]"
# DESTINATION_CITIES="//div[@class='a7edcddad6 eb112f9f9a d8074b5e44' and @data-testid='autocomplete-results']"
CLEAR_BTN="css=.a83ed08757 > .fcd9eec8fb:nth-child(1) > svg"
DATE_PICKER="//button[@data-testid='date-display-field-start']"
SELECTED_DATE="//span[contains(@tabindex,'0')]"
Expand All @@ -21,12 +20,9 @@
GUEST_OPTION_BTN="(//div[@class='e22b782521'])[3]"
GUEST_POP_UP=" //div[@class='b067f3afe2 b3c059c742']"
ADULTS_NUMBER="//input[@id='group_adults']"
# CHILDREN_NO="//input[@id='group_children']"
CHILDREN_NUMBER="//div[2]/input"
ROOM_NUMBER="//input[@id='no_rooms']"
GUEST_FIELD="css=//span[@class='a8887b152e c7ce171153']"
# ADULT_MINUS_BTN="//div/button[@class='a83ed08757 c21c56c305 f38b6daa18 d691166b09 ab98298258 bb803d8689 e91c91fa93'][1]"
# ADULT_PLUS_BTN="(//div[@class='bfb38641b0'])[1]//button[@class='a83ed08757 c21c56c305 f38b6daa18 d691166b09 ab98298258 bb803d8689 f4d78af12a']"
ADULT_MINUS_BTN="(//div[@class='bfb38641b0'])[1]//button[contains(@class, 'e91c91fa93')]"
ADULT_PLUS_BTN="(//div[@class='bfb38641b0'])[1]//button[contains(@class, 'f4d78af12a')]"
CHILDREN_MINUS_BTN="(//div[@class='bfb38641b0'])[2]//button[contains(@class, 'e91c91fa93')]"
Expand All @@ -43,10 +39,7 @@
FLIGHT_HOTEL_PAGE="https://booking-dp-fr.lastminute.com/?utm_source=booking&utm_medium=whitelabel&utm_campaign=homepage_tab&token="
FLIGHT_HOTEL_BTN="//span[text()='Flight + Hotel']"
DEPARTURE_FLIGHT_HOTEL_FIELD="//input[@placeholder='City or airport']"
# LIST_OF_DEPARTURE="//div[@class='d-1oa70av']"
# LIST_OF_DEPARTURE="//div[@class='d-1oa70av']/div/section/ul"
LIST_OF_DEPARTURE="//ul[@id=':R2q6j6lalqmt2mmH2:']/li/span"
# DESTINATION_FLIGHT_HOTEL_FIELD="(//div[@class='d-younp9 ed5mks94'])[1]"
FLIGHT_HOTEL_LANGUAGE="css=#Icon-globe_svg__filled"
FLIGHT_HOTEL_ENGLISH="//a[@href='https://booking-dp.lastminute.com/']"
FLIGHT_HOTEL_ACCEPT_COOKIES="css=button.iubenda-cs-accept-btn"
Expand All @@ -56,4 +49,6 @@
ASSIGNED_DESTINATION="(//div[@class='d-28ke2m ed5mks93'])[2]/input"
CLEAR_DEPARTURE_DESTINATION="(//button[@class='d-l65ey4 ed5mks91'])[1]"
SWITCH_BUTTON="css=.ButtonFlip-module__flipIcon___2sPKY > svg"
DATE_PICKER_FLIGHTS_HOTELS="(//button[@aria-label='When?'])[1]"
CALENDER="(//button[@aria-label='When?'])[1]"
SELECTED_DATE_FOR_FLIGHTS_HOTELS="//div[@class='d-1ola07z']//button[@aria-selected='true']"
ROOMS_HOTELS="css=//button[@fdprocessedid='60gups']"