flights_gui_tests 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5fb7f12ab377af8252c0adbabbadf6c357607b49
4
- data.tar.gz: f6d9383a8a6fc60706add832af55c7476671377d
3
+ metadata.gz: 804c26f0d72a2277711abec2a8acab84b2346756
4
+ data.tar.gz: 96c8bcd0fa95e7a3a3c6b0324f8c535da6b8d8e9
5
5
  SHA512:
6
- metadata.gz: 2860ff7063fcf0f95db9ca1e4711dfa33bb27815a88adc81840f889a7217edff3d21206f2d95080fb0ad7029e43684288968fae9b50d151ad4181a104dc16636
7
- data.tar.gz: 1bff02276b2e013ef4582b15b8a1ae2d9d10a6437f92fc067c62f809120d4a1cafb4c7db81bd5097185faf7c9630196f918dfddd518660db51516c2f9316edd0
6
+ metadata.gz: ba742b7d885be7e5954997649a768d427b110408f0d16603121764e03c25204b8dbf39de50f301373672348e0bc8499935b803d92179d76b1b7296cf832adb84
7
+ data.tar.gz: 76be7007d8ee172391576061d6f102ce92b496f3de9bbbd2f7e51d68c756239c7a29a5dd6a73b736f8245bc131609ac81b2da4920b084eb3067a753e6a4aeff6
@@ -58,8 +58,7 @@ Y(/^verifico si no trae errores$/) do
58
58
  end
59
59
 
60
60
  Cuando(/^ingreso al checkout con cookie "(.*?)" al "(.*?)"/) do |name,value|
61
- step "mostrar devtools"
62
- step "fuerzo el abztesting por devtool de \"#{name}\" al \"#{value}\""
61
+ step "fuerzo el abztesting de \"#{name}\" al \"#{value}\""
63
62
  @page.volver
64
63
  @page = Results::SearchPage.new($browser)
65
64
  step "espero que termine de cargar la pagina de resultados"
@@ -7,7 +7,7 @@ Entonces(/^valido los valores del desglose del checkout$/) do
7
7
  end
8
8
  @itinerario_resultados.tarifas.each_pair do |key,value|
9
9
  if @itinerario_checkout.tarifas[key] and !value.zero? and value.currency == @itinerario_checkout.tarifas[key].currency
10
- value.value.should be_within(4).of(@itinerario_checkout.tarifas[key].value)
10
+ value.value.should be_within(4).of(@itinerario_checkout.tarifas[key].value)
11
11
  end
12
12
  end
13
13
  end
@@ -16,6 +16,7 @@ Entonces(/^elijo opcion "(.*)" para dry run$/) do |value|
16
16
  end
17
17
 
18
18
  Cuando(/^fuerzo el abztesting por devtool de "(.*?)" al "(.*?)"$/) do |arg1,arg2|
19
+ byebug
19
20
  @page.abztesting_element.click
20
21
  sleep(0.5)
21
22
  @page.setear_abztesting(arg1,arg2)
@@ -2,7 +2,7 @@
2
2
  Entonces(/^verifico las nuevas urls de vuelos a destino por aerolinea$/) do
3
3
  doc = Hpricot.parse(@page.html)
4
4
  options = (doc/"div.ux-flights-filter-airlines")[0]
5
- options = (options/"ul.items label").reject{|option| option.attributes["class"].match(/selected|disabled|enabled/)}
5
+ options = (options/"li.item").select { |option| !(option / "input")[0].attributes['id'].match(/airlines-unique|airlines-all/) }
6
6
  @airline = options[rand(options.length)]
7
7
  code = (@airline/"img").first.attributes['src'].match(/\/(..)\.png/)[1].strip
