flights_gui_tests 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/features/data/miles.yml +5 -5
- data/features/step_definitions/checkout/cash_payment_steps.rb +57 -0
- data/features/step_definitions/checkout/checkout_steps.rb +48 -5
- data/features/step_definitions/checkout/compra_duplicada_steps.rb +27 -0
- data/features/step_definitions/checkout/cupones_steps.rb +35 -0
- data/features/step_definitions/checkout/error_messages_steps.rb +245 -0
- data/features/step_definitions/checkout/fast_checkout_steps.rb +51 -0
- data/features/step_definitions/checkout/form_steps.rb +1 -1
- data/features/step_definitions/checkout/load_steps.rb +14 -1
- data/features/step_definitions/checkout/price_jump_steps.rb +67 -0
- data/features/step_definitions/checkout/upselling_steps.rb +55 -0
- data/features/step_definitions/checkout/verifications_steps.rb +36 -0
- data/features/step_definitions/{results/desambiguation_steps.rb → desambiguation_steps.rb} +10 -8
- data/features/step_definitions/landing/landing_steps.rb +51 -4
- data/features/step_definitions/landing/load_steps.rb +8 -0
- data/features/step_definitions/landing/long_tail_steps.rb +48 -0
- data/features/step_definitions/landing/negative_steps.rb +109 -0
- data/features/step_definitions/page_steps.rb +4 -0
- data/features/step_definitions/results/filters_steps.rb +15 -7
- data/features/step_definitions/results/load_steps.rb +14 -0
- data/features/step_definitions/results/matrix_steps.rb +22 -0
- data/features/step_definitions/results/results_steps.rb +1 -1
- data/features/step_definitions/{results/tags_steps.rb → tags_steps.rb} +93 -1
- data/features/step_definitions/thanks/load_steps.rb +9 -2
- data/features/step_definitions/thanks/thanks_steps.rb +44 -7
- data/features/support/classes/clusters/checkout_cluster.rb +9 -4
- data/features/support/env.rb +2 -0
- data/features/support/modules/checkout/datos_de_facturacion.rb +13 -17
- data/features/support/modules/checkout/errores.rb +35 -0
- data/features/support/modules/checkout/fast_checkout.rb +31 -0
- data/features/support/modules/checkout/pasajeros.rb +1 -0
- data/features/support/modules/checkout/tarjeta.rb +83 -0
- data/features/support/modules/results/filters.rb +1 -1
- data/features/support/modules/results/matrix/matrix_airline.rb +4 -0
- data/features/support/pages/all_pages.rb +20 -14
- data/features/support/pages/checkout/checkout_page.rb +59 -4
- data/features/support/pages/checkout/popup_results_page.rb +5 -3
- data/features/support/pages/landing/search_page.rb +21 -2
- data/features/support/pages/results/desambiguation_airports_page.rb +8 -2
- data/features/support/pages/results/search_page.rb +8 -3
- data/features/support/pages/thanks/thanks_page.rb +28 -0
- data/features/tests/checkout/agency.feature +35 -0
- data/features/tests/checkout/book_ok.feature +9 -1
- data/features/tests/checkout/cac.feature +56 -0
- data/features/tests/checkout/cash_payment.feature +55 -0
- data/features/tests/checkout/compras_duplicadas.feature +97 -0
- data/features/tests/checkout/cupones.feature +37 -0
- data/features/tests/checkout/error_messages.feature +84 -0
- data/features/tests/checkout/fast_checkout.feature +80 -0
- data/features/tests/checkout/low_cost.feature +52 -0
- data/features/tests/checkout/online_payment.feature +55 -0
- data/features/tests/checkout/price_jump.feature +107 -0
- data/features/tests/checkout/providers.feature +59 -0
- data/features/tests/checkout/seguros.feature +46 -0
- data/features/tests/flights_tracker/search.feature +1 -1
- data/features/tests/landing/disambiguation_airports.feature +88 -0
- data/features/tests/landing/filters.feature +88 -0
- data/features/tests/landing/integration.feature +148 -0
- data/features/tests/landing/long_tail.feature +171 -0
- data/features/tests/landing/matrix.feature +154 -0
- data/features/tests/landing/negative.feature +152 -0
- data/features/tests/landing/orders.feature +81 -0
- data/features/tests/landing/pagination.feature +142 -0
- data/features/tests/landing/reviews.feature +137 -0
- data/features/tests/landing/search.feature +2 -2
- data/features/tests/landing/sort.feature +142 -0
- data/features/tests/landing/tags.feature +144 -0
- data/features/tests/results/errors.feature +1 -1
- data/features/tests/results/matrix/matrix_price.feature +1 -1
- data/features/tests/results/recommendation.feature +2 -2
- data/features/tests/results/reviews_airlines.feature +1 -1
- data/features/tests/results/search.feature +1 -1
- data/flights_gui_tests.gemspec +1 -1
- data/henry-context.yml +7828 -191
- metadata +39 -4
@@ -1,12 +1,49 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
Entonces(/^verifico el link de mi despegar$/) do
|
3
|
-
|
3
|
+
if AllPages.site=="BR"
|
4
|
+
@page.link_mi_despegar_element.text.no_accents.downcase.should match("em caso de duvidas, acesse")
|
5
|
+
@page.link_mi_despegar_element.link(:title,"Meu Decolar").should visible
|
6
|
+
elsif AllPages.site=="US"
|
7
|
+
@page.link_mi_despegar_element.text.no_accents.downcase.should match("if you have any questions, please login to")
|
8
|
+
@page.link_mi_despegar_element.link(:title,"My Despegar").should visible
|
9
|
+
else
|
10
|
+
@page.link_mi_despegar_element.text.no_accents.downcase.should match("ante cualquier consulta, ingrese a")
|
11
|
+
@page.link_mi_despegar_element.link(:title,"Mi Despegar").should visible
|
12
|
+
end
|
4
13
|
end
|
5
14
|
|
6
|
-
|
7
|
-
|
8
|
-
|
15
|
+
Y(/^verifico los valores del desglose en gracias contra los del checkout/) do
|
16
|
+
@itinerario_gracias.validarSumaDesgloce.should be_within(4).of(@itinerario_gracias.tarifas['total'].value)
|
17
|
+
unless @itinerario_gracias.tarifas['adt'].valor.zero? or @itinerario_gracias.tarifas['tarifa_adulto'].nil?
|
18
|
+
@itinerario_gracias.tarifas['adt'].valor.should equal(@itinerario_gracias.tarifas['tarifa_adulto'].valor * @page.manage_data.adt)
|
19
|
+
end
|
20
|
+
@itinerario_checkout.tarifas.each_pair do |key,value|
|
21
|
+
if @itinerario_gracias.tarifas[key] and !value.zero? and value.currency == @itinerario_gracias.tarifas[key].currency
|
22
|
+
if value != @itinerario_gracias.tarifas[key]
|
23
|
+
puts key
|
24
|
+
value.should equal(@itinerario_gracias.tarifas[key])
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
9
29
|
|
10
|
-
Entonces(/^verifico
|
11
|
-
|
12
|
-
|
30
|
+
Entonces(/^verifico los datos del vuelo comprado$/) do
|
31
|
+
@cluster_json = @page.manage_data.get_results_search_service
|
32
|
+
@page.ver_desglose_gracias_element.should visible("Link para popup de detalle de vuelo")
|
33
|
+
@page.ver_desglose_gracias_element.click
|
34
|
+
@page.popup_desglose_gracias_element.when_visible(timeout=20)
|
35
|
+
itinerario_gracias = Hpricot.parse(@page.popup_desglose_gracias_element.html)
|
36
|
+
itinerario_gracias.inner_text.empty?.should_not be_true
|
37
|
+
@monto_total=(itinerario_gracias/"span#total-price span.amount").inner_text.gsub(/\.|\,/,'').to_i
|
38
|
+
@page.links_mas_detalles_gracias_elements.each do |a|
|
39
|
+
a.click
|
40
|
+
Watir::Wait.until(timeout=20){@page.popup_desglose_detalles_gracias_element.present?}
|
41
|
+
doc = Hpricot.parse(@page.popup_desglose_detalles_gracias_element.html)
|
42
|
+
detail = DetailsCluster.new(doc)
|
43
|
+
@page.cerrar_popup_desglose_detalles_gracias_element.click
|
44
|
+
Watir::Wait.until(timeout=20){!@page.popup_desglose_detalles_gracias_element.present?}
|
45
|
+
sleep(1)
|
46
|
+
end
|
47
|
+
@itinerario_gracias = @page.datos_itinerario
|
48
|
+
@page.cerrar_popup_desglose_gracias_element.click
|
49
|
+
end
|
@@ -69,10 +69,10 @@ module Checkout
|
|
69
69
|
def load_prices(p_html)
|
70
70
|
|
71
71
|
@tarifas = Hash.new
|
72
|
-
if (p_html/"span#secondary-currency").empty?
|
73
|
-
@tarifas['tarifa_adulto'] = Price.new((p_html/"
|
74
|
-
|
75
|
-
@tarifas['tarifa_adulto'] = Price.new((p_html/"
|
72
|
+
if !(p_html/"span#secondary-currency").empty?
|
73
|
+
@tarifas['tarifa_adulto'] = Price.new((p_html/"div.adult-price-conversion span#local-currency span.code").first.inner_text.strip + " " + (p_html/"div.adult-price-conversion span#local-currency span.amount").first.inner_text.strip)
|
74
|
+
elsif !(p_html/"li.adult-price").empty?
|
75
|
+
@tarifas['tarifa_adulto'] = Price.new((p_html/"li.adult-price span[@class='price-currency'] span.currency").first.inner_text.strip + " " + (p_html/"li.adult-price span[@class='price-currency'] span.amount").first.inner_text.strip)
|
76
76
|
end
|
77
77
|
|
78
78
|
adt = (p_html/"li.adult_fare").select{|li| li.inner_text.no_accents.downcase =~ /adulto|adult/}.first
|
@@ -113,5 +113,10 @@ module Checkout
|
|
113
113
|
|
114
114
|
end
|
115
115
|
|
116
|
+
def escala_to_i(escala)
|
117
|
+
return 0 if escala.to_s =~ /(solo vuelo directo)|(Sin escalas)|(Sem escalas)|(Soamente v.o directo)|(Vuelo Directo)/i
|
118
|
+
return escala.to_s.gsub(/\D/,'').to_i
|
119
|
+
end
|
120
|
+
|
116
121
|
end
|
117
122
|
end
|
data/features/support/env.rb
CHANGED
@@ -48,6 +48,8 @@ require_relative 'modules/results/itineraries/data'
|
|
48
48
|
|
49
49
|
require_relative 'modules/checkout/pasajeros'
|
50
50
|
require_relative 'modules/checkout/tarjeta'
|
51
|
+
require_relative 'modules/checkout/errores'
|
52
|
+
require_relative 'modules/checkout/fast_checkout'
|
51
53
|
require_relative 'modules/checkout/datos_de_facturacion'
|
52
54
|
require_relative 'modules/checkout/informacion_de_contacto'
|
53
55
|
|
@@ -19,30 +19,26 @@ module Checkout
|
|
19
19
|
text_field(:departamento_facturacion,:id=>"invoice-address-deparment")
|
20
20
|
text_field(:codigo_postal_facturacion,:id=>"invoice-postal-code")
|
21
21
|
text_field(:otro_estado_facturacion,:id=>"invoice-other-state")
|
22
|
+
text_field(:mail_facturacion,:id=>"invoice-mail")
|
22
23
|
|
23
24
|
checkbox(:invoice_check,:id=>"invoice-check")
|
24
25
|
|
25
|
-
|
26
|
+
link(:buscar_codigo_postal,:class=>"search-postal-code")
|
26
27
|
|
27
28
|
def cargar_datos_facturacion
|
28
29
|
if AllPages.site=="AR"
|
29
30
|
option = ["FINAL","INSCR","EXENT","MONOTRIBUTO"][rand(3)]
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
codigo_postal_facturacion_element.set("7111")
|
42
|
-
numero_facturacion_element.set("123")
|
43
|
-
piso_facturacion_element.set("1")
|
44
|
-
departamento_facturacion_element.set("1")
|
45
|
-
end
|
31
|
+
situacion_fiscal_element.select_value(option)
|
32
|
+
#lleno los campos requeridos
|
33
|
+
cuil_element.set("30643063936")
|
34
|
+
nombre_facturacion_element.set("diego qa romero") if nombre_facturacion_element.present?
|
35
|
+
provincia_facturacion_element.select_value("C")
|
36
|
+
set_autocomplete("ciudad_facturacion_custom","buenos aires")
|
37
|
+
calle_facturacion_element.set("corrientes")
|
38
|
+
codigo_postal_facturacion_element.set("7111")
|
39
|
+
numero_facturacion_element.set("123")
|
40
|
+
piso_facturacion_element.set("1")
|
41
|
+
departamento_facturacion_element.set("1")
|
46
42
|
else
|
47
43
|
check_invoice_check if invoice_check?
|
48
44
|
cuil_element.set("3334445556")
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
module Checkout
|
3
|
+
module Errores
|
4
|
+
include PageObject
|
5
|
+
|
6
|
+
span(:error_nacionalidad_invalida,:id=>"nationality-0-invalid_custom_nationality")
|
7
|
+
span(:error_numero_tarjeta_vacio,:id=>"card-number-missing_field")
|
8
|
+
span(:error_fecha_tarjeta_vacio,:id=>"expiration-date-missing_field")
|
9
|
+
span(:error_codigo_seguridad_vacio,:id=>"security-code-missing_field")
|
10
|
+
span(:error_usuario_tarjeta_vacio,:id=>"owner-name-missing_field")
|
11
|
+
span(:error_mail_vacio,:id=>"contact-email-missing_field")
|
12
|
+
span(:error_repetir_mail_vacio,:id=>"contact-email-repeat-missing_field")
|
13
|
+
span(:error_telefono_vacio,:id=>"phone-0-missing_field")
|
14
|
+
span(:error_cuit_erroneo,:id=>"invoice-fiscal-id-invalid_cuit")
|
15
|
+
|
16
|
+
span(:error_razon_social_vacio,:id=>"invoice-card-holder-name-missing_field")
|
17
|
+
span(:error_mail_facturacion_vacio,:id=>"invoice-email-missing_field")
|
18
|
+
span(:error_ciudad_facturacion_vacio,:id=>"invoice-city-missing_field")
|
19
|
+
span(:error_codigo_postal_facturacion_vacio,:id=>"invoice-postal-code-missing_field")
|
20
|
+
span(:error_direccion_facturacion_vacio,:id=>"invoice-address-missing_field")
|
21
|
+
span(:error_cuit_vacio,:id=>"invoice-fiscal-id-missing_field")
|
22
|
+
|
23
|
+
span(:error_ruc_erroneo,:id=>"invoice-fiscal-id-invalid_ruc")
|
24
|
+
span(:error_mail_facturacion,:id=>"invoice-email-invalid_email")
|
25
|
+
span(:error_codigo_seguridad_invalido,:id=>"security-code-invalid_card_security_code")
|
26
|
+
span(:error_usuario_tarjeta_invalido,:id=>"owner-name-invalid_card_owner_name")
|
27
|
+
span(:error_mail_erroneo,:id=>"contact-email-invalid_email")
|
28
|
+
span(:error_repetir_mail_erroneo,:id=>"contact-email-repeat-invalid_email")
|
29
|
+
|
30
|
+
spans(:error_primer_nombre_vacio,:css=>".passenger-first-name-container .error-missing_field-message")
|
31
|
+
spans(:error_primer_nombre_erroneo,:css=>".passenger-first-name-container .error-invalid_name-message")
|
32
|
+
spans(:error_apellido_erroneo,:css=>".passenger-last-name-container .error-invalid_name-message")
|
33
|
+
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
module Checkout
|
3
|
+
|
4
|
+
module FastCheckout
|
5
|
+
|
6
|
+
include PageObject
|
7
|
+
|
8
|
+
div(:checkout_login,:id=>"checkout-login")
|
9
|
+
div(:tarjetas_guardadas,:id=>"stored-cards")
|
10
|
+
div(:nueva_tarjeta,:class=>"new-card-container")
|
11
|
+
div(:datos_tarjeta_guardada,:id=>"paymentDefinition.billingAddressDefinition")
|
12
|
+
|
13
|
+
link(:log_out_checkout,:css=>"#checkout-login .log-out")
|
14
|
+
link(:log_in_checkout,:css=>"#checkout-login .log-in")
|
15
|
+
link(:mostrar_cartas_guardadas,:class=>"display-cards")
|
16
|
+
|
17
|
+
elements(:container_tarjetas,:ul,:class=>"card-container")
|
18
|
+
|
19
|
+
p(:usuario_logueado_checkout,:css=>"#checkout-login .logged-in")
|
20
|
+
|
21
|
+
radio_button(:opcion_tarjeta_guardada,:css=>"#stored-cards .radio")
|
22
|
+
|
23
|
+
text_field(:codigo_seguridad_tarjeta_guardada,:id=>"stored-card-0-security-code")
|
24
|
+
|
25
|
+
text_field(:mail_usuario_nibbler,:id=>"signin-email")
|
26
|
+
text_field(:pass_usuario_nibbler,:id=>"signin-pass")
|
27
|
+
|
28
|
+
button(:boton_usuario_nibbler,:class=>"nibbler-selfservice-pass-button")
|
29
|
+
|
30
|
+
end
|
31
|
+
end
|
@@ -12,6 +12,7 @@ module Checkout
|
|
12
12
|
elements(:dia_nacimiento,:select_list,:css=>"#passengers .select-day")
|
13
13
|
elements(:mes_nacimiento,:select_list,:css=>"#passengers .select-month")
|
14
14
|
elements(:ano_nacimiento,:select_list,:css=>"#passengers .select-year")
|
15
|
+
elements(:campos_pasajeros,:fieldset,:id=>"passengers")
|
15
16
|
|
16
17
|
div(:edades_adultos,:id=>"birthday-group-0")
|
17
18
|
|
@@ -9,6 +9,7 @@ module Checkout
|
|
9
9
|
select_list(:tipo_titular_tarjeta,:id=>"owner-type")
|
10
10
|
select_list(:sexo_titular_tarjeta,:id=>"owner-gender")
|
11
11
|
select_list(:estado_entrega_tarjeta,:id=>"billing-address-state")
|
12
|
+
select_list(:sexo_offline,:id=>"offline-owner-gender")
|
12
13
|
|
13
14
|
text_field(:cp_entrega_tarjeta,:id=>"billing-address-postal-code")
|
14
15
|
text_field(:piso_entrega_tarjeta,:id=>"billing-address-floor")
|
@@ -21,15 +22,31 @@ module Checkout
|
|
21
22
|
text_field(:nombre_titular_tarjeta,:id=>"owner-name")
|
22
23
|
text_field(:documento_titular_tarjeta,:id=>"owner-document-number")
|
23
24
|
text_field(:banco_emisor,:id=>"other-bank-name")
|
25
|
+
text_field(:documento_offline,:id=>"offline-owner-document-number")
|
26
|
+
text_field(:nombre_completo_contacto,:id=>"contact-contact-full-name")
|
24
27
|
|
25
28
|
div(:debito,:class=>"installment-info")
|
29
|
+
div(:warning_deposito,:css=>"#cash-installment .ux-common-message-warning")
|
30
|
+
div(:con_intereses,:class=>"installments-with-interest")
|
26
31
|
|
27
32
|
radio_button(:un_pago,:id=>"installment-0")
|
28
33
|
radio_button(:un_pago_argentina,:class=>"radio main-radio ")
|
29
34
|
radio_button(:un_pago_debito,:id=>"installment-1")
|
35
|
+
radio_button(:deposito,:css=>"#cash-installment .main-radio")
|
36
|
+
radio_button(:pago_online,:css=>"#homebanking-installment .main-radio")
|
37
|
+
radio_button(:opcion_cac,:css=>"#cac-installment .main-radio")
|
38
|
+
radio_button(:pago_con_intereses,:class=>"radio main-radio radio-with-interest")
|
39
|
+
|
30
40
|
|
31
41
|
elements(:tipos_de_pago,:radio,:css=>"#paymentDefinition input.radio")
|
32
42
|
|
43
|
+
span(:desc_fecha_deposito,:css=>"#cash-installment .installment-description-info")
|
44
|
+
span(:desc_pasos_deposito,:css=>"#cash-installment .installment-detail-text")
|
45
|
+
span(:precio_final,:id=>"total-price")
|
46
|
+
|
47
|
+
li(:medio_de_pago_seleccionado,:css=>"#paymentDefinition .selected")
|
48
|
+
li(:medio_de_subpago_seleccionado,:css=>".list .sub-selected")
|
49
|
+
|
33
50
|
def cargar_datos_tarjeta
|
34
51
|
if AllPages.site=="AR"
|
35
52
|
select_un_pago_argentina
|
@@ -67,5 +84,71 @@ module Checkout
|
|
67
84
|
cp_entrega_tarjeta_element.set "1182" if cp_entrega_tarjeta_element.present?
|
68
85
|
end
|
69
86
|
|
87
|
+
def verificar_tipos_de_pago
|
88
|
+
interes = nil
|
89
|
+
doc=Hpricot.parse(precio_final_element.html)
|
90
|
+
total_1 = doc.inner_text.gsub(/\D/,'').to_i
|
91
|
+
radios = tipos_de_pago_elements
|
92
|
+
i=0
|
93
|
+
radios.each do |radio|
|
94
|
+
if radio.present?
|
95
|
+
radio.click
|
96
|
+
sleep(0.5)
|
97
|
+
doc=Hpricot.parse(precio_final_element.html)
|
98
|
+
total_2 = doc.inner_text.gsub(/\D/,'').to_i
|
99
|
+
unless radio.attribute_value("data-regular-expressions").nil?
|
100
|
+
keys = JSON.parse(radio.attribute_value("data-regular-expressions")).keys
|
101
|
+
if interes or radio.attribute_value("class").match(/radio-with-interest/)
|
102
|
+
validar_cuota_con_intereses(total_1,total_2)
|
103
|
+
else
|
104
|
+
case keys.first
|
105
|
+
when /1(.*)CREDIT(.*)null$/ then validar_cuota_un_pago()
|
106
|
+
when /(.*)CREDIT(.*)null$/ then validar_cuota_con_intereses(total_1,total_2)
|
107
|
+
when /(.*)CREDIT(.*)$/ then validar_cuota_sin_intereses(total_1,total_2)
|
108
|
+
end
|
109
|
+
keys.uniq.length.should equal(keys.length)
|
110
|
+
end
|
111
|
+
else
|
112
|
+
interes = true
|
113
|
+
end
|
114
|
+
end
|
115
|
+
if i > 17
|
116
|
+
break
|
117
|
+
end
|
118
|
+
i = i + 1
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
122
|
+
def validar_cuota_un_pago()
|
123
|
+
|
124
|
+
end
|
125
|
+
|
126
|
+
def validar_cuota_sin_intereses(total_1,total_2)
|
127
|
+
if medio_de_pago_seleccionado_element.div(:class,"installments-price").present?
|
128
|
+
doc = Hpricot.parse(medio_de_pago_seleccionado_element.div(:class,"installments-price").html)
|
129
|
+
inicial = (doc/"span.first-installment").inner_text.downstrip.gsub(/\./,'').match(/(\d+)$/)[1].to_i
|
130
|
+
valor_restantes = (doc/"span.all-installments/span.currency/span.amount").inner_text.gsub(/\./,'').to_i
|
131
|
+
cant_restantes = (doc/"span.all-installments").inner_text.gsub(/\./,'').match(/\+ (\d+)/)[1].to_i
|
132
|
+
(inicial + (cant_restantes * valor_restantes)).should be_within(3).of(total_2)
|
133
|
+
total_1.should equal(total_2)
|
134
|
+
else
|
135
|
+
total_1.should equal(total_2)
|
136
|
+
end
|
137
|
+
end
|
138
|
+
|
139
|
+
def validar_cuota_con_intereses(total_1,total_2)
|
140
|
+
if medio_de_subpago_seleccionado_element.present?
|
141
|
+
doc = Hpricot.parse(medio_de_subpago_seleccionado_element.html)
|
142
|
+
unless (doc/"span.interest").inner_text.empty?
|
143
|
+
costo_financiero = (doc/"span.interest").inner_text.downstrip.gsub(/\./,'').match(/(\d+)$/)[1].to_i
|
144
|
+
inicial = (doc/"span.first-installment").inner_text.downstrip.gsub(/\./,'').match(/(\d+)$/)[1].to_i
|
145
|
+
cant_restantes = (doc/"span.all-installments").inner_text.downstrip.gsub(/\./,'').match(/\+ (\d{1,2})/)[1].to_i
|
146
|
+
valor_restantes = (doc/"span.all-installments/span.price/span.currency/span.amount").inner_text.gsub(/\./,'').to_i
|
147
|
+
((total_2 - (inicial + (cant_restantes * valor_restantes))).abs <= 2).should be_true
|
148
|
+
costo_financiero.should equal(total_2 - total_1)
|
149
|
+
end
|
150
|
+
end
|
151
|
+
end
|
152
|
+
|
70
153
|
end
|
71
154
|
end
|
@@ -13,7 +13,7 @@ module Results
|
|
13
13
|
link(:remover_ultima_accion,:class=>"remove-last-action")
|
14
14
|
|
15
15
|
div(:filtros_precio,:id=>"ux-flights-filters")
|
16
|
-
div(:slider_horario_salida,:
|
16
|
+
div(:slider_horario_salida,:css=>".ux-flights-filter-outboundhours-slider")
|
17
17
|
|
18
18
|
#filtros aerolineas
|
19
19
|
span(:cantidad_items_aerolineas,:css=>".airlines-all .total")
|
@@ -8,9 +8,9 @@ class AllPages
|
|
8
8
|
@@site
|
9
9
|
end
|
10
10
|
|
11
|
-
def load_page(tipo,pais,ambiente,cabotaje="nil")
|
11
|
+
def load_page(tipo,pais,ambiente,cabotaje="nil",params={})
|
12
12
|
@@site = pais
|
13
|
-
@@manage_data = Class.const_get("MockSearch#{tipo.capitalize}").new(pais,ambiente,cabotaje)
|
13
|
+
@@manage_data = Class.const_get("MockSearch#{tipo.capitalize}").new(pais,ambiente,cabotaje,params)
|
14
14
|
end
|
15
15
|
|
16
16
|
def set_autocomplete(object,text)
|
@@ -19,6 +19,10 @@ class AllPages
|
|
19
19
|
@browser.send_keys :enter
|
20
20
|
end
|
21
21
|
|
22
|
+
def ir(url)
|
23
|
+
@browser.goto url
|
24
|
+
end
|
25
|
+
|
22
26
|
def url
|
23
27
|
@browser.url
|
24
28
|
end
|
@@ -56,20 +60,22 @@ class AllPages
|
|
56
60
|
end
|
57
61
|
end
|
58
62
|
|
59
|
-
def
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
else "landing-f-gui=beta|results-f-gui=beta|chkf-app=beta"
|
70
|
-
end
|
63
|
+
def override(tipo)
|
64
|
+
case tipo.upcase
|
65
|
+
when 'RESULTS' then "results-f-gui=beta"
|
66
|
+
when 'CHECKOUT' then "chkf-app=beta"
|
67
|
+
when 'LANDING' then "landing-f-gui=beta"
|
68
|
+
when 'FSM' then "fsm-rest=beta|fsm=beta"
|
69
|
+
when 'CHAS' then "chas-flight=beta"
|
70
|
+
when 'DEBASE' then "flights-dbs-new=flights-dbs-new-b"
|
71
|
+
when 'PRISM' then "prism=beta"
|
72
|
+
end
|
71
73
|
end
|
72
74
|
|
75
|
+
def add_cookie(cookies)
|
76
|
+
cookies.split('_').collect{|cookie| override(cookie)}.join('|')
|
77
|
+
end
|
78
|
+
|
73
79
|
def set_cookies()
|
74
80
|
dominio = case @@site
|
75
81
|
when 'BR' then 'decolar.com'
|
@@ -6,22 +6,74 @@ module Checkout
|
|
6
6
|
include Pages::Cookies
|
7
7
|
include Checkout::Pasajeros
|
8
8
|
include Checkout::Tarjeta
|
9
|
+
include Checkout::Errores
|
10
|
+
include Checkout::FastCheckout
|
9
11
|
include Checkout::DatosDeFacturacion
|
10
12
|
include Checkout::InformacionDeContacto
|
11
13
|
|
12
14
|
element(:pasajeros,:fieldset,:id=>"passengers")
|
13
|
-
checkbox(:condiciones_de_compra,:id=>"read-agreement")
|
14
|
-
link(:comprar,:id=>"submit")
|
15
|
-
div(:popup_transicion_compra,:id=>"popup-checkout-transition-template")
|
16
15
|
element(:checkout_id,:em,:class=>"checkout-id")
|
16
|
+
element(:checkout_id_cash,:span,:class=>"checkout-id")
|
17
|
+
|
18
|
+
link(:comprar,:id=>"submit")
|
19
|
+
link(:cupon_validar,:id=>"validate-voucher")
|
20
|
+
link(:link_cobertura,:class=>"coverage")
|
21
|
+
link(:enviar_preguntas_riesgo,:id=>"submit")
|
17
22
|
|
23
|
+
divs(:secciones_preguntas_riesgo,:class=>"item section radio-group group")
|
24
|
+
|
25
|
+
div(:seccion_preguntas_riesgo,:css=>"#form .radio-group")
|
26
|
+
div(:popup_transicion_compra,:id=>"popup-checkout-transition-template")
|
18
27
|
div(:popup_nuevo_precio,:id=>"popup-price-difference-template")
|
19
28
|
div(:popup_nuevo_vuelo,:id=>"popup-new-flight")
|
20
|
-
|
29
|
+
div(:popup_confirmacion_pago,:id=>"confirm-payment-popup")
|
30
|
+
div(:opcion_no_deposito,:css=>"#confirm-payment-popup .flights-button-no")
|
31
|
+
div(:opcion_si_deposito,:css=>"#confirm-payment-popup .flights-button-yes")
|
21
32
|
div(:notificacion_error,:class=>"notification-box error-box")
|
22
33
|
div(:notificacion_warning,:class=>"notification-box warn-box")
|
23
34
|
div(:notificacion_error_ux,:class=>"ux-common-error")
|
24
35
|
div(:boton_si_cambio_precio,:class=>"button-yes")
|
36
|
+
div(:agencia_afiliada,:id=>"agency")
|
37
|
+
div(:cobertura,:id=>'upselling')
|
38
|
+
div(:cobertura_deshabilitada,:class=>"upselling upselling-disabled")
|
39
|
+
div(:itinerario,:id=>"detail")
|
40
|
+
div(:popup_chat,:id=>"dtalk-container")
|
41
|
+
div(:cupon_error,:id=>"coupon-error")
|
42
|
+
div(:cupon_exito,:id=>"voucher-success")
|
43
|
+
div(:popup_cobertura,:id=>"popup-upselling-coverage-template")
|
44
|
+
div(:popup_compra_duplicada,:id=>"popup-duplicated-transaction")
|
45
|
+
div(:opcion_no_compra_duplicada,:css=>"#popup-duplicated-transaction .button-no")
|
46
|
+
div(:opcion_si_compra_duplicada,:css=>"#popup-duplicated-transaction .button-yes")
|
47
|
+
div(:clientes_felices,:id=>"happy-clients")
|
48
|
+
div(:popup_price_jump,:id=>"popup-price-difference")
|
49
|
+
div(:opcion_si_price_jump,:css=>"#popup-price-difference .button-yes")
|
50
|
+
div(:link_price_jump,:css=>"#popup-price-difference .popup-link")
|
51
|
+
|
52
|
+
checkbox(:opcion_seguros,:id=>"upselling-checkbox")
|
53
|
+
checkbox(:condiciones_de_compra,:id=>"read-agreement")
|
54
|
+
checkbox(:cupones,:id=>"vouchers")
|
55
|
+
|
56
|
+
span(:elegir_otro_vuelo,:class=>"choose-another")
|
57
|
+
span(:error_datos,:class=>"error-message")
|
58
|
+
span(:carga,:css=>".loading .img")
|
59
|
+
span(:cerrar_popup_chat,:css=>"#dtalk-container .close-round-section")
|
60
|
+
span(:cerrar_popup_cobertura,:css=>".popup-upselling-coverage .popup-close-button")
|
61
|
+
span(:protegido,:css=>".protected")
|
62
|
+
span(:desprotegido,:css=>".unprotected")
|
63
|
+
span(:precio_seguro,:css=>"#upselling .description .bold")
|
64
|
+
|
65
|
+
text_field(:cupon_email,:id=>"voucher-email")
|
66
|
+
text_field(:cupon_voucher,:id=>"voucher-code-0")
|
67
|
+
|
68
|
+
li(:precio_seguro_desglose,:class=>"item destination_service_insurance")
|
69
|
+
|
70
|
+
p(:id_reserva_compra_duplicada,:css=>"#popup-duplicated-transaction .paragraph")
|
71
|
+
|
72
|
+
def load_page(tipo,pais,ambiente,cabotaje="nil")
|
73
|
+
super(tipo,pais,ambiente,cabotaje)
|
74
|
+
puts " URL: #{self.manage_data.generate_url_checkout + "?agency=AG14073"}"
|
75
|
+
@browser.goto(self.manage_data.generate_url_checkout + "?agency=AG14073")
|
76
|
+
end
|
25
77
|
|
26
78
|
def cargar_datos_pasajeros
|
27
79
|
@browser.execute_script("javascript:void($('.other-passenger-inputs').css('display','block'));")
|
@@ -41,5 +93,8 @@ module Checkout
|
|
41
93
|
end
|
42
94
|
end
|
43
95
|
|
96
|
+
def datos_itinerario()
|
97
|
+
return Checkout::CheckoutCluster.new(tipo_de_busqueda,Hpricot.parse(itinerario_element.html))
|
98
|
+
end
|
44
99
|
end
|
45
100
|
end
|
@@ -7,8 +7,8 @@ module Checkout
|
|
7
7
|
elements(:opciones_vuelta,:radio,:css=>"div.inbound input")
|
8
8
|
elements(:itinerarios, :div, :css=>"#clusters .cluster")
|
9
9
|
|
10
|
-
div(:itinerario,:class=>"cluster-content flights-cluster")
|
11
|
-
|
10
|
+
div(:itinerario,:class=>"cluster-content flights-cluster")
|
11
|
+
|
12
12
|
def cargar_itinerarios
|
13
13
|
@datos_de_itinerarios = []
|
14
14
|
itinerarios_elements.each do |itinerario|
|
@@ -24,7 +24,9 @@ module Checkout
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def sumar_aparicion
|
27
|
+
@apariciones = @apariciones || 0
|
27
28
|
@apariciones += 1
|
29
|
+
puts @apariciones
|
28
30
|
end
|
29
31
|
|
30
32
|
def apariciones
|
@@ -32,7 +34,7 @@ module Checkout
|
|
32
34
|
end
|
33
35
|
|
34
36
|
def iniciar_apariciones
|
35
|
-
@apariciones = 0
|
37
|
+
@apariciones = @apariciones || 0
|
36
38
|
end
|
37
39
|
|
38
40
|
end
|
@@ -1,22 +1,34 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
module Landing
|
3
3
|
class SearchPage < AllPages
|
4
|
-
include PageObject
|
5
4
|
|
6
|
-
|
5
|
+
include Results::Filters
|
6
|
+
include Results::Matriz::MatrizAerolinea
|
7
|
+
include Pages::Tags
|
8
|
+
|
9
|
+
elements(:buscar,:link,:css=>".flights-cluster .btn-buy")
|
7
10
|
elements(:opciones_ida,:radio,:name=>"0-outbound")
|
8
11
|
elements(:opciones_vuelta,:radio,:name=>"0-inbound")
|
9
12
|
elements(:itinerarios, :div, :css=>"#clusters .cluster")
|
13
|
+
elements(:filtros_salidas,:checkbox,:css=>".ux-flights-filter-departures input")
|
14
|
+
elements(:paginas,:li,:css=>".flights-pagination .page")
|
15
|
+
elements(:detalle_precio_itinerario, :li, :css=>"#clusters .cluster .fare-detail li")
|
16
|
+
|
17
|
+
element(:precio_itinerario, :span, :css=>".cluster .fare .price-currency")
|
18
|
+
element(:precio_itinerario_pe, :span, :css=>".cluster .fare .PEN")
|
10
19
|
|
11
20
|
div(:lista_itinerarios, :id=>"clusters")
|
12
21
|
div(:titulo,:class=>"mainTitle")
|
13
22
|
div(:popup_detalles,:id=>"popup-detail")
|
23
|
+
div(:mensaje,:class=>"messages")
|
24
|
+
div(:reviews_pasajeros,:class=>"flights-comments")
|
14
25
|
|
15
26
|
span(:mensaje_sin_resultados,:class=>"message")
|
16
27
|
span(:simbolo_error,:class=>'commonSprite warningSymbol')
|
17
28
|
span(:mostrar_mas_itinerarios,:class=>"showMoreItineraries")
|
18
29
|
span(:dolares,:class=>"price-currency USD ")
|
19
30
|
|
31
|
+
|
20
32
|
radio_button(:vuelo_oneway,:id=>"oneway")
|
21
33
|
radio_button(:vuelo_roundtrip,:id=>"roundtrip")
|
22
34
|
|
@@ -24,9 +36,16 @@ module Landing
|
|
24
36
|
select_list(:adultos,:css=>"#searchPopup .adultsSelect")
|
25
37
|
select_list(:menores,:css=>"#searchPopup .childsSelect")
|
26
38
|
select_list(:edad,:css=>"#searchPopup .selectAge")
|
39
|
+
select_list(:moneda,:id=>"currency")
|
27
40
|
|
28
41
|
link(:buscar_popup,:css=>"#searchPopup .flights-search-button")
|
29
42
|
|
43
|
+
li(:pagina_previa,:class=>"pagination-button prev")
|
44
|
+
li(:pagina_siguiente,:class=>"pagination-button next")
|
45
|
+
|
46
|
+
h3(:reviews_pasajeros_title,:css=>".flights-comments .ux-common-results-title")
|
47
|
+
|
48
|
+
|
30
49
|
def load_page(tipo,pais,ambiente,cabotaje="nil")
|
31
50
|
super(tipo,pais,ambiente,cabotaje)
|
32
51
|
@datos_de_itinerarios = []
|
@@ -7,10 +7,16 @@ module Results
|
|
7
7
|
|
8
8
|
link(:boton_busqueda,:class=>"ctn-searchbutton")
|
9
9
|
|
10
|
-
def
|
11
|
-
|
10
|
+
def load_page_results(tipo,pais,ambiente,city,cabotaje="nil")
|
11
|
+
load_page(tipo,pais,ambiente,cabotaje)
|
12
12
|
puts " URL: #{self.manage_data.generate_url_disambiguation_airports(city)}"
|
13
13
|
@browser.goto(self.manage_data.generate_url_disambiguation_airports(city))
|
14
14
|
end
|
15
|
+
|
16
|
+
def load_page_landing(tipo,pais,ambiente,city,cabotaje="nil")
|
17
|
+
load_page(tipo,pais,ambiente,cabotaje)
|
18
|
+
puts " URL: #{self.manage_data.generate_url_landing_disambiguation_airports(city)}"
|
19
|
+
@browser.goto(self.manage_data.generate_url_landing_disambiguation_airports(city))
|
20
|
+
end
|
15
21
|
end
|
16
22
|
end
|
@@ -31,7 +31,7 @@ module Results
|
|
31
31
|
li(:pagina_previa,:class=>"pagination-button prev")
|
32
32
|
li(:pagina_siguiente,:class=>"pagination-button next")
|
33
33
|
|
34
|
-
elements(:buscar,:link,:
|
34
|
+
elements(:buscar,:link,:css=>".fare-container .btn-buy")
|
35
35
|
elements(:opciones_ida,:radio,:css=>"div.outbound input")
|
36
36
|
elements(:opciones_vuelta,:radio,:css=>"div.inbound input")
|
37
37
|
elements(:itinerarios, :div, :css=>"#clusters .cluster")
|
@@ -43,8 +43,8 @@ module Results
|
|
43
43
|
select_list(:orden,:id=>"orderby")
|
44
44
|
select_list(:moneda,:id=>"currency")
|
45
45
|
|
46
|
-
def load_page(tipo,pais,ambiente,cabotaje="nil")
|
47
|
-
super(tipo,pais,ambiente,cabotaje)
|
46
|
+
def load_page(tipo,pais,ambiente,cabotaje="nil",params={})
|
47
|
+
super(tipo,pais,ambiente,cabotaje,params)
|
48
48
|
@datos_de_itinerarios = []
|
49
49
|
puts " URL: #{self.manage_data.generate_url_results_search}"
|
50
50
|
@browser.goto(self.manage_data.generate_url_results_search)
|
@@ -63,6 +63,7 @@ module Results
|
|
63
63
|
end
|
64
64
|
|
65
65
|
def cargar_itinerarios
|
66
|
+
@datos_de_itinerarios = @datos_de_itinerarios || []
|
66
67
|
itinerarios_elements.each do |itinerario|
|
67
68
|
@datos_de_itinerarios << ResultsCluster.new(tipo_de_busqueda,Hpricot.parse(itinerario.html))
|
68
69
|
end
|
@@ -97,5 +98,9 @@ module Results
|
|
97
98
|
return @datos_de_itinerarios[index]
|
98
99
|
end
|
99
100
|
|
101
|
+
def datos_itinerario()
|
102
|
+
index, permitida = sanear_itinerarios("DL")
|
103
|
+
@datos_de_itinerarios[index]
|
104
|
+
end
|
100
105
|
end
|
101
106
|
end
|