Bugzilla – Attachment 65270 Details for
Bug 18982
selenium tests needs too many prerequisites
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18982: Create a specific itemtype for these tests
Bug-18982-Create-a-specific-itemtype-for-these-tes.patch (text/plain), 3.24 KB, created by
Biblibre Sandboxes
on 2017-07-26 07:40:58 UTC
(
hide
)
Description:
Bug 18982: Create a specific itemtype for these tests
Filename:
MIME Type:
Creator:
Biblibre Sandboxes
Created:
2017-07-26 07:40:58 UTC
Size:
3.24 KB
patch
obsolete
>From fd45927183b6953d4706f7aca7404acefd1caf44 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 25 Jul 2017 16:48:06 -0300 >Subject: [PATCH] Bug 18982: Create a specific itemtype for these tests > >No need to require rentalcharge=0 for all itemtypes, we create our own. > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> > >Signed-off-by: Andrei <acovaliov@gmail.com> >--- > t/db_dependent/selenium/basic_workflow.t | 20 +++++++++++++------- > 1 file changed, 13 insertions(+), 7 deletions(-) > >diff --git a/t/db_dependent/selenium/basic_workflow.t b/t/db_dependent/selenium/basic_workflow.t >index cbe36aa..e185b4d 100644 >--- a/t/db_dependent/selenium/basic_workflow.t >+++ b/t/db_dependent/selenium/basic_workflow.t >@@ -23,9 +23,6 @@ > # Xvfb :1 -screen 0 1024x768x24 2>&1 >/dev/null & > # DISPLAY=:1 java -jar $SELENIUM_PATH > # >-# Remove the rentalcharge: >-# % UPDATE itemtypes SET rentalcharge = 0; >-# > # Then you can execute the test file. > # > # If you get: >@@ -50,6 +47,7 @@ my $login = 'koha'; > my $password = 'koha'; > my $base_url= ( $ENV{KOHA_INTRANET_URL} || 'http://'.C4::Context->preference("staffClientBaseURL") ) . "/cgi-bin/koha/"; > >+ > my $number_of_biblios_to_insert = 3; > our $sample_data = { > category => { >@@ -64,6 +62,13 @@ our $sample_data = { > userid => 'test_username', > password => 'password', > password2 => 'password' >+ >+ }, >+ itemtype => { >+ itemtype => 'IT4TEST', >+ description => 'Just an itemtype for tests', >+ rentalcharge => 0, >+ notforloan => 0, > }, > }; > our ( $borrowernumber, $start, $prev_time, $cleanup_needed ); >@@ -128,8 +133,8 @@ SKIP: { > > time_diff("add biblio"); > >- my $itemtype = $dbh->selectcol_arrayref(q|SELECT itemtype FROM itemtypes|); >- $itemtype = $itemtype->[0]; >+ my $itemtype = $sample_data->{itemtype}; >+ $dbh->do(q|INSERT INTO itemtypes (itemtype, description, rentalcharge, notforloan) VALUES (?, ?, ?, ?)|, undef, $itemtype->{itemtype}, $itemtype->{description}, $itemtype->{rentalcharge}, $itemtype->{notforloan}); > > for my $biblionumber ( @biblionumbers ) { > $driver->get($base_url."/cataloguing/additem.pl?biblionumber=$biblionumber"); >@@ -149,8 +154,8 @@ SKIP: { > like( $driver->get_title(), qr($biblionumber.*Items) ); > > $dbh->do(q|UPDATE items SET notforloan=0 WHERE biblionumber=?|, {}, $biblionumber ); >- $dbh->do(q|UPDATE biblioitems SET itemtype=? WHERE biblionumber=?|, {}, $itemtype, $biblionumber); >- $dbh->do(q|UPDATE items SET itype=? WHERE biblionumber=?|, {}, $itemtype, $biblionumber); >+ $dbh->do(q|UPDATE biblioitems SET itemtype=? WHERE biblionumber=?|, {}, $itemtype->{itemtype}, $biblionumber); >+ $dbh->do(q|UPDATE items SET itype=? WHERE biblionumber=?|, {}, $itemtype->{itemtype}, $biblionumber); > } > > time_diff("add items"); >@@ -217,6 +222,7 @@ sub cleanup { > for my $i ( 1 .. $number_of_biblios_to_insert ) { > $dbh->do(qq|DELETE items, biblio FROM biblio INNER JOIN items ON biblio.biblionumber = items.biblionumber WHERE biblio.title = "test biblio$i"|); > }; >+ $dbh->do(q|DELETE FROM itemtypes WHERE itemtype=?|, undef, $sample_data->{itemtype}{itemtype}); > } > > sub time_diff { >-- >2.7.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 18982
:
65261
|
65262
|
65263
|
65264
|
65268
|
65269
| 65270 |
65271
|
65282