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,325 @@
|
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
|
2
|
+
When /^Ingreso a la home de "(.*)"/ do |site|
|
|
3
|
+
set_site(site)
|
|
4
|
+
@search = MockSearchRoundtrip.new($SITE,$ENV,"nil")
|
|
5
|
+
BROWSER.goto(@search.host)
|
|
6
|
+
set_cookies(BROWSER)
|
|
7
|
+
set_language(site)
|
|
8
|
+
begin
|
|
9
|
+
li = BROWSER.li(:class,'flightsLink').present? ? BROWSER.li(:class,'flightsLink') : BROWSER.li(:class,'link-flights')
|
|
10
|
+
Watir::Wait.until(timeout = 120){li.present?}
|
|
11
|
+
rescue Watir::Wait::TimeoutError, Timeout::Error
|
|
12
|
+
stop_browser(BROWSER)
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
When /^Ingreso a la home de landing de "(.*)"$/ do |site|
|
|
17
|
+
set_site(site)
|
|
18
|
+
@search = MockSearchRoundtrip.new($SITE,$ENV,"nil")
|
|
19
|
+
begin
|
|
20
|
+
BROWSER.goto(@search.generate_url_landing_home)
|
|
21
|
+
rescue Timeout::Error
|
|
22
|
+
stop_browser(BROWSER)
|
|
23
|
+
end
|
|
24
|
+
set_cookies(BROWSER)
|
|
25
|
+
set_language(site)
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
When /^Ingreso a la home de landing$/ do
|
|
29
|
+
begin
|
|
30
|
+
li = BROWSER.li(:class,'flightsLink').present? ? BROWSER.li(:class,'flightsLink') : BROWSER.li(:class,'link-flights')
|
|
31
|
+
BROWSER.goto(li.links[0].href.gsub(/\/...\//,'/'))
|
|
32
|
+
rescue Timeout::Error
|
|
33
|
+
stop_browser(BROWSER)
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
When /^Genero resultados de landing$/ do
|
|
38
|
+
begin
|
|
39
|
+
set_site("CO")
|
|
40
|
+
@search = MockSearchRoundtrip.new($SITE,$ENV,"nil")
|
|
41
|
+
@ciudad_elegida = "Buenos aires"
|
|
42
|
+
BROWSER.goto(@search.generate_url_landing_search("BOG","BUE"))
|
|
43
|
+
@cambio = "$"
|
|
44
|
+
@precio_home_sov = Price.new("$ 100")
|
|
45
|
+
set_cookies(BROWSER)
|
|
46
|
+
set_language($SITE)
|
|
47
|
+
rescue Timeout::Error
|
|
48
|
+
stop_browser(BROWSER)
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
When /^Espero que termine de cargar la home de landing$/ do
|
|
53
|
+
Watir::Wait.until(timeout = 60){BROWSER.div(:class,'destiny-offers').present? or BROWSER.div(:class,'most-searched').present?}
|
|
54
|
+
@class_div = BROWSER.div(:class,'destiny-offers').present? ? 'destiny-offers' : 'most-searched'
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
Then /^Verifico que los links de las ciudades esten correctos$/ do
|
|
58
|
+
doc = Hpricot.parse(BROWSER.html)
|
|
59
|
+
array=[]
|
|
60
|
+
file = File.open("features/data/home-offers-config.csv")
|
|
61
|
+
file.each_line{|line| array << line.split(',')}
|
|
62
|
+
(doc/"div.#{@class_div} ul li").each do |li|
|
|
63
|
+
(li/"a").should_not is_empty
|
|
64
|
+
tmp = $SITE=="BR" ? "passagens-aereas" : "vuelos"
|
|
65
|
+
(li/"a").first.attributes['href'].should match(/(.+)#{tmp}\/...\/...\/#{tmp}(.+)|(.+)#{tmp}\/...\/...\/#{tmp}(.+)/)
|
|
66
|
+
if BROWSER.div(:class,'destiny-offers').present?
|
|
67
|
+
(li/"div.first-col h4").should_not is_empty
|
|
68
|
+
(li/"div.sec-col span").should_not is_empty
|
|
69
|
+
match=(li/"a").first.attributes['href'].match(/(.+)#{tmp}\/(...)\/(...)\/#{tmp}(.+)|(.+)#{tmp}\/(...)\/(...)\/#{tmp}(.+)/)
|
|
70
|
+
array.select{|tmp| tmp[0]==$SITE and tmp[3].strip.downcase==match[3].strip.downcase}.should_not is_empty
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
@validaciones << 1
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
When /^Elijo un link para pasar a los resultados de landing$/ do
|
|
77
|
+
doc = Hpricot.parse(BROWSER.html)
|
|
78
|
+
links = (doc/"div.#{@class_div} ul li")
|
|
79
|
+
@opt = links[rand(links.length)]
|
|
80
|
+
if BROWSER.div(:class,'destiny-offers').present?
|
|
81
|
+
@precio_home_sov = Price.new((@opt/"div.sec-col div.price-container").inner_text.strip)
|
|
82
|
+
@cambio = (@opt/"div.sec-col/div.price-container/span.mask").inner_text.strip
|
|
83
|
+
@ciudad_elegida = (@opt/"a").first.attributes['title'].no_accents.gsub(/Ver ofertas de voos a |Ver ofertas de vuelos a |View flight deals to |View flight deals to /,'').strip
|
|
84
|
+
else
|
|
85
|
+
@precio_home_sov = Price.new("#{(@opt/'div.info-price span.mask').inner_text.strip} #{(@opt/'div.info-price span.price').inner_text.strip}")
|
|
86
|
+
@cambio = (@opt/'div.info-price span.mask').inner_text.strip
|
|
87
|
+
@ciudad_elegida = (@opt/"a").first.attributes['title'].no_accents.gsub(/Ver ofertas de voos a |Ver ofertas de vuelos a |View flight deals to /,'').strip
|
|
88
|
+
end
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
When /^Ingreso a resultados de landing$/ do
|
|
92
|
+
begin
|
|
93
|
+
BROWSER.div(:class,@class_div).link(:href,(@opt/"a").first.attributes['href']).click
|
|
94
|
+
Watir::Wait.until(timeout = 60){BROWSER.span(:class,'commonSprite warningSymbol').present? or (BROWSER.div(:id,"clusters").present? or BROWSER.li(:class,"flightPanel").present?) or BROWSER.div(:class,"flightOffers").present? or (BROWSER.div(:class,"noResultsWidthFilterTitle").present? or BROWSER.div(:class,'noResults').present?)}
|
|
95
|
+
rescue Watir::Wait::TimeoutError, Timeout::Error
|
|
96
|
+
stop_browser(BROWSER)
|
|
97
|
+
end
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
When /^Ingreso a resultados de landing para la ciudad "(.*)"$/ do |code|
|
|
101
|
+
doc = Hpricot.parse(BROWSER.html)
|
|
102
|
+
links = (doc/"div.most-searched//li")
|
|
103
|
+
@opt = links.select{|li| (li/"a")[0].attributes["href"].match(/\/(...)\/(...)\//)[2].upcase.match(code.upcase)}.first
|
|
104
|
+
unless @opt
|
|
105
|
+
links = (doc/"div.destiny-offers//li")
|
|
106
|
+
@opt = links.select{|li| (li/"a")[0].attributes["href"].match(/\/(...)\/(...)\//)[2].upcase.match(code.upcase)}.first
|
|
107
|
+
@precio_home_sov = Price.new((@opt/"div.sec-col div.price-container").inner_text.strip)
|
|
108
|
+
else
|
|
109
|
+
@precio_home_sov = Price.new("#{(@opt/'div.info-price span.mask').inner_text.strip} #{(@opt/'div.info-price span.price').inner_text.strip}")
|
|
110
|
+
end
|
|
111
|
+
@ciudad_elegida = (@opt/"a").first.attributes['title'].no_accents.gsub(/Ver ofertas de voos a |Ver ofertas de vuelos a |View flight deals to /,'').strip
|
|
112
|
+
begin
|
|
113
|
+
BROWSER.link(:href,(@opt/"a").first.attributes['href']).click
|
|
114
|
+
Watir::Wait.until(timeout = 60){BROWSER.span(:class,'commonSprite warningSymbol').present? or (BROWSER.div(:id,"clusters").present? or BROWSER.li(:class,"flightPanel").present?) or BROWSER.div(:class,"flightOffers").present? or (BROWSER.div(:class,"noResultsWidthFilterTitle").present? or BROWSER.div(:class,'noResults').present?)}
|
|
115
|
+
rescue Watir::Wait::TimeoutError, Timeout::Error
|
|
116
|
+
stop_browser(BROWSER)
|
|
117
|
+
end
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
Then /^Verifico que traiga resultados de landings$/ do
|
|
121
|
+
pending(BROWSER.span(:class,'message').text) if BROWSER.span(:class,'message').present?
|
|
122
|
+
BROWSER.span(:class,'commonSprite warningSymbol').should_not visible
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
Then /^Levanto el json de resultados para landing$/ do
|
|
126
|
+
@json = Services::Landing.new(Hpricot.parse(BROWSER.html)).json
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
And /^Verifico que la ciudad destino sea la que se eligio en home$/ do
|
|
130
|
+
doc = Hpricot.parse(BROWSER.html)
|
|
131
|
+
ciudades = (doc/"div.mainTitle/h1").inner_text.strip.no_accents
|
|
132
|
+
ciudad_destino = ciudades.match(/ (para|a|to) ([^,]+)/)[2].strip
|
|
133
|
+
@ciudad_elegida.should equal(ciudad_destino) unless @ciudad_elegida.match(/Guarullos/)
|
|
134
|
+
@validaciones << 3
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
And /^Verifico que la url sea la correcta$/ do
|
|
138
|
+
@url_parse = BROWSER.url.match(/#{@search.host()}\/(vuelos|passagens-aereas)\/(\D{3})\/(\D{3})\/(vuelos|passagens-aereas)-(a|para)-(.+)-(desde|saindo-de)-(.+)/)
|
|
139
|
+
@url_parse.should be_true
|
|
140
|
+
@validaciones << 4
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
When /^Elijo el tipo de vuelo "(.*)"$/ do |tipo|
|
|
144
|
+
BROWSER.div(:class,'ux-common-filter-section filter-searchType ux-common-filter-active').radio(:id,tipo).set
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
When /^Levanto los datos de clusters$/ do
|
|
148
|
+
doc = Hpricot.parse(BROWSER.html)
|
|
149
|
+
@clusters = load_clusters(doc)
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
When /^Levanto los datos de clusters "(.*)"$/ do |tipo|
|
|
154
|
+
doc = Hpricot.parse(BROWSER.html)
|
|
155
|
+
@clusters = load_clusters(doc,tipo)
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
And /^Comparo los datos de cluster contra los detalles$/ do
|
|
159
|
+
doc = Hpricot.parse(BROWSER.html)
|
|
160
|
+
load_clusters_details(doc).each_with_index do |detail,i|
|
|
161
|
+
#(doc/"div.popup-content div.detail span.total-time").should match((@clusters[i].idas[j].duracion).to_s)
|
|
162
|
+
detail["idas"].each_with_index do |item,j|
|
|
163
|
+
item.tramos.first["clase"].should be_true
|
|
164
|
+
item.tramos.first["clase"].should_not equal("")
|
|
165
|
+
item.tramos.first["ciudad_origen"].should match(@clusters[i].idas[j].origen.no_accents.strip)
|
|
166
|
+
(item.tramos.first["fecha_origen"].strftime("%d%m")).should match(@clusters[i].idas[j].fecha.strftime("%d%m"))
|
|
167
|
+
(item.tramos.first["hora_origen"].strftime("%d%m")).should match(@clusters[i].idas[j].hou_sal_ida.strftime("%d%m"))
|
|
168
|
+
item.duracion.to_s.should match((@clusters[i].idas[j].duracion).to_s)
|
|
169
|
+
item.tramos.first["ciudad_destino"].should match(@clusters[i].idas[j].destino.no_accents.strip)
|
|
170
|
+
(item.tramos.first["hora_destino"].strftime("%d%m")).should match(@clusters[i].idas[j].hou_lle_ida.strftime("%d%m"))
|
|
171
|
+
end
|
|
172
|
+
detail["vueltas"].each_with_index do |item,j|
|
|
173
|
+
item.tramos.first["clase"].should be_true
|
|
174
|
+
item.tramos.first["clase"].should_not equal("")
|
|
175
|
+
item.tramos.first["ciudad_origen"].should match(@clusters[i].vueltas[j].origen.no_accents.strip)
|
|
176
|
+
(item.tramos.first["fecha_origen"].strftime("%d%m")).should match(@clusters[i].vueltas[j].fecha.strftime("%d%m"))
|
|
177
|
+
(item.tramos.first["hora_origen"].strftime("%H%M")).should match(@clusters[i].vueltas[j].hou_sal_ida.strftime("%H%M"))
|
|
178
|
+
item.duracion.to_s.should match((@clusters[i].vueltas[j].duracion).to_s)
|
|
179
|
+
item.tramos.first["ciudad_destino"].should match(@clusters[i].vueltas[j].destino.no_accents.strip)
|
|
180
|
+
(item.tramos.first["hora_destino"].strftime("%d%m")).should match(@clusters[i].vueltas[j].hou_lle_ida.strftime("%d%m"))
|
|
181
|
+
end
|
|
182
|
+
end
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
And /^Verifico que el primer precio sea el que se mostro en home$/ do
|
|
186
|
+
@validaciones << 5
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
And /^Verifico que no vengan mas de diez resultados por pagina$/ do
|
|
190
|
+
(@clusters.length<11).should be_true
|
|
191
|
+
@validaciones << 6
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
And /^Verifico que traiga precios con formato correcto y positivos$/ do
|
|
195
|
+
@clusters.each do |cluster|
|
|
196
|
+
if cluster.tarifas
|
|
197
|
+
tarifa = BROWSER.span(:class,'price-currency USD ').present? ? cluster.tarifas['tarifa_adulto_dolar'] : cluster.tarifas['tarifa_adulto']
|
|
198
|
+
tarifa.to_s.match(/\,/).should_not be_true
|
|
199
|
+
tarifa.to_s.match(/\-/).should_not be_true
|
|
200
|
+
#tarifa.currency.strip.no_accents.gsub(/\n/,'').gsub(/\.$/,'').should equal(@cambio.no_accents.to_s.strip)
|
|
201
|
+
if $SITE == "AR"
|
|
202
|
+
#cluster.tarifas['afip'].value.should_not equal(0)
|
|
203
|
+
end
|
|
204
|
+
end
|
|
205
|
+
end
|
|
206
|
+
@validaciones << 7
|
|
207
|
+
end
|
|
208
|
+
|
|
209
|
+
And /^Verifico que traiga aeropuertos y concuerden con la ciudad buscada$/ do
|
|
210
|
+
@clusters.each do |cluster|
|
|
211
|
+
(cluster.ida.origen_iata and cluster.ida.destino_iata).should be_true
|
|
212
|
+
if cluster.vuelta
|
|
213
|
+
(cluster.vuelta.origen_iata and cluster.vuelta.destino_iata).should be_true
|
|
214
|
+
end
|
|
215
|
+
end
|
|
216
|
+
@validaciones << 8
|
|
217
|
+
end
|
|
218
|
+
|
|
219
|
+
And /^Verifico que traiga fechas en formato correcto$/ do
|
|
220
|
+
@clusters.each do |cluster|
|
|
221
|
+
cluster.idas.first.should be_true
|
|
222
|
+
ida_sitio = []
|
|
223
|
+
cluster.idas.each{|ida| ida_sitio << ida.fecha if ida.fecha}
|
|
224
|
+
if cluster.vueltas and cluster.vueltas.first
|
|
225
|
+
cluster.vueltas.first.should be_true
|
|
226
|
+
vuelta_sitio = []
|
|
227
|
+
cluster.vueltas.each{|vuelta| vuelta_sitio << vuelta.fecha if vuelta.fecha}
|
|
228
|
+
if ida_sitio.first and cluster.vueltas.first
|
|
229
|
+
vueltas_sitio = []
|
|
230
|
+
cluster.vueltas.each{|vuelta| vueltas_sitio << vuelta.fecha if vuelta.fecha}
|
|
231
|
+
if vueltas_sitio.first
|
|
232
|
+
vueltas_sitio.each do |vueltas|
|
|
233
|
+
ida = ida_sitio.select{|ida| vueltas < ida}
|
|
234
|
+
ida.should is_empty
|
|
235
|
+
end
|
|
236
|
+
end
|
|
237
|
+
end
|
|
238
|
+
end
|
|
239
|
+
end
|
|
240
|
+
@validaciones << 9
|
|
241
|
+
end
|
|
242
|
+
|
|
243
|
+
When /^Elijo un ticket e ingreso a la pagina de resultados$/ do
|
|
244
|
+
@departure_date = @clusters.first.ida.fecha
|
|
245
|
+
@return_date = @clusters.first.vuelta.fecha if @clusters.first.vuelta
|
|
246
|
+
@from_iata = BROWSER.url.match(/\/(...)\//)[1].upcase
|
|
247
|
+
@to_iata = BROWSER.url.match(/\/(...)\/(...)\//)[2].upcase
|
|
248
|
+
|
|
249
|
+
BROWSER.div(:class,'sub-cluster outbound').radio(:id,"0-outbound-0").set
|
|
250
|
+
BROWSER.div(:class,'sub-cluster inbound').radio(:id,"0-inbound-0").set if @clusters.first.vuelta
|
|
251
|
+
BROWSER.div(:id,'clusters').div(:class,/cluster flights-cluster/).link(:class,"buy btn-buy flights-button").click
|
|
252
|
+
BROWSER.div(:id,'searchPopup').select_list(:class,'adultsSelect flights-select').select(3)
|
|
253
|
+
BROWSER.div(:id,'searchPopup').select_list(:class,'childsSelect flights-select').select(2)
|
|
254
|
+
["3","4"].each_with_index do | age, j |
|
|
255
|
+
BROWSER.div(:id,'searchPopup').select_list(:class=>'selectAge flights-select',:index=>j).select_value(age) #@users_ninos[num_ninos].nil? ? rand(11).to_s : @users_ninos[num_ninos].age.to_s)
|
|
256
|
+
end
|
|
257
|
+
BROWSER.div(:id,'searchPopup').link(:class,'flights-search-button').click
|
|
258
|
+
|
|
259
|
+
end
|
|
260
|
+
|
|
261
|
+
Then /^Verifico que sea la pagina de resultados correcta$/ do
|
|
262
|
+
if @return_date
|
|
263
|
+
BROWSER.url.should match("\/roundtrip\/#{@from_iata.downcase}\/#{@to_iata.downcase}\/#{@departure_date}\/#{@return_date}\/3\/I\-C\/0")
|
|
264
|
+
else
|
|
265
|
+
BROWSER.url.should match("\/oneway\/#{@from_iata.downcase}\/#{@to_iata.downcase}\/#{@departure_date}\/3\/I\-C\/0")
|
|
266
|
+
end
|
|
267
|
+
end
|
|
268
|
+
|
|
269
|
+
And /^Verifico que el valor elejido en landing se encuentre en la lista de resultados$/ do
|
|
270
|
+
doc = Hpricot.parse(BROWSER.html)
|
|
271
|
+
matchs = (doc/"div#clusters div.cluster span[@class='price-currency USD'] span.amount").select{|span| (span.inner_text.to_i - @clusters.first.tarifa.valor).abs < 2 }
|
|
272
|
+
end
|
|
273
|
+
|
|
274
|
+
And /^Verifico que la moneda elegida en landing se encuentre en la lista de resultados$/ do
|
|
275
|
+
if @cambio.strip=="US$" or @cambio.strip=="USD"
|
|
276
|
+
BROWSER.span(:class,"price-currency USD ").span(:class,"currency price-mask").text.should match('US\$|USD')
|
|
277
|
+
else
|
|
278
|
+
BROWSER.span(:class,"price-currency #{currency($SITE)} ").span(:class,"currency price-mask").text.gsub(/\.$/,'').should equal(@precio_home_sov.currency.gsub(/\.$/,''))
|
|
279
|
+
end
|
|
280
|
+
end
|
|
281
|
+
|
|
282
|
+
When /^Verifico que funcione el paginado correctamente$/ do
|
|
283
|
+
iterator = 2
|
|
284
|
+
while(BROWSER.div(:id,'pagination').li(:class,'pagination-button next').present? and iterator < 5)do
|
|
285
|
+
before_url = BROWSER.url
|
|
286
|
+
BROWSER.div(:class,'flights-pagination').li(:class,'pagination-button next').links[0].click
|
|
287
|
+
Watir::Wait.until(timeout = 5){before_url != BROWSER.url}
|
|
288
|
+
BROWSER.url.should match("(.+)\?pageIndex\=#{iterator}")
|
|
289
|
+
iterator += 1
|
|
290
|
+
end
|
|
291
|
+
end
|
|
292
|
+
|
|
293
|
+
And /^Verifico que el paginado mantenga los filtros$/ do
|
|
294
|
+
BROWSER.div(:class,'ux-common-filter-section ux-flights-filter-departures').checkboxes[0].click
|
|
295
|
+
sleep(0.5)
|
|
296
|
+
if BROWSER.div(:id,'pagination').li(:class,'pagination-button next').present?
|
|
297
|
+
url_with_filter = BROWSER.url
|
|
298
|
+
BROWSER.div(:class,'flights-pagination').li(:class,'pagination-button next').links[0].click
|
|
299
|
+
Watir::Wait.until(timeout = 5){url_with_filter != BROWSER.url}
|
|
300
|
+
BROWSER.url.strip.should equal(url_with_filter.strip.gsub(/\/1\//,"/2/"))
|
|
301
|
+
end
|
|
302
|
+
reset_filter
|
|
303
|
+
end
|
|
304
|
+
|
|
305
|
+
Then /^Vuelvo a la primer pagina$/ do
|
|
306
|
+
BROWSER.div(:class,'flights-pagination').li(:class,'pagination-button prev').links[0].click while BROWSER.div(:class,'flights-pagination').li(:class,'pagination-button prev').present?
|
|
307
|
+
end
|
|
308
|
+
|
|
309
|
+
When /^Verifico que el paginado no traiga mas de "(.*)" paginas$/ do |limit_pages|
|
|
310
|
+
doc = Hpricot.parse(BROWSER.html)
|
|
311
|
+
if (doc/"li.paginatorItem")[-2]
|
|
312
|
+
((doc/"li.paginatorItem")[-2].inner_text.to_i <= limit_pages.to_i).should be_true
|
|
313
|
+
end
|
|
314
|
+
end
|
|
315
|
+
|
|
316
|
+
And /^Verifico que el mensaje de error en el cluster sea correcto$/ do
|
|
317
|
+
clusters=load_clusters(BROWSER)
|
|
318
|
+
index = nil
|
|
319
|
+
cluster=clusters.each_with_index do |cluster,i|
|
|
320
|
+
if (cluster.idas.length>1 or cluster.vueltas.length>1)
|
|
321
|
+
BROWSER.link(:class=>"buy btn-buy flights-button",:index=>i).click
|
|
322
|
+
BROWSER.div(:class=>"cluster",:index=>i).li(:class=>'item error-message',:index=>((cluster.idas.length>1) ? 0 : 1)).text.no_accents.should match("Please choose a (return|departure) flight|Por favor, seleccione un vuelo de|Por favor, selecione um voo de")
|
|
323
|
+
end
|
|
324
|
+
end
|
|
325
|
+
end
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
|
2
|
+
Then /^Elijo ordenamiento "(.*)"$/ do |value|
|
|
3
|
+
begin
|
|
4
|
+
BROWSER.select_list(:id,'orderby').select_value(value)
|
|
5
|
+
rescue Timeout::Error
|
|
6
|
+
stop_browser(BROWSER)
|
|
7
|
+
end
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
Then /^Levanto los datos de los clusters "(.*)"$/ do |type|
|
|
11
|
+
@clusters = []
|
|
12
|
+
i=0
|
|
13
|
+
doc = Hpricot.parse(BROWSER.div(:id,'clusters').html)
|
|
14
|
+
(doc/"div.cluster").each do |cluster|
|
|
15
|
+
itinerary = ResultsCluster.new(type,cluster)
|
|
16
|
+
i += 1
|
|
17
|
+
@clusters << itinerary
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
Then /^Verifico ordenamiento FARE_ASCENDING$/ do
|
|
22
|
+
after = @clusters.first.tarifas['tarifa_adulto']
|
|
23
|
+
@clusters.each do |cluster|
|
|
24
|
+
after.value.should_not is_greater_than(cluster.tarifas['tarifa_adulto'].value)
|
|
25
|
+
after = cluster.tarifas['tarifa_adulto']
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
Then /^Verifico ordenamiento FARE_DESCENDING$/ do
|
|
30
|
+
after = @clusters.first.tarifas['tarifa_adulto']
|
|
31
|
+
@clusters.each do |cluster|
|
|
32
|
+
after.value.should is_greater_equal_than(cluster.tarifas['tarifa_adulto'].value)
|
|
33
|
+
after = cluster.tarifas['tarifa_adulto']
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
Then /^Verifico ordenamiento STOPSCOUNT_DESCENDING$/ do
|
|
38
|
+
after = @clusters.first
|
|
39
|
+
@clusters.each do |cluster|
|
|
40
|
+
after.total_escalas.last.should is_greater_equal_than(cluster.total_escalas.first)
|
|
41
|
+
after = cluster
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
Then /^Verifico ordenamiento STOPSCOUNT_ASCENDING$/ do
|
|
46
|
+
after = @clusters.first
|
|
47
|
+
@clusters.each do |cluster|
|
|
48
|
+
after.total_escalas.last.should_not is_greater_than(cluster.total_escalas.last)
|
|
49
|
+
after = cluster
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
Then /^Verifico ordenamiento TOTALFARE_ASCENDING$/ do
|
|
54
|
+
after = @clusters.first.tarifas['total']
|
|
55
|
+
@clusters.each do |cluster|
|
|
56
|
+
after.value.should_not is_greater_than(cluster.tarifas['total'].value)
|
|
57
|
+
after = cluster.tarifas['total']
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
Then /^Verifico ordenamiento TOTALFARE_DESCENDING$/ do
|
|
62
|
+
after = @clusters.first.tarifas['total']
|
|
63
|
+
@clusters.each do |cluster|
|
|
64
|
+
after.value.should is_greater_equal_than(cluster.tarifas['total'].value)
|
|
65
|
+
after = cluster.tarifas['total']
|
|
66
|
+
end
|
|
67
|
+
end
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
|
2
|
+
When /^Especifico filtro "(.*)"$/ do |query|
|
|
3
|
+
begin
|
|
4
|
+
BROWSER.goto "#{@path}#{query}"
|
|
5
|
+
rescue Timeout::Error
|
|
6
|
+
begin Timeout::Error
|
|
7
|
+
BROWSER.goto "#{@path}#{query}"
|
|
8
|
+
rescue
|
|
9
|
+
sleep(5)
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
When /^Seteo path$/ do
|
|
15
|
+
@path = BROWSER.url
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
Then /^Espero que de la carga devuelva "(.*)"$/ do |expected_result|
|
|
19
|
+
BROWSER.text.should match(expected_result)
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
Then /^Verifico que el panel de opciones avanzadas este (cerrado|abierto)$/ do |status|
|
|
23
|
+
if status == "cerrado"
|
|
24
|
+
BROWSER.div(:class,"com-advancedlink").present?
|
|
25
|
+
else
|
|
26
|
+
BROWSER.div(:class,"com-advancedlink active").present?
|
|
27
|
+
end
|
|
28
|
+
end
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
|
2
|
+
When /^Verifico las combinaciones de busqueda avanzada "(.*)"$/ do |tipo|
|
|
3
|
+
escala = ["0","1","2","3","4","5"][rand(6)]
|
|
4
|
+
clase = ["YC","C","F"][rand(3)]
|
|
5
|
+
horario_salida = ["00","01","02","03","04","05","06","07","08","09","10","11","12"][rand(13)]
|
|
6
|
+
horario_llegada = ["00","01","02","03","04","05","06","07","08","09","10","11","12"][rand(13)]
|
|
7
|
+
aerolineas = ["AA","JJ","AR"]
|
|
8
|
+
aerolinea = aerolineas[rand(aerolineas.length)]
|
|
9
|
+
options = [ [horario_salida,horario_llegada,clase,escala,aerolinea].collect{|option| [option,"NA"][rand(2)]},
|
|
10
|
+
[horario_salida,horario_llegada,clase,escala,aerolinea],
|
|
11
|
+
["NA",horario_llegada,clase,escala,aerolinea],
|
|
12
|
+
[horario_salida,"NA",clase,escala,aerolinea],
|
|
13
|
+
[horario_salida,horario_llegada,"NA",escala,aerolinea],
|
|
14
|
+
[horario_salida,horario_llegada,clase,"NA",aerolinea],
|
|
15
|
+
[horario_salida,horario_llegada,clase,escala,"NA"]]
|
|
16
|
+
options.each do |option|
|
|
17
|
+
option.delete_at(1) if tipo.downcase.match(/oneway/)
|
|
18
|
+
respond = nil
|
|
19
|
+
begin
|
|
20
|
+
respond = HTTParty.get(%!#{@url_resultado}/#{option.join('/')}!,:headers=>{"x-uow"=>"ROBOT"})
|
|
21
|
+
rescue Errno::ECONNRESET
|
|
22
|
+
nil.should be_true
|
|
23
|
+
rescue Timeout::Error
|
|
24
|
+
nil.should be_true
|
|
25
|
+
end
|
|
26
|
+
respond.should be_true
|
|
27
|
+
respond.code.should equal(200)
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
When /^Especifico path "(.*)""(.*)""(.*)"$/ do |site,cabotage,type|
|
|
32
|
+
@search = Class.const_get("MockSearch#{type.capitalize}").new(site,$ENV,cabotage)
|
|
33
|
+
@url_resultado = @search.generate_url_results_search()
|
|
34
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
|
2
|
+
Then /^Verifico la busqueda anticipada "(.*)""(.*)""(.*)"$/ do |site,cabotage,type|
|
|
3
|
+
begin
|
|
4
|
+
@search = Class.const_get("MockSearch#{type.capitalize}").new(site,$ENV,cabotage)
|
|
5
|
+
respond = HTTParty.get(@search.generate_url_anticipated_search(),:headers=>{"x-uow"=>"ROBOT"})
|
|
6
|
+
rescue Errno::ECONNRESET
|
|
7
|
+
nil.should be_true
|
|
8
|
+
rescue Timeout::Error
|
|
9
|
+
nil.should be_true
|
|
10
|
+
end
|
|
11
|
+
respond.should be_true
|
|
12
|
+
respond.code.should equal(200)
|
|
13
|
+
end
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
Then /^Ingreso a la pagina de trackeo de vuelos "(.*)"$/ do |site|
|
|
2
|
+
set_site(site)
|
|
3
|
+
@search = MockSearchRoundtrip.new($SITE,$ENV,"nil")
|
|
4
|
+
puts @search.host + "/flights/tracker/"
|
|
5
|
+
BROWSER.goto(@search.host + "/flights/tracker/")
|
|
6
|
+
#BROWSER.div(:class,'flight-tracker-alert').links[0].click
|
|
7
|
+
end
|
|
8
|
+
Then /^Espero que termine de cargar la pagina de trackeo de vuelos$/ do
|
|
9
|
+
Watir::Wait.until(timeout=20){BROWSER.image(:class,'flight-tracker-banner').present?}
|
|
10
|
+
end
|
|
11
|
+
Then /^Verifico que se encuentren los elementos de la pagina de trackeo de vuelos$/ do
|
|
12
|
+
doc = Hpricot.parse(BROWSER.html)
|
|
13
|
+
(doc/"div#searchContainer").length.should equal(1)
|
|
14
|
+
(doc/"div#searchContainer div#flights-tracker-searchbox").length.should equal(1)
|
|
15
|
+
(doc/"div#searchContainer div#flights-tracker-searchbox").length.should equal(1)
|
|
16
|
+
(doc/"div#searchContainer div#flights-tracker-searchbox input#airline").length.should equal(1)
|
|
17
|
+
(doc/"div#searchContainer div#flights-tracker-searchbox input#flightNumber").length.should equal(1)
|
|
18
|
+
(doc/"div#searchContainer div#flights-tracker-searchbox input#no-flight-number-checkbox").length.should equal(1)
|
|
19
|
+
(doc/"div#searchContainer div#flights-tracker-searchbox input[@name='flight-date']").length.should equal(3)
|
|
20
|
+
(doc/"div#searchContainer div#flights-tracker-searchbox a.flights-search-button").length.should equal(1)
|
|
21
|
+
(doc/"div#searchContainer div#flights-tracker-searchbox input#flight-tracker-origin-city").length.should equal(1)
|
|
22
|
+
(doc/"div#searchContainer div#flights-tracker-searchbox input#flight-tracker-destiny-city").length.should equal(1)
|
|
23
|
+
(doc/"div#searchContainer div#flights-tracker-searchbox select#flight-tracker-hours").length.should equal(1)
|
|
24
|
+
end
|
|
25
|
+
Then /^Ingreso aerolinea$/ do
|
|
26
|
+
@caja = BROWSER.div(:id,'flights-tracker-searchbox')
|
|
27
|
+
@caja.text_field(:id,'airline').set("aerolineas argentinas")
|
|
28
|
+
sleep(0.5)
|
|
29
|
+
BROWSER.send_keys :enter
|
|
30
|
+
end
|
|
31
|
+
Then /^Ingreso numero de vuelo "(.*)"$/ do |nro|
|
|
32
|
+
@caja.text_field(:id,'flightNumber').set(nro)
|
|
33
|
+
end
|
|
34
|
+
Then /^Ingreso fecha de partida "(.*)"$/ do |fecha|
|
|
35
|
+
@caja.radio(:value,fecha).set()
|
|
36
|
+
end
|
|
37
|
+
Then /^Selecciono buscar$/ do
|
|
38
|
+
@caja.link(:class,"flights-search-button").click
|
|
39
|
+
sleep(0.5)
|
|
40
|
+
end
|
|
41
|
+
Then /^Espero que termine de cargar el vuelo trackeado$/ do
|
|
42
|
+
Watir::Wait.until(timeout=30){!BROWSER.div(:class,"flight-tracker-loader-content").present?}
|
|
43
|
+
end
|
|
44
|
+
Then /^Verifico que no encuentre resultados de trackeo$/ do
|
|
45
|
+
BROWSER.div(:id,'results-error').should visible("no se encontraron resultados")
|
|
46
|
+
end
|
|
47
|
+
Then /^Verifico que encuentre resultados de trackeo$/ do
|
|
48
|
+
BROWSER.div(:id,'results-error').should_not visible("no se encontraron resultados")
|
|
49
|
+
BROWSER.div(:id,'flight-info').should visible("informacion del vuelo")
|
|
50
|
+
end
|
|
51
|
+
Then /^Verifico que los datos de trackeo sean correctos$/ do
|
|
52
|
+
doc=Hpricot.parse(BROWSER.div(:id,'flight-info').html)
|
|
53
|
+
(doc/"span.flight-info-number").inner_text.should equal("AR 1298")
|
|
54
|
+
(doc/"div.airport-info-outbound div.airport-info-description").inner_text.should match('Aeropuerto El Plumerillo \(MDZ\) \- Mendoza|Aeroporto El Plumerillo \(MDZ\) \- Mendoza|El Plumerillo Airport \(MDZ\) \- Mendoza')
|
|
55
|
+
(doc/"div.airport-info-inbound div.airport-info-description").inner_text.should match('Arturo Merino Benitez Airport \(SCL\) \- Santiago de Chile|Aeropuerto Arturo Merino Benitez \(SCL\) \- Santiago de Chile|Aeroporto Arturo Merino Benitez \(SCL\) \- Santiago')
|
|
56
|
+
(doc/"span.flight-info-airline-name").inner_text.no_accents.should equal("Aerolineas Argentinas")
|
|
57
|
+
end
|
|
58
|
+
Then /^Elijo no se el numero de vuelo$/ do
|
|
59
|
+
BROWSER.checkbox(:id,"no-flight-number-checkbox").set(true)
|
|
60
|
+
end
|
|
61
|
+
Then /^Elijo origen$/ do
|
|
62
|
+
@caja.text_field(:id,'flight-tracker-origin-city').set("mendoza")
|
|
63
|
+
sleep(0.5)
|
|
64
|
+
BROWSER.send_keys :enter
|
|
65
|
+
end
|
|
66
|
+
Then /^Elijo destino$/ do
|
|
67
|
+
@caja.text_field(:id,'flight-tracker-destiny-city').set("santiago")
|
|
68
|
+
sleep(0.5)
|
|
69
|
+
BROWSER.send_keys :enter
|
|
70
|
+
end
|
|
71
|
+
Then /^Elijo horario de partida "(.*)"/ do |horario|
|
|
72
|
+
@caja.select_list(:id,'flight-tracker-hours').select_value(horario)
|
|
73
|
+
end
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
|
2
|
+
Before do |scenario|
|
|
3
|
+
@@name = scenario.source_tag_names.collect{|tag| tag.gsub(/\@/,'')}.join(".")
|
|
4
|
+
@validaciones = Array.new
|
|
5
|
+
end
|
|
6
|
+
|
|
7
|
+
After do |scenario|
|
|
8
|
+
if $henry_params['browser']
|
|
9
|
+
if BROWSER.div(:id,'errorInfo').present?
|
|
10
|
+
puts BROWSER.div(:id,'errorInfo').html
|
|
11
|
+
end
|
|
12
|
+
if scenario.failed?
|
|
13
|
+
name = "FAILED_#{scenario.name.gsub(' ','').gsub(/[^0-9A-Za-z]/, '')}.png"
|
|
14
|
+
screenshot = "./output/reports/html/screenshots/#{name}"
|
|
15
|
+
BROWSER.driver.save_screenshot(screenshot)
|
|
16
|
+
embed "./screenshots/#{name}", 'image/png'
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
at_exit do
|
|
22
|
+
BROWSER.close if $henry_params['browser']
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
When /^Si (.*), (.*)$/ do |condition, paso |
|
|
26
|
+
doit = true
|
|
27
|
+
begin
|
|
28
|
+
step condition
|
|
29
|
+
rescue RSpec::Expectations::ExpectationNotMetError => e
|
|
30
|
+
doit = false
|
|
31
|
+
end
|
|
32
|
+
if doit
|
|
33
|
+
step paso
|
|
34
|
+
end
|
|
35
|
+
end
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
|
2
|
+
When /^Fuerzo la cookie de newsletter$/ do
|
|
3
|
+
if BROWSER.cookies.to_a.select{|cookie| cookie[:name]=="-#{@search.description.upcase}-#{@search.city_from_1.code.upcase}-#{@search.city_to_1.code.upcase}"}.first
|
|
4
|
+
tracker_id = BROWSER.cookies.to_a.select{|cookie| cookie[:name]=="trackerid"}.first[:value]
|
|
5
|
+
end
|
|
6
|
+
cookie = BROWSER.cookies.to_a.select{|cookie| cookie[:name].match("#{@search.description.upcase}-#{@search.city_from_1.code.upcase}-#{@search.city_to_1.code.upcase}")}.first
|
|
7
|
+
delete_cookie(cookie[:name])
|
|
8
|
+
add_cookie("#{tracker_id}#{cookie[:name]}",3,{:expires => cookie[:expires],:domain=>cookie[:domain]})
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
When /^Fuerzo el abztesting de newsletter al "(.*)"$/ do |value|
|
|
12
|
+
cookie = BROWSER.cookies.to_a.select{|cookie| cookie[:name]=="abzTestingId"}.first
|
|
13
|
+
new_value = cookie[:value].gsub(/#{get_abtesting('newsletterPopup')}/,value)
|
|
14
|
+
delete_cookie("abzTestingId")
|
|
15
|
+
add_cookie("abzTestingId",new_value,{:expires => cookie[:expires],:domain=>cookie[:domain]})
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
When /^Verifico que se creen las cookies$/ do
|
|
19
|
+
puts BROWSER.cookies.to_a.select{|cookie| cookie[:name].match("#{@search.description.upcase}-#{@search.city_from_1.code.upcase}-#{@search.city_to_1.code.upcase}")}.first
|
|
20
|
+
puts BROWSER.cookies.to_a.select{|cookie| cookie[:name]=="abzTestingId"}.first
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
When /^Verifico los textos del popup grande de newsletter$/ do
|
|
24
|
+
BROWSER.div(:id,'flights-alerts-popup').p(:class,'nibbler-advice').text.no_accents.should match('Can\’t find the price you are looking for\? Create a flight price alert and receive the best deals in your e\-mail|\¿No encuentra el precio que busca\? Reciba las mejores ofertas en su e-mail|Nao encontra o preco que deseja\? Crie seu aviso personalizado e receba as melhores ofertas no seu e-mail')
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
When /^Verifico que cargue el popup chico de newsletter$/ do
|
|
28
|
+
Watir::Wait.until(timeout=10){BROWSER.div(:id,'create-alert-popup').present?}
|
|
29
|
+
BROWSER.div(:id,'create-alert-popup').should visible("popup chico de newsletter")
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
When /^Verifico los textos del popup chico de newsletter$/ do
|
|
33
|
+
BROWSER.div(:id,'create-alert-popup').div(:class,'popup-header').text.no_accents.should match('Can\’t find what you are looking for\?|\¿No encuentra lo que busca\?|Nao encontrou o que deseja\?')
|
|
34
|
+
BROWSER.div(:id,'create-alert-popup').div(:id,'create-alert-popup-content').link(:class,'create-alert-button flights-best-price-button').should visible("link de crear alerta personalizada")
|
|
35
|
+
BROWSER.div(:id,'create-alert-popup').div(:id,'create-alert-popup-content').link(:class,'cancel-button').should visible("link de cancelar alerta personalizada")
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
When /^Elijo crear alerta personalizada$/ do
|
|
39
|
+
BROWSER.div(:id,'create-alert-popup').div(:id,'create-alert-popup-content').link(:class,'create-alert-button flights-best-price-button').click
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
When /^No elijo crear alerta personalizada$/ do
|
|
43
|
+
BROWSER.div(:id,'create-alert-popup').div(:id,'create-alert-popup-content').link(:class,'cancel-button').click
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
When /^Verifico que no cargue el popup de newsletter$/ do
|
|
47
|
+
sleep(2)
|
|
48
|
+
BROWSER.div(:id,'flights-alerts-popup').p(:class,'nibbler-advice').should_not visible("popup grande de newsletter")
|
|
49
|
+
BROWSER.div(:id,'create-alert-popup').div(:id,'create-alert-popup-content').should_not visible("popup chico de newsletter")
|
|
50
|
+
end
|