Bug 16423 - Fix t/db_dependent/www/batch.t so it matches new layout
Summary: Fix t/db_dependent/www/batch.t so it matches new layout
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Test Suite (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Tomás Cohen Arazi
QA Contact: Marcel de Rooy
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 18807
  Show dependency treegraph
 
Reported: 2016-05-02 20:30 UTC by Tomás Cohen Arazi
Modified: 2017-06-14 19:56 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
Bug 16423: Fix t/db_dependent/www/batch.t so it matches new layout (3.82 KB, patch)
2016-05-02 20:45 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 16423: (followup) Add more tests (2.25 KB, patch)
2016-05-02 20:45 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 16423: Fix t/db_dependent/www/batch.t so it matches new layout (3.91 KB, patch)
2016-05-03 15:01 UTC, Bernardo Gonzalez Kriegel
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 16423: (followup) Add more tests (2.42 KB, patch)
2016-05-03 15:01 UTC, Bernardo Gonzalez Kriegel
Details | Diff | Splinter Review
Bug 16423: Fix t/db_dependent/www/batch.t so it matches new layout (3.99 KB, patch)
2016-05-03 15:06 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 16423: (followup) Add more tests (2.51 KB, patch)
2016-05-03 15:06 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 16423: [QA Follow-up] Remove $opac (1.26 KB, patch)
2016-05-03 15:20 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Tomás Cohen Arazi 2016-05-02 20:30:29 UTC
To reproduce:
- Run
  $ prove t/db_dependent/www/batch.t
=> FAIL: Several tests fail due to page layout/information problems.
Comment 1 Tomás Cohen Arazi 2016-05-02 20:45:16 UTC Comment hidden (obsolete)
Comment 2 Tomás Cohen Arazi 2016-05-02 20:45:22 UTC Comment hidden (obsolete)
Comment 3 Bernardo Gonzalez Kriegel 2016-05-03 10:59:43 UTC
Before patch I found
not ok 7 - upload succeeded
and this message
malformed JSON string, neither array, object, number, string or atom, at character offset 0 (before "<!DOCTYPE html>\n<!-...") at t/db_dependent/www/batch.t line 104.

After patch, test 7 pass and no message, but test 23 fails
not ok 23 - bib is gone

#   Failed test 'bib is gone'
#   at t/db_dependent/www/batch.t line 201.
#     searched: "\x{0a}\x{0a}\x{0a}\x{0a}\x{0a}\x{0a}\x{0a}\x{0a}<!DOCTYPE html>\x{0a}<!-- TEMPLATE FILE: detail"...
#   can't find: "The record you requested does not exist"
#         LCSS: " record y"
# LCSS context: "ave been uploaded for this bibliographic record ye"
Comment 4 Tomás Cohen Arazi 2016-05-03 11:49:05 UTC
Is that on current master??
Comment 5 Bernardo Gonzalez Kriegel 2016-05-03 11:54:06 UTC
(In reply to Tomás Cohen Arazi from comment #4)
> Is that on current master??

Yes.

a7446eb Bug 16423: (followup) Add more tests
c802f5b Bug 16423: Fix t/db_dependent/www/batch.t so it matches new layout
4d0d52e Revert "Bug 16104: Remove warnings "used only once: possible typo""
b20ba02 Bug 15533 - DBRev - Update OldReserve schema file to match database schema
68dbe84 Bug 14632: Add Copyright for the Koha Dev Team
....
Comment 6 Marcel de Rooy 2016-05-03 12:05:34 UTC
Passes with me (one warning):

1..24
Use of uninitialized value $opac in substitution (s///) at t/db_dependent/www/batch.t line 55.
ok 1 - connect to intranet
ok 2 - login to staff client
ok 3 - load main page
ok 4 - open tools module
ok 5 - go to stage MARC
ok 6 - uploaded file
ok 7 - upload succeeded
ok 8 - reopen stage MARC page
ok 9 - stage MARC
ok 10 - have job ID
ok 11 - job was completed
ok 12 - reopen stage MARC page at end of upload
ok 13 - stage MARC
ok 14 - view batch
ok 15 - get the datatable for the new batch id
ok 16 - found book
ok 17 - record marked as staged
ok 18 - record has no matches
ok 19 - imported records into catalog
ok 20 - record marked as imported
ok 21 - revert import
ok 22 - getting reverted bib
ok 23 - bib is gone
ok 24 - record marked as reverted
Comment 7 Bernardo Gonzalez Kriegel 2016-05-03 15:01:24 UTC Comment hidden (obsolete)
Comment 8 Bernardo Gonzalez Kriegel 2016-05-03 15:01:32 UTC Comment hidden (obsolete)
Comment 9 Marcel de Rooy 2016-05-03 15:06:20 UTC
Created attachment 51151 [details] [review]
Bug 16423: Fix t/db_dependent/www/batch.t so it matches new layout

This patch adjusts batch.t so it matches the use of datatables on the
'Manage staged records' page, and small layout changes already fixed
on search_utf8.t.

The tests are slightly modified so they actually test interesting stuff.
Some were passing only because an undefined value was passed.

To test:
- On master, run
  $ prove t/db_dependent/www/batch.t
=> FAIL: Tests fail notably
- Apply the patch
- Run:
  $ prove t/db_dependent/www/batch.t
=> SUCCESS: Notice tests now pass.
- Sign off :-D

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Test pass

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 10 Marcel de Rooy 2016-05-03 15:06:24 UTC
Created attachment 51152 [details] [review]
Bug 16423: (followup) Add more tests

On fixing this tests, we retrieved the JSON data for the datatable used on
the 'Manage staged records' page. It would be cool to check the data it
carries makes sense.

To test:
- Run t/db_dependent/www/batch.t
=> SUCCESS: Tests pass
- Sign off :-D

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>

All test pass
prove t/db_dependent/www/batch.t
t/db_dependent/www/batch.t .. ok
All tests successful.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 11 Marcel de Rooy 2016-05-03 15:20:23 UTC
Created attachment 51155 [details] [review]
Bug 16423: [QA Follow-up] Remove $opac

It is not used. And even may raise an uninitialized warnings.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Test still passes :)
Comment 12 Kyle M Hall 2016-05-03 15:34:26 UTC
Pushed to master for Koha 16.05, thanks Marcel, Tomas!