flights_gui_tests 0.3.9 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/features/step_definitions/checkout/load_steps.rb +6 -2
- data/features/step_definitions/results/reviews_steps.rb +15 -1
- data/features/support/env.rb +2 -7
- data/features/support/modules/checkout/checkout.rb +17 -0
- data/features/support/modules/checkout/new_checkout/datos_de_facturacion.rb +78 -0
- data/features/support/modules/checkout/new_checkout/errores.rb +35 -0
- data/features/support/modules/checkout/new_checkout/fast_checkout.rb +32 -0
- data/features/support/modules/checkout/new_checkout/informacion_de_contacto.rb +30 -0
- data/features/support/modules/checkout/new_checkout/pasajeros.rb +72 -0
- data/features/support/modules/checkout/new_checkout/popup.rb +22 -0
- data/features/support/modules/checkout/new_checkout/reviews.rb +16 -0
- data/features/support/modules/checkout/new_checkout/tarjeta.rb +265 -0
- data/features/support/modules/checkout/{datos_de_facturacion.rb → old_checkout/datos_de_facturacion.rb} +0 -0
- data/features/support/modules/checkout/{errores.rb → old_checkout/errores.rb} +0 -0
- data/features/support/modules/checkout/{fast_checkout.rb → old_checkout/fast_checkout.rb} +0 -0
- data/features/support/modules/checkout/{informacion_de_contacto.rb → old_checkout/informacion_de_contacto.rb} +0 -0
- data/features/support/modules/checkout/{pasajeros.rb → old_checkout/pasajeros.rb} +0 -0
- data/features/support/modules/checkout/{popup.rb → old_checkout/popup.rb} +0 -0
- data/features/support/modules/checkout/old_checkout/reviews.rb +16 -0
- data/features/support/modules/checkout/{tarjeta.rb → old_checkout/tarjeta.rb} +0 -0
- data/features/support/modules/results/itineraries/details.rb +19 -19
- data/features/support/modules/results/recommendation.rb +1 -1
- data/features/support/pages/all_pages.rb +1 -1
- data/features/support/pages/checkout/checkout_page.rb +5 -0
- data/features/support/pages/checkout/new_checkout_page.rb +116 -0
- data/features/tests/checkout/book_ok.feature +1 -0
- data/features/tests/results/matrix/matrix_price.feature +10 -0
- data/flights_gui_tests.gemspec +1 -1
- metadata +21 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ff7c78b697bea3ff7ded2c1e8edebe885431490d
|
4
|
+
data.tar.gz: ba08856fe7b286f1b17f0786bbd47e63d3eff823
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1ad6f7712d62722a306e67f86c51623aaa08e922a2dec639b7ccd493a2ea834bc178b8e63ccb9c1ad67ef4cf56300bfd93cde84f725d4519cd4fd9ec7cad178c
|
7
|
+
data.tar.gz: f68627df0fddb461fba54bc4b403bbee819f7b9ca35df1d225052389c509622b1c2f37f5d6e70b254e05631a1bb775efa54a40049d409dbcd66a4651ef0c9480
|
@@ -21,8 +21,12 @@ Cuando(/^ingreso a un checkout directo para una busqueda '(.*?)' del tipo '(.*?)
|
|
21
21
|
pending("No se encontraron resultados para la busqueda #{@page.manage_data.generate_url_results_search}")
|
22
22
|
end
|
23
23
|
|
24
|
-
Cuando(/^espero que termine de cargar la pagina de checkout$/) do
|
25
|
-
|
24
|
+
Cuando(/^espero que termine de cargar la (pagina|nueva pagina) de checkout$/) do |pagina|
|
25
|
+
if pagina == "pagina"
|
26
|
+
@page = Checkout::CheckoutPage.new($browser)
|
27
|
+
else
|
28
|
+
@page = Checkout::NewCheckoutPage.new($browser)
|
29
|
+
end
|
26
30
|
@page.popup_transicion_inicial_element.when_not_visible(timeout=120)
|
27
31
|
@page.pasajeros_element.when_visible(timeout=120)
|
28
32
|
puts "URL: #{@page.browser.url}"
|
@@ -15,4 +15,18 @@ Cuando(/^(?:verifico|valido) las reviews de aerolineas$/) do
|
|
15
15
|
@page.close_popup_reviews_aerolineas_element.click
|
16
16
|
@page.popup_reviews_aerolineas_element.when_not_visible(timeout=10)
|
17
17
|
end
|
18
|
-
end
|
18
|
+
end
|
19
|
+
|
20
|
+
Entonces(/^verifico que se muestren las reviews de aerolineas$/) do
|
21
|
+
@page.reviews_aerolineas_elements.each_with_index do |aerolinea,index|
|
22
|
+
@page.enviar_tecla :escape
|
23
|
+
sleep(1)
|
24
|
+
aerolinea.click
|
25
|
+
@page.popup_reviews_aerolineas_element.when_visible(timeout=10)
|
26
|
+
doc = Hpricot.parse(@page.popup_reviews_aerolineas_element.html)
|
27
|
+
@page.logo_aerolinea_en_matriz(index).should match((doc/"span.logo/img").first.attributes['src'].strip.downcase)
|
28
|
+
aerolinea.text.strip.downcase.should equal((doc/"h4.name").inner_text.strip.downcase)
|
29
|
+
@page.close_popup_reviews_aerolineas_element.click
|
30
|
+
@page.popup_reviews_aerolineas_element.when_not_visible(timeout=10)
|
31
|
+
end
|
32
|
+
end
|
data/features/support/env.rb
CHANGED
@@ -46,13 +46,7 @@ require_relative 'modules/results/matrix/matrix_price'
|
|
46
46
|
require_relative 'modules/results/matrix/matrix_fare_chart'
|
47
47
|
require_relative 'modules/results/itineraries'
|
48
48
|
|
49
|
-
require_relative 'modules/checkout/
|
50
|
-
require_relative 'modules/checkout/tarjeta'
|
51
|
-
require_relative 'modules/checkout/popup'
|
52
|
-
require_relative 'modules/checkout/errores'
|
53
|
-
require_relative 'modules/checkout/fast_checkout'
|
54
|
-
require_relative 'modules/checkout/datos_de_facturacion'
|
55
|
-
require_relative 'modules/checkout/informacion_de_contacto'
|
49
|
+
require_relative 'modules/checkout/checkout'
|
56
50
|
|
57
51
|
# carga de paginas y modulos de cargas
|
58
52
|
require_relative 'pages/flights_tracker/search_page'
|
@@ -60,6 +54,7 @@ require_relative 'pages/results/desambiguation_airports_page'
|
|
60
54
|
require_relative 'pages/results/desambiguation_city_page'
|
61
55
|
require_relative 'pages/results/search_page'
|
62
56
|
require_relative 'pages/checkout/checkout_page'
|
57
|
+
require_relative 'pages/checkout/new_checkout_page'
|
63
58
|
require_relative 'pages/checkout/popup_results_page'
|
64
59
|
require_relative 'pages/thanks/thanks_page'
|
65
60
|
require_relative 'pages/landing/search_page'
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require_relative 'old_checkout/pasajeros'
|
3
|
+
require_relative 'old_checkout/tarjeta'
|
4
|
+
require_relative 'old_checkout/reviews'
|
5
|
+
require_relative 'old_checkout/popup'
|
6
|
+
require_relative 'old_checkout/errores'
|
7
|
+
require_relative 'old_checkout/fast_checkout'
|
8
|
+
require_relative 'old_checkout/datos_de_facturacion'
|
9
|
+
require_relative 'old_checkout/informacion_de_contacto'
|
10
|
+
require_relative 'new_checkout/pasajeros'
|
11
|
+
require_relative 'new_checkout/tarjeta'
|
12
|
+
require_relative 'new_checkout/reviews'
|
13
|
+
require_relative 'new_checkout/popup'
|
14
|
+
require_relative 'new_checkout/errores'
|
15
|
+
require_relative 'new_checkout/fast_checkout'
|
16
|
+
require_relative 'new_checkout/datos_de_facturacion'
|
17
|
+
require_relative 'new_checkout/informacion_de_contacto'
|
@@ -0,0 +1,78 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
module NewCheckout
|
3
|
+
module DatosDeFacturacion
|
4
|
+
include PageObject
|
5
|
+
|
6
|
+
select_list(:situacion_fiscal,:id=>"invoice-fiscal-status")
|
7
|
+
select_list(:provincia_facturacion,:id=>"invoice-state")
|
8
|
+
|
9
|
+
element(:formulario_facturacion,:fieldset,:id=>"invoice")
|
10
|
+
|
11
|
+
text_field(:cuil,:id=>"invoice-fiscal-id")
|
12
|
+
text_field(:domicilio_facturacion,:id=>"invoice-address")
|
13
|
+
text_field(:nombre_facturacion,:id=>"invoice-card-holder-name")
|
14
|
+
text_field(:ciudad_facturacion_custom,:id=>"invoice-city-custom")
|
15
|
+
text_field(:ciudad_facturacion,:id=>"invoice-city")
|
16
|
+
text_field(:calle_facturacion,:id=>"invoice-street")
|
17
|
+
text_field(:numero_facturacion,:id=>"invoice-address-number")
|
18
|
+
text_field(:piso_facturacion,:id=>"invoice-address-floor")
|
19
|
+
text_field(:departamento_facturacion,:id=>"invoice-address-deparment")
|
20
|
+
text_field(:codigo_postal_facturacion,:id=>"invoice-postal-code")
|
21
|
+
text_field(:otro_estado_facturacion,:id=>"invoice-other-state")
|
22
|
+
text_field(:mail_facturacion,:id=>"invoice-mail")
|
23
|
+
text_field(:barrio_facturacion,:id=>"invoice-neighbourhood")
|
24
|
+
text_field(:municipal_facturacion,:id=>"invoice-townRegistration")
|
25
|
+
|
26
|
+
checkbox(:invoice_check,:id=>"invoice-check")
|
27
|
+
|
28
|
+
link(:buscar_codigo_postal,:class=>"search-postal-code")
|
29
|
+
|
30
|
+
def cargar_datos_facturacion
|
31
|
+
if AllPages.site=="AR"
|
32
|
+
option = ["FINAL","INSCR","EXENT","MONOTRIBUTO"][rand(4)]
|
33
|
+
situacion_fiscal_element.select_value(option)
|
34
|
+
#lleno los campos requeridos
|
35
|
+
cuil_element.set("30643063936")
|
36
|
+
nombre_facturacion_element.set("diego qa romero") if nombre_facturacion_element.present?
|
37
|
+
provincia_facturacion_element.select_value("C")
|
38
|
+
set_autocomplete("ciudad_facturacion_custom","buenos ")
|
39
|
+
calle_facturacion_element.set("corrientes")
|
40
|
+
codigo_postal_facturacion_element.set("7111")
|
41
|
+
numero_facturacion_element.set("123")
|
42
|
+
piso_facturacion_element.set("1")
|
43
|
+
departamento_facturacion_element.set("1")
|
44
|
+
elsif AllPages.site=="BR"
|
45
|
+
# option = ["CPF","CNPJ"][rand(2)]
|
46
|
+
# situacion_fiscal_element.select_value(option)
|
47
|
+
# #lleno los campos requeridos
|
48
|
+
# option=="CPF" ? cuil_element.set("22233366638") : cuil_element.set("54651716001150")
|
49
|
+
# nombre_facturacion_element.set("diego qa romero") if nombre_facturacion_element.present?
|
50
|
+
# provincia_facturacion_element.select_value("AC")
|
51
|
+
# municipal_facturacion_element.set("municipal") if municipal_facturacion_element.present?
|
52
|
+
# set_autocomplete("ciudad_facturacion_custom","rio ")
|
53
|
+
# calle_facturacion_element.set("corrientes")
|
54
|
+
# barrio_facturacion_element.set("san jose")
|
55
|
+
# codigo_postal_facturacion_element.set("7111")
|
56
|
+
# numero_facturacion_element.set("123")
|
57
|
+
# piso_facturacion_element.set("1")
|
58
|
+
# departamento_facturacion_element.set("1")
|
59
|
+
else
|
60
|
+
check_invoice_check if invoice_check?
|
61
|
+
cuil_element.set("3334445556") if cuil_element.present?
|
62
|
+
nombre_facturacion_element.set("diego qa romero") if nombre_facturacion_element.present?
|
63
|
+
provincia_facturacion_element.select(provincia_facturacion_options[2]) if provincia_facturacion_element.present?
|
64
|
+
ciudad_facturacion_element.set("Rosario") if ciudad_facturacion_element.present?
|
65
|
+
ciudad_facturacion_custom_element.set("Rosario") if ciudad_facturacion_custom_element.present?
|
66
|
+
calle_facturacion_element.set("corrientes") if calle_facturacion_element.present?
|
67
|
+
if AllPages.site=="MX"
|
68
|
+
otro_estado_facturacion_element.set("Chiapas") if otro_estado_facturacion_element.present?
|
69
|
+
codigo_postal_facturacion_element.set("7111") if codigo_postal_facturacion_element.present?
|
70
|
+
numero_facturacion_element.set("123") if numero_facturacion_element.present?
|
71
|
+
piso_facturacion_element.set("1") if piso_facturacion_element.present?
|
72
|
+
departamento_facturacion_element.set("1") if departamento_facturacion_element.present?
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
end
|
78
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
module NewCheckout
|
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,32 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
module NewCheckout
|
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
|
+
div(:login_usuario_nibbler,:id=>"nibbler-selfservice-login-overlay")
|
13
|
+
|
14
|
+
link(:log_out_checkout,:css=>"#checkout-login .log-out")
|
15
|
+
link(:log_in_checkout,:css=>"#checkout-login .log-in")
|
16
|
+
link(:mostrar_cartas_guardadas,:class=>"display-cards")
|
17
|
+
|
18
|
+
elements(:container_tarjetas,:ul,:class=>"card-container")
|
19
|
+
|
20
|
+
p(:usuario_logueado_checkout,:css=>"#checkout-login .logged-in")
|
21
|
+
|
22
|
+
radio_button(:opcion_tarjeta_guardada,:css=>"#stored-cards .radio")
|
23
|
+
|
24
|
+
text_field(:codigo_seguridad_tarjeta_guardada,:id=>"stored-card-0-security-code")
|
25
|
+
|
26
|
+
text_field(:mail_usuario_nibbler,:id=>"signin-email")
|
27
|
+
text_field(:pass_usuario_nibbler,:id=>"signin-pass")
|
28
|
+
|
29
|
+
button(:boton_usuario_nibbler,:css=>"#nibbler-selfservice-login-overlay .nibbler-common-button")
|
30
|
+
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
module NewCheckout
|
3
|
+
module InformacionDeContacto
|
4
|
+
include PageObject
|
5
|
+
|
6
|
+
text_field(:mail_contacto,:id=>"contact-email")
|
7
|
+
text_field(:mail_contacto_confimacion,:id=>"contact-email-repeat")
|
8
|
+
text_field(:pais_contacto,:id=>"country-code-0")
|
9
|
+
text_field(:area_contacto,:id=>"area-code-0")
|
10
|
+
text_field(:numero_contacto,:id=>"phone-number-0")
|
11
|
+
|
12
|
+
select_list(:telefono_contacto,:id=>"phone-type-0")
|
13
|
+
|
14
|
+
checkbox(:opcion_ofertas,:id=>"offers")
|
15
|
+
|
16
|
+
elements(:bandera_argentina,:span,:class=>"flagIcon flag-ar")
|
17
|
+
|
18
|
+
def cargar_datos_de_contacto
|
19
|
+
uncheck_opcion_ofertas
|
20
|
+
mail_contacto_element.set "bookingvuelos@despegar.com"
|
21
|
+
mail_contacto_confimacion_element.set "bookingvuelos@despegar.com"
|
22
|
+
telefono_contacto_element.select_value("HOME")
|
23
|
+
pais_contacto_element.set "Argentina (54)"
|
24
|
+
sleep 0.5
|
25
|
+
area_contacto_element.set "055"
|
26
|
+
numero_contacto_element.set "123456"
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,72 @@
|
|
1
|
+
#encoding: utf-8
|
2
|
+
module NewCheckout
|
3
|
+
module Pasajeros
|
4
|
+
include PageObject
|
5
|
+
|
6
|
+
elements(:nombre,:text_field,:css=>"#passengers .input-passenger-first-name")
|
7
|
+
elements(:apellido,:text_field,:css=>"#passengers .input-passenger-last-name")
|
8
|
+
elements(:documento,:text_field,:css=>"#passengers .input-document-number")
|
9
|
+
elements(:nacionalidad,:select_list,:css=>"#passengers .select-nationality")
|
10
|
+
elements(:tipo_documento,:select_list,:css=>"#passengers .select-document-type")
|
11
|
+
elements(:sexo,:select_list,:css=>"#passengers .select-passenger-gender")
|
12
|
+
elements(:dia_nacimiento,:select_list,:css=>"#passengers .select-day")
|
13
|
+
elements(:mes_nacimiento,:select_list,:css=>"#passengers .select-month")
|
14
|
+
elements(:ano_nacimiento,:select_list,:css=>"#passengers .select-year")
|
15
|
+
elements(:campos_pasajeros,:fieldset,:id=>"passengers")
|
16
|
+
|
17
|
+
div(:edades_adultos,:id=>"birthday-group-0")
|
18
|
+
|
19
|
+
PLUS_NAME = ["A","B","C","D","E","F","G","H","I","J","k"]
|
20
|
+
|
21
|
+
def cargar_adultos
|
22
|
+
@index = 0
|
23
|
+
@index_menores = 0
|
24
|
+
self.manage_data.adt.times do |adulto|
|
25
|
+
nombre_elements[@index].set "Diego QA#{PLUS_NAME[@index]}"
|
26
|
+
apellido_elements[@index].set "Romero#{PLUS_NAME[@index]}"
|
27
|
+
documento_elements[@index].set "3245673#{@index}" if documento_elements[@index]
|
28
|
+
nacionalidad_elements[@index].select_value(AllPages.site) if nacionalidad_elements[@index]
|
29
|
+
tipo_documento_elements[@index].select_value(AllPages.site.match("AR|BR") ? "LOCAL" : "PASSPORT") if tipo_documento_elements[@index]
|
30
|
+
sexo_elements[@index].select_value("MALE") if sexo_elements[@index]
|
31
|
+
if edades_adultos?
|
32
|
+
dia_nacimiento_elements[@index_menores].select(@index+1)
|
33
|
+
mes_nacimiento_elements[@index_menores].select(3)
|
34
|
+
ano_nacimiento_elements[@index_menores].select_value("197#{@index}")
|
35
|
+
@index_menores += 1
|
36
|
+
end
|
37
|
+
@index += 1
|
38
|
+
end
|
39
|
+
end
|
40
|
+
def cargar_ninos
|
41
|
+
self.manage_data.cnn.times do |nino|
|
42
|
+
nombre_elements[@index].set "Martin QA#{PLUS_NAME[@index]}"
|
43
|
+
apellido_elements[@index].set "Diez jr#{PLUS_NAME[@index]}"
|
44
|
+
documento_elements[@index].set "4245663#{@index}" if documento_elements[@index]
|
45
|
+
nacionalidad_elements[@index].select_value(AllPages.site) if nacionalidad_elements[@index]
|
46
|
+
tipo_documento_elements[@index].select_value(AllPages.site.match("AR|BR") ? "LOCAL" : "PASSPORT") if tipo_documento_elements[@index]
|
47
|
+
sexo_elements[@index].select_value("MALE") if sexo_elements[@index]
|
48
|
+
dia_nacimiento_elements[@index_menores].select(@index+1)
|
49
|
+
mes_nacimiento_elements[@index_menores].select(3)
|
50
|
+
ano_nacimiento_elements[@index_menores].select_value("2009")
|
51
|
+
@index += 1
|
52
|
+
@index_menores += 1
|
53
|
+
end
|
54
|
+
end
|
55
|
+
def cargar_bebes
|
56
|
+
self.manage_data.inf.times do |bebe|
|
57
|
+
nombre_elements[@index].set "Maribel QA#{PLUS_NAME[@index]}"
|
58
|
+
apellido_elements[@index].set "Dias Herr jrb#{PLUS_NAME[@index]}"
|
59
|
+
documento_elements[@index].set "4249966#{@index}" if documento_elements[@index]
|
60
|
+
nacionalidad_elements[@index].select_value(AllPages.site) if nacionalidad_elements[@index]
|
61
|
+
tipo_documento_elements[@index].select_value(AllPages.site.match("AR|BR") ? "LOCAL" : "PASSPORT") if tipo_documento_elements[@index]
|
62
|
+
sexo_elements[@index].select_value("MALE") if sexo_elements[@index]
|
63
|
+
dia_nacimiento_elements[@index_menores].select(@index+1)
|
64
|
+
mes_nacimiento_elements[@index_menores].select(3)
|
65
|
+
ano_nacimiento_elements[@index_menores].select_value("2014")
|
66
|
+
@index += 1
|
67
|
+
@index_menores += 1
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
end
|
72
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
#encoding: utf-8
|
2
|
+
module NewCheckout
|
3
|
+
module PopUp
|
4
|
+
include PageObject
|
5
|
+
|
6
|
+
div(:popup_transicion_inicial,:id=>"popup-initial-transition")
|
7
|
+
div(:popup_transicion_compra,:id=>"popup-checkout-transition-template")
|
8
|
+
div(:popup_nuevo_precio,:id=>"popup-price-difference-template")
|
9
|
+
div(:popup_nuevo_vuelo,:id=>"popup-new-flight")
|
10
|
+
div(:popup_confirmacion_pago,:id=>"confirm-payment-popup")
|
11
|
+
div(:popup_chat,:id=>"dtalk-container")
|
12
|
+
div(:popup_cobertura,:id=>"popup-upselling-coverage-template")
|
13
|
+
div(:popup_compra_duplicada,:id=>"popup-duplicated-transaction")
|
14
|
+
div(:opcion_no_compra_duplicada,:css=>"#popup-duplicated-transaction .button-no")
|
15
|
+
div(:opcion_si_compra_duplicada,:css=>"#popup-duplicated-transaction .button-yes")
|
16
|
+
div(:popup_price_jump,:id=>"popup-price-difference")
|
17
|
+
div(:opcion_si_price_jump,:css=>"#popup-price-difference .button-yes")
|
18
|
+
span(:cerrar_popup_chat,:css=>"#dtalk-container .close-round-section")
|
19
|
+
span(:cerrar_popup_cobertura,:css=>".popup-upselling-coverage .popup-close-button")
|
20
|
+
span(:cerrar_popup_cantidad_visitantes,:css=>"#searches-count-alert-popup .popup-close-button")
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
#encoding: utf-8
|
2
|
+
module NewCheckout
|
3
|
+
module Reviews
|
4
|
+
include PageObject
|
5
|
+
|
6
|
+
div(:popup_reviews_aerolineas,:id=>"popup-reviews")
|
7
|
+
span(:close_popup_reviews_aerolineas,:css=>"#popup-reviews .popup-close-button")
|
8
|
+
elements(:reviews_aerolineas,:link,:css=>"#itinerary .segments .airline")
|
9
|
+
elements(:logos_aerolineas,:image,:css=>"#itinerary .segments .airline-logo img")
|
10
|
+
|
11
|
+
def logo_aerolinea_en_matriz(index)
|
12
|
+
self.logos_aerolineas_elements[index].attribute("src").strip.downcase
|
13
|
+
end
|
14
|
+
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,265 @@
|
|
1
|
+
#encoding: utf-8
|
2
|
+
module NewCheckout
|
3
|
+
module Tarjeta
|
4
|
+
include PageObject
|
5
|
+
|
6
|
+
select_list(:tarjeta,:id=>"card-installment-select")
|
7
|
+
select_list(:cuotas,:id=>"card-installment-select")
|
8
|
+
select_list(:mes_vencimiento_tarjeta,:id=>"card-expiration-month")
|
9
|
+
select_list(:ano_vencimiento_tarjeta,:id=>"card-expiration-year")
|
10
|
+
select_list(:tipo_titular_tarjeta,:id=>"owner-type")
|
11
|
+
select_list(:sexo_titular_tarjeta,:id=>"owner-gender")
|
12
|
+
select_list(:estado_entrega_tarjeta,:id=>"billing-address-state")
|
13
|
+
select_list(:sexo_offline,:id=>"offline-owner-gender")
|
14
|
+
|
15
|
+
text_field(:cp_entrega_tarjeta,:id=>"billing-address-postal-code")
|
16
|
+
text_field(:piso_entrega_tarjeta,:id=>"billing-address-floor")
|
17
|
+
text_field(:depto_entrega_tarjeta,:id=>"billing-address-deparment")
|
18
|
+
text_field(:numero_entrega_tarjeta,:id=>"billing-address-number")
|
19
|
+
text_field(:ciudad_entrega_tarjeta,:id=>"billing-address-city")
|
20
|
+
text_field(:calle_entrega_tarjeta,:id=>"billing-address-street")
|
21
|
+
text_field(:numero_tarjeta,:id=>"card-number")
|
22
|
+
text_field(:codigo_seguridad_tarjeta,:id=>"security-code")
|
23
|
+
text_field(:nombre_titular_tarjeta,:id=>"owner-name")
|
24
|
+
text_field(:documento_titular_tarjeta,:id=>"owner-document-number")
|
25
|
+
text_field(:banco_emisor,:id=>"other-bank-name")
|
26
|
+
text_field(:documento_offline,:id=>"offline-owner-document-number")
|
27
|
+
text_field(:nombre_completo_contacto,:id=>"contact-contact-full-name")
|
28
|
+
text_field(:cuit_empresa,:id=>"owner-fiscal-document-number")
|
29
|
+
|
30
|
+
div(:debito,:class=>"installment-info")
|
31
|
+
div(:warning_deposito,:css=>"#cash-installment .ux-common-message-warning")
|
32
|
+
div(:con_intereses,:class=>"installments-with-interest")
|
33
|
+
|
34
|
+
radio_button(:un_pago,:id=>"installment-0")
|
35
|
+
radio_button(:un_pago_visa,:value=>"_VI")
|
36
|
+
radio_button(:un_pago_argentina,:class=>"radio main-radio ")
|
37
|
+
radio_button(:un_pago_debito,:id=>"installment-1")
|
38
|
+
radio_button(:deposito,:css=>"#cash-installment .main-radio")
|
39
|
+
radio_button(:pago_online,:css=>"#homebanking-installment .main-radio")
|
40
|
+
radio_button(:opcion_cac,:css=>"#cac-installment .main-radio")
|
41
|
+
radio_button(:pago_con_intereses,:class=>"radio main-radio radio-with-interest")
|
42
|
+
|
43
|
+
|
44
|
+
elements(:tipos_de_pago,:radio,:css=>"#paymentDefinition input.radio")
|
45
|
+
|
46
|
+
span(:desc_fecha_deposito,:css=>"#cash-installment .installment-description-info")
|
47
|
+
span(:desc_pasos_deposito,:css=>"#cash-installment .installment-detail-text")
|
48
|
+
span(:precio_final,:id=>"total-price")
|
49
|
+
span(:precio_final_combo,:css=>"#installments-price .total")
|
50
|
+
span(:desglose_de_cuotas,:css=>"#installments-price .installments-detail")
|
51
|
+
|
52
|
+
li(:medio_de_pago_seleccionado,:css=>"#paymentDefinition .selected")
|
53
|
+
li(:medio_de_subpago_seleccionado,:css=>".list .sub-selected")
|
54
|
+
|
55
|
+
def cargar_datos_tarjeta
|
56
|
+
data = self.manage_data.get_results_search_service
|
57
|
+
provider = data["result"]["data"]["items"][0]["provider"]
|
58
|
+
if AllPages.site=="AR"
|
59
|
+
select_un_pago_argentina
|
60
|
+
else
|
61
|
+
if debito.downcase.no_accents.match(/debito/)
|
62
|
+
select_un_pago_debito
|
63
|
+
else
|
64
|
+
select_un_pago
|
65
|
+
end
|
66
|
+
end
|
67
|
+
if provider == "VOL"
|
68
|
+
tarjeta_element.select("American Express")
|
69
|
+
numero_tarjeta_element.set("345678000000007")
|
70
|
+
codigo_seguridad_tarjeta_element.set("1234")
|
71
|
+
mes_vencimiento_tarjeta_element.select('10')
|
72
|
+
ano_vencimiento_tarjeta_element.select(Date.today.year+1)
|
73
|
+
elsif provider == "AIJ"
|
74
|
+
tarjeta_element.select("Visa")
|
75
|
+
numero_tarjeta_element.set("4012001021000605")
|
76
|
+
codigo_seguridad_tarjeta_element.set("989")
|
77
|
+
mes_vencimiento_tarjeta_element.select('12')
|
78
|
+
ano_vencimiento_tarjeta_element.select('2014')
|
79
|
+
else
|
80
|
+
tarjeta_element.select "Visa"
|
81
|
+
numero_tarjeta_element.set "4242424242424242"
|
82
|
+
mes_vencimiento_tarjeta_element.select 5
|
83
|
+
ano_vencimiento_tarjeta_element.select(Date.today.year+1)
|
84
|
+
codigo_seguridad_tarjeta_element.set "123"
|
85
|
+
end
|
86
|
+
banco_emisor_element.set "galicia" if banco_emisor_element.present?
|
87
|
+
self.elegir_tipo_titular_tarjeta if tipo_titular_tarjeta_element.present?
|
88
|
+
nombre_titular_tarjeta_element.set "Martin qa diez"
|
89
|
+
if documento_titular_tarjeta_element.present?
|
90
|
+
number = case AllPages.site
|
91
|
+
when "CL" then "7028168-6"
|
92
|
+
when "BR" then "22233366638"
|
93
|
+
else "32456324"
|
94
|
+
end
|
95
|
+
documento_titular_tarjeta_element.set number
|
96
|
+
end
|
97
|
+
sexo_titular_tarjeta_element.select_value "MALE" if sexo_titular_tarjeta_element.present?
|
98
|
+
#datos extras de tarjeta
|
99
|
+
self.cargar_datos_extras_de_tarjeta
|
100
|
+
end
|
101
|
+
|
102
|
+
def cargar_datos_tarjeta_nuevo_formulario
|
103
|
+
data = self.manage_data.get_results_search_service
|
104
|
+
provider = data["result"]["data"]["items"][0]["provider"]
|
105
|
+
un_pago_visa_element.click
|
106
|
+
sleep(1)
|
107
|
+
cuotas_element.select_value("1_CREDIT_VI_null")
|
108
|
+
numero_tarjeta_element.set "4242424242424242"
|
109
|
+
mes_vencimiento_tarjeta_element.select 5
|
110
|
+
ano_vencimiento_tarjeta_element.select(Date.today.year+1)
|
111
|
+
codigo_seguridad_tarjeta_element.set "123"
|
112
|
+
banco_emisor_element.set "galicia" if banco_emisor_element.present?
|
113
|
+
tipo_titular_tarjeta_value = "PERSON" if tipo_titular_tarjeta_element.present?
|
114
|
+
nombre_titular_tarjeta_element.set "Martin qa diez"
|
115
|
+
if documento_titular_tarjeta_element.present?
|
116
|
+
number = case AllPages.site
|
117
|
+
when "CL" then "7028168-6"
|
118
|
+
when "BR" then "22233366638"
|
119
|
+
else "32456324"
|
120
|
+
end
|
121
|
+
documento_titular_tarjeta_element.set number
|
122
|
+
end
|
123
|
+
sexo_titular_tarjeta_element.select_value "MALE" if sexo_titular_tarjeta_element.present?
|
124
|
+
self.cargar_datos_extras_de_tarjeta
|
125
|
+
end
|
126
|
+
|
127
|
+
def cargar_datos_tarjeta_guardada
|
128
|
+
@browser.execute_script("javascript:void($('#stored-cards .display-cards').click())") if mostrar_cartas_guardadas_element.text.no_accents.downcase.match("mas|mais|more")
|
129
|
+
if AllPages.site=="BR"
|
130
|
+
ul = container_tarjetas_elements.to_a.select{|ul| ul.li(:class,'item owner-name').text.match(/BR/)}.first
|
131
|
+
pending("no se encontro usuario de tarjeta para brasil") unless ul
|
132
|
+
ul.radio(:class,'radio').click
|
133
|
+
ul.text_fields[0].set("123")
|
134
|
+
else
|
135
|
+
ul = container_tarjetas_elements.to_a.select{|ul| ul.li(:class,'item owner-name').text.match(/Diego QA Romero/)}.first
|
136
|
+
ul.radio(:class,'radio').click
|
137
|
+
ul.text_fields[0].set("123")
|
138
|
+
end
|
139
|
+
if datos_tarjeta_guardada_element.present?
|
140
|
+
self.cargar_datos_extras_de_tarjeta
|
141
|
+
end
|
142
|
+
end
|
143
|
+
|
144
|
+
def cargar_datos_extras_de_tarjeta
|
145
|
+
data = self.manage_data.get_results_search_service
|
146
|
+
provider = data["result"]["data"]["items"][0]["provider"]
|
147
|
+
if provider == "VOL"
|
148
|
+
ciudad_entrega_tarjeta_element.set "Y Ciudad" if ciudad_entrega_tarjeta_element.present?
|
149
|
+
calle_entrega_tarjeta_element.set "Y Calle" if calle_entrega_tarjeta_element.present?
|
150
|
+
elsif provider == "AIJ"
|
151
|
+
ciudad_entrega_tarjeta_element.set "ciudad" if ciudad_entrega_tarjeta_element.present?
|
152
|
+
calle_entrega_tarjeta_element.set "calle" if calle_entrega_tarjeta_element.present?
|
153
|
+
else
|
154
|
+
ciudad_entrega_tarjeta_element.set "capital" if ciudad_entrega_tarjeta_element.present?
|
155
|
+
calle_entrega_tarjeta_element.set "corrientes" if calle_entrega_tarjeta_element.present?
|
156
|
+
end
|
157
|
+
estado_entrega_tarjeta_element.select(estado_entrega_tarjeta_options[3]) if estado_entrega_tarjeta_element.present?
|
158
|
+
numero_entrega_tarjeta_element.set "1234" if numero_entrega_tarjeta_element.present?
|
159
|
+
piso_entrega_tarjeta_element.set "3" if piso_entrega_tarjeta_element.present?
|
160
|
+
depto_entrega_tarjeta_element.set "A" if depto_entrega_tarjeta_element.present?
|
161
|
+
if AllPages.site=~/US|MX/
|
162
|
+
cp_entrega_tarjeta_element.set "11823" if cp_entrega_tarjeta_element.present?
|
163
|
+
else
|
164
|
+
cp_entrega_tarjeta_element.set "1182" if cp_entrega_tarjeta_element.present?
|
165
|
+
end
|
166
|
+
end
|
167
|
+
|
168
|
+
def verificar_tipos_de_pago
|
169
|
+
interes = nil
|
170
|
+
doc=Hpricot.parse(precio_final_element.html)
|
171
|
+
total_1 = doc.inner_text.gsub(/\D/,'').to_i
|
172
|
+
radios = tipos_de_pago_elements
|
173
|
+
i=0
|
174
|
+
radios.each do |radio|
|
175
|
+
if radio.present? and !radio.disabled?
|
176
|
+
radio.click
|
177
|
+
sleep(0.5)
|
178
|
+
doc=Hpricot.parse(precio_final_element.html)
|
179
|
+
total_2 = doc.inner_text.gsub(/\D/,'').to_i
|
180
|
+
unless radio.attribute_value("data-regular-expressions").nil?
|
181
|
+
keys = JSON.parse(radio.attribute_value("data-regular-expressions")).keys
|
182
|
+
if interes or radio.attribute_value("class").match(/radio-with-interest/)
|
183
|
+
validar_cuota_con_intereses(total_1,total_2)
|
184
|
+
else
|
185
|
+
case keys.first
|
186
|
+
when /1(.*)CREDIT(.*)null$/ then validar_cuota_un_pago()
|
187
|
+
when /(.*)CREDIT(.*)null$/ then validar_cuota_con_intereses(total_1,total_2)
|
188
|
+
when /(.*)CREDIT(.*)$/ then validar_cuota_sin_intereses(total_1,total_2)
|
189
|
+
end
|
190
|
+
keys.uniq.length.should equal(keys.length)
|
191
|
+
end
|
192
|
+
else
|
193
|
+
interes = true
|
194
|
+
end
|
195
|
+
end
|
196
|
+
if i > 17
|
197
|
+
break
|
198
|
+
end
|
199
|
+
i = i + 1
|
200
|
+
end
|
201
|
+
end
|
202
|
+
|
203
|
+
def validar_cuota_un_pago()
|
204
|
+
|
205
|
+
end
|
206
|
+
|
207
|
+
def validar_cuota_sin_intereses(total_1,total_2)
|
208
|
+
if medio_de_pago_seleccionado_element.div(:class,"installments-price").present?
|
209
|
+
doc = Hpricot.parse(medio_de_pago_seleccionado_element.div(:class,"installments-price").html)
|
210
|
+
inicial = (doc/"span.first-installment").inner_text.downstrip.gsub(/\./,'').match(/(\d+)$/)[1].to_i
|
211
|
+
valor_restantes = (doc/"span.all-installments/span.currency/span.amount").inner_text.gsub(/\./,'').to_i
|
212
|
+
cant_restantes = (doc/"span.all-installments").inner_text.gsub(/\./,'').match(/\+ (\d+)/)[1].to_i
|
213
|
+
(inicial + (cant_restantes * valor_restantes)).should be_within(3).of(total_2)
|
214
|
+
total_1.should equal(total_2)
|
215
|
+
else
|
216
|
+
total_1.should equal(total_2)
|
217
|
+
end
|
218
|
+
end
|
219
|
+
|
220
|
+
def validar_cuota_con_intereses(total_1,total_2)
|
221
|
+
if medio_de_subpago_seleccionado_element.present?
|
222
|
+
doc = Hpricot.parse(medio_de_subpago_seleccionado_element.html)
|
223
|
+
unless (doc/"span.interest").inner_text.empty?
|
224
|
+
costo_financiero = (doc/"span.interest").inner_text.downstrip.gsub(/\./,'').match(/(\d+)$/)[1].to_i
|
225
|
+
inicial = (doc/"span.first-installment").inner_text.downstrip.gsub(/\./,'').match(/(\d+)$/)[1].to_i
|
226
|
+
cant_restantes = (doc/"span.all-installments").inner_text.downstrip.gsub(/\./,'').match(/\+ (\d{1,2})/)[1].to_i
|
227
|
+
valor_restantes = (doc/"span.all-installments/span.price/span.currency/span.amount").inner_text.gsub(/\./,'').to_i
|
228
|
+
((total_2 - (inicial + (cant_restantes * valor_restantes))).abs <= 2).should be_true
|
229
|
+
costo_financiero.should equal(total_2 - total_1)
|
230
|
+
end
|
231
|
+
end
|
232
|
+
end
|
233
|
+
|
234
|
+
def verificar_nuevos_tipos_de_pago
|
235
|
+
doc = Hpricot.parse(@browser.html)
|
236
|
+
(doc/"ul.new-installments li.purchase-installment").each do |li|
|
237
|
+
@browser.radio(:id,(li/"input").first.attributes['id']).click
|
238
|
+
sleep(1)
|
239
|
+
doc = Hpricot.parse(@browser.html)
|
240
|
+
(doc/"select#card-installment-select option").each do |option|
|
241
|
+
@browser.select_list(:id,'card-installment-select').select_value(option.attributes['value'])
|
242
|
+
total_desglose = Hpricot.parse(precio_final_element.html).inner_text.gsub(/\D/,'').to_i
|
243
|
+
if desglose_de_cuotas_element.present?
|
244
|
+
doc = Hpricot.parse(desglose_de_cuotas_element.html)
|
245
|
+
inicial = (doc/"span.first-price").inner_text.downstrip.gsub(/\./,'').match(/(\d+)$/)[1].to_i
|
246
|
+
valor_restantes = (doc/"span.others-price").inner_text.downstrip.gsub(/\./,'').match(/(\d+)$/)[1].to_i
|
247
|
+
cant_restantes = (doc/"span.others-quantity").inner_text.to_i
|
248
|
+
(inicial + (cant_restantes * valor_restantes)).should be_within(3).of(total_desglose)
|
249
|
+
end
|
250
|
+
end
|
251
|
+
end
|
252
|
+
end
|
253
|
+
|
254
|
+
def elegir_tipo_titular_tarjeta
|
255
|
+
tipo = ["PERSON","COMPANY"][rand(2)]
|
256
|
+
tipo_titular_tarjeta_element.select_value tipo
|
257
|
+
if tipo=="COMPANY"
|
258
|
+
puts tipo
|
259
|
+
sleep(0.5)
|
260
|
+
cuit_empresa_element.set "20-32454321-0"
|
261
|
+
end
|
262
|
+
end
|
263
|
+
|
264
|
+
end
|
265
|
+
end
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,16 @@
|
|
1
|
+
#encoding: utf-8
|
2
|
+
module Checkout
|
3
|
+
module Reviews
|
4
|
+
include PageObject
|
5
|
+
|
6
|
+
div(:popup_reviews_aerolineas,:id=>"popup-reviews")
|
7
|
+
span(:close_popup_reviews_aerolineas,:css=>"#popup-reviews .popup-close-button")
|
8
|
+
elements(:reviews_aerolineas,:link,:css=>"#itinerary .segments .airline")
|
9
|
+
elements(:logos_aerolineas,:image,:css=>"#itinerary .segments .airline-logo img")
|
10
|
+
|
11
|
+
def logo_aerolinea_en_matriz(index)
|
12
|
+
self.logos_aerolineas_elements[index].attribute("src").strip.downcase
|
13
|
+
end
|
14
|
+
|
15
|
+
end
|
16
|
+
end
|
File without changes
|
@@ -97,11 +97,7 @@ module Results
|
|
97
97
|
end
|
98
98
|
|
99
99
|
def new_recorrer_segmentos(route,cluster,i)
|
100
|
-
|
101
|
-
route.li(:class,'detail').links[0].click
|
102
|
-
rescue Selenium::WebDriver::Error::ElementNotVisibleError
|
103
|
-
byebug
|
104
|
-
end
|
100
|
+
new_cerrar_popup(route)
|
105
101
|
new_popup_detail_elements[i].when_visible(timeout=20)
|
106
102
|
doc = Hpricot.parse(new_popup_detail_elements[i].html)
|
107
103
|
detail = NewDetailsCluster.new(doc)
|
@@ -115,22 +111,26 @@ module Results
|
|
115
111
|
end
|
116
112
|
|
117
113
|
def new_validar_mas_detalles(json,i,itinerario)
|
118
|
-
j=0
|
119
114
|
mostrar_mas_itinerarios_element.click if mostrar_mas_itinerarios_element.present?
|
120
|
-
rutas_ida(itinerarios_elements[i]).
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
115
|
+
rutas_ida(itinerarios_elements[i]).each_with_index do |route,j|
|
116
|
+
if route.present?
|
117
|
+
cluster_detail = new_recorrer_segmentos(route,itinerario.idas[j],$num)
|
118
|
+
new_cerrar_popup(route)
|
119
|
+
validar_clase(cluster_detail,route)
|
120
|
+
$num += 1
|
121
|
+
else
|
122
|
+
puts "No se ve el elemento numero #{i} en la ruta #{j}"
|
123
|
+
end
|
126
124
|
end
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
125
|
+
rutas_vuelta(itinerarios_elements[i]).each_with_index do |route,k|
|
126
|
+
if route.present?
|
127
|
+
cluster_detail = new_recorrer_segmentos(route,itinerario.vueltas[k],$num)
|
128
|
+
$num += 1
|
129
|
+
new_cerrar_popup(route)
|
130
|
+
validar_clase(cluster_detail,route)
|
131
|
+
else
|
132
|
+
puts "No se ve el elemento numero #{i} en la ruta #{k}"
|
133
|
+
end
|
134
134
|
end
|
135
135
|
end
|
136
136
|
|
@@ -85,7 +85,7 @@ class AllPages
|
|
85
85
|
when 'RESULTS' then "results-f-gui=beta"
|
86
86
|
when 'CHECKOUT' then "chkf-app=beta"
|
87
87
|
when 'LANDING' then "landing-f-gui=beta"
|
88
|
-
when 'FSM' then "fsm-
|
88
|
+
when 'FSM' then "fsm-search=beta|fsm-retrieve=beta|fsm-cheapest=beta"
|
89
89
|
when 'CHAS' then "chas-flight=beta"
|
90
90
|
when 'DEBASE' then "flights-dbs-new=flights-dbs-new-b"
|
91
91
|
when 'PRISM' then "prism=beta"
|
@@ -7,6 +7,7 @@ module Checkout
|
|
7
7
|
include Checkout::Pasajeros
|
8
8
|
include Checkout::PopUp
|
9
9
|
include Checkout::Tarjeta
|
10
|
+
include Checkout::Reviews
|
10
11
|
include Checkout::Errores
|
11
12
|
include Checkout::FastCheckout
|
12
13
|
include Checkout::DatosDeFacturacion
|
@@ -67,6 +68,10 @@ module Checkout
|
|
67
68
|
@parametro_agencia = parametro_agencia
|
68
69
|
end
|
69
70
|
|
71
|
+
def logo_aerolinea_en_matriz(index)
|
72
|
+
self.logos_aerolineas_elements[index].attribute("src").strip.downcase
|
73
|
+
end
|
74
|
+
|
70
75
|
def url_busqueda()
|
71
76
|
"#{self.manage_data.generate_url_checkout}#{@parametro_agencia}"
|
72
77
|
end
|
@@ -0,0 +1,116 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
module Checkout
|
3
|
+
class NewCheckoutPage < AllPages
|
4
|
+
|
5
|
+
include Pages::Tags
|
6
|
+
include Pages::Cookies
|
7
|
+
include Checkout::Pasajeros
|
8
|
+
include Checkout::PopUp
|
9
|
+
include Checkout::Tarjeta
|
10
|
+
include Checkout::Reviews
|
11
|
+
include Checkout::Errores
|
12
|
+
include Checkout::FastCheckout
|
13
|
+
include Checkout::DatosDeFacturacion
|
14
|
+
include Checkout::InformacionDeContacto
|
15
|
+
|
16
|
+
element(:pasajeros,:fieldset,:id=>"passengers")
|
17
|
+
element(:checkout_id,:em,:class=>"checkout-id")
|
18
|
+
element(:checkout_id_cash,:span,:class=>"checkout-id")
|
19
|
+
|
20
|
+
link(:comprar,:id=>"submit")
|
21
|
+
link(:cupon_validar,:id=>"validate-voucher")
|
22
|
+
link(:link_cobertura,:class=>"coverage")
|
23
|
+
link(:enviar_preguntas_riesgo,:id=>"submit")
|
24
|
+
|
25
|
+
divs(:secciones_preguntas_riesgo,:class=>"item section radio-group group")
|
26
|
+
|
27
|
+
div(:seccion_preguntas_riesgo,:css=>"#form .radio-group")
|
28
|
+
div(:opcion_no_deposito,:css=>"#confirm-payment-popup .flights-button-no")
|
29
|
+
div(:opcion_si_deposito,:css=>"#confirm-payment-popup .flights-button-yes")
|
30
|
+
div(:notificacion_error,:class=>"notification-box error-box")
|
31
|
+
div(:notificacion_warning,:class=>"notification-box warn-box")
|
32
|
+
div(:notificacion_warning_ux,:class=>"ux-common-message ux-common-message-warning ")
|
33
|
+
div(:mensaje_error_ux,:class=>"ux-common-message ux-common-message-error ")
|
34
|
+
div(:notificacion_error_ux,:class=>"ux-common-error")
|
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(:cupon_error,:id=>"coupon-error")
|
41
|
+
div(:cupon_exito,:id=>"voucher-success")
|
42
|
+
div(:clientes_felices,:id=>"happy-clients")
|
43
|
+
div(:link_price_jump,:css=>"#popup-price-difference .popup-link")
|
44
|
+
|
45
|
+
checkbox(:opcion_seguros,:id=>"upselling-checkbox")
|
46
|
+
checkbox(:condiciones_de_compra,:id=>"read-agreement")
|
47
|
+
checkbox(:cupones,:id=>"vouchers")
|
48
|
+
|
49
|
+
span(:elegir_otro_vuelo,:class=>"choose-another")
|
50
|
+
span(:error_datos,:class=>"error-message")
|
51
|
+
span(:carga,:css=>".loading .img")
|
52
|
+
span(:protegido,:css=>".protected")
|
53
|
+
span(:desprotegido,:css=>".unprotected")
|
54
|
+
span(:precio_seguro,:css=>"#upselling .description .bold")
|
55
|
+
|
56
|
+
text_field(:cupon_email,:id=>"voucher-email")
|
57
|
+
text_field(:cupon_voucher,:id=>"voucher-code-0")
|
58
|
+
|
59
|
+
li(:precio_seguro_desglose,:class=>"item destination_service_insurance")
|
60
|
+
|
61
|
+
p(:id_reserva_compra_duplicada,:css=>"#popup-duplicated-transaction .paragraph")
|
62
|
+
|
63
|
+
def cargar_url(tipo,ambiente,cabotaje="nil",params={})
|
64
|
+
super(tipo,ambiente,cabotaje,params)
|
65
|
+
end
|
66
|
+
|
67
|
+
def agregar_parametro_agencia(parametro_agencia)
|
68
|
+
@parametro_agencia = parametro_agencia
|
69
|
+
end
|
70
|
+
|
71
|
+
def logo_aerolinea_en_matriz(index)
|
72
|
+
self.logos_aerolineas_elements[index].attribute("src").strip.downcase
|
73
|
+
end
|
74
|
+
|
75
|
+
def url_busqueda()
|
76
|
+
"#{self.manage_data.generate_url_checkout}#{@parametro_agencia}"
|
77
|
+
end
|
78
|
+
|
79
|
+
def cargar_datos_pasajeros
|
80
|
+
@browser.execute_script("javascript:void($('.other-passenger-inputs').css('display','block'));")
|
81
|
+
self.cargar_adultos
|
82
|
+
self.cargar_ninos
|
83
|
+
self.cargar_bebes
|
84
|
+
end
|
85
|
+
|
86
|
+
def cargar_datos_CAC
|
87
|
+
@browser.execute_script("javascript:void(function(){ShowButtonCAC();})();")
|
88
|
+
opcion_cac_element.set
|
89
|
+
if documento_offline_element.present?
|
90
|
+
number = case @@site
|
91
|
+
when "CL" then "7028168-6"
|
92
|
+
when "BR" then "22233366638"
|
93
|
+
else "32456734"
|
94
|
+
end
|
95
|
+
documento_offline_element.set(number)
|
96
|
+
end
|
97
|
+
sexo_offline_element.select_value("MALE") if sexo_offline_element.present?
|
98
|
+
nombre_completo_contacto_element.set("Diego Qa Romero") if nombre_completo_contacto_element.present?
|
99
|
+
end
|
100
|
+
|
101
|
+
def aceptar_y_comprar
|
102
|
+
unless condiciones_de_compra_checked?
|
103
|
+
@browser.execute_script("javascript:void($('#read-agreement').click());")
|
104
|
+
end
|
105
|
+
begin
|
106
|
+
@browser.execute_script("javascript:void($('#submit').click());")
|
107
|
+
rescue Selenium::WebDriver::Error::UnknownError
|
108
|
+
comprar_element.click
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
112
|
+
def datos_itinerario()
|
113
|
+
return Checkout::CheckoutCluster.new(tipo_de_busqueda,Hpricot.parse(itinerario_element.html))
|
114
|
+
end
|
115
|
+
end
|
116
|
+
end
|
@@ -21,6 +21,7 @@ Característica: checkout.book_ok
|
|
21
21
|
Y si el site es "AR", verifico el tag de remarketing de facebook
|
22
22
|
Entonces verifico que los precios de las cuotas se muestran correctamente
|
23
23
|
Y verifico que se muestren la caja de clientes felices
|
24
|
+
Y verifico que se muestren las reviews de aerolineas
|
24
25
|
Entonces cargo los pasajeros
|
25
26
|
Y cargo los datos de la tarjeta
|
26
27
|
Y si el site es "AR|MX|PE|EC", cargo los datos de facturacion
|
@@ -40,4 +40,14 @@ Característica: results.matrix_price
|
|
40
40
|
@roundtrip
|
41
41
|
Ejemplos:
|
42
42
|
|pais|tipo|cabotage|
|
43
|
+
|AR |roundtrip|true|
|
44
|
+
@br
|
45
|
+
@roundtrip
|
46
|
+
Ejemplos:
|
47
|
+
|pais|tipo|cabotage|
|
48
|
+
|AR |roundtrip|true|
|
49
|
+
@mx
|
50
|
+
@roundtrip
|
51
|
+
Ejemplos:
|
52
|
+
|pais|tipo|cabotage|
|
43
53
|
|AR |roundtrip|true|
|
data/flights_gui_tests.gemspec
CHANGED
@@ -14,7 +14,7 @@ Gem::Specification.new do |gem|
|
|
14
14
|
|
15
15
|
gem.require_paths = ["lib"] # Usualmente es solo lib -> ["lib"]
|
16
16
|
|
17
|
-
gem.version = '0.
|
17
|
+
gem.version = '0.4.0' # La version se debe incrementar cada vez que se desea publicar una nueva version del test.
|
18
18
|
|
19
19
|
gem.add_dependency('henry-container', '>= 0.1.39')
|
20
20
|
gem.add_dependency('page-object')
|
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.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- lgonzalez
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-12-
|
11
|
+
date: 2014-12-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: henry-container
|
@@ -262,13 +262,23 @@ files:
|
|
262
262
|
- features/support/matchers.rb
|
263
263
|
- features/support/modules/accessor.rb
|
264
264
|
- features/support/modules/browser.rb
|
265
|
-
- features/support/modules/checkout/
|
266
|
-
- features/support/modules/checkout/
|
267
|
-
- features/support/modules/checkout/
|
268
|
-
- features/support/modules/checkout/
|
269
|
-
- features/support/modules/checkout/
|
270
|
-
- features/support/modules/checkout/
|
271
|
-
- features/support/modules/checkout/
|
265
|
+
- features/support/modules/checkout/checkout.rb
|
266
|
+
- features/support/modules/checkout/new_checkout/datos_de_facturacion.rb
|
267
|
+
- features/support/modules/checkout/new_checkout/errores.rb
|
268
|
+
- features/support/modules/checkout/new_checkout/fast_checkout.rb
|
269
|
+
- features/support/modules/checkout/new_checkout/informacion_de_contacto.rb
|
270
|
+
- features/support/modules/checkout/new_checkout/pasajeros.rb
|
271
|
+
- features/support/modules/checkout/new_checkout/popup.rb
|
272
|
+
- features/support/modules/checkout/new_checkout/reviews.rb
|
273
|
+
- features/support/modules/checkout/new_checkout/tarjeta.rb
|
274
|
+
- features/support/modules/checkout/old_checkout/datos_de_facturacion.rb
|
275
|
+
- features/support/modules/checkout/old_checkout/errores.rb
|
276
|
+
- features/support/modules/checkout/old_checkout/fast_checkout.rb
|
277
|
+
- features/support/modules/checkout/old_checkout/informacion_de_contacto.rb
|
278
|
+
- features/support/modules/checkout/old_checkout/pasajeros.rb
|
279
|
+
- features/support/modules/checkout/old_checkout/popup.rb
|
280
|
+
- features/support/modules/checkout/old_checkout/reviews.rb
|
281
|
+
- features/support/modules/checkout/old_checkout/tarjeta.rb
|
272
282
|
- features/support/modules/devtools.rb
|
273
283
|
- features/support/modules/element.rb
|
274
284
|
- features/support/modules/helpers.rb
|
@@ -290,6 +300,7 @@ files:
|
|
290
300
|
- features/support/modules/results/wish_list.rb
|
291
301
|
- features/support/pages/all_pages.rb
|
292
302
|
- features/support/pages/checkout/checkout_page.rb
|
303
|
+
- features/support/pages/checkout/new_checkout_page.rb
|
293
304
|
- features/support/pages/checkout/popup_results_page.rb
|
294
305
|
- features/support/pages/flights_tracker/search_page.rb
|
295
306
|
- features/support/pages/landing/new_landing_page.rb
|
@@ -365,7 +376,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
365
376
|
version: '0'
|
366
377
|
requirements: []
|
367
378
|
rubyforge_project:
|
368
|
-
rubygems_version: 2.
|
379
|
+
rubygems_version: 2.4.3
|
369
380
|
signing_key:
|
370
381
|
specification_version: 4
|
371
382
|
summary: test para results, checkout y landing
|