flights_gui_henry_tests 1.8.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +15 -0
- data/Gemfile +3 -0
- data/features/data/home-offers-config.csv +883 -0
- data/features/data/host.yml +72 -0
- data/features/data/miles.yml +216 -0
- data/features/data/search.yml +27 -0
- data/features/data/sites.yml +39 -0
- data/features/data/tag_microsoft.yml +68 -0
- data/features/step_definitions/checkout/agencia_steps.rb +6 -0
- data/features/step_definitions/checkout/chat_steps.rb +43 -0
- data/features/step_definitions/checkout/checkout_steps.rb +144 -0
- data/features/step_definitions/checkout/cupones_steps.rb +26 -0
- data/features/step_definitions/checkout/error_messages.rb +251 -0
- data/features/step_definitions/checkout/seguros_steps.rb +78 -0
- data/features/step_definitions/checkout/thanks_steps.rb +75 -0
- data/features/step_definitions/content/contents_steps.rb +140 -0
- data/features/step_definitions/desambiguation/disambiguation_airports_steps.rb +73 -0
- data/features/step_definitions/desambiguation/disambiguation_city_steps.rb +43 -0
- data/features/step_definitions/filter/filters_airlines.rb +38 -0
- data/features/step_definitions/filter/filters_airports_steps.rb +31 -0
- data/features/step_definitions/filter/filters_price_steps.rb +87 -0
- data/features/step_definitions/filter/filters_stops_steps.rb +44 -0
- data/features/step_definitions/filter/filters_time_steps.rb +143 -0
- data/features/step_definitions/filter/matrix_steps.rb +249 -0
- data/features/step_definitions/landing/landing_checkout_steps.rb +45 -0
- data/features/step_definitions/landing/landing_filters_steps.rb +17 -0
- data/features/step_definitions/landing/landing_home_alerts_steps.rb +21 -0
- data/features/step_definitions/landing/landing_home_steps.rb +82 -0
- data/features/step_definitions/landing/landing_long_tail.rb +58 -0
- data/features/step_definitions/landing/landing_negative_steps.rb +127 -0
- data/features/step_definitions/landing/landing_passenger_review_steps.rb +8 -0
- data/features/step_definitions/landing/landing_steps.rb +325 -0
- data/features/step_definitions/orders/orders.rb +67 -0
- data/features/step_definitions/others/advancedgui_steps.rb +28 -0
- data/features/step_definitions/others/advancednogui_steps.rb +34 -0
- data/features/step_definitions/others/anticipatedsearch_steps.rb +13 -0
- data/features/step_definitions/others/flights_tracker_steps.rb +73 -0
- data/features/step_definitions/others/generic_steps.rb +35 -0
- data/features/step_definitions/others/newsletter_steps.rb +50 -0
- data/features/step_definitions/others/one_day_search.rb +58 -0
- data/features/step_definitions/others/print_steps.rb +26 -0
- data/features/step_definitions/others/querystringparameters_steps.rb +6 -0
- data/features/step_definitions/others/recommendation_steps.rb +80 -0
- data/features/step_definitions/others/render_steps.rb +70 -0
- data/features/step_definitions/others/tag_steps.rb +157 -0
- data/features/step_definitions/others/upgrade_bussines_steps.rb +27 -0
- data/features/step_definitions/results/load_steps.rb +69 -0
- data/features/step_definitions/results/results_steps.rb +21 -0
- data/features/step_definitions/results/search_steps.rb +82 -0
- data/features/step_definitions/search/alerts_steps.rb +132 -0
- data/features/step_definitions/search/basefare_steps.rb +64 -0
- data/features/step_definitions/search/bestprices_steps.rb +70 -0
- data/features/step_definitions/search/cross_sell_row_hoteles.rb +78 -0
- data/features/step_definitions/search/cross_sell_steps.rb +15 -0
- data/features/step_definitions/search/delays_steps.rb +67 -0
- data/features/step_definitions/search/details_steps.rb +9 -0
- data/features/step_definitions/search/ecoflights_steps.rb +9 -0
- data/features/step_definitions/search/fenix_steps.rb +119 -0
- data/features/step_definitions/search/flight_gui_steps.rb +312 -0
- data/features/step_definitions/search/miles_step.rb +13 -0
- data/features/step_definitions/search/pagination_steps.rb +41 -0
- data/features/step_definitions/search/reviews_step.rb +56 -0
- data/features/step_definitions/search/search_no_gui_steps.rb +185 -0
- data/features/step_definitions/search/wish_list_steps.rb +123 -0
- data/features/support/env.rb +61 -0
- data/features/support/lib/clusters/data/datos_new.rb +33 -0
- data/features/support/lib/clusters/details/details_cluster.rb +30 -0
- data/features/support/lib/clusters/results/landing_cluster.rb +29 -0
- data/features/support/lib/clusters/results/render_cluster.rb +43 -0
- data/features/support/lib/clusters/results_cluster.rb +140 -0
- data/features/support/lib/clusters.rb +5 -0
- data/features/support/lib/helpers/browser.rb +212 -0
- data/features/support/lib/helpers/checkout.rb +31 -0
- data/features/support/lib/helpers/clusters.rb +234 -0
- data/features/support/lib/helpers/landing.rb +117 -0
- data/features/support/lib/helpers/render.rb +135 -0
- data/features/support/lib/helpers.rb +5 -0
- data/features/support/lib/price.rb +66 -0
- data/features/support/lib/services/fenix.rb +14 -0
- data/features/support/lib/services/landing.rb +18 -0
- data/features/support/lib/services/results.rb +62 -0
- data/features/support/lib/services.rb +4 -0
- data/features/support/matchers.rb +120 -0
- data/features/support/redefinitions.rb +42 -0
- data/features/tests/checkout/agency.feature +33 -0
- data/features/tests/checkout/button_cac.feature +52 -0
- data/features/tests/checkout/chat.feature +20 -0
- data/features/tests/checkout/cupones.feature +54 -0
- data/features/tests/checkout/error_messages.feature +64 -0
- data/features/tests/checkout/integration.feature +215 -0
- data/features/tests/checkout/low_cost.feature +55 -0
- data/features/tests/checkout/seguros.feature +37 -0
- data/features/tests/contents/costs.feature +29 -0
- data/features/tests/contents/rules.feature +58 -0
- data/features/tests/contents/webcheckin.feature +26 -0
- data/features/tests/desambiguation/airports.feature +89 -0
- data/features/tests/desambiguation/city.feature +86 -0
- data/features/tests/filters/filters.feature +160 -0
- data/features/tests/fixes/advancedgui.feature +171 -0
- data/features/tests/fixes/advancednogui.feature +60 -0
- data/features/tests/fixes/book_no_gui.feature +21 -0
- data/features/tests/fixes/cross_sell_row_hoteles.feature +70 -0
- data/features/tests/fixes/facebook.feature +31 -0
- data/features/tests/fixes/landing_home_alerts.feature +82 -0
- data/features/tests/fixes/matrix_stops.feature +104 -0
- data/features/tests/fixes/one_day_search.feature +63 -0
- data/features/tests/fixes/print.feature +87 -0
- data/features/tests/fixes/searches_no_gui.feature +85 -0
- data/features/tests/landing/landing_alerts.feature +93 -0
- data/features/tests/landing/landing_checkout.feature +286 -0
- data/features/tests/landing/landing_filters.feature +176 -0
- data/features/tests/landing/landing_home.feature +68 -0
- data/features/tests/landing/landing_integration.feature +153 -0
- data/features/tests/landing/landing_long_tail.feature +162 -0
- data/features/tests/landing/landing_matrix.feature +156 -0
- data/features/tests/landing/landing_negative.feature +157 -0
- data/features/tests/landing/landing_orders.feature +107 -0
- data/features/tests/landing/landing_pagination.feature +142 -0
- data/features/tests/landing/landing_passenger_review.feature +139 -0
- data/features/tests/landing/landing_positive.feature +155 -0
- data/features/tests/landing/landing_reviews.feature +139 -0
- data/features/tests/landing/landing_tags.feature +148 -0
- data/features/tests/matrix/matrix_airlines.feature +104 -0
- data/features/tests/matrix/matrix_fare_chart.feature +24 -0
- data/features/tests/matrix/matrix_price.feature +35 -0
- data/features/tests/others/alerts.feature +89 -0
- data/features/tests/others/anticipatedsearch.feature +82 -0
- data/features/tests/others/flights_tracker.feature +94 -0
- data/features/tests/others/newsletter.feature +131 -0
- data/features/tests/others/querystringparameters.feature +82 -0
- data/features/tests/others/recommendation.feature +170 -0
- data/features/tests/others/semaphore.feature +206 -0
- data/features/tests/others/upgrade_bussines.feature +100 -0
- data/features/tests/search/basefare.feature +88 -0
- data/features/tests/search/itineraries.feature +85 -0
- data/features/tests/search/orders.feature +100 -0
- data/features/tests/search/pagination.feature +70 -0
- data/features/tests/search/reviews.feature +84 -0
- data/features/tests/search/searches.feature +197 -0
- data/features/tests/search/wish_list.feature +102 -0
- data/flights_gui_henry_tests.gemspec +32 -0
- data/henry-context.yml +14733 -0
- metadata +324 -0
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
When /^Verifico que sean visibles los campos obligatorios$/ do
|
|
2
|
+
container = BROWSER.fieldset(:id,'passengers')
|
|
3
|
+
index = 0
|
|
4
|
+
@search.adt.times do |adulto|
|
|
5
|
+
container.text_field(:id,"passenger-first-name-#{index}").should visible
|
|
6
|
+
container.text_field(:id,"passenger-last-name-#{index}").should visible
|
|
7
|
+
index += 1
|
|
8
|
+
end
|
|
9
|
+
@search.cnn.times do |adulto|
|
|
10
|
+
container.text_field(:id,"passenger-first-name-#{index}").should visible
|
|
11
|
+
container.text_field(:id,"passenger-last-name-#{index}").should visible
|
|
12
|
+
container.select_list(:id,"passenger-birthday-day-#{index}").should visible
|
|
13
|
+
container.select_list(:id,"passenger-birthday-month-#{index}").should visible
|
|
14
|
+
container.select_list(:id,"passenger-birthday-year-#{index}").should visible
|
|
15
|
+
index += 1
|
|
16
|
+
end
|
|
17
|
+
@search.inf.times do |adulto|
|
|
18
|
+
container.text_field(:id,"passenger-first-name-#{index}").should visible
|
|
19
|
+
container.text_field(:id,"passenger-last-name-#{index}").should visible
|
|
20
|
+
container.select_list(:id,"passenger-birthday-day-#{index}").should visible
|
|
21
|
+
container.select_list(:id,"passenger-birthday-month-#{index}").should visible
|
|
22
|
+
container.select_list(:id,"passenger-birthday-year-#{index}").should visible
|
|
23
|
+
index += 1
|
|
24
|
+
end
|
|
25
|
+
container = BROWSER.fieldset(:id,'payment')
|
|
26
|
+
container.radio(:value,/CREDIT/).should visible
|
|
27
|
+
container.select_list(:id,'card-brand').should visible
|
|
28
|
+
container.text_field(:id,'card-number').should visible
|
|
29
|
+
container.select_list(:id,'card-expiration-month').should visible
|
|
30
|
+
container.select_list(:id,'card-expiration-year').should visible
|
|
31
|
+
container.text_field(:id,'security-code').should visible
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
When /^Verifico que se desplieguen las alertas de campos vacios$/ do
|
|
35
|
+
container = BROWSER.fieldset(:id,'passengers')
|
|
36
|
+
BROWSER.link(:id,'submit').click
|
|
37
|
+
(@search.adt+@search.cnn+@search.inf).times do |time|
|
|
38
|
+
container.span(:id,"passenger-first-name-#{time}-missing_field").should visible
|
|
39
|
+
end
|
|
40
|
+
container = BROWSER.fieldset(:id,'payment')
|
|
41
|
+
container.span(:id,"card-number-missing_field").should visible
|
|
42
|
+
container.span(:id,"expiration-date-missing_field").should visible
|
|
43
|
+
container.span(:id,"security-code-missing_field").should visible
|
|
44
|
+
container.span(:id,"owner-name-missing_field").should visible
|
|
45
|
+
container = BROWSER.fieldset(:id,'contact')
|
|
46
|
+
container.span(:id,"contact-email-missing_field").should visible
|
|
47
|
+
container.span(:id,"contact-email-repeat-missing_field").should visible
|
|
48
|
+
container.span(:id,"phone-0-missing_field").should visible
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
When /^Verifico que se desplieguen las alertas de campos con datos invalidos$/ do
|
|
52
|
+
container = BROWSER.fieldset(:id,'passengers')
|
|
53
|
+
(@search.adt+@search.cnn+@search.inf).times do |time|
|
|
54
|
+
container.text_field(:id,"passenger-first-name-#{time}").set("123")
|
|
55
|
+
container.text_field(:id,"passenger-last-name-#{time}").set("123")
|
|
56
|
+
BROWSER.link(:id,'submit').click
|
|
57
|
+
container.span(:id,"passenger-first-name-#{time}-invalid_name").should visible
|
|
58
|
+
container.span(:id,"passenger-last-name-#{time}-invalid_name").should visible
|
|
59
|
+
container.text_field(:id,"passenger-first-name-#{time}").set("@%")
|
|
60
|
+
container.text_field(:id,"passenger-last-name-#{time}").set("@%")
|
|
61
|
+
BROWSER.link(:id,'submit').click
|
|
62
|
+
container.span(:id,"passenger-first-name-#{time}-invalid_name").should visible
|
|
63
|
+
container.span(:id,"passenger-last-name-#{time}-invalid_name").should visible
|
|
64
|
+
end
|
|
65
|
+
container = BROWSER.fieldset(:id,'payment')
|
|
66
|
+
container.text_field(:id,'security-code').set("052545454")
|
|
67
|
+
BROWSER.link(:id,'submit').click
|
|
68
|
+
container.span(:id,"security-code-invalid_card_security_code").should visible
|
|
69
|
+
container.select_list(:id,'card-expiration-month').select "1"
|
|
70
|
+
container.select_list(:id,'card-expiration-year').select (Date.today.year).to_s
|
|
71
|
+
BROWSER.link(:id,'submit').click
|
|
72
|
+
container.span(:id,"expiration-date-invalid_date_min").should visible
|
|
73
|
+
container.text_field(:id,'owner-name').set("diegoqaromero")
|
|
74
|
+
BROWSER.link(:id,'submit').click
|
|
75
|
+
container.span(:id,"owner-name-invalid_card_owner_name").should visible
|
|
76
|
+
container = BROWSER.fieldset(:id,'contact')
|
|
77
|
+
container.text_field(:id,'contact-email').set("123")
|
|
78
|
+
BROWSER.link(:id,'submit').click
|
|
79
|
+
container.span(:id,"contact-email-invalid_email").should visible
|
|
80
|
+
container.text_field(:id,'contact-email-repeat').set("123")
|
|
81
|
+
BROWSER.link(:id,'submit').click
|
|
82
|
+
container.span(:id,"contact-email-repeat-invalid_email").should visible
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
When /^Verifico intentos de compra con datos invalidos$/ do
|
|
86
|
+
container = BROWSER.fieldset(:id,'passengers')
|
|
87
|
+
plus_name=["A","B","C","D","E","F","G","H","I","J","k"]
|
|
88
|
+
(@search.adt+@search.cnn+@search.inf).times do |time|
|
|
89
|
+
container.text_field(:id,"passenger-first-name-#{time}").set("123")
|
|
90
|
+
BROWSER.link(:id,'submit').click
|
|
91
|
+
BROWSER.div(:id,'popup-checkout-transition-template').should_not visible
|
|
92
|
+
container.text_field(:id,"passenger-first-name-#{time}").set("@%")
|
|
93
|
+
BROWSER.link(:id,'submit').click
|
|
94
|
+
BROWSER.div(:id,'popup-checkout-transition-template').should_not visible
|
|
95
|
+
container.text_field(:id,"passenger-first-name-#{time}").set(nil)
|
|
96
|
+
BROWSER.link(:id,'submit').click
|
|
97
|
+
BROWSER.div(:id,'popup-checkout-transition-template').should_not visible
|
|
98
|
+
container.text_field(:id,"passenger-first-name-#{time}").set("Martin QA" + plus_name[time])
|
|
99
|
+
end
|
|
100
|
+
(@search.adt+@search.cnn+@search.inf).times do |time|
|
|
101
|
+
container.text_field(:id,"passenger-last-name-#{time}").set("123")
|
|
102
|
+
BROWSER.link(:id,'submit').click
|
|
103
|
+
BROWSER.div(:id,'popup-checkout-transition-template').should_not visible
|
|
104
|
+
container.text_field(:id,"passenger-last-name-#{time}").set("@%")
|
|
105
|
+
BROWSER.link(:id,'submit').click
|
|
106
|
+
BROWSER.div(:id,'popup-checkout-transition-template').should_not visible
|
|
107
|
+
container.text_field(:id,"passenger-last-name-#{time}").set(nil)
|
|
108
|
+
BROWSER.link(:id,'submit').click
|
|
109
|
+
BROWSER.div(:id,'popup-checkout-transition-template').should_not visible
|
|
110
|
+
container.text_field(:id,"passenger-last-name-#{time}").set("Diez" + plus_name[time])
|
|
111
|
+
end
|
|
112
|
+
container = BROWSER.fieldset(:id,'payment')
|
|
113
|
+
container.text_field(:id,'security-code').set("052545454")
|
|
114
|
+
BROWSER.link(:id,'submit').click
|
|
115
|
+
BROWSER.div(:id,'popup-checkout-transition-template').should_not visible
|
|
116
|
+
container.text_field(:id,'security-code').set(nil)
|
|
117
|
+
BROWSER.link(:id,'submit').click
|
|
118
|
+
BROWSER.div(:id,'popup-checkout-transition-template').should_not visible
|
|
119
|
+
container.select_list(:id,'card-brand').select "Visa" #Se puede hacer un select con regexp?
|
|
120
|
+
container.text_field(:id,'card-number').set("32454532532")
|
|
121
|
+
BROWSER.link(:id,'submit').click
|
|
122
|
+
BROWSER.div(:id,'popup-checkout-transition-template').should_not visible
|
|
123
|
+
container.text_field(:id,'card-number').set(nil)
|
|
124
|
+
BROWSER.link(:id,'submit').click
|
|
125
|
+
BROWSER.div(:id,'popup-checkout-transition-template').should_not visible
|
|
126
|
+
container.text_field(:id,'card-number').set("4242424242424242") #Parametrizar
|
|
127
|
+
container.text_field(:id,'security-code').set("123") #Parametrizar
|
|
128
|
+
container.select_list(:id,'card-expiration-month').select (Date.today.month - 1).to_s
|
|
129
|
+
container.select_list(:id,'card-expiration-year').select (Date.today.year).to_s
|
|
130
|
+
BROWSER.link(:id,'submit').click
|
|
131
|
+
BROWSER.div(:id,'popup-checkout-transition-template').should_not visible
|
|
132
|
+
container.select_list(:id,'card-expiration-month').select (Date.today.month).to_s
|
|
133
|
+
container.select_list(:id,'card-expiration-year').select (Date.today.year).to_s
|
|
134
|
+
container.text_field(:id,"owner-name").set(nil)
|
|
135
|
+
BROWSER.link(:id,'submit').click
|
|
136
|
+
BROWSER.div(:id,'popup-checkout-transition-template').should_not visible
|
|
137
|
+
container.text_field(:id,"owner-name").set("diegoqaromero")
|
|
138
|
+
BROWSER.link(:id,'submit').click
|
|
139
|
+
BROWSER.div(:id,'popup-checkout-transition-template').should_not visible
|
|
140
|
+
container.text_field(:id,"owner-name").set "Diego qa romero"
|
|
141
|
+
container = BROWSER.fieldset(:id,'contact')
|
|
142
|
+
container.text_field(:id,"contact-email").set("123")
|
|
143
|
+
BROWSER.link(:id,'submit').click
|
|
144
|
+
BROWSER.div(:id,'popup-checkout-transition-template').should_not visible
|
|
145
|
+
container.text_field(:id,"contact-email").set(nil)
|
|
146
|
+
BROWSER.link(:id,'submit').click
|
|
147
|
+
BROWSER.div(:id,'popup-checkout-transition-template').should_not visible
|
|
148
|
+
container.text_field(:id,"contact-email").set("testvuelos@despegar.com")
|
|
149
|
+
container.text_field(:id,"contact-email-repeat").set("123")
|
|
150
|
+
BROWSER.link(:id,'submit').click
|
|
151
|
+
BROWSER.div(:id,'popup-checkout-transition-template').should_not visible
|
|
152
|
+
container.text_field(:id,"contact-email-repeat").set(nil)
|
|
153
|
+
BROWSER.link(:id,'submit').click
|
|
154
|
+
BROWSER.div(:id,'popup-checkout-transition-template').should_not visible
|
|
155
|
+
container.text_field(:id,"contact-email-repeat").set("testvuelos@despegar.com")
|
|
156
|
+
container.text_field(:id,"phone-number-0").set ("#{}")
|
|
157
|
+
BROWSER.link(:id,'submit').click
|
|
158
|
+
BROWSER.div(:id,'popup-checkout-transition-template').should_not visible
|
|
159
|
+
container.text_field(:id,"phone-number-0").set (nil)
|
|
160
|
+
BROWSER.link(:id,'submit').click
|
|
161
|
+
BROWSER.div(:id,'popup-checkout-transition-template').should_not visible
|
|
162
|
+
container.text_field(:id,"phone-number-0").set("2345679")
|
|
163
|
+
BROWSER.checkbox(:id=>'read-agreement').set(true)
|
|
164
|
+
BROWSER.link(:id,'submit').click
|
|
165
|
+
BROWSER.div(:id,'popup-checkout-transition-template').should_not visible
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
When /^Verifico texto de error de banco vacio$/ do
|
|
169
|
+
BROWSER.empty_other_bank_name_error.should be_visible
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
When /^Verifico que se muestre el combo de codigo de telefono de pais$/ do
|
|
173
|
+
doc = Hpricot.parse(BROWSER.html)
|
|
174
|
+
BROWSER.text_field(:id,'country-code-0').should visible
|
|
175
|
+
BROWSER.text_field(:id,'country-code-0').set("AR")
|
|
176
|
+
BROWSER.text_field(:id,'country-code-0').send_keys :enter
|
|
177
|
+
sleep(0.5)
|
|
178
|
+
BROWSER.text_field(:id,'country-code-0').value.should equal("Argentina (54)")
|
|
179
|
+
BROWSER.text_field(:id,'country-code-0').set("XX")
|
|
180
|
+
BROWSER.text_field(:id,'country-code-0').send_keys :tab
|
|
181
|
+
BROWSER.text_field(:id,'country-code-0').value.should equal("XX")
|
|
182
|
+
#BROWSER.span(:id,'phone-0-invalid').should visible
|
|
183
|
+
BROWSER.text_field(:id,'country-code-0').set("AR")
|
|
184
|
+
BROWSER.text_field(:id,'country-code-0').send_keys :enter
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
When /^Verifico que se muestren los campos de factura$/ do
|
|
188
|
+
container = BROWSER.fieldset(:id,'invoice')
|
|
189
|
+
container.div(:id,'invoiceDefinition.selected.value').should visible
|
|
190
|
+
container.div(:id,'invoiceDefinition.invoiceDataDefinition').should_not visible
|
|
191
|
+
container.checkbox(:id,'invoice-check').should visible
|
|
192
|
+
container.checkbox(:id,'invoice-check').set(true)
|
|
193
|
+
container.text_field(:id,'invoice-fiscal-id').should visible
|
|
194
|
+
container.text_field(:id,'invoice-card-holder-name').should visible
|
|
195
|
+
container.select_list(:id,'invoice-country').should visible
|
|
196
|
+
container.select_list(:id,'invoice-state').should visible
|
|
197
|
+
container.text_field(:id,'invoice-city').should visible
|
|
198
|
+
container.text_field(:id,'invoice-street').should visible
|
|
199
|
+
if $SITE.match("MX")
|
|
200
|
+
container.text_field(:id,'invoice-email').should visible
|
|
201
|
+
container.text_field(:id,'invoice-postal-code').should visible
|
|
202
|
+
container.text_field(:id,'invoice-address-number').should visible
|
|
203
|
+
container.text_field(:id,'invoice-address-floor').should visible
|
|
204
|
+
container.text_field(:id,'invoice-address-deparment').should visible
|
|
205
|
+
container.link(:class,'search-postal-code').should visible
|
|
206
|
+
end
|
|
207
|
+
end
|
|
208
|
+
|
|
209
|
+
When /^Verifico texto de error de campos de factura vacio$/ do
|
|
210
|
+
container = BROWSER.fieldset(:id,'invoice')
|
|
211
|
+
BROWSER.link(:id,'submit').click
|
|
212
|
+
container.span(:id,'invoice-fiscal-id-missing_field').text.no_accents.should match("Por favor, ingrese el RFC de la razon social informada|Por favor, ingrese un numero de RUC")
|
|
213
|
+
if $SITE.match("MX")
|
|
214
|
+
container.span(:id,'invoice-card-holder-name-missing_field').text.no_accents.should match("Por favor, ingrese el nombre o razon social")
|
|
215
|
+
container.span(:id,'invoice-email-missing_field').text.no_accents.should match("Por favor, ingrese el e-mail donde desea recibir la factura fiscal")
|
|
216
|
+
container.span(:id,'invoice-city-missing_field').text.no_accents.should match("Por favor, ingrese la colonia del domicilio fiscal")
|
|
217
|
+
container.span(:id,'invoice-postal-code-missing_field').text.no_accents.should match("Por favor, ingrese el codigo postal del domicilio fiscal")
|
|
218
|
+
container.span(:id,'invoice-address-missing_field').text.no_accents.should match("Por favor, complete la direccion")
|
|
219
|
+
end
|
|
220
|
+
end
|
|
221
|
+
|
|
222
|
+
When /^Verifico texto de error de campos de factura con datos erroneos$/ do
|
|
223
|
+
container = BROWSER.fieldset(:id,'invoice')
|
|
224
|
+
container.text_field(:id,'invoice-fiscal-id').set("##%#}")
|
|
225
|
+
BROWSER.link(:id,'submit').click
|
|
226
|
+
if $SITE.match("MX")
|
|
227
|
+
container.span(:id,'invoice-fiscal-id-invalid_cuit').text.no_accents.should match("Por favor, ingrese un RFC valido")
|
|
228
|
+
container.text_field(:id,'invoice-email').set("qwerty")
|
|
229
|
+
BROWSER.link(:id,'submit').click
|
|
230
|
+
container.span(:id,'invoice-email-invalid_email').text.no_accents.should match("El e-mail ingresado posee caracteres invalidos. Por favor verifique la direccion ingresada")
|
|
231
|
+
elsif $SITE.match("PE")
|
|
232
|
+
container.span(:id,'invoice-fiscal-id-invalid_ruc').text.no_accents.should match("Por favor, verifique que el RUC contenga exactamente 11 digitos")
|
|
233
|
+
end
|
|
234
|
+
end
|
|
235
|
+
|
|
236
|
+
And /^Verifico los campos de cupones de descuento$/ do
|
|
237
|
+
if BROWSER.checkbox(:id,'vouchers').present?
|
|
238
|
+
BROWSER.checkbox(:id,'vouchers').set(true)
|
|
239
|
+
BROWSER.text_field(:id,'voucher-code-0').should visible("caja de texto de codigo de referencia")
|
|
240
|
+
BROWSER.link(:class,'add-voucher').should_not visible("link de agregar otro codigo de referencia")
|
|
241
|
+
BROWSER.text_field(:id,'voucher-code-0').set("233332223332223a")
|
|
242
|
+
BROWSER.checkbox(:id,"invoice-check").set(false) if BROWSER.checkbox(:id,"invoice-check").present?
|
|
243
|
+
BROWSER.checkbox(:id=>'read-agreement').set(true)
|
|
244
|
+
BROWSER.link(:id,'submit').click
|
|
245
|
+
sleep(1)
|
|
246
|
+
BROWSER.div(:id,'popup-checkout-transition-template').should_not visible
|
|
247
|
+
Watir::Wait.until(){BROWSER.span(:id,'voucher-code-0-invalid_id').should visible}
|
|
248
|
+
BROWSER.div(:class,'ux-common-warning ux-common-error').should visible
|
|
249
|
+
BROWSER.div(:class,'ux-common-warning ux-common-error').text.no_accents.downcase.should match("ocurrio un error con el codigo de referencia")
|
|
250
|
+
end
|
|
251
|
+
end
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
|
2
|
+
Then /^Verifico que se muestre correctamente la caja de seguro sin chequear$/ do
|
|
3
|
+
BROWSER.div(:id,'upselling').should visible("caja de seguros")
|
|
4
|
+
BROWSER.div(:id,'upselling').checkbox(:id,'upselling-checkbox').should visible("checkbox en la caja de seguro")
|
|
5
|
+
BROWSER.div(:id,'upselling').link(:class,'coverage').should visible("link de cobertura en la caja de seguro")
|
|
6
|
+
BROWSER.div(:id,'upselling').span(:class,/status unprotected/).should visible("texto de no estoy protegido en la caja de seguro")
|
|
7
|
+
BROWSER.div(:id,'upselling').span(:class,/status unprotected/).text.should match("No estoy protegido")
|
|
8
|
+
BROWSER.div(:id,'upselling').span(:class,"description").text.should match("ASSIST CARD")
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
When /^Chequeo el seguro$/ do
|
|
12
|
+
BROWSER.div(:id,'upselling').checkbox(:id,'upselling-checkbox').set(true)
|
|
13
|
+
Watir::Wait.until(timeout = 20){!BROWSER.div(:class,'loading').span(:class,'img').present?}
|
|
14
|
+
sleep(1)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
Then /^Verifico que se muestre correctamente la caja de seguro chequeada$/ do
|
|
18
|
+
BROWSER.div(:id,'upselling').should visible("caja de seguros")
|
|
19
|
+
BROWSER.div(:id,'upselling').checkbox(:id,'upselling-checkbox').should visible("checkbox en la caja de seguro")
|
|
20
|
+
BROWSER.div(:id,'upselling').link(:class,'coverage').should visible("link de cobertura en la caja de seguro")
|
|
21
|
+
BROWSER.div(:id,'upselling').span(:class,/status protected/).should visible("texto de estoy protegido en la caja de seguro")
|
|
22
|
+
BROWSER.div(:id,'upselling').span(:class,/status protected/).text.should match("Estoy protegido")
|
|
23
|
+
BROWSER.div(:id,'upselling').span(:class,"description").text.should match("ASSIST CARD")
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
When /^Muestro el popup de la cobertura completa$/ do
|
|
27
|
+
BROWSER.div(:id,'upselling').link(:class,'coverage').click
|
|
28
|
+
Watir::Wait.until(timeout = 20){BROWSER.div(:id,'popup-upselling-coverage-template').present?}
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
Then /^Verifico que se muestre correctamente el popup de la cobertura completa para destino "(.*)"$/ do |destino|
|
|
32
|
+
popup = BROWSER.div(:id,'popup-upselling-coverage-template')
|
|
33
|
+
popup.div(:class,'coverage').should visible("Contenido del popup")
|
|
34
|
+
popup.text.should match_sensitive("ASSIST CARD")
|
|
35
|
+
popup.div(:class,'coverage').ul(:class,'list codes').should visible("Contenido del popup Codigos")
|
|
36
|
+
popup.div(:class,'coverage').ul(:class,'list descriptions').should visible("Contenido del popup Descripcion")
|
|
37
|
+
popup.div(:class,'coverage').ul(:class,'list values').should visible("Contenido del popup Values")
|
|
38
|
+
popup.div(:class,'coverage').ul(:class,'list values').li(:class,/row odd/).text.strip.should match(destino.match("MIA") ? 'U\$S' : "€")
|
|
39
|
+
popup.div(:class,'coverage').text.should_not is_empty
|
|
40
|
+
BROWSER.div(:class,'popup-upselling-coverage').span(:class,'popup-close-button popup-close').click
|
|
41
|
+
Watir::Wait.until(timeout = 20){!popup.div(:class,'coverage').present?}
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
And /^Elijo "(.*)" si quiero cobertura$/ do |option|
|
|
45
|
+
BROWSER.div(:id,'upselling').checkbox(:id,'upselling-checkbox').set((option=="chequear") ? true : false)
|
|
46
|
+
Watir::Wait.until(timeout = 20){!BROWSER.div(:class,'loading').span(:class,'img').present?}
|
|
47
|
+
sleep(1)
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
When /^Se encuentra la opcion de cobertura$/ do
|
|
51
|
+
unless BROWSER.div(:id,'upselling').present?
|
|
52
|
+
pending("No se encuentra la opcion de seguros")
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
And /^Verifico que el precio del seguro se muestre correctamente en el desglose$/ do
|
|
57
|
+
BROWSER.div(:id,'detail').li(:class,/item destination_service_insurance/).should visible
|
|
58
|
+
price_detail=BROWSER.div(:id,'detail').li(:class,/item destination_service_insurance/).span(:class,'amount').text
|
|
59
|
+
price_assistance=BROWSER.div(:id,'upselling').span(:class,'description').span(:class,'bold').text.gsub(/\./,'').match(/(.+)(\D)(\d+) (por persona)$/)[3]
|
|
60
|
+
price_detail.gsub(/\./,'').to_i.should be_within(4).of(price_assistance.to_i*(@search.adt+@search.cnn+@search.inf)) unless $SITE == "AR"
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
And /^Verifico que el precio del seguro no se muestre en el desglose$/ do
|
|
64
|
+
BROWSER.div(:id,'detail').li(:class,'item travel-assistance ').should_not visible
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
Then /^valido que el seguro este "(.*)"$/ do |option|
|
|
68
|
+
Watir::Wait.until(timeout = 20){BROWSER.div(:id,'upselling').present?}
|
|
69
|
+
if (option=="chequear")
|
|
70
|
+
BROWSER.div(:id,'upselling').span(:class,/status protected hidden/).text.should match("Estoy protegido")
|
|
71
|
+
else
|
|
72
|
+
BROWSER.div(:id,'upselling').span(:class,/status unprotected/).text.should match("No estoy protegido")
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
When /^existe la opcion de cobertura$/ do
|
|
77
|
+
BROWSER.div(:id,'upselling').should visible
|
|
78
|
+
end
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
And /^Verifico la opcion de compartir en facebook$/ do
|
|
2
|
+
Watir::Wait.until(timeout = 20){BROWSER.div(:id,'mi-despegar-header').present?}
|
|
3
|
+
# BROWSER.div(:id,'ticket').div(:class,'button-logged nibbler-shared-checkout-thanks-cont').should visible("caja de compratir en facebook")
|
|
4
|
+
# BROWSER.div(:id,'ticket').div(:class,'button-logged nibbler-shared-checkout-thanks-cont').div(:class,'nibbler-shared-checkout-thanks-user').should visible("usuario logueado en facebook")
|
|
5
|
+
# BROWSER.div(:id,'ticket').div(:class,'button-logged nibbler-shared-checkout-thanks-cont').div(:class,'nibbler-shared-checkout-thanks-user').p(:class,'nibbler-shared-checkout-thanks-user-name').text.should match("Tester")
|
|
6
|
+
# BROWSER.div(:id,'ticket').div(:class,'button-logged nibbler-shared-checkout-thanks-cont').link(:class,'nibbler-shared-checkout-thanks-btn share-button').should visible("Boton facebook compartir")
|
|
7
|
+
# BROWSER.div(:id,'ticket').div(:class,'button-logged nibbler-shared-checkout-thanks-cont').link(:class,'nibbler-shared-checkout-thanks-btn share-button').click
|
|
8
|
+
# Watir::Wait.until(timeout = 20){BROWSER.div(:class,'fb_dialog_content fb_dialog_iframe').present?}
|
|
9
|
+
# frame = BROWSER.div(:class,'fb_dialog_content fb_dialog_iframe').frames.first
|
|
10
|
+
# frame.div(:class,'platform_dialog_container').form(:id,'uiserver_form').div(:class,'uiAttachmentTitle').links[0].text.no_accents.should match(@search.to_city_1.name($SITE)) unless @search.description=="multipledestinations"
|
|
11
|
+
# frame.div(:class,'platform_dialog_container').form(:id,'uiserver_form').textarea(:id,'feedform_user_message').set("TEST IT")
|
|
12
|
+
# frame.div(:id,'platform_dialog_bottom_bar').input(:id,'u_0_7').click
|
|
13
|
+
# Watir::Wait.until(timeout = 20){!BROWSER.div(:class,'fb_dialog_content fb_dialog_iframe').present?}
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
When /^Verifico el boton de login de facebook$/ do
|
|
17
|
+
BROWSER.div(:id,'ticket').div(:class,'facebook-buttons').should visible("Caja de botones de facebook")
|
|
18
|
+
BROWSER.div(:id,'ticket').div(:class,'facebook-buttons').span(:class,'messages-custom-login-title').should visible("Titulo caja de botones de facebook")
|
|
19
|
+
BROWSER.div(:id,'ticket').div(:class,'facebook-buttons').ul(:class,'nibbler-shared-checkout-thanks-steps').should visible("Descripcion de pasos en caja de botones de facebook")
|
|
20
|
+
BROWSER.div(:id,'ticket').div(:class,'facebook-buttons').link(:class,'social-login nibbler-shared-checkout-thanks-btn').should visible("Link para ingresar en caja de botones de facebook")
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
When /^Verifico que el usuario se loguee en facebook$/ do
|
|
24
|
+
BROWSER.div(:id,'ticket').div(:class,'facebook-buttons').link(:class,'social-login nibbler-shared-checkout-thanks-btn').click
|
|
25
|
+
attach_browser(BROWSER, :url, "facebook")
|
|
26
|
+
Watir::Wait.until(timeout = 20){BROWSER.text_field(:id,'email').present? or BROWSER.div(:id,'ticket').div(:class,'button-logged nibbler-shared-checkout-thanks-cont').present?}
|
|
27
|
+
unless BROWSER.div(:id,'ticket').div(:class,'button-logged nibbler-shared-checkout-thanks-cont').present?
|
|
28
|
+
BROWSER.text_field(:id,'email').set("nicolas.simean@teracode.com")
|
|
29
|
+
BROWSER.text_field(:id,'pass').set("testing")
|
|
30
|
+
BROWSER.button(:id,'u_0_1').click
|
|
31
|
+
attach_browser(BROWSER, :url, ($SITE=="BR") ? "decolar" : "despegar")
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
And /^me pide confirmar permisos$/ do
|
|
36
|
+
nil.should be_true
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
And /^confirmo los permisos para loguearme en facebook$/ do
|
|
40
|
+
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
And /^Cierro la sesion de facebook$/ do
|
|
44
|
+
BROWSER.div(:id,'header').p(:class,'button-logout').link(:class,'social-logged').click
|
|
45
|
+
Watir::Wait.until(timeout = 20){!BROWSER.div(:id,'header').p(:class,'button-logout').link(:class,'social-logged').present?}
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
And /^Verifico los links del header$/ do
|
|
49
|
+
header_html = Hpricot.parse(BROWSER.div(:id,'header').html)
|
|
50
|
+
links = []
|
|
51
|
+
(header_html/"a").each do |a|
|
|
52
|
+
if a.attributes['href'] and !a.attributes['href'].match(/pacotes/)
|
|
53
|
+
if a.attributes['href'].match(/http/)
|
|
54
|
+
links << a.attributes['href']
|
|
55
|
+
else
|
|
56
|
+
links << "http://#{@search.host}" + a.attributes['href']
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
links.uniq.each do |link|
|
|
61
|
+
get = HTTParty.get(link)
|
|
62
|
+
get.code.should equal(200)
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
And /^Verifico que se muestre las ofertas de cross selling$/ do
|
|
67
|
+
BROWSER.div(:class,'ux-common-crossselling').should visible("Cross selling en gracias")
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
And /^Verifico el link de mi despegar$/ do
|
|
71
|
+
if @case_data.params['country'].upcase=="BR"
|
|
72
|
+
BROWSER.div(:class,'ux-shared-checkout-thanks-ticket-cont').text.no_accents.downcase.should match("em caso de duvidas, acesse")
|
|
73
|
+
BROWSER.div(:class,'ux-shared-checkout-thanks-ticket-cont').link(:href,/http:\/\/#{@search.host}\/meudecolar/).should visible
|
|
74
|
+
end
|
|
75
|
+
end
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
|
2
|
+
#rules
|
|
3
|
+
When /^Ingreso a la pagina de reglas "(.*)"$/ do |site|
|
|
4
|
+
set_site(site)
|
|
5
|
+
@search = MockSearchRoundtrip.new(site,$ENV,nil)
|
|
6
|
+
BROWSER.goto(@search.host + "/content/flights/rules")
|
|
7
|
+
set_cookies(BROWSER)
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
Then /^Espero que la carga devuelva "(.*)"$/ do |text|
|
|
11
|
+
BROWSER.text.should match(text)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
Then /^Verifico que el link de costos redirija correctamente$/ do
|
|
15
|
+
BROWSER.a(:class,'baggage-fees').href.should match("\/content\/flights\/baggagefees")
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
#costs
|
|
19
|
+
|
|
20
|
+
When /^Ingreso a la pagina de costos "(.*)"$/ do |site|
|
|
21
|
+
set_site(site)
|
|
22
|
+
@search = MockSearch.new(site,$ENV,nil)
|
|
23
|
+
BROWSER.goto(@search.host + "/content/flights/baggagefees")
|
|
24
|
+
set_cookies(BROWSER)
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
When /^Espero que termine de cargar la pagina de costos$/ do
|
|
28
|
+
Watir::Wait.until{BROWSER.div(:class,"tabs grid_7 omega alpha").present?}
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
When /^Hago click en el indice "(.*)"$/ do |index|
|
|
32
|
+
BROWSER.div(:class,"tabs grid_7 omega alpha").a(:class=>/grid_7 omega alpha/,:index=>index.to_i).click
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
When /^Hago click en la aerolinea "(.*)"$/ do |index|
|
|
36
|
+
BROWSER.li(:class=>"airline",:index=>index.to_i).div(:class,"airline-title").click
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
Then /^Verifico que se muestre la aerolinea "(.*)"$/ do |index|
|
|
40
|
+
BROWSER.li(:class=>"airline",:index=>index.to_i).ul(:class,"fees-category").should visible
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
Then /^Verifico que se muestre el indice "(.*)"$/ do |text|
|
|
44
|
+
BROWSER.div(:class,"tabs grid_7 omega alpha").a(:class=>"tab active grid_7 omega alpha",:index=>0).text.strip.should match(text)
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
Then /^Verifico que no se muestre el indice "(.*)"$/ do |text|
|
|
48
|
+
BROWSER.div(:class,"tabs grid_7 omega alpha").a(:class=>"tab active grid_7 omega alpha",:index=>0).text.strip.should_not match(text)
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
Then /^Verifico la correcta carga de la pagina de costos$/ do
|
|
52
|
+
BROWSER.li(:class,"airline").ul(:class,"fees-category").exists?.should be_true
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
#webcheckin
|
|
56
|
+
|
|
57
|
+
When /^Ingreso a la pagina de webcheckin "(.*)"$/ do |site|
|
|
58
|
+
set_site(site)
|
|
59
|
+
@search = MockSearch.new(site,$ENV,nil)
|
|
60
|
+
BROWSER.goto(@search.host + "/content/flights/webcheckin")
|
|
61
|
+
set_cookies(BROWSER)
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
Then /^Espero que la pagina de webcheckin cargue correctamente$/ do
|
|
65
|
+
Watir::Wait.until(timeout = 60){BROWSER.ul(:class,'airlines').present?}
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
When /^Levanto datos de aerolineas$/ do
|
|
69
|
+
doc = Hpricot.parse(BROWSER.html)
|
|
70
|
+
@airlines = (doc/"ul.airlines li")
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
Then /^Verifico cada aerolinea y que el link redireccione correctamente$/ do
|
|
74
|
+
i = 0
|
|
75
|
+
air_no_200 = []
|
|
76
|
+
@airlines.each do |airline|
|
|
77
|
+
href = (airline/"a").first.attributes['href']
|
|
78
|
+
img = (airline/"img").first.attributes
|
|
79
|
+
code = img['src'].match(/\/(..)\.png/)[1]
|
|
80
|
+
text = (airline/"h2").inner_text.strip
|
|
81
|
+
img['alt'].should match(text)
|
|
82
|
+
if code.upcase =~ /LA|DL|KLM/
|
|
83
|
+
href.should match(/www.lan.com|delta.com|klm/)
|
|
84
|
+
elsif code.upcase == 'JJ'
|
|
85
|
+
else
|
|
86
|
+
begin
|
|
87
|
+
BROWSER.ul(:class,'airlines').links[i].click
|
|
88
|
+
rescue Timeout::Error
|
|
89
|
+
puts "Timeout al ingresar al webcheckin de #{text}"
|
|
90
|
+
end
|
|
91
|
+
href.should match("content\/flights\/webcheckin\/#{code.upcase}")
|
|
92
|
+
begin
|
|
93
|
+
Watir::Wait.until(timeout = 60){BROWSER.frame(:id,'frame').present?}
|
|
94
|
+
rescue Watir::Wait::TimeoutError, Timeout::Error
|
|
95
|
+
puts "No se muestra como un frame -> #{text}"
|
|
96
|
+
end
|
|
97
|
+
if BROWSER.frame(:id,'frame').present?
|
|
98
|
+
frame = BROWSER.frame(:id,'frame')
|
|
99
|
+
begin
|
|
100
|
+
frame.src.empty?.should_not be_true
|
|
101
|
+
rescue Selenium::WebDriver::Error::UnknownError
|
|
102
|
+
puts frame
|
|
103
|
+
rescue Timeout::Error
|
|
104
|
+
puts frame
|
|
105
|
+
end
|
|
106
|
+
begin
|
|
107
|
+
respond = HTTParty.get(frame.src)
|
|
108
|
+
rescue URI::InvalidURIError
|
|
109
|
+
puts "URI::InvalidURIError -> #{text}"
|
|
110
|
+
rescue HTTParty::RedirectionTooDeep
|
|
111
|
+
puts "HTTParty::RedirectionTooDeep -> #{text}"
|
|
112
|
+
rescue EOFError
|
|
113
|
+
puts "EOFError -> #{text}"
|
|
114
|
+
rescue Errno::ECONNREFUSED
|
|
115
|
+
puts "Errno::ECONNREFUSED -> #{text}"
|
|
116
|
+
rescue SocketError
|
|
117
|
+
puts "SocketError -> #{text}"
|
|
118
|
+
rescue Errno::ECONNRESET
|
|
119
|
+
puts "Errno::ECONNRESET -> #{text}"
|
|
120
|
+
rescue Errno::ETIMEDOUT
|
|
121
|
+
air_no_200 << text
|
|
122
|
+
rescue Timeout::Error
|
|
123
|
+
puts "Timeout::Error -> #{text}"
|
|
124
|
+
end
|
|
125
|
+
if respond
|
|
126
|
+
puts "#{respond.code} #{text} #{frame.src}"
|
|
127
|
+
air_no_200 << text if respond.code != 200
|
|
128
|
+
end
|
|
129
|
+
end
|
|
130
|
+
BROWSER.back
|
|
131
|
+
begin
|
|
132
|
+
Watir::Wait.until(timeout = 120){BROWSER.ul(:class,'airlines').present?}
|
|
133
|
+
rescue Watir::Wait::TimeoutError
|
|
134
|
+
puts "Watir::Wait::TimeoutError (back) -> #{text}"
|
|
135
|
+
end
|
|
136
|
+
end
|
|
137
|
+
i += 1
|
|
138
|
+
end
|
|
139
|
+
air_no_200.should is_empty
|
|
140
|
+
end
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
#encoding: UTF-8
|
|
2
|
+
When /^Espero que termine de cargar la pagina de desambiguacion$/ do
|
|
3
|
+
Watir::Wait.until(timeout = 60){BROWSER.div(:class,'disambiguation-top grid_24 alpha omega').present?}
|
|
4
|
+
end
|
|
5
|
+
|
|
6
|
+
Then /^Verifico que ingrese a la pagina de desambiguacion$/ do
|
|
7
|
+
BROWSER.div(:class,"messages").should visible
|
|
8
|
+
BROWSER.div(:class,"messages").text.should match("Por favor seleccione uno de los siguientes aeropuertos cercanos|Veja abaixo os aeroportos mais|Please choose one of the following nearby airports")
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
When /^Seteo las edades de los menores$/ do
|
|
12
|
+
@search.get_childrens.to_i.times do | j |
|
|
13
|
+
BROWSER.li(:class,"ctn-select-age ctn-#{1+j}").selects[0].select_value(["I","C"][rand(2)])
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
Then /^Verifico que se muestre el mapa$/ do
|
|
18
|
+
doc = Hpricot.parse(BROWSER.html)
|
|
19
|
+
(doc/"li.strech").each do |tramo|
|
|
20
|
+
(tramo/"div.map-container").should_not is_empty
|
|
21
|
+
(tramo/"ul.airports").should_not is_empty
|
|
22
|
+
(tramo/"ul/li").should_not is_empty
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
And /^Verifico que el combo de distancia este correcto$/ do
|
|
27
|
+
doc = Hpricot.parse(BROWSER.html)
|
|
28
|
+
@distancia = (doc/"select.distances").first
|
|
29
|
+
BROWSER.select_list(:class,@distancia.attributes['class']).should visible
|
|
30
|
+
BROWSER.select_list(:class,@distancia.attributes['class']).select_value((@distancia/"option").last.attributes['value'])
|
|
31
|
+
sleep(0.5)
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
And /^Verifico cada opcion de aeropuerto "(.*)" en "(.*)"$/ do |type,city|
|
|
35
|
+
cities={"BZC"=>["GIG", "SDU", "JDF", "CFB", "CAW", "MEA", "IZA"],
|
|
36
|
+
"PCM"=>["CUN","CZM"]}
|
|
37
|
+
doc = Hpricot.parse(BROWSER.html)
|
|
38
|
+
i = 0
|
|
39
|
+
(doc/"li.strech").each do |tramo|
|
|
40
|
+
airports = ((tramo/"ul.airports//li.airport").reject{|it| it.attributes['style'].match(/none/)})
|
|
41
|
+
airports.collect{ |airport| (airport/"p.description").inner_text[-4,3]}.should equal(cities[city])
|
|
42
|
+
option = rand(airports.length)
|
|
43
|
+
begin
|
|
44
|
+
aux = (tramo/"ul.airports//li.airport").length - airports.length
|
|
45
|
+
rescue
|
|
46
|
+
aux = 0
|
|
47
|
+
end
|
|
48
|
+
if type.downcase.match(/multipledestinations/)
|
|
49
|
+
if (tramo/"select").first.attributes["class"].downcase.match(/departure/)
|
|
50
|
+
@iata = (tramo/"ul.airports//p.description")[option+aux].inner_text[-4,3]
|
|
51
|
+
else
|
|
52
|
+
@iata = (tramo/"ul.airports//p.description")[option+aux].inner_text[-4,3]
|
|
53
|
+
end
|
|
54
|
+
else
|
|
55
|
+
if (tramo/"select").first.attributes["class"].downcase.match(/departure/)
|
|
56
|
+
@iata = (tramo/"ul.airports//p.description")[option+aux].inner_text[-4,3]
|
|
57
|
+
else
|
|
58
|
+
@iata = (tramo/"ul.airports//p.description")[option+aux].inner_text[-4,3]
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
puts @iata
|
|
62
|
+
BROWSER.li(:class=>"strech",:index=>i).radio(:class=>'radio',:index=>option+aux).click if BROWSER.li(:class=>"strech",:index=>i).radio(:class=>'radio',:index=>option+aux).exists?
|
|
63
|
+
i += 1
|
|
64
|
+
end
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
And /^Paso a resultados$/ do
|
|
68
|
+
BROWSER.link(:class,'ctn-searchbutton').click
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
Then /^Verifico que el aeropuerto elegido sea el buscado$/ do
|
|
72
|
+
BROWSER.url.should match("#{@iata}")
|
|
73
|
+
end
|