8
8
  @arrival = @page.url.match(/#{@page.manage_data.host()}\/(vuelos|passagens-aereas|flights)\/(\D{3})\/(\D{3})\/(vuelos|passagens-aereas)-(a|para)-(.+)-(desde|saindo-de)-(.+)/)[3]
@@ -27,14 +27,14 @@ end
27
27
 
28
28
  Entonces(/^verifico las nuevas urls de vuelos a destino por aeropuerto de llegada$/) do
29
29
  doc = Hpricot.parse(@page.html)
30
- options = (doc/"div.ux-flights-filter-destinyairports label").reject{|option| option.attributes["class"].match(/selected|disabled/) or option.attributes["for"].match(/unique-airport/)}
30
+ options = (doc/"div.ux-flights-filter-destinyairports li.item").select { |option| !(option / "input")[0].attributes['id'].match(/airport-outbound-all|airport-outbound-unique/)}
31
31
  @airport = options[rand(options.length)]
32
32
  @page.ir(@page.manage_data.generate_url_landing_arrival_airport((@airport/"input").first.attributes['value']))
33
33
  end
34
34
 
35
35
  Cuando(/^verifico las nuevas urls de vuelos a destino por aeropuerto de salida$/) do
36
36
  doc = Hpricot.parse(@page.html)
37
- options = (doc/"div.ux-flights-filter-originairports label").reject{|option| option.attributes["class"].match(/selected|disabled/) or option.attributes["for"].match(/unique-airport/)}
37
+ options = (doc/"div.ux-flights-filter-originairports li.item").select { |option| !(option / "input")[0].attributes['id'].match(/airport-inbound-all|airport-inbound-unique/)}
38
38
  @airport = options[rand(options.length)]
39
39
  @page.ir(@page.manage_data.generate_url_landing_origin_airport((@airport/"input").first.attributes['value'],@arrival))
40
40
  end
@@ -1,7 +1,6 @@
1
1
  # encoding: utf-8
2
2
  Entonces(/^ingreso y espero que cargue la nueva pagina de landing$/) do
3
3
  Watir::Wait.until(timeout = 300){@page.titulo_element.present? or @page.titulo_banner_element.present? or @page.itinerario_element.present?}
4
- byebug
5
4
  unless @page.titulo_banner_element.present?
6
5
  step "fuerzo el abztesting de \"applicationType\" al \"11\""
7
6
  @page.load_page(@page.tipo_de_busqueda,AllPages.site,$ENV,@ciudad_destino.code)
@@ -1,30 +1,30 @@
1
1
  # encoding: utf-8
2
2
  Entonces(/^verifico los textos de las opciones del combo$/) do
3
3
  combo_text = case AllPages.site
4
- when "US" then "Recommended"
5
- when "BR" then "Mais Escolhidos"
6
- else "Mas Elegidos"
4
+ when 'US' then 'Recommended'
5
+ when 'BR' then 'Mais Escolhidos'
6
+ else 'Mas Elegidos'
7
7
  end
8
8
  doc = Hpricot.parse(@page.orden_element.html)
9
- options = (doc/"option").collect{|option| option.inner_text.no_accents.strip}
9
+ options = (doc / 'option').map { |option| option.inner_text.no_accents.strip }
10
10
  options.include?(combo_text).should be_true
11
11
  end
12
12
 
13
13
  Entonces(/^verifico las ociones de ordenamiento$/) do
14
14
  doc = Hpricot.parse(@page.orden_element.html)
15
- options = (doc/"option").collect{|option| option.attributes['value']}
16
- if AllPages.site=="BR"
17
- @page.orden_element.value.should match("FARE_ASCENDING")
18
- end
19
- options.should include?("FARE_ASCENDING")
20
- options.should include?("STOPSCOUNT_ASCENDING")
21
- options.should include?("TOTALFARE_ASCENDING")
22
- options.should include?("DURATION_ASCENDING")
23
- options.should include?("PERSONAL_ASCENDING")
24
- options.should_not include?("FLIGHTCLASS_ASCENDING")
25
- options.should_not include?("FARE_DESCENDING")
26
- options.should_not include?("STOPSCOUNT_DESCENDING")
27
- options.should_not include?("TOTALFARE_DESCENDING")
15
+ options = (doc / 'option').map { |option| option.attributes['value'] }
16
+ if AllPages.site == 'BR'
17
+ @page.orden_element.value.should match('FARE_ASCENDING')
18
+ end
19
+ options.should include?('FARE_ASCENDING')
20
+ options.should include?('STOPSCOUNT_ASCENDING')
21
+ options.should include?('TOTALFARE_ASCENDING')
22
+ options.should include?('DURATION_ASCENDING')
23
+ options.should include?('PERSONAL_ASCENDING')
24
+ options.should_not include?('FLIGHTCLASS_ASCENDING')
25
+ options.should_not include?('FARE_DESCENDING')
26
+ options.should_not include?('STOPSCOUNT_DESCENDING')
27
+ options.should_not include?('TOTALFARE_DESCENDING')
28
28
  end
29
29
 
30
30
  Entonces(/^elijo moneda local$/) do
@@ -32,8 +32,8 @@ Entonces(/^elijo moneda local$/) do
32
32
  end
33
33
 
34
34
  Entonces(/^filtro por un itinerario en la matriz$/) do
35
- @page.activar_aerolineas_en_matriz
36
- if AllPages.site == "PE"
35
+ @page.activar_aerolineas_en_matriz
36
+ if AllPages.site == 'PE'
37
37
  @page.seleccionar_itinerario_matriz_pe_element.click
38
38
  else
39
39
  @page.seleccionar_itinerario_matriz_element.click
@@ -41,29 +41,29 @@ Entonces(/^filtro por un itinerario en la matriz$/) do
41
41
  end
42
42
 
43
43
  Entonces(/^verifico la base tarifaria$/) do
44
- if AllPages.site == "PE"
45
- @page.precio_itinerario_pe_element.when_visible(timeout=20)
46
- else
47
- @page.precio_itinerario_element.when_visible(timeout=20)
44
+ if AllPages.site == 'PE'
45
+ @page.precio_itinerario_pe_element.when_visible(20)
46
+ else
47
+ @page.precio_itinerario_element.when_visible(20)
48
48
  end
49
49
  if @page.desglose_element.present?
50
- @basefare = "tot"
50
+ @basefare = 'tot'
51
51
  else
52
- @basefare = "adt"
53
- end
52
+ @basefare = 'adt'
53
+ end
54
54
  price_cluster = Hash.new
55
55
  doc = Hpricot.parse(@page.html)
56
- price_matrix = (doc/"div#matrix span[@class='price-currency #{Helpers.currency(AllPages.site)} ']").first.inner_text.strip
57
- price_cluster['adt'] = (doc/"div.cluster span.fare span[@class='price-currency #{Helpers.currency(AllPages.site)} ']").first.inner_text.strip
58
- if @basefare=="tot"
59
- price_cluster['tot'] = (doc/"div.cluster div.fare-detail li.fare-price span[@class='price-currency #{Helpers.currency(AllPages.site)} ']").first.inner_text.strip
56
+ price_matrix = (doc / "div#matrix span[@class='price-currency #{Helpers.currency(AllPages.site)} ']").first.inner_text.strip
57
+ price_cluster['adt'] = (doc / "div.cluster span.fare span[@class='price-currency #{Helpers.currency(AllPages.site)} ']").first.inner_text.strip
58
+ if @basefare == 'tot'
59
+ price_cluster['tot'] = (doc / "div.cluster div.fare-detail li.fare-price span[@class='price-currency #{Helpers.currency(AllPages.site)} ']").first.inner_text.strip
60
60
  end
61
61
  if price_cluster[@basefare]
62
- puts "#{price_cluster[@basefare].gsub(/\n/,'')} != #{price_matrix.gsub(/\n/,'')}"
63
- ((price_cluster[@basefare].gsub(/\n/,'') == price_matrix.gsub(/\n/,'')) or @basefare=="abtesting").should be_true
64
- end
62
+ puts "#{price_cluster[@basefare].gsub(/\n/, '')} != #{price_matrix.gsub(/\n/, '')}"
63
+ ((price_cluster[@basefare].gsub(/\n/, '') == price_matrix.gsub(/\n/, '')) || @basefare == 'abtesting').should be_true
64
+ end
65
65
  end
66
66
 
67
67
  Entonces(/^verifico el breakdown$/) do
68
- (@basefare=="abtesting" or ((@basefare=="adt")^(@page.detalle_precio_itinerario_elements.length > 0))).should be_true
68
+ (@basefare == 'abtesting' || ((@basefare == 'adt') ^ (@page.detalle_precio_itinerario_elements.length > 0))).should be_true
69
69
  end
@@ -1,23 +1,23 @@
1
1
  # encoding: utf-8
2
- Cuando(/^ingreso bebes de mas$/) do
3
- url = @page.url.gsub(/\/\d\/\d\/\d/,"/1/0/4")
4
- @page.buscar url
2
+ Cuando(/^ingreso bebes de mas$/) do
3
+ url = @page.url.gsub(%r{/\d/\d/\d}, '/1/0/4')
4
+ @page.buscar url
5
5
  end
6
6
 
7
7
  Then(/^ingreso una fecha pasada$/) do
8
- date = Date.today -1
9
- @page.nueva_fecha_ida date
10
- @page.buscar
8
+ date = Date.today - 1
9
+ @page.nueva_fecha_ida date
10
+ @page.buscar
11
11
  end
12
12
 
13
13
  Then(/^Verifico mensaje de error "(.*)"$/) do |text|
14
- step "verifico que la pagina no rompa"
15
- @page.resultados_error_element.should visible("Mensaje de error")
16
- @page.resultados_error_element.text.no_accents.downcase.should match(text)
14
+ step 'verifico que la pagina no rompa'
15
+ @page.resultados_error_element.should visible('Mensaje de error')
16
+ @page.resultados_error_element.text.no_accents.downcase.should match(text)
17
17
  end
18
18
 
19
19
  Then(/^ingreso una fecha del dia de hoy$/) do
20
- date = Date.today
21
- @page.nueva_fecha_ida date
22
- @page.buscar
20
+ date = Date.today
21
+ @page.nueva_fecha_ida date
22
+ @page.buscar
23
23
  end
@@ -1,69 +1,69 @@
1
1
  # encoding: utf-8
2
2
  Cuando(/^verifico que el cambio de moneda no muestre limpiar filtros$/) do
3
- if @page.moneda_local_element.present?
4
- @page.moneda_local_element.set
5
- sleep(0.5)
6
- @page.moneda_dolar_element.set
7
- sleep(0.5)
8
- @page.limpiar_filtro_precio_element.should_not visible("boton de limpiar filtro")
9
- end
10
- @page.aplicar_filtro_precio_element.text.should match("Aplicar|Apply")
3
+ if @page.moneda_local_element.present?
4
+ @page.moneda_local_element.set
5
+ sleep(0.5)
6
+ @page.moneda_dolar_element.set
7
+ sleep(0.5)
8
+ @page.limpiar_filtro_precio_element.should_not visible('boton de limpiar filtro')
9
+ end
10
+ @page.aplicar_filtro_precio_element.text.should match('Aplicar|Apply')
11
11
  end
12
12
 
13
13
  Cuando(/^elijo una aerolinea a aplicar$/) do
14
- doc = Hpricot.parse(@page.html)
15
- options = (doc/"div.ux-flights-filter-airlines")[0]
16
- options = (options/"ul.items label").reject{|option| option.attributes["class"].match(/selected|disabled|enabled/) or option.attributes["for"]=="airport-outbound-unique"}
17
- @airline = options[rand(options.length)]
18
- @total = (@airline/"span.total").inner_text.strip.to_i
14
+ doc = Hpricot.parse(@page.html)
15
+ options = (doc / 'div.ux-flights-filter-airlines')[0]
16
+ options = (options/"li.item").select { |option| !(option / "input")[0].attributes['id'].match(/airlines-unique|airlines-all/) }
17
+ @airline = options[rand(options.length)]
18
+ @total = (@airline / 'span.total').inner_text.strip.to_i
19
19
  end
20
20
 
21
21
  Entonces(/^filtro por aerolinea$/) do
22
- @page.browser.checkbox(:id,(@airline/"input").first.attributes['id']).set
22
+ @page.browser.checkbox(:id, (@airline / 'input').first.attributes['id']).set
23
23
  end
24
24
 
25
25
  Entonces(/^verifico que los contadores respecto a las aerolineas sean correctos$/) do
26
- @page.cantidad_items_aeropuerto_salida_element.text.to_i.should equal(@total)
27
- @page.cantidad_items_aeropuerto_llegada_element.text.to_i.should equal(@total) if @page.cantidad_items_aeropuerto_llegada_element.present?
28
- @page.cantidad_items_paradas_element.text.to_i.should equal(@total)
26
+ @page.cantidad_items_aeropuerto_salida_element.text.to_i.should equal(@total)
27
+ @page.cantidad_items_aeropuerto_llegada_element.text.to_i.should equal(@total) if @page.cantidad_items_aeropuerto_llegada_element.present?
28
+ @page.cantidad_items_paradas_element.text.to_i.should equal(@total)
29
29
  end
30
30
 
31
31
  Entonces(/^verifico que la primer pagina muestre correctamente los filtros de aerolineas$/) do
32
- group_airlines = [["UA","CM","AM","US","AA","DL"],["LA","4M","XL","4C","JJ","PZ"],["AV","TA","LR"]]
33
- doc = Hpricot.parse(@page.html)
34
- airlines = []
35
- airline = (@airline/"img").first.attributes['src'].match(/\/(.{1,7})\.png/)[1].strip
36
- (doc/"div#clusters div.cluster ul.itineraries-group").each do |itineraries|
37
- airlines += (itineraries/"li.logo img").collect{|img| img.attributes['src'].match(/\/(.{1,7})\.png/)[1]}
38
- airlines += (itineraries/"li.airlines img").collect{|img| img.attributes['src'].match(/\/(.{1,7})\.png/)[1]}
39
- airlines += (itineraries/"li.airlinesShort img").collect{|img| img.attributes['src'].match(/\/(.{1,7})\.png/)[1]}
40
- group_airlines.each{|airlines_tmp| airlines.concat(airlines_tmp) if airlines_tmp.include?(airline)}
41
- end
42
- airlines.should include?(airline)
32
+ group_airlines = [['UA', 'CM', 'AM', 'US', 'AA', 'DL'], ['LA', '4M', 'XL', '4C', 'JJ', 'PZ'], ['AV', 'TA', 'LR']]
33
+ doc = Hpricot.parse(@page.html)
34
+ airlines = []
35
+ airline = (@airline / 'img').first.attributes['src'].match(/\/(.{1,7})\.png/)[1].strip
36
+ (doc/'div#clusters div.cluster ul.itineraries-group').each do |itineraries|
37
+ airlines += (itineraries / 'li.logo img').map { |img| img.attributes['src'].match(/\/(.{1,7})\.png/)[1] }
38
+ airlines += (itineraries / 'li.airlines img').map { |img| img.attributes['src'].match(/\/(.{1,7})\.png/)[1] }
39
+ airlines += (itineraries / 'li.airlinesShort img').map { |img| img.attributes['src'].match(/\/(.{1,7})\.png/)[1] }
40
+ group_airlines.each { |airlines_tmp| airlines.concat(airlines_tmp) if airlines_tmp.include?(airline) }
41
+ end
42
+ airlines.should include?(airline)
43
43
  end
44
44
 
45
45
  Cuando(/^limpio el filtro de aerolineas$/) do
46
- begin
47
- @page.limpiar_filtro_aerolinea_element.set
48
- rescue Watir::Exception::ObjectDisabledException
49
- @page.cantidad_items_aeropuerto_salida_element.text.to_i.should equal(@total)
50
- end
46
+ begin
47
+ @page.limpiar_filtro_aerolinea_element.set
48
+ rescue Watir::Exception::ObjectDisabledException
49
+ @page.cantidad_items_aeropuerto_salida_element.text.to_i.should equal(@total)
50
+ end
51
51
  end
52
52
 
53
53
  Cuando(/^elijo un aeropuerto (outbound|inbound) a aplicar$/) do |_class|
54
- doc = Hpricot.parse(@page.html)
55
- if _class == 'outbound'
56
- _clase = 'origin'
57
- else
58
- _clase = 'destiny'
59
- end
60
- options = (doc/"div.ux-flights-filter-#{_clase}airports label").reject{|option| option.attributes["class"].match(/selected|disabled/) or option.attributes["for"].match("unique")}
61
- @airport = options[rand(options.length)]
62
- @total = (@airport/"span.total").inner_text.strip.to_i
54
+ doc = Hpricot.parse(@page.html)
55
+ if _class == 'outbound'
56
+ _clase = 'origin'
57
+ else
58
+ _clase = 'destiny'
59
+ end
60
+ options = (doc / "div.ux-flights-filter-#{_clase}airports li.item").select { |option| !(option / "input")[0].attributes['id'].match(/airport-#{_class}-all|airport-#{_class}-unique/)}
61
+ @airport = options[rand(options.length)]
62
+ @total = (@airport / 'span.total').inner_text.strip.to_i
63
63
  end
64
64
 
65
65
  Entonces(/^filtro por aeropuerto$/) do
66
- @page.browser.checkbox(:id,(@airport/"input").first.attributes['id']).set
66
+ @page.browser.checkbox(:id, (@airport/'input').first.attributes['id']).set
67
67
  end
68
68
 
69
69
  Entonces(/^verifico que los contadores respecto al aeropuerto sean correctos$/) do
@@ -72,7 +72,7 @@ end
72
72
 
73
73
  Entonces(/^verifico que la primer pagina muestre correctamente los filtros de aeropuertos (outbound|inbound)$/) do |_class|
74
74
  doc = Hpricot.parse(@page.html)
75
- (@airport/"input").first.attributes["value"].strip.should equal((doc/"div#clusters div.cluster div.#{_class} span.airport a").first.inner_text.strip)
75
+ (@airport / 'input').first.attributes['value'].strip.should equal((doc/"div#clusters div.cluster div.#{_class} span.airport a").first.inner_text.strip)
76
76
  end
77
77
 
78
78
  Cuando(/^limpio el filtro de aeropuertos de salida$/) do
@@ -84,11 +84,11 @@ Cuando(/^limpio el filtro de aeropuertos de llegada$/) do
84
84
  end
85
85
 
86
86
  Cuando(/^elijo una escala a aplicar$/) do
87
- doc = Hpricot.parse(@page.html)
88
- options = (doc/"div.ux-flights-filter-stops//label").reject{|option| option.attributes["class"].match(/selected|disabled/)}
89
- @stop = options[rand(options.length)]
90
- @cant = (@stop/"span.label").inner_text.gsub(/\D/,'').strip.to_i
91
- @total = (@stop/"span.total").inner_text.strip.to_i
87
+ doc = Hpricot.parse(@page.html)
88
+ options = (doc/"div.ux-flights-filter-stops li.item").select { |option| !(option / "input")[0].attributes["class"].match(/ux-common-filter-disabled/)}
89
+ @stop = options[rand(options.length)]
90
+ @cant = (@stop/"span.label").inner_text.gsub(/\D/,'').strip.to_i
91
+ @total = (@stop/"span.total").inner_text.strip.to_i
92
92
  end
93
93
 
94
94
  Entonces(/^filtro por escala$/) do
@@ -101,7 +101,7 @@ Entonces(/^verifico que los contadores respecto a las escalas sean correctos$/)
101
101
  end
102
102
 
103
103
  Entonces(/^verifico que la primer pagina muestre correctamente los filtros de escalas$/) do
104
- doc = Hpricot.parse(@page.html)
104
+ doc = Hpricot.parse(@page.html)
105
105
  (doc/"div#clusters div.cluster li.stops").each do |stop|
106
106
  applied_stop = @cant
107
107
  stop_displayed = stop.inner_text.gsub(/\D/,'').strip.to_i
@@ -119,6 +119,7 @@ Cuando(/^elijo un horario a aplicar - filtros nuevo -$/) do
119
119
  options = (doc/"div#inline-filters-detail-time div.inline-filters-slider-panel")
120
120
  options = (options[0]/"ul.hour-filter-range-links li")
121
121
  @time = options[rand(options.length)]
122
+ byebug
122
123
  end
123
124
 
124
125
  Entonces(/^filtro por horario de ida - filtros nuevo -$/) do
@@ -1,29 +1,29 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
  Cuando(/^vuelvo a la primer pagina en resultados$/) do
3
- @page.actualizar_informacion_element.when_not_visible(timeout=60)
3
+ @page.actualizar_informacion_element.when_not_visible(60)
4
4
  while @page.pagina_previa_element.present?
5
5
  @page.pagina_previa_element.links[0].click
6
6
  begin
7
- @page.actualizar_informacion_element.when_not_visible(timeout=60)
7
+ @page.actualizar_informacion_element.when_not_visible(60)
8
8
  rescue Timeout::Error, Watir::Wait::TimeoutError
9
- pending("Timeout al volver a la primer pagina")
10
- end
9
+ pending('Timeout al volver a la primer pagina')
10
+ end
11
11
  end
12
12
  sleep(1)
13
13
  end
14
14
 
15
15
  Entonces(/^verifico que funcione el paginado correctamente en resultados$/) do
16
16
  iterator = 2
17
- while(@page.pagina_previa_element.present? and iterator < 7)do
17
+ while @page.pagina_previa_element.present? && iterator < 7
18
18
  @page.pagina_previa_element.links[0].click
19
- step "espero que termine de cargar la pagina de resultados"
19
+ step 'espero que termine de cargar la pagina de resultados'
20
20
  iterator += 1
21
21
  end
22
22
  end
23
23
 
24
24
  Entonces(/^verifico que el paginado no traiga mas de "(.*?)" paginas en resultados$/) do |arg1|
25
25
  doc = Hpricot.parse(@page.html)
26
- if (doc/"li.page ")[-2]
27
- ((doc/"li.page ")[-2].inner_text.to_i <= arg1.to_i).should be_true
26
+ if (doc / 'li.page ')[-2]
27
+ ((doc / 'li.page ')[-2].inner_text.to_i <= arg1.to_i).should be_true
28
28
  end
29
- end
29
+ end
@@ -15,7 +15,7 @@ require 'byebug'
15
15
 
16
16
  $VERBOSE = nil
17
17
 
18
- #carga de clases y redefiniciones
18
+ # carga de clases y redefiniciones
19
19
  require_relative 'classes/date'
20
20
  require_relative 'classes/string'
21
21
  require_relative 'classes/price'
@@ -23,7 +23,7 @@ require_relative 'classes/duracion'
23
23
  require_relative 'classes/element'
24
24
  require_relative 'classes/process_manager'
25
25
 
26
- #carga de modulos
26
+ # carga de modulos
27
27
  require_relative 'modules/helpers'
28
28
  require_relative 'modules/devtools'
29
29
  require_relative 'modules/browser'
@@ -57,7 +57,7 @@ require_relative 'modules/checkout/fast_checkout'
57
57
  require_relative 'modules/checkout/datos_de_facturacion'
58
58
  require_relative 'modules/checkout/informacion_de_contacto'
59
59
 
60
- #carga de paginas y modulos de cargas
60
+ # carga de paginas y modulos de cargas
61
61
  require_relative 'pages/flights_tracker/search_page'
62
62
  require_relative 'pages/results/desambiguation_airports_page'
63
63
  require_relative 'pages/results/desambiguation_city_page'
@@ -68,18 +68,18 @@ require_relative 'pages/thanks/thanks_page'
68
68
  require_relative 'pages/landing/search_page'
69
69
  require_relative 'pages/landing/new_landing_page'
70
70
 
71
- #carga de asserts personalizados
71
+ # carga de asserts personalizados
72
72
  require_relative 'matchers'
73
73
  require_relative 'hooks'
74
74
 
75
- #carga de clases de cluster
75
+ # carga de clases de cluster
76
76
  require_relative 'classes/clusters/results_cluster'
77
77
  require_relative 'classes/clusters/results/landing_cluster'
78
78
  require_relative 'classes/clusters/results/render_cluster'
79
79
  require_relative 'classes/clusters/results/details_cluster'
80
80
  require_relative 'classes/clusters/checkout_cluster'
81
81
 
82
- #carga de parametros globales
82
+ # carga de parametros globales
83
83
  $HENRY_PARAMS = Henry::Environment.params
84
84
  $ENV = $HENRY_PARAMS['env']
85
85
 
@@ -93,7 +93,7 @@ rescue Net::ReadTimeout, Selenium::WebDriver::Error::WebDriverError, ChildProces
93
93
  reintentos -= 1
94
94
  sleep 5
95
95
  if reintentos > 0
96
- puts "Error Net::ReadTimeout - Reintentando abrir el browser..."
96
+ puts 'Error Net::ReadTimeout - Reintentando abrir el browser...'
97
97
  retry
98
98
  else
99
99
  @@error_navegador = true
@@ -1,13 +1,9 @@
1
1
  # -*- encoding : utf-8 -*-
2
- Before do |scenario|
3
- #creo una ventana de navegador
4
- end
5
-
6
2
  After do |scenario|
7
3
  if $HENRY_PARAMS['browser']
8
4
  if scenario.failed?
9
- FileUtils.mkdir_p(Henry::Environment.output_path+"/reports/html/screenshots/")
10
- name = "FAILED_#{scenario.name.gsub(' ','').gsub(/[^0-9A-Za-z]/, '')}.png"
5
+ FileUtils.mkdir_p(Henry::Environment.output_path + '/reports/html/screenshots/')
6
+ name = "FAILED_#{scenario.name.gsub(' ', '').gsub(/[^0-9A-Za-z]/, '')}.png"
11
7
  screenshot = "#{Henry::Environment.output_path}/reports/html/screenshots/#{name}"
12
8
  $browser.screenshot.save(screenshot)
13
9
  embed "./screenshots/#{name}", 'image/png'
@@ -17,4 +13,4 @@ end
17
13
 
18
14
  at_exit do
19
15
  $browser.close
20
- end
16
+ end
@@ -49,10 +49,10 @@ module Results
49
49
  span(:cerrar_popup_alerta,:css=>"#create-alert-popup .popup-close-button")
50
50
  span(:cerrar_popup_cantidad_visitantes,:css=>"#searches-count-alert-popup .popup-close-button")
51
51
 
52
- div(:boton_alertas,:id=>"flights-alerts")
52
+ div(:boton_alertas,:id=>"nibbler-subscriptions")
53
53
 
54
- div(:popup_alertas,:id=>"flights-alerts-popup")
55
- div(:cerrar_popup_alertas,:class=>"commonSprite closeBlueIcon nibbler-close close-tooltip")
54
+ div(:popup_alertas,:id=>"nibbler-subscriptions")
55
+ span(:cerrar_popup_alertas,:css=>"#nibbler-subscriptions .nibbler-common-overlay-close")
56
56
 
57
57
  def load_page(tipo,pais,ambiente,cabotaje="nil",params={})
58
58
  super(tipo,pais,ambiente,cabotaje,params)
@@ -12,7 +12,7 @@ Característica: results.errors
12
12
  Cuando ingreso bebes de mas
13
13
  Entonces Verifico mensaje de error "cada bebe debe viajar acompanado por un adulto|cada bebe devera viajar acompanhado por um adulto|every infant must travel with an adult"
14
14
  Cuando ingreso una fecha pasada
15
- Entonces Verifico mensaje de error "es una fecha demasiado cercana para comprar en nuestro sitio web|e uma data muito proxima ao embarque para voce comprar sua passagem em nosso website|is too soon to book on our website"
15
+ Entonces Verifico mensaje de error "no podemos realizar busquedas en el pasado|nao conseguimos fazer buscas em datas passadas|we can.t make searches in the past"
16
16
  Cuando ingreso una fecha del dia de hoy
17
17
  Entonces Verifico mensaje de error "es una fecha demasiado cercana para comprar en nuestro sitio web| e uma data muito proxima ao embarque para voce comprar sua passagem em nosso website|is too soon to book on our website"
18
18
 
@@ -20,6 +20,15 @@ Característica: results.filters
20
20
  Cuando si el site es "PE", elijo moneda local como precio de filtrado
21
21
  Cuando espero que termine de cargar la pagina de resultados
22
22
  Entonces verifico que la pagina no rompa
23
+ Cuando elijo un horario outbound a aplicar
24
+ Entonces filtro por horario outbound
25
+ Cuando espero que termine de cargar la pagina de resultados
26
+ Entonces verifico que la pagina no rompa
27
+ Y verifico que la primer pagina muestre correctamente los filtros de horario outbound
28
+ Cuando limpio el filtro de horario outbound
29
+ Cuando espero que termine de cargar la pagina de resultados
30
+ Entonces verifico que la pagina no rompa
31
+ Cuando elijo una duracion outbound a aplicar
23
32
  Cuando elijo una aerolinea a aplicar
24
33
  Entonces filtro por aerolinea
25
34
  Cuando espero que termine de cargar la pagina de resultados
@@ -45,15 +54,6 @@ Característica: results.filters
45
54
  Y verifico que la primer pagina muestre correctamente los filtros de escalas
46
55
  Cuando limpio el filtro de escalas
47
56
  Cuando espero que termine de cargar la pagina de resultados
48
- Cuando elijo un horario outbound a aplicar
49
- Entonces filtro por horario outbound
50
- Cuando espero que termine de cargar la pagina de resultados
51
- Entonces verifico que la pagina no rompa
52
- Y verifico que la primer pagina muestre correctamente los filtros de horario outbound
53
- Cuando limpio el filtro de horario outbound
54
- Cuando espero que termine de cargar la pagina de resultados
55
- Entonces verifico que la pagina no rompa
56
- Cuando elijo una duracion outbound a aplicar
57
57
  Entonces filtro por duracion outbound
58
58
  Cuando espero que termine de cargar la pagina de resultados
59
59
  Entonces verifico que la pagina no rompa
@@ -1,21 +1,20 @@
1
- #multi_test_flight.gemspec
2
-
3
- # -*- encoding: utf-8 -*-
4
- Gem::Specification.new do |gem|
1
+ # multi_test_flight.gemspec
2
+ # -*- encoding: utf-8 -*-
3
+ Gem::Specification.new do |gem|
5
4
  gem.authors = ["lgonzalez,lsimean"]
6
5
  gem.email = ["lgonzalez@despegar.com,nsimean@despegar.com"]
7
6
  gem.description = %q{test automatizado para el proyecto flights gui}
8
7
  gem.summary = %q{test para results, checkout y landing}
9
8
 
10
9
  gem.files = Dir[".henry/**/*.*"] + Dir["flights_gui_tests.gemspec"] + Dir["Gemfile"] + Dir['features/**/*.rb'] + Dir['features/data/*.*'] + Dir['features/**/*.feature'] + Dir['henry-context.yml']
11
- #Se pueden descartar archivos que solo son necesarios en desarrollo.
12
- #Usualmente esta lista se obtiene de forma programática levantando todos los archivos que esten dentro de lib.
10
+ # Se pueden descartar archivos que solo son necesarios en desarrollo.
11
+ # Usualmente esta lista se obtiene de forma programática levantando todos los archivos que esten dentro de lib.
13
12
 
14
- gem.name = "flights_gui_tests" #Debe ser unico en el Gem Server, tratemos de utilizar nombre que identifiquen de forma inequivoca
13
+ gem.name = "flights_gui_tests" # Debe ser unico en el Gem Server, tratemos de utilizar nombre que identifiquen de forma inequivoca
15
14
 
16
- gem.require_paths = ["lib"] #Usualmente es solo lib -> ["lib"]
15
+ gem.require_paths = ["lib"] # Usualmente es solo lib -> ["lib"]
17
16
 
18
- gem.version = '0.1.1' #La version se debe incrementar cada vez que se desea publicar una nueva version del test.
17
+ gem.version = '0.1.2' # La version se debe incrementar cada vez que se desea publicar una nueva version del test.
19
18
 
20
19
  gem.add_dependency('henry-container', '>= 0.1.39')
21
20
  gem.add_dependency('page-object')
@@ -30,5 +29,4 @@
30
29
  gem.add_dependency('byebug')
31
30
 
32
31
  gem.add_development_dependency('geminabox')
33
-
34
- end
32
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flights_gui_tests
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - lgonzalez,lsimean
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-02 00:00:00.000000000 Z
11
+ date: 2014-10-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: henry-container