Revision 7bde24ad
[#1457] Rafraichissement AJAX dans VigiBoard
Change le mécanisme de rafraichissement du tableau de VigiBoard pour
utiliser de l'AJAX.
Réutilise le fichier "loader.js" pour obtenir un sablier lors du
chargement (et donc suppression des copies dans VigiMap/VigiGraph).
Le script "loader.js" est enrichi pour pouvoir ajouter la notion d'un
calque qui est rendu semi-opaque lors de l'exécution de la requête.
Change-Id: Idc537cd8b4f257af9fcd6ac8c6334deadd9d042a
Refs: #1457.
Reviewed-on: https://vigilo-dev.si.c-s.fr/review/1898
Tested-by: Build system <qa@vigilo-dev.si.c-s.fr>
Reviewed-by: Francois POIROTTE <francois.poirotte@c-s.fr>
vigiboard/i18n/de/LC_MESSAGES/vigiboard.po | ||
---|---|---|
8 | 8 |
"Project-Id-Version: vigiboard 2.0.0\n" |
9 | 9 |
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" |
10 | 10 |
"POT-Creation-Date: 2010-11-19 10:22+0100\n" |
11 |
"PO-Revision-Date: 2015-04-23 18:04+0200\n"
|
|
11 |
"PO-Revision-Date: 2015-08-31 14:19+0200\n"
|
|
12 | 12 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" |
13 | 13 |
"Language-Team: de_DE <LL@li.org>\n" |
14 | 14 |
"Plural-Forms: nplurals=2; plural=(n != 1)\n" |
... | ... | |
311 | 311 |
msgid "And" |
312 | 312 |
msgstr "" |
313 | 313 |
|
314 |
#: vigiboard/controllers/plugins/date.py:109
|
|
314 |
#: vigiboard/controllers/plugins/date.py:110
|
|
315 | 315 |
msgid "Start date cannot be greater than current date" |
316 | 316 |
msgstr "" |
317 | 317 |
|
318 |
#: vigiboard/controllers/plugins/date.py:112
|
|
318 |
#: vigiboard/controllers/plugins/date.py:115
|
|
319 | 319 |
msgid "Start date cannot be greater than end date" |
320 | 320 |
msgstr "" |
321 | 321 |
|
322 |
#: vigiboard/controllers/plugins/date.py:120
|
|
322 |
#: vigiboard/controllers/plugins/date.py:124
|
|
323 | 323 |
msgid "End date cannot be greater than current date" |
324 | 324 |
msgstr "" |
325 | 325 |
|
326 |
#: vigiboard/controllers/plugins/details.py:195
|
|
326 |
#: vigiboard/controllers/plugins/details.py:205
|
|
327 | 327 |
#: vigiboard/controllers/plugins/state.py:47 |
328 | 328 |
msgid "Current state" |
329 | 329 |
msgstr "" |
... | ... | |
392 | 392 |
msgid "%Y-%m-%d" |
393 | 393 |
msgstr "%d.%m.%Y" |
394 | 394 |
|
395 |
#: vigiboard/public/js/main.js:39
|
|
395 |
#: vigiboard/public/js/main.js:40
|
|
396 | 396 |
msgid "Search Event" |
397 | 397 |
msgstr "" |
398 | 398 |
|
399 |
#: vigiboard/public/js/main.js:54
|
|
399 |
#: vigiboard/public/js/main.js:55
|
|
400 | 400 |
msgid "Select a group" |
401 | 401 |
msgstr "" |
402 | 402 |
|
403 |
#: vigiboard/public/js/main.js:84 vigiboard/public/js/main.js:105
|
|
404 |
#: vigiboard/public/js/main.js:136 vigiboard/public/js/main.js:169
|
|
403 |
#: vigiboard/public/js/main.js:85 vigiboard/public/js/main.js:106
|
|
404 |
#: vigiboard/public/js/main.js:153 vigiboard/public/js/main.js:186
|
|
405 | 405 |
msgid "Unable to save preferences" |
406 | 406 |
msgstr "" |
407 | 407 |
|
408 |
#: vigiboard/public/js/main.js:141 |
|
409 |
msgid "Could not refresh data, reloading the page" |
|
410 |
msgstr "" |
|
411 |
|
|
408 | 412 |
#: vigiboard/public/js/silence.js:63 |
409 | 413 |
msgid "Are you sure you want to delete this rule?" |
410 | 414 |
msgstr "" |
... | ... | |
477 | 481 |
"Warnung: die Änderung des Tickets wirkt sich auf alle ausgewählten " |
478 | 482 |
"Ereignisse aus." |
479 | 483 |
|
480 |
#: vigiboard/widgets/search_form.py:56
|
|
484 |
#: vigiboard/widgets/search_form.py:57
|
|
481 | 485 |
msgid "Search" |
482 | 486 |
msgstr "Suchen" |
483 | 487 |
|
vigiboard/i18n/en/LC_MESSAGES/vigiboard.po | ||
---|---|---|
6 | 6 |
# |
7 | 7 |
msgid "" |
8 | 8 |
msgstr "" |
9 |
"Project-Id-Version: vigilo-vigiboard 3.5\n"
|
|
9 |
"Project-Id-Version: vigilo-vigiboard 3.6.0\n"
|
|
10 | 10 |
"Report-Msgid-Bugs-To: contact@projet-vigilo.org\n" |
11 |
"POT-Creation-Date: 2015-04-23 18:04+0200\n"
|
|
12 |
"PO-Revision-Date: 2015-04-23 18:04+0200\n"
|
|
11 |
"POT-Creation-Date: 2015-08-31 14:19+0200\n"
|
|
12 |
"PO-Revision-Date: 2015-08-31 14:19+0200\n"
|
|
13 | 13 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" |
14 | 14 |
"Language-Team: en <LL@li.org>\n" |
15 | 15 |
"Plural-Forms: nplurals=2; plural=(n != 1)\n" |
... | ... | |
327 | 327 |
msgid "And" |
328 | 328 |
msgstr "And" |
329 | 329 |
|
330 |
#: vigiboard/controllers/plugins/date.py:109
|
|
330 |
#: vigiboard/controllers/plugins/date.py:110
|
|
331 | 331 |
msgid "Start date cannot be greater than current date" |
332 | 332 |
msgstr "Start date cannot be greater than current date" |
333 | 333 |
|
334 |
#: vigiboard/controllers/plugins/date.py:112
|
|
334 |
#: vigiboard/controllers/plugins/date.py:115
|
|
335 | 335 |
msgid "Start date cannot be greater than end date" |
336 | 336 |
msgstr "Start date cannot be greater than end date" |
337 | 337 |
|
338 |
#: vigiboard/controllers/plugins/date.py:120
|
|
338 |
#: vigiboard/controllers/plugins/date.py:124
|
|
339 | 339 |
msgid "End date cannot be greater than current date" |
340 | 340 |
msgstr "End date cannot be greater than current date" |
341 | 341 |
|
342 |
#: vigiboard/controllers/plugins/details.py:195
|
|
342 |
#: vigiboard/controllers/plugins/details.py:205
|
|
343 | 343 |
#: vigiboard/controllers/plugins/state.py:47 |
344 | 344 |
msgid "Current state" |
345 | 345 |
msgstr "Current state" |
... | ... | |
408 | 408 |
msgid "%Y-%m-%d" |
409 | 409 |
msgstr "%Y-%m-%d" |
410 | 410 |
|
411 |
#: vigiboard/public/js/main.js:39
|
|
411 |
#: vigiboard/public/js/main.js:40
|
|
412 | 412 |
msgid "Search Event" |
413 | 413 |
msgstr "Search Event" |
414 | 414 |
|
415 |
#: vigiboard/public/js/main.js:54
|
|
415 |
#: vigiboard/public/js/main.js:55
|
|
416 | 416 |
msgid "Select a group" |
417 | 417 |
msgstr "Select a group" |
418 | 418 |
|
419 |
#: vigiboard/public/js/main.js:84 vigiboard/public/js/main.js:105
|
|
420 |
#: vigiboard/public/js/main.js:136 vigiboard/public/js/main.js:169
|
|
419 |
#: vigiboard/public/js/main.js:85 vigiboard/public/js/main.js:106
|
|
420 |
#: vigiboard/public/js/main.js:153 vigiboard/public/js/main.js:186
|
|
421 | 421 |
msgid "Unable to save preferences" |
422 | 422 |
msgstr "Unable to save preferences" |
423 | 423 |
|
424 |
#: vigiboard/public/js/main.js:141 |
|
425 |
msgid "Could not refresh data, reloading the page" |
|
426 |
msgstr "Could not refresh data, reloading the page" |
|
427 |
|
|
424 | 428 |
#: vigiboard/public/js/silence.js:63 |
425 | 429 |
msgid "Are you sure you want to delete this rule?" |
426 | 430 |
msgstr "Are you sure you want to delete this rule?" |
... | ... | |
489 | 493 |
msgid "Warning: changing the ticket will affect all selected events." |
490 | 494 |
msgstr "Warning: changing the ticket will affect all selected events." |
491 | 495 |
|
492 |
#: vigiboard/widgets/search_form.py:56
|
|
496 |
#: vigiboard/widgets/search_form.py:57
|
|
493 | 497 |
msgid "Search" |
494 | 498 |
msgstr "Search" |
495 | 499 |
|
vigiboard/i18n/fr/LC_MESSAGES/vigiboard.po | ||
---|---|---|
8 | 8 |
"Project-Id-Version: vigiboard 0.1\n" |
9 | 9 |
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" |
10 | 10 |
"POT-Creation-Date: 2009-07-06 11:19+0200\n" |
11 |
"PO-Revision-Date: 2015-04-23 18:04+0200\n"
|
|
11 |
"PO-Revision-Date: 2015-08-31 14:19+0200\n"
|
|
12 | 12 |
"Last-Translator: Thomas ANDREJAK <thomas.andrejak@c-s.fr>\n" |
13 | 13 |
"Language-Team: fr_FR <LL@li.org>\n" |
14 | 14 |
"Plural-Forms: nplurals=2; plural=(n > 1)\n" |
... | ... | |
340 | 340 |
msgid "And" |
341 | 341 |
msgstr "Et" |
342 | 342 |
|
343 |
#: vigiboard/controllers/plugins/date.py:109
|
|
343 |
#: vigiboard/controllers/plugins/date.py:110
|
|
344 | 344 |
msgid "Start date cannot be greater than current date" |
345 | 345 |
msgstr "La date de début ne peut être supérieure à la date courante" |
346 | 346 |
|
347 |
#: vigiboard/controllers/plugins/date.py:112
|
|
347 |
#: vigiboard/controllers/plugins/date.py:115
|
|
348 | 348 |
msgid "Start date cannot be greater than end date" |
349 | 349 |
msgstr "La date de début ne peut être supérieure à la date de fin" |
350 | 350 |
|
351 |
#: vigiboard/controllers/plugins/date.py:120
|
|
351 |
#: vigiboard/controllers/plugins/date.py:124
|
|
352 | 352 |
msgid "End date cannot be greater than current date" |
353 | 353 |
msgstr "La date de fin ne peut être supérieure à la date courante" |
354 | 354 |
|
355 |
#: vigiboard/controllers/plugins/details.py:195
|
|
355 |
#: vigiboard/controllers/plugins/details.py:205
|
|
356 | 356 |
#: vigiboard/controllers/plugins/state.py:47 |
357 | 357 |
msgid "Current state" |
358 | 358 |
msgstr "État courant" |
... | ... | |
421 | 421 |
msgid "%Y-%m-%d" |
422 | 422 |
msgstr "%d/%m/%Y" |
423 | 423 |
|
424 |
#: vigiboard/public/js/main.js:39
|
|
424 |
#: vigiboard/public/js/main.js:40
|
|
425 | 425 |
msgid "Search Event" |
426 | 426 |
msgstr "Rechercher un événement" |
427 | 427 |
|
428 |
#: vigiboard/public/js/main.js:54
|
|
428 |
#: vigiboard/public/js/main.js:55
|
|
429 | 429 |
msgid "Select a group" |
430 | 430 |
msgstr "Choisir un groupe" |
431 | 431 |
|
432 |
#: vigiboard/public/js/main.js:84 vigiboard/public/js/main.js:105
|
|
433 |
#: vigiboard/public/js/main.js:136 vigiboard/public/js/main.js:169
|
|
432 |
#: vigiboard/public/js/main.js:85 vigiboard/public/js/main.js:106
|
|
433 |
#: vigiboard/public/js/main.js:153 vigiboard/public/js/main.js:186
|
|
434 | 434 |
msgid "Unable to save preferences" |
435 | 435 |
msgstr "Impossible de sauvegarder les préférences" |
436 | 436 |
|
437 |
#: vigiboard/public/js/main.js:141 |
|
438 |
msgid "Could not refresh data, reloading the page" |
|
439 |
msgstr "Impossible de mettre à jour les données, rechargement de la page" |
|
440 |
|
|
437 | 441 |
#: vigiboard/public/js/silence.js:63 |
438 | 442 |
msgid "Are you sure you want to delete this rule?" |
439 | 443 |
msgstr "Êtes-vous sûr de vouloir supprimer cette règle ?" |
... | ... | |
502 | 506 |
msgid "Warning: changing the ticket will affect all selected events." |
503 | 507 |
msgstr "Attention : la modification du ticket affectera toute la sélection." |
504 | 508 |
|
505 |
#: vigiboard/widgets/search_form.py:56
|
|
509 |
#: vigiboard/widgets/search_form.py:57
|
|
506 | 510 |
msgid "Search" |
507 | 511 |
msgstr "Rechercher" |
508 | 512 |
|
vigiboard/i18n/vigiboard.pot | ||
---|---|---|
7 | 7 |
#, fuzzy |
8 | 8 |
msgid "" |
9 | 9 |
msgstr "" |
10 |
"Project-Id-Version: vigilo-vigiboard 3.5\n"
|
|
10 |
"Project-Id-Version: vigilo-vigiboard 3.6.0\n"
|
|
11 | 11 |
"Report-Msgid-Bugs-To: contact@projet-vigilo.org\n" |
12 |
"POT-Creation-Date: 2015-04-23 18:04+0200\n"
|
|
12 |
"POT-Creation-Date: 2015-08-31 14:19+0200\n"
|
|
13 | 13 |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" |
14 | 14 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" |
15 | 15 |
"Language-Team: LANGUAGE <LL@li.org>\n" |
... | ... | |
307 | 307 |
msgid "And" |
308 | 308 |
msgstr "" |
309 | 309 |
|
310 |
#: vigiboard/controllers/plugins/date.py:109
|
|
310 |
#: vigiboard/controllers/plugins/date.py:110
|
|
311 | 311 |
msgid "Start date cannot be greater than current date" |
312 | 312 |
msgstr "" |
313 | 313 |
|
314 |
#: vigiboard/controllers/plugins/date.py:112
|
|
314 |
#: vigiboard/controllers/plugins/date.py:115
|
|
315 | 315 |
msgid "Start date cannot be greater than end date" |
316 | 316 |
msgstr "" |
317 | 317 |
|
318 |
#: vigiboard/controllers/plugins/date.py:120
|
|
318 |
#: vigiboard/controllers/plugins/date.py:124
|
|
319 | 319 |
msgid "End date cannot be greater than current date" |
320 | 320 |
msgstr "" |
321 | 321 |
|
322 |
#: vigiboard/controllers/plugins/details.py:195
|
|
322 |
#: vigiboard/controllers/plugins/details.py:205
|
|
323 | 323 |
#: vigiboard/controllers/plugins/state.py:47 |
324 | 324 |
msgid "Current state" |
325 | 325 |
msgstr "" |
... | ... | |
386 | 386 |
msgid "%Y-%m-%d" |
387 | 387 |
msgstr "" |
388 | 388 |
|
389 |
#: vigiboard/public/js/main.js:39
|
|
389 |
#: vigiboard/public/js/main.js:40
|
|
390 | 390 |
msgid "Search Event" |
391 | 391 |
msgstr "" |
392 | 392 |
|
393 |
#: vigiboard/public/js/main.js:54
|
|
393 |
#: vigiboard/public/js/main.js:55
|
|
394 | 394 |
msgid "Select a group" |
395 | 395 |
msgstr "" |
396 | 396 |
|
397 |
#: vigiboard/public/js/main.js:84 vigiboard/public/js/main.js:105
|
|
398 |
#: vigiboard/public/js/main.js:136 vigiboard/public/js/main.js:169
|
|
397 |
#: vigiboard/public/js/main.js:85 vigiboard/public/js/main.js:106
|
|
398 |
#: vigiboard/public/js/main.js:153 vigiboard/public/js/main.js:186
|
|
399 | 399 |
msgid "Unable to save preferences" |
400 | 400 |
msgstr "" |
401 | 401 |
|
402 |
#: vigiboard/public/js/main.js:141 |
|
403 |
msgid "Could not refresh data, reloading the page" |
|
404 |
msgstr "" |
|
405 |
|
|
402 | 406 |
#: vigiboard/public/js/silence.js:63 |
403 | 407 |
msgid "Are you sure you want to delete this rule?" |
404 | 408 |
msgstr "" |
... | ... | |
467 | 471 |
msgid "Warning: changing the ticket will affect all selected events." |
468 | 472 |
msgstr "" |
469 | 473 |
|
470 |
#: vigiboard/widgets/search_form.py:56
|
|
474 |
#: vigiboard/widgets/search_form.py:57
|
|
471 | 475 |
msgid "Search" |
472 | 476 |
msgstr "" |
473 | 477 |
|
vigiboard/public/js/main.js | ||
---|---|---|
5 | 5 |
*/ |
6 | 6 |
|
7 | 7 |
var vigiloLog = new Log(); |
8 |
// Activation ou désactivation du log en fonction de valeur de la variable debug. |
|
8 |
// Activation ou désactivation du log en fonction |
|
9 |
// de la valeur de la variable debug. |
|
9 | 10 |
if (debug_mode) { |
10 | 11 |
vigiloLog.enableLog(); |
11 | 12 |
} else { |
... | ... | |
125 | 126 |
* réutiliser au maximum le contenu du cache. |
126 | 127 |
* Observations faites sous Fx 3.6.8. |
127 | 128 |
*/ |
128 |
window.location.reload(false); |
|
129 |
var req = new Request.HTML({ |
|
130 |
method: "get", |
|
131 |
noCache: false, |
|
132 |
link: 'cancel', |
|
133 |
url: (new URI()), |
|
134 |
evalScripts: false, |
|
135 |
filter: 'table.vigitable', |
|
136 |
onSuccess: function (tree) { |
|
137 |
$$('table.vigitable')[0].empty().adopt(tree); |
|
138 |
}, |
|
139 |
onException: function () { |
|
140 |
// En cas d'erreur, on recharge toute la page. |
|
141 |
alert(_('Could not refresh data, reloading the page')); |
|
142 |
window.location.reload(false); |
|
143 |
} |
|
144 |
}); |
|
145 |
req.send(); |
|
129 | 146 |
} |
130 | 147 |
|
131 | 148 |
function change_theme(theme_id, theme_name) { |
vigiboard/tests/__init__.py | ||
---|---|---|
65 | 65 |
# Cleaning up the database: |
66 | 66 |
teardown_db() |
67 | 67 |
del self.app |
68 |
|
|
69 |
def get_rows(self, response): |
|
70 |
return response.lxml.xpath( |
|
71 |
'//table[contains(concat(" ", @class, " "), " vigitable ")]' |
|
72 |
'/tbody/tr') |
|
73 |
|
|
74 |
def get_cells(self, response): |
|
75 |
return response.lxml.xpath( |
|
76 |
'//table[contains(concat(" ", @class, " "), " vigitable ")]' |
|
77 |
'/tbody/tr/td') |
vigiboard/tests/functional/plugins/test_plugin_hls.py | ||
---|---|---|
121 | 121 |
|
122 | 122 |
# On s'assure que la colonne des HLS |
123 | 123 |
# impactés est vide pour notre évènement. |
124 |
plugin_data = resp.lxml.xpath('//table[@class="vigitable"]' |
|
124 |
plugin_data = resp.lxml.xpath( |
|
125 |
'//table[contains(concat(" ", @class, " "), " vigitable ")]' |
|
125 | 126 |
'/tbody/tr/td[@class="plugin_hls"]/text()') |
126 | 127 |
assert_equal(plugin_data[0].strip(), "") |
127 | 128 |
|
... | ... | |
143 | 144 |
|
144 | 145 |
# On s'assure que la colonne des HLS impactés contient |
145 | 146 |
# bien le nom de notre HLS de plus haut niveau impacté. |
146 |
plugin_data = resp.lxml.xpath('//table[@class="vigitable"]' |
|
147 |
plugin_data = resp.lxml.xpath( |
|
148 |
'//table[contains(concat(" ", @class, " "), " vigitable ")]' |
|
147 | 149 |
'/tbody/tr/td[@class="plugin_hls"]/text()') |
148 | 150 |
assert_equal(plugin_data[0].strip(), "HLS12") |
149 | 151 |
|
... | ... | |
165 | 167 |
|
166 | 168 |
# On s'assure que la colonne des HLS contient bien |
167 | 169 |
# le nombre de HLS de plus haut niveau impactés, |
168 |
plugin_data = resp.lxml.xpath('//table[@class="vigitable"]' |
|
170 |
plugin_data = resp.lxml.xpath( |
|
171 |
'//table[contains(concat(" ", @class, " "), " vigitable ")]' |
|
169 | 172 |
'/tbody/tr/td[@class="plugin_hls"]/a/text()') |
170 | 173 |
assert_equal(plugin_data[0].strip(), "2") |
171 | 174 |
|
... | ... | |
207 | 210 |
|
208 | 211 |
# On s'assure que la colonne des HLS contient bien |
209 | 212 |
# le nom de notre HLS de plus haut niveau impacté. |
210 |
plugin_data = resp.lxml.xpath('//table[@class="vigitable"]' |
|
213 |
plugin_data = resp.lxml.xpath( |
|
214 |
'//table[contains(concat(" ", @class, " "), " vigitable ")]' |
|
211 | 215 |
'/tbody/tr/td[@class="plugin_hls"]/text()') |
212 | 216 |
assert_equal(plugin_data[0].strip(), "HLS") |
vigiboard/tests/functional/test_correvents_table.py | ||
---|---|---|
37 | 37 |
response = self.app.get('/', extra_environ=environ) |
38 | 38 |
|
39 | 39 |
# Il doit y avoir 2 lignes de résultats. |
40 |
rows = response.lxml.xpath('//table[@class="vigitable"]/tbody/tr')
|
|
40 |
rows = self.get_rows(response)
|
|
41 | 41 |
print "There are %d rows in the result set" % len(rows) |
42 | 42 |
assert_equal(len(rows), 2) |
43 | 43 |
|
44 | 44 |
# Il doit y avoir plusieurs colonnes dans la ligne de résultats. |
45 |
cols = response.lxml.xpath('//table[@class="vigitable"]/tbody/tr/td')
|
|
45 |
cols = self.get_cells(response)
|
|
46 | 46 |
print "There are %d columns in the result set" % len(cols) |
47 | 47 |
assert_true(len(cols) > 1) |
48 | 48 |
|
... | ... | |
59 | 59 |
response = self.app.get('/', extra_environ=environ) |
60 | 60 |
|
61 | 61 |
# Il doit y avoir 5 lignes de résultats. |
62 |
rows = response.lxml.xpath('//table[@class="vigitable"]/tbody/tr')
|
|
62 |
rows = self.get_rows(response)
|
|
63 | 63 |
print "There are %d rows in the result set" % len(rows) |
64 | 64 |
assert_equal(len(rows), 5) |
65 | 65 |
|
66 | 66 |
# Il doit y avoir plusieurs colonnes dans la ligne de résultats. |
67 |
cols = response.lxml.xpath('//table[@class="vigitable"]/tbody/tr/td')
|
|
67 |
cols = self.get_cells(response)
|
|
68 | 68 |
print "There are %d columns in the result set" % len(cols) |
69 | 69 |
assert_true(len(cols) > 1) |
70 | 70 |
|
... | ... | |
81 | 81 |
response = self.app.get('/', extra_environ=environ) |
82 | 82 |
|
83 | 83 |
# Il doit y avoir 5 lignes de résultats. |
84 |
rows = response.lxml.xpath('//table[@class="vigitable"]/tbody/tr')
|
|
84 |
rows = self.get_rows(response)
|
|
85 | 85 |
print "There are %d rows in the result set" % len(rows) |
86 | 86 |
assert_equal(len(rows), 5) |
87 | 87 |
|
88 | 88 |
# Il doit y avoir plusieurs colonnes dans la ligne de résultats. |
89 |
cols = response.lxml.xpath('//table[@class="vigitable"]/tbody/tr/td')
|
|
89 |
cols = self.get_cells(response)
|
|
90 | 90 |
print "There are %d columns in the result set" % len(cols) |
91 | 91 |
assert_true(len(cols) > 1) |
92 | 92 |
|
... | ... | |
122 | 122 |
response = self.app.get(url, extra_environ=environ, status=200) |
123 | 123 |
|
124 | 124 |
# Il doit y avoir 1 ligne de résultats. |
125 |
rows = response.lxml.xpath('//table[@class="vigitable"]/tbody/tr')
|
|
125 |
rows = self.get_rows(response)
|
|
126 | 126 |
print "There are %d rows in the result set" % len(rows) |
127 | 127 |
assert_equal(len(rows), 1) |
128 | 128 |
|
... | ... | |
133 | 133 |
response = self.app.get(url, extra_environ=environ, status=200) |
134 | 134 |
|
135 | 135 |
# Il doit y avoir 1 ligne de résultats. |
136 |
rows = response.lxml.xpath('//table[@class="vigitable"]/tbody/tr')
|
|
136 |
rows = self.get_rows(response)
|
|
137 | 137 |
print "There are %d rows in the result set" % len(rows) |
138 | 138 |
assert_equal(len(rows), 1) |
139 | 139 |
|
... | ... | |
162 | 162 |
response = self.app.get(url, extra_environ=environ, status=200) |
163 | 163 |
|
164 | 164 |
# Il doit y avoir 1 ligne de résultats. |
165 |
rows = response.lxml.xpath('//table[@class="vigitable"]/tbody/tr')
|
|
165 |
rows = self.get_rows(response)
|
|
166 | 166 |
print "There are %d rows in the result set" % len(rows) |
167 | 167 |
assert_equal(len(rows), 1) |
168 | 168 |
|
... | ... | |
173 | 173 |
response = self.app.get(url, extra_environ=environ, status=200) |
174 | 174 |
|
175 | 175 |
# Il doit y avoir 1 ligne de résultats. |
176 |
rows = response.lxml.xpath('//table[@class="vigitable"]/tbody/tr')
|
|
176 |
rows = self.get_rows(response)
|
|
177 | 177 |
print "There are %d rows in the result set" % len(rows) |
178 | 178 |
assert_equal(len(rows), 1) |
vigiboard/tests/functional/test_root.py | ||
---|---|---|
489 | 489 |
current_page = response.lxml.xpath( |
490 | 490 |
'//span[@class="pager_curpage"]/text()') |
491 | 491 |
assert_equal(2, int(current_page[0])) |
492 |
rows = response.lxml.xpath('//table[@class="vigitable"]/tbody/tr') |
|
493 |
assert_equal(len(rows), 1) |
|
494 |
cols = response.lxml.xpath('//table[@class="vigitable"]/tbody/tr/td') |
|
495 |
assert_true(len(cols) > 1) |
|
492 |
assert_equal(len(self.get_rows(response)), 1) |
|
493 |
assert_true(len(self.get_cells(response)) > 1) |
|
496 | 494 |
|
497 | 495 |
# On force l'état de l'événement sur la 2ème page à 'OK'. |
498 | 496 |
# - Tout d'abord, on récupère l'identifiant de l'événement en question. |
499 |
idcorrevent = response.lxml.xpath('string(//table[@class="vigitable"]/tbody/tr/td[@class="plugin_details"]/a/@href)') |
|
497 |
idcorrevent = response.lxml.xpath( |
|
498 |
'string(//table[contains(concat(" ", @class, " "), " vigitable ")]' |
|
499 |
'/tbody/tr/td[@class="plugin_details"]/a/@href)') |
|
500 | 500 |
idcorrevent = int(idcorrevent.lstrip('#')) |
501 | 501 |
# - Puis, on met à jour son état (en le forçant à OK). |
502 | 502 |
# On s'attend à ce que le statut de la requête soit 302, |
... | ... | |
520 | 520 |
current_page = response.lxml.xpath( |
521 | 521 |
'//span[@class="pager_curpage"]/text()') |
522 | 522 |
assert_equal(1, int(current_page[0])) |
523 |
rows = response.lxml.xpath('//table[@class="vigitable"]/tbody/tr') |
|
524 |
assert_equal(len(rows), items_per_page) |
|
525 |
cols = response.lxml.xpath('//table[@class="vigitable"]/tbody/tr/td') |
|
526 |
assert_true(len(cols) > 1) |
|
523 |
assert_equal(len(self.get_rows(response)), items_per_page) |
|
524 |
assert_true(len(self.get_cells(response)) > 1) |
|
527 | 525 |
|
528 | 526 |
# Une requête sur la 2ème page doit désormais |
529 | 527 |
# afficher le contenu de la 1ère page. |
... | ... | |
531 | 529 |
current_page = response.lxml.xpath( |
532 | 530 |
'//span[@class="pager_curpage"]/text()') |
533 | 531 |
assert_equal(1, int(current_page[0])) |
534 |
rows = response.lxml.xpath('//table[@class="vigitable"]/tbody/tr') |
|
535 |
assert_equal(len(rows), items_per_page) |
|
532 |
assert_equal(len(self.get_rows(response)), items_per_page) |
vigiboard/tests/functional/test_search_form_host.py | ||
---|---|---|
98 | 98 |
extra_environ={'REMOTE_USER': 'user'}) |
99 | 99 |
|
100 | 100 |
# Il doit y avoir 1 seule ligne de résultats. |
101 |
rows = response.lxml.xpath('//table[@class="vigitable"]/tbody/tr')
|
|
101 |
rows = self.get_rows(response)
|
|
102 | 102 |
print "There are %d rows in the result set" % len(rows) |
103 | 103 |
assert_equal(len(rows), 1) |
104 | 104 |
|
105 | 105 |
# Il doit y avoir plusieurs colonnes dans la ligne de résultats. |
106 |
cols = response.lxml.xpath('//table[@class="vigitable"]/tbody/tr/td')
|
|
106 |
cols = self.get_cells(response)
|
|
107 | 107 |
print "There are %d columns in the result set" % len(cols) |
108 | 108 |
assert_true(len(cols) > 1) |
109 | 109 |
|
... | ... | |
116 | 116 |
extra_environ={'REMOTE_USER': 'user'}) |
117 | 117 |
|
118 | 118 |
# Il doit y avoir 1 seule ligne de résultats. |
119 |
rows = response.lxml.xpath('//table[@class="vigitable"]/tbody/tr')
|
|
119 |
rows = self.get_rows(response)
|
|
120 | 120 |
print "There are %d rows in the result set" % len(rows) |
121 | 121 |
assert_equal(len(rows), 1) |
122 | 122 |
|
123 | 123 |
# Il doit y avoir 1 seule colonne dans la ligne de résultats. |
124 | 124 |
# (la colonne contient le texte "Il n'y a aucun événément", traduit) |
125 |
cols = response.lxml.xpath('//table[@class="vigitable"]/tbody/tr/td')
|
|
125 |
cols = self.get_cells(response)
|
|
126 | 126 |
print "There are %d columns in the result set" % len(cols) |
127 | 127 |
assert_equal(len(cols), 1) |
128 | 128 |
|
... | ... | |
140 | 140 |
extra_environ={'REMOTE_USER': 'user'}) |
141 | 141 |
|
142 | 142 |
# Il doit y avoir 1 seule ligne de résultats. |
143 |
rows = response.lxml.xpath('//table[@class="vigitable"]/tbody/tr')
|
|
143 |
rows = self.get_rows(response)
|
|
144 | 144 |
print "There are %d rows in the result set" % len(rows) |
145 | 145 |
assert_equal(len(rows), 1) |
146 | 146 |
|
147 | 147 |
# Il doit y avoir 1 seule colonne dans la ligne de résultats. |
148 | 148 |
# (la colonne contient le texte "Il n'y a aucun événément", traduit) |
149 |
cols = response.lxml.xpath('//table[@class="vigitable"]/tbody/tr/td')
|
|
149 |
cols = self.get_cells(response)
|
|
150 | 150 |
print "There are %d columns in the result set" % len(cols) |
151 | 151 |
assert_equal(len(cols), 1) |
vigiboard/tests/functional/test_search_form_misc.py | ||
---|---|---|
93 | 93 |
'to_date': to_date, |
94 | 94 |
}, |
95 | 95 |
extra_environ={'REMOTE_USER': 'user'}) |
96 |
rows = response.lxml.xpath('//table[@class="vigitable"]/tbody/tr')
|
|
96 |
rows = self.get_rows(response)
|
|
97 | 97 |
print "There are %d rows in the result set" % len(rows) |
98 | 98 |
return len(rows) |
99 | 99 |
|
... | ... | |
108 | 108 |
extra_environ={'REMOTE_USER': 'user'}) |
109 | 109 |
|
110 | 110 |
# Il doit y avoir 1 seule ligne de résultats. |
111 |
rows = response.lxml.xpath('//table[@class="vigitable"]/tbody/tr')
|
|
111 |
rows = self.get_rows(response)
|
|
112 | 112 |
print "There are %d rows in the result set" % len(rows) |
113 | 113 |
assert_equal(len(rows), 1) |
114 | 114 |
|
115 | 115 |
# Il doit y avoir plusieurs colonnes dans la ligne de résultats. |
116 |
cols = response.lxml.xpath('//table[@class="vigitable"]/tbody/tr/td')
|
|
116 |
cols = self.get_cells(response)
|
|
117 | 117 |
print "There are %d columns in the result set" % len(cols) |
118 | 118 |
assert_true(len(cols) > 1) |
119 | 119 |
|
... | ... | |
129 | 129 |
transaction.commit() |
130 | 130 |
|
131 | 131 |
# Il doit y avoir 1 seule ligne de résultats. |
132 |
rows = response.lxml.xpath('//table[@class="vigitable"]/tbody/tr')
|
|
132 |
rows = self.get_rows(response)
|
|
133 | 133 |
print "There are %d rows in the result set" % len(rows) |
134 | 134 |
assert_equal(len(rows), 1) |
135 | 135 |
|
136 | 136 |
# Il doit y avoir plusieurs colonnes dans la ligne de résultats. |
137 |
cols = response.lxml.xpath('//table[@class="vigitable"]/tbody/tr/td')
|
|
137 |
cols = self.get_cells(response)
|
|
138 | 138 |
print "There are %d columns in the result set" % len(cols) |
139 | 139 |
assert_true(len(cols) > 1) |
140 | 140 |
|
... | ... | |
157 | 157 |
extra_environ={'REMOTE_USER': 'user'}) |
158 | 158 |
|
159 | 159 |
# Il doit y avoir 1 seule ligne de résultats. |
160 |
rows = response.lxml.xpath('//table[@class="vigitable"]/tbody/tr')
|
|
160 |
rows = self.get_rows(response)
|
|
161 | 161 |
print "There are %d rows in the result set" % len(rows) |
162 | 162 |
assert_equal(len(rows), 1) |
163 | 163 |
|
164 | 164 |
# Il doit y avoir plusieurs colonnes dans la ligne de résultats. |
165 |
cols = response.lxml.xpath('//table[@class="vigitable"]/tbody/tr/td')
|
|
165 |
cols = self.get_cells(response)
|
|
166 | 166 |
print "There are %d columns in the result set" % len(cols) |
167 | 167 |
assert_true(len(cols) > 1) |
168 | 168 |
|
vigiboard/tests/functional/test_search_form_service.py | ||
---|---|---|
76 | 76 |
extra_environ={'REMOTE_USER': 'user'}) |
77 | 77 |
|
78 | 78 |
# Il doit y avoir 1 seule ligne de résultats. |
79 |
rows = response.lxml.xpath('//table[@class="vigitable"]/tbody/tr')
|
|
79 |
rows = self.get_rows(response)
|
|
80 | 80 |
print "There are %d rows in the result set" % len(rows) |
81 | 81 |
assert_equal(len(rows), 1) |
82 | 82 |
|
83 | 83 |
# Il doit y avoir plusieurs colonnes dans la ligne de résultats. |
84 |
cols = response.lxml.xpath('//table[@class="vigitable"]/tbody/tr/td')
|
|
84 |
cols = self.get_cells(response)
|
|
85 | 85 |
print "There are %d columns in the result set" % len(cols) |
86 | 86 |
assert_true(len(cols) > 1) |
87 | 87 |
|
... | ... | |
110 | 110 |
extra_environ={'REMOTE_USER': 'user'}) |
111 | 111 |
|
112 | 112 |
# Il doit y avoir 1 seule ligne de résultats. |
113 |
rows = response.lxml.xpath('//table[@class="vigitable"]/tbody/tr')
|
|
113 |
rows = self.get_rows(response)
|
|
114 | 114 |
print "There are %d rows in the result set" % len(rows) |
115 | 115 |
assert_equal(len(rows), 1) |
116 | 116 |
|
117 | 117 |
# Il doit y avoir plusieurs colonnes dans la ligne de résultats. |
118 |
cols = response.lxml.xpath('//table[@class="vigitable"]/tbody/tr/td')
|
|
118 |
cols = self.get_cells(response)
|
|
119 | 119 |
print "There are %d columns in the result set" % len(cols) |
120 | 120 |
assert_true(len(cols) > 1) |
121 | 121 |
|
... | ... | |
128 | 128 |
extra_environ={'REMOTE_USER': 'user'}) |
129 | 129 |
|
130 | 130 |
# Il doit y avoir 1 seule ligne de résultats. |
131 |
rows = response.lxml.xpath('//table[@class="vigitable"]/tbody/tr')
|
|
131 |
rows = self.get_rows(response)
|
|
132 | 132 |
print "There are %d rows in the result set" % len(rows) |
133 | 133 |
assert_equal(len(rows), 1) |
134 | 134 |
|
135 | 135 |
# Il doit y avoir 1 seule colonne dans la ligne de résultats. |
136 | 136 |
# (la colonne contient le texte "Il n'y a aucun événément", traduit) |
137 |
cols = response.lxml.xpath('//table[@class="vigitable"]/tbody/tr/td')
|
|
137 |
cols = self.get_cells(response)
|
|
138 | 138 |
assert_equal(len(cols), 1) |
139 | 139 |
|
140 | 140 |
def test_search_service_when_disallowed(self): |
... | ... | |
151 | 151 |
extra_environ={'REMOTE_USER': 'user'}) |
152 | 152 |
|
153 | 153 |
# Il doit y avoir 1 seule ligne de résultats. |
154 |
rows = response.lxml.xpath('//table[@class="vigitable"]/tbody/tr')
|
|
154 |
rows = self.get_rows(response)
|
|
155 | 155 |
print "There are %d rows in the result set" % len(rows) |
156 | 156 |
assert_equal(len(rows), 1) |
157 | 157 |
|
158 | 158 |
# Il doit y avoir 1 seule colonne dans la ligne de résultats. |
159 | 159 |
# (la colonne contient le texte "Il n'y a aucun événément", traduit) |
160 |
cols = response.lxml.xpath('//table[@class="vigitable"]/tbody/tr/td')
|
|
160 |
cols = self.get_cells(response)
|
|
161 | 161 |
print "There are %d columns in the result set" % len(cols) |
162 | 162 |
assert_equal(len(cols), 1) |
vigiboard/tests/functional/test_search_form_supitemgroup.py | ||
---|---|---|
39 | 39 |
) |
40 | 40 |
|
41 | 41 |
# Il doit y avoir 2 lignes dans la réponse. |
42 |
rows = response.lxml.xpath('//table[@class="vigitable"]/tbody/tr')
|
|
42 |
rows = self.get_rows(response)
|
|
43 | 43 |
print "There are %d rows in the result set" % len(rows) |
44 | 44 |
assert_equal(len(rows), 2) |
45 | 45 |
|
46 | 46 |
# Il doit y avoir plusieurs colonnes dans la réponse. |
47 |
cols = response.lxml.xpath('//table[@class="vigitable"]/tbody/tr/td')
|
|
47 |
cols = self.get_cells(response)
|
|
48 | 48 |
print "There are %d columns in the result set" % len(cols) |
49 | 49 |
assert_true(len(cols) > 1) |
50 | 50 |
|
... | ... | |
58 | 58 |
) |
59 | 59 |
|
60 | 60 |
# Il doit y avoir 2 lignes dans la réponse. |
61 |
rows = response.lxml.xpath('//table[@class="vigitable"]/tbody/tr')
|
|
61 |
rows = self.get_rows(response)
|
|
62 | 62 |
print "There are %d rows in the result set" % len(rows) |
63 | 63 |
assert_equal(len(rows), 2) |
64 | 64 |
|
65 | 65 |
# Il doit y avoir plusieurs colonnes dans la réponse. |
66 |
cols = response.lxml.xpath('//table[@class="vigitable"]/tbody/tr/td')
|
|
66 |
cols = self.get_cells(response)
|
|
67 | 67 |
print "There are %d columns in the result set" % len(cols) |
68 | 68 |
assert_true(len(cols) > 1) |
69 | 69 |
|
... | ... | |
76 | 76 |
) |
77 | 77 |
|
78 | 78 |
# Il doit y avoir 2 lignes dans la réponse. |
79 |
rows = response.lxml.xpath('//table[@class="vigitable"]/tbody/tr')
|
|
79 |
rows = self.get_rows(response)
|
|
80 | 80 |
print "There are %d rows in the result set" % len(rows) |
81 | 81 |
assert_equal(len(rows), 2) |
82 | 82 |
|
83 | 83 |
# Il doit y avoir plusieurs colonnes dans la réponse. |
84 |
cols = response.lxml.xpath('//table[@class="vigitable"]/tbody/tr/td')
|
|
84 |
cols = self.get_cells(response)
|
|
85 | 85 |
print "There are %d columns in the result set" % len(cols) |
86 | 86 |
assert_true(len(cols) > 1) |
87 | 87 |
|
... | ... | |
96 | 96 |
) |
97 | 97 |
|
98 | 98 |
# Il doit y avoir 5 lignes dans la réponse. |
99 |
rows = response.lxml.xpath('//table[@class="vigitable"]/tbody/tr')
|
|
99 |
rows = self.get_rows(response)
|
|
100 | 100 |
print "There are %d rows in the result set" % len(rows) |
101 | 101 |
assert_equal(len(rows), 5) |
102 | 102 |
|
103 | 103 |
# Il doit y avoir plusieurs colonnes dans la réponse. |
104 |
cols = response.lxml.xpath('//table[@class="vigitable"]/tbody/tr/td')
|
|
104 |
cols = self.get_cells(response)
|
|
105 | 105 |
print "There are %d columns in the result set" % len(cols) |
106 | 106 |
assert_true(len(cols) > 1) |
107 | 107 |
|
... | ... | |
115 | 115 |
) |
116 | 116 |
|
117 | 117 |
# Il doit y avoir 5 lignes dans la réponse. |
118 |
rows = response.lxml.xpath('//table[@class="vigitable"]/tbody/tr')
|
|
118 |
rows = self.get_rows(response)
|
|
119 | 119 |
print "There are %d rows in the result set" % len(rows) |
120 | 120 |
assert_equal(len(rows), 5) |
121 | 121 |
|
122 | 122 |
# Il doit y avoir plusieurs colonnes dans la réponse. |
123 |
cols = response.lxml.xpath('//table[@class="vigitable"]/tbody/tr/td')
|
|
123 |
cols = self.get_cells(response)
|
|
124 | 124 |
print "There are %d columns in the result set" % len(cols) |
125 | 125 |
assert_true(len(cols) > 1) |
126 | 126 |
|
... | ... | |
134 | 134 |
extra_environ={'REMOTE_USER': 'access'}) |
135 | 135 |
|
136 | 136 |
# Il doit y avoir 1 seule ligne de résultats. |
137 |
rows = response.lxml.xpath('//table[@class="vigitable"]/tbody/tr')
|
|
137 |
rows = self.get_rows(response)
|
|
138 | 138 |
print "There are %d rows in the result set" % len(rows) |
139 | 139 |
assert_equal(len(rows), 1) |
140 | 140 |
|
141 | 141 |
# Il doit y avoir 1 seule colonne dans la ligne de résultats. |
142 | 142 |
# (la colonne contient le texte "Il n'y a aucun événément", traduit) |
143 |
cols = response.lxml.xpath('//table[@class="vigitable"]/tbody/tr/td')
|
|
143 |
cols = self.get_cells(response)
|
|
144 | 144 |
print "There are %d columns in the result set" % len(cols) |
145 | 145 |
assert_equal(len(cols), 1) |
146 | 146 |
|
... | ... | |
151 | 151 |
extra_environ={'REMOTE_USER': 'manager'}) |
152 | 152 |
|
153 | 153 |
# Il doit y avoir 1 seule ligne de résultats. |
154 |
rows = response.lxml.xpath('//table[@class="vigitable"]/tbody/tr')
|
|
154 |
rows = self.get_rows(response)
|
|
155 | 155 |
print "There are %d rows in the result set" % len(rows) |
156 | 156 |
|
157 | 157 |
# Il doit y avoir 1 seule colonne dans la ligne de résultats. |
158 | 158 |
# (la colonne contient le texte "Il n'y a aucun événément", traduit) |
159 | 159 |
assert_equal(len(rows), 1) |
160 |
cols = response.lxml.xpath('//table[@class="vigitable"]/tbody/tr/td')
|
|
160 |
cols = self.get_cells(response)
|
|
161 | 161 |
print "There are %d columns in the result set" % len(cols) |
162 | 162 |
assert_equal(len(cols), 1) |
163 | 163 |
|
... | ... | |
182 | 182 |
|
183 | 183 |
# Il doit y avoir 1 seule ligne dans la réponse. |
184 | 184 |
# (la réponse contient le texte "Il n'y a aucun événément", traduit) |
185 |
rows = response.lxml.xpath('//table[@class="vigitable"]/tbody/tr')
|
|
185 |
rows = self.get_rows(response)
|
|
186 | 186 |
print "There are %d rows in the result set" % len(rows) |
187 | 187 |
assert_equal(len(rows), 1) |
188 | 188 |
|
189 | 189 |
# Il doit y avoir 1 seule colonne dans la réponse. |
190 |
cols = response.lxml.xpath('//table[@class="vigitable"]/tbody/tr/td')
|
|
190 |
cols = self.get_cells(response)
|
|
191 | 191 |
print "There are %d columns in the result set" % len(cols) |
192 | 192 |
assert_equal(len(cols), 1) |
vigiboard/tests/functional/test_sorting.py | ||
---|---|---|
67 | 67 |
# - la 2nde concerne 'service1' sur 'host2'. |
68 | 68 |
# Il doit y avoir plusieurs colonnes dans la ligne de résultats. |
69 | 69 |
hostnames = response.lxml.xpath( |
70 |
'//table[@class="vigitable"]/tbody/tr/' \
|
|
71 |
'td[@class="plugin_hostname"]/text()') |
|
70 |
'//table[contains(concat(" ", @class, " "), " vigitable ")]'
|
|
71 |
'/tbody/tr/td[@class="plugin_hostname"]/text()')
|
|
72 | 72 |
assert_equal(hostnames, ['host1', 'host2']) |
73 | 73 |
servicenames = response.lxml.xpath( |
74 |
'//table[@class="vigitable"]/tbody/tr/' \
|
|
75 |
'td[@class="plugin_servicename"]/text()') |
|
74 |
'//table[contains(concat(" ", @class, " "), " vigitable ")]'
|
|
75 |
'/tbody/tr/td[@class="plugin_servicename"]/text()')
|
|
76 | 76 |
assert_equal(servicenames, ['service2', 'service1']) |
77 | 77 |
|
78 | 78 |
def test_descending_order(self): |
... | ... | |
89 | 89 |
# - la 2nde concerne 'service1' sur 'host2'. |
90 | 90 |
# Il doit y avoir plusieurs colonnes dans la ligne de résultats. |
91 | 91 |
hostnames = response.lxml.xpath( |
92 |
'//table[@class="vigitable"]/tbody/tr/' \
|
|
93 |
'td[@class="plugin_hostname"]/text()') |
|
92 |
'//table[contains(concat(" ", @class, " "), " vigitable ")]'
|
|
93 |
'/tbody/tr/td[@class="plugin_hostname"]/text()')
|
|
94 | 94 |
assert_equal(hostnames, ['host1', 'host2']) |
95 | 95 |
servicenames = response.lxml.xpath( |
96 |
'//table[@class="vigitable"]/tbody/tr/' \
|
|
97 |
'td[@class="plugin_servicename"]/text()') |
|
96 |
'//table[contains(concat(" ", @class, " "), " vigitable ")]'
|
|
97 |
'/tbody/tr/td[@class="plugin_servicename"]/text()')
|
|
98 | 98 |
assert_equal(servicenames, ['service2', 'service1']) |
99 | 99 |
|
100 | 100 |
def test_pagination(self): |
... | ... | |
122 | 122 |
# Il ne doit y avoir qu'une seule ligne de |
123 | 123 |
# résultats concernant "service2" sur "host1" |
124 | 124 |
hostnames = response.lxml.xpath( |
125 |
'//table[@class="vigitable"]/tbody/tr/' \
|
|
126 |
'td[@class="plugin_hostname"]/text()') |
|
125 |
'//table[contains(concat(" ", @class, " "), " vigitable ")]'
|
|
126 |
'/tbody/tr/td[@class="plugin_hostname"]/text()')
|
|
127 | 127 |
assert_equal(hostnames, ['host1']) |
128 | 128 |
servicenames = response.lxml.xpath( |
129 |
'//table[@class="vigitable"]/tbody/tr/' \
|
|
130 |
'td[@class="plugin_servicename"]/text()') |
|
129 |
'//table[contains(concat(" ", @class, " "), " vigitable ")]'
|
|
130 |
'/tbody/tr/td[@class="plugin_servicename"]/text()')
|
|
131 | 131 |
assert_equal(servicenames, ['service2']) |
132 | 132 |
|
133 | 133 |
|
Also available in: Unified diff