]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/xul/staff_client/server/addon/pv_supa_goodstuff_tests/pv_supa_goodstuff_test3.expect
P.V. SUPA GoodStuff integration
[working/Evergreen.git] / Open-ILS / xul / staff_client / server / addon / pv_supa_goodstuff_tests / pv_supa_goodstuff_test3.expect
1 #!/usr/bin/expect -f
2 # This test simulates interaction with GoodStuff hardware for the purpose
3 # of RFID scanning items for checkout.
4 #
5 # Prerequisites:
6 #
7 # Requires expect and netcat to be installed, and expects for a pristine
8 # load of EG's stock test data to be installed.  In the staff client,
9 # pv_supa_goodstuff should be listed in the Add-Ons list under Admin ->
10 # Workstation Administration -> Server Add-ons.  In the GoodStuff
11 # preferences section, Enabled should be checked, the IP/Hostname field
12 # should point to the server running this test script, and the port
13 # should be 5000.  Networking should be configured to allow the client
14 # machine to reach port 5000 on this server.  If netcat is not installed
15 # as /bin/nc, change the spawn line below as appropriate.  The staff
16 # client should registered to the BR1 branch and the stock admin user
17 # should be used.
18 #
19 # Steps:
20 #
21 # 1) Ensure the staff client is configured as per the prerequisites, and
22 #    clear all tabs in the staff client.
23 # 2) Invoke this script.
24 # 3) In the staff client, press F2 or invoke Circulation -> Check In Items.
25 #    If the RFID checkbox is unchecked, check it.
26 # 4) The client will transit item CONC90000480.  Click "Do Not Print".
27 # 5) The client will fail to check in item "madeupitem".  Click "OK".
28 # 6) The fake GoodStuff will report a problem scanning all the parts for
29 #    item CONC40000120, and say that it read only 1 of 2 parts.  Click
30 #    "Re-Scan Item".  The item will be checked in.
31 # 7) The client will check-in item CONC40000121, but the fake GoodStuff
32 #    will report a problem setting the item's security flag.  Click
33 #    "Activate Security".  The problem will persist.  Click "Make No
34 #    Change".
35 # 8) Close the tab.  The script should end without errors.  This
36 #    particular test may be ran again with identical results without
37 #    needing to reset the test data.
38 #
39 set send_slow {1 .1}
40 proc send {ignore arg} {
41     sleep .1
42     exp_send -s -- $arg
43 }
44 set timeout -1
45 spawn "/bin/nc" -l -p 5000
46 match_max 100000
47 expect "START|ITEM\r"
48 send -- "START|OK\r"
49 expect -exact "START|OK\r
50 "
51 send -- "CONC90000480"
52 expect -exact "CONC90000480"
53 send -- "|1/1\r"
54 expect -exact "|1/1\r
55 CONC90000480|ACTIVATE\r
56 "
57 send -- "CONC90000480"
58 expect -exact "CONC90000480"
59 send -- "|OK\r"
60 expect -exact "|OK\r
61 "
62 send -- "madeupitem|1/1\r"
63 expect -exact "madeupitem|1/1\r
64 madeupitem|ACTIVATE\r
65 "
66 send -- "madeupitem|OK\r"
67 expect -exact "madeupitem|OK\r
68 "
69 send -- "CONC40000120"
70 expect -exact "CONC40000120"
71 send -- "|1/2\r"
72 expect -exact "|1/2\r
73 CONC40000120|REREAD\r
74 "
75 send -- "CONC40000120"
76 expect -exact "CONC40000120"
77 send -- "|2/2\r"
78 expect -exact "|2/2\r
79 CONC40000120|ACTIVATE\r
80 "
81 send -- "CONC40000120"
82 expect -exact "CONC40000120"
83 send -- "|OK\r"
84 expect -exact "|OK\r
85 "
86 send -- "CONC40000121"
87 expect -exact "CONC40000121"
88 send -- "|1/1\r"
89 expect -exact "|1/1\r
90 CONC40000121|ACTIVATE\r
91 "
92 send -- "CONC40000121"
93 expect -exact "CONC40000121"
94 send -- "|NOK\r"
95 expect -exact "|NOK\r
96 CONC40000121|ACTIVATE\r
97 "
98 send -- "CONC40000121"
99 expect -exact "CONC40000121"
100 send -- "|NOK\r"
101 expect -exact "|NOK\r
102 CONC40000121\r
103 "
104 send -- "CONC40000121"
105 expect -exact "CONC40000121"
106 send -- "|OK\r"
107 expect -exact "|OK\r
108 END\r"
109 expect eof