ds_test 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.bashrc +1 -0
- data/Rakefile +4 -1
- data/cucumber.out +9 -17
- data/ds_test.gemspec +1 -1
- data/features/PAMFailedBookings.feature +1 -1
- data/features/RMBundleStatus.feature +11 -0
- data/features/methods/PAMFailedBookings_actions.rb +6 -5
- data/features/methods/RMbundleStatus.rb +91 -0
- data/features/quotamedia.feature +1 -2
- data/features/step_definitions/PAMFailedBookings_steps.rb +1 -3
- data/features/step_definitions/RMbundleStatus.rb +13 -0
- data/henry-context.yml +4 -4
- data/hints.henry.rmbundlestatus +1 -0
- data/out.henry +1 -1
- metadata +11 -10
- data/failedbookings_alert +0 -5
- data/features/commissionChange +0 -10
- data/features/step_definitions/commissionChange_steps +0 -9
- data/hints.henry +0 -1
- /data/features/step_definitions/{servicios_steps.rb → quotamedia.rb} +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8d43062c6cc8f3aedc8a5329549029538ff08183
|
4
|
+
data.tar.gz: 81510326b64b61d67a8ab57072f462709b19b1cf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cdc1444854f029527d6c04ad5ca175041cb05b9e6a72a6bd1d23e28443db6b647a037ab0cf93f70a35c56ef5e2a1572a98f859f6cff038cbbb6ac739d0adbc8b
|
7
|
+
data.tar.gz: 9233e29804854e5f95e21606b2f30a27a13455a24bb343c82526b92056df4caf29acc77863f13c5d4c9d128ab5359c989006a3b2bbf10df3ea9d9625c3c60caa
|
data/.bashrc
CHANGED
data/Rakefile
CHANGED
@@ -11,7 +11,10 @@ Cucumber::Rake::Task.new(:quotamedia) do |task|
|
|
11
11
|
task.cucumber_opts = ["#{parametros} log/quotamedia#{t}.html --tags @quota_media"]
|
12
12
|
end
|
13
13
|
|
14
|
-
|
15
14
|
Cucumber::Rake::Task.new(:PAMFailedBookings) do |task|
|
16
15
|
task.cucumber_opts = ["#{parametros} log/PAMFailedBookings#{t}.html --tags @pam_failed_bookings"]
|
16
|
+
end
|
17
|
+
|
18
|
+
Cucumber::Rake::Task.new(:RMBundleStatus) do |task|
|
19
|
+
task.cucumber_opts = ["#{parametros} log/RMBundleStatus#{t}.html --tags @rm_bundle_status"]
|
17
20
|
end
|
data/cucumber.out
CHANGED
@@ -1,20 +1,12 @@
|
|
1
1
|
#language: es
|
2
|
-
[36m@
|
3
|
-
Característica: Consultar el servicio de
|
2
|
+
[36m@rm_bundle_status[0m
|
3
|
+
Característica: Consultar el servicio de listado de Bundles de RM para ver si esta activo y checkear la disponibilidad de los items que los componen.
|
4
4
|
|
5
|
-
Escenario: Invocar el servicio de
|
6
|
-
[32mDado que invoco al servicio de
|
7
|
-
[
|
8
|
-
[
|
9
|
-
[36m[98244435, 98251526][0m
|
10
|
-
[31m undefined method `[]' for nil:NilClass (NoMethodError)[0m
|
11
|
-
[31m ./features/methods/PAMFailedBookings_actions.rb:58:in `enviar_alerta'[0m
|
12
|
-
[31m ./features/step_definitions/PAMFailedBookings_steps.rb:11:in `/^checkeo si hay bookings fallidos$/'[0m
|
13
|
-
[31m features/PAMFailedBookings.feature:11:in `Entonces checkeo si hay bookings fallidos'[0m
|
5
|
+
Escenario: Invocar el servicio de listado de Bundles de RM validando que existan bundles y tengan disponibilidad real.[90m # features/RMBundleStatus.feature:7[0m
|
6
|
+
[32mDado que invoco al servicio de listado de Bundles de RM[90m # features/step_definitions/RMbundleStatus.rb:3[0m[0m
|
7
|
+
[32mEntonces checkeo si cada item que los compone tiene disponibilidad[90m # features/step_definitions/RMbundleStatus.rb:7[0m[0m
|
8
|
+
[36mTodos los bundles cargados tienen disponibilidad.[0m
|
14
9
|
|
15
|
-
[
|
16
|
-
[
|
17
|
-
|
18
|
-
1 scenario ([31m1 failed[0m)
|
19
|
-
2 steps ([31m1 failed[0m, [32m1 passed[0m)
|
20
|
-
0m14.149s
|
10
|
+
1 scenario ([32m1 passed[0m)
|
11
|
+
2 steps ([32m2 passed[0m)
|
12
|
+
0m51.061s
|
data/ds_test.gemspec
CHANGED
@@ -4,7 +4,7 @@ $:.push File.expand_path("../lib", __FILE__)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |gem|
|
6
6
|
gem.name = "ds_test"
|
7
|
-
gem.version = "0.1.
|
7
|
+
gem.version = "0.1.1"
|
8
8
|
gem.authors = ["DS QA"]
|
9
9
|
gem.email = ["jdelrio@despegar.com,smendoza@despegar.com"]
|
10
10
|
gem.description = %q{Test de Media}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
#language: es
|
2
|
+
|
3
|
+
@rm_bundle_status
|
4
|
+
|
5
|
+
Característica: Consultar el servicio de listado de Bundles de RM para ver si esta activo y checkear la disponibilidad de los items que los componen.
|
6
|
+
|
7
|
+
Escenario: Invocar el servicio de listado de Bundles de RM validando que existan bundles y tengan disponibilidad real.
|
8
|
+
|
9
|
+
|
10
|
+
Dado que invoco al servicio de listado de Bundles de RM
|
11
|
+
Entonces checkeo si cada item que los compone tiene disponibilidad
|
@@ -10,9 +10,11 @@ end
|
|
10
10
|
def checkear_respuesta
|
11
11
|
# Checkea la respuesta del servicio para ver si hay o no bookings fallidos
|
12
12
|
|
13
|
+
@contenido
|
14
|
+
|
13
15
|
if @service.nil? or @service.empty? or @service.include? "Error"
|
14
16
|
puts "Hubo un error al consultar el servicio de Bookings Fallidos de PAM".on_red
|
15
|
-
resultado=false
|
17
|
+
resultado = false
|
16
18
|
end
|
17
19
|
|
18
20
|
items = []
|
@@ -41,6 +43,7 @@ def checkear_respuesta
|
|
41
43
|
|
42
44
|
end
|
43
45
|
|
46
|
+
resultado
|
44
47
|
|
45
48
|
end
|
46
49
|
|
@@ -72,7 +75,7 @@ def enviar_alerta
|
|
72
75
|
|
73
76
|
mail = Mail.new do
|
74
77
|
from 'ds.test.alert@gmail.com'
|
75
|
-
to 'smendoza@despegar.com'
|
78
|
+
to 'smendoza@despegar.com, ds-pam@despegar.com'
|
76
79
|
subject 'Nuevas reservas fallidas de DS-PAM'
|
77
80
|
|
78
81
|
html_part do
|
@@ -82,10 +85,8 @@ def enviar_alerta
|
|
82
85
|
end
|
83
86
|
|
84
87
|
mail.deliver!
|
85
|
-
|
86
88
|
end
|
87
89
|
end
|
88
|
-
|
89
90
|
false
|
91
|
+
end
|
90
92
|
|
91
|
-
end
|
@@ -0,0 +1,91 @@
|
|
1
|
+
def rm_bundle_list
|
2
|
+
# Consulta el servicio de RM que devuelve el listado de Bundles y los items que los componen.
|
3
|
+
# PROD: 10.2.7.16
|
4
|
+
# RC: 10.254.168.100
|
5
|
+
|
6
|
+
@bundles = HTTParty.get("http://10.2.7.16/ds-rm/service/bundles/")
|
7
|
+
end
|
8
|
+
|
9
|
+
|
10
|
+
|
11
|
+
def checkear_bundles
|
12
|
+
#Checkea la disponibilidad de cada uno de los items que componen los bundles cargados.
|
13
|
+
|
14
|
+
if @bundles.nil? or @bundles.empty? or @bundles.include? "error"
|
15
|
+
puts "Hubo un error al consultar el servicio de Bundles de RM".on_red
|
16
|
+
checkeado = false
|
17
|
+
end
|
18
|
+
|
19
|
+
bundle_info = []
|
20
|
+
|
21
|
+
if !@bundles.empty?
|
22
|
+
|
23
|
+
@bundles.each do | check |
|
24
|
+
|
25
|
+
check['items'].each do | availability |
|
26
|
+
|
27
|
+
tracking_id = availability['trackingId']
|
28
|
+
i = 0
|
29
|
+
for i in 0..1 do
|
30
|
+
|
31
|
+
record = HTTParty.get("http://10.2.7.16/ds-rm/service/provider-records?tracking_id=#{tracking_id}")
|
32
|
+
|
33
|
+
if record.nil? or record.empty? or record.include? 'errors'
|
34
|
+
|
35
|
+
i = i + 1
|
36
|
+
if i == 2
|
37
|
+
bundle_title = check['title']['es']
|
38
|
+
bundle_oid = check['oid']
|
39
|
+
bundle_info << bundle_title + ' | oid: ' + bundle_oid
|
40
|
+
end
|
41
|
+
else
|
42
|
+
i = 2
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
if !bundle_info.empty?
|
50
|
+
|
51
|
+
@output = bundle_info.uniq
|
52
|
+
puts @output
|
53
|
+
false
|
54
|
+
else
|
55
|
+
|
56
|
+
puts 'Todos los bundles cargados tienen disponibilidad.'
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
|
61
|
+
def alerta_bundles
|
62
|
+
#Genera y envía un e-mail de alerta listando los bundles que contengan items sin disponibilidad.
|
63
|
+
|
64
|
+
body_template = '<br><h1># Servicio de alerta de Bundles con items sin disponibilidad: #</h1><br><b>Los siguientes Bundles no se estan ofreciendo en el sitio
|
65
|
+
porque uno o más de los items que los componen no estan disponibles:</b><br><ul>'
|
66
|
+
|
67
|
+
@output.each do | item |
|
68
|
+
body_template = body_template + '<li>' + item.to_s + '</li>'
|
69
|
+
end
|
70
|
+
|
71
|
+
body_template = body_template + '</ul>' + '<br><br><br><br><br><h3>Para editar los Bundles dirigirse a DS-RAMBO:</h3><br>
|
72
|
+
<a href="http://backoffice.despegar.com/ds-rambo/login">
|
73
|
+
<img src="http://www.despegar.com/media/pictures/dcba67fc-0775-48d9-b00d-27b8f296af43" alt="Mountain View" style="width:320px;height:85px;">
|
74
|
+
</a><br><br><br><br><br>
|
75
|
+
-Reporte automatizado de DS-QA<br>
|
76
|
+
Dudas o consultas: ds-qa@despegar.com'
|
77
|
+
|
78
|
+
mail = Mail.new do
|
79
|
+
from 'ds.test.alert@gmail.com'
|
80
|
+
to 'ds-shopping@despegar.com, dssales-product@despegar.com, nicolas.sacheri@despegar.com, santiago.iribarne@despegar.com'
|
81
|
+
subject '[Alerta] Bundles con items sin disponibilidad - DS Automation'
|
82
|
+
|
83
|
+
html_part do
|
84
|
+
content_type 'text/html; charset=UTF-8'
|
85
|
+
body body_template
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
mail.deliver!
|
90
|
+
|
91
|
+
end
|
data/features/quotamedia.feature
CHANGED
@@ -0,0 +1,13 @@
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
2
|
+
#language: es
|
3
|
+
Dado(/^que invoco al servicio de listado de Bundles de RM$/) do
|
4
|
+
rm_bundle_list
|
5
|
+
end
|
6
|
+
|
7
|
+
Entonces(/^checkeo si cada item que los compone tiene disponibilidad$/) do
|
8
|
+
resultado = checkear_bundles
|
9
|
+
##resultado.should be_truthy
|
10
|
+
if !resultado
|
11
|
+
alerta_bundles
|
12
|
+
end
|
13
|
+
end
|
data/henry-context.yml
CHANGED
@@ -20,12 +20,12 @@ tasks:
|
|
20
20
|
- format: html
|
21
21
|
name: ${DATE}_${TASK_NAME}.html
|
22
22
|
|
23
|
-
- name:
|
23
|
+
- name: rm_bundle_status
|
24
24
|
class_name: Henry::Task::CucumberTask
|
25
25
|
options:
|
26
26
|
tags:
|
27
|
-
-
|
27
|
+
- rm_bundle_status
|
28
28
|
expand: true
|
29
29
|
reports:
|
30
|
-
- format: html
|
31
|
-
name: ${DATE}_${TASK_NAME}.html
|
30
|
+
- format: html
|
31
|
+
name: ${DATE}_${TASK_NAME}.html
|
@@ -0,0 +1 @@
|
|
1
|
+
{"tasks":["rm_bundle_status"]}
|
data/out.henry
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"summary":{"total":1,"breakdownByStatusCode":{"OK":
|
1
|
+
{"summary":{"total":1,"breakdownByStatusCode":{"OK":1,"ERROR":0,"WARNING":0}},"tasks":[[{"name":"rm_bundle_status","code":"OK","message":"OK","returnedData":{"output":"#language: es\n\u001b[36m@rm_bundle_status\u001b[0m\nCaracterística: Consultar el servicio de listado de Bundles de RM para ver si esta activo y checkear la disponibilidad de los items que los componen.\n\n Escenario: Invocar el servicio de listado de Bundles de RM validando que existan bundles y tengan disponibilidad real.\u001b[90m # features/RMBundleStatus.feature:7\u001b[0m\n \u001b[32mDado que invoco al servicio de listado de Bundles de RM\u001b[90m # features/step_definitions/RMbundleStatus.rb:3\u001b[0m\u001b[0m\n \u001b[32mEntonces checkeo si cada item que los compone tiene disponibilidad\u001b[90m # features/step_definitions/RMbundleStatus.rb:7\u001b[0m\u001b[0m\n \u001b[36mTodos los bundles cargados tienen disponibilidad.\u001b[0m\n\n1 scenario (\u001b[32m1 passed\u001b[0m)\n2 steps (\u001b[32m2 passed\u001b[0m)\n0m51.061s\n","backtrace":null},"log":{},"worker":"smendoza-ThinkPad-Edge","parameters":{"env":"rc"}}]]}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ds_test
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- DS QA
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-03-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: byebug
|
@@ -203,20 +203,20 @@ files:
|
|
203
203
|
- cucumber.out.orig
|
204
204
|
- ds_test-0.0.4.gem
|
205
205
|
- ds_test.gemspec
|
206
|
-
- failedbookings_alert
|
207
206
|
- features/PAMFailedBookings.feature
|
208
|
-
- features/
|
207
|
+
- features/RMBundleStatus.feature
|
209
208
|
- features/methods/PAMFailedBookings_actions.rb
|
209
|
+
- features/methods/RMbundleStatus.rb
|
210
210
|
- features/methods/actions_media.rb
|
211
211
|
- features/quotamedia.feature
|
212
212
|
- features/step_definitions/PAMFailedBookings_steps.rb
|
213
|
-
- features/step_definitions/
|
214
|
-
- features/step_definitions/
|
213
|
+
- features/step_definitions/RMbundleStatus.rb
|
214
|
+
- features/step_definitions/quotamedia.rb
|
215
215
|
- features/support/env.rb
|
216
216
|
- henry-context.yml
|
217
|
-
- hints.henry
|
218
217
|
- hints.henry.pamfailedbookings
|
219
218
|
- hints.henry.quotamedia
|
219
|
+
- hints.henry.rmbundlestatus
|
220
220
|
- in.henry
|
221
221
|
- log/PAMFailedBookings250920151127.html
|
222
222
|
- log/PAMFailedBookings250920151128.html
|
@@ -247,11 +247,12 @@ specification_version: 4
|
|
247
247
|
summary: Test automatizados
|
248
248
|
test_files:
|
249
249
|
- features/PAMFailedBookings.feature
|
250
|
-
- features/
|
250
|
+
- features/RMBundleStatus.feature
|
251
251
|
- features/methods/PAMFailedBookings_actions.rb
|
252
|
+
- features/methods/RMbundleStatus.rb
|
252
253
|
- features/methods/actions_media.rb
|
253
254
|
- features/quotamedia.feature
|
254
255
|
- features/step_definitions/PAMFailedBookings_steps.rb
|
255
|
-
- features/step_definitions/
|
256
|
-
- features/step_definitions/
|
256
|
+
- features/step_definitions/RMbundleStatus.rb
|
257
|
+
- features/step_definitions/quotamedia.rb
|
257
258
|
- features/support/env.rb
|
data/failedbookings_alert
DELETED
data/features/commissionChange
DELETED
@@ -1,10 +0,0 @@
|
|
1
|
-
#language: es
|
2
|
-
|
3
|
-
@commision_change
|
4
|
-
|
5
|
-
Característica: Consultar el servicio de comisiones especiales de PAM para verificar si cambiaron los coeficientes cargados.
|
6
|
-
|
7
|
-
Escenario: Invocar el servicio de comisiones especiales de PAM validando que hayan cambiado los porcentajes y la diferencia.
|
8
|
-
|
9
|
-
Dado que invoco al servicio de comisiones especiales de PAM
|
10
|
-
Entonces checkeo si cambiaron los coeficientes de comisiones.
|
@@ -1,9 +0,0 @@
|
|
1
|
-
# -*- encoding : utf-8 -*-
|
2
|
-
#language: es
|
3
|
-
Dado(/^que invoco al servicio de consulta de comisiones especiales$/) do
|
4
|
-
commission_change
|
5
|
-
end
|
6
|
-
|
7
|
-
Entonces(/^checkeo si cambiaron los coeficientes de las comisiones$/) do
|
8
|
-
checkear_respuesta.should be_truthy
|
9
|
-
end
|
data/hints.henry
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"tasks":["pam_failed_bookings"]}
|
File without changes
|