~replaceafill/ubuntu/trusty/schooltool/2.8_custom-css

« back to all changes in this revision

Viewing changes to src/schooltool/schoolyear/browser/stests/new_year_timetables.txt

  • Committer: Gediminas Paulauskas
  • Date: 2014-05-08 15:13:41 UTC
  • mfrom: (1.1.34)
  • Revision ID: menesis@pov.lt-20140508151341-wcsbt3m1lxbrc90x
Tags: 1:2.8.0-0ubuntu1
* New upstream release.
* debian/patches/ckeditor4.patch: remove, fixed upstream.
* debian/copyright: add a section for included d3 javascript library.
* debian/missing-sources: add sources for included javascript libraries:
  - d3 2.9.7
  - jquery 1.7.1
  - jquery-scrollto 1.4.2
  - jquery-ui 1.8.18

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Test for the copy timetables option for new years
 
2
=================================================
 
3
 
 
4
See https://bugs.launchpad.net/bugs/1005962
 
5
 
 
6
Log in as manager:
 
7
 
 
8
    >>> manager = browsers.manager
 
9
    >>> manager.ui.login('manager', 'schooltool')
 
10
 
 
11
Add a school year:
 
12
 
 
13
    >>> manager.ui.schoolyear.add('2014', '2014-01-01', '2014-12-31')
 
14
 
 
15
Add a couple of timetables:
 
16
 
 
17
    >>> manager.query.link('School').click()
 
18
    >>> manager.query.link('Timetables').click()
 
19
    >>> manager.query.link('Timetable').click()
 
20
    >>> manager.query.id('field.title').clear()
 
21
    >>> manager.query.id('field.title').ui.set_value('3 periods')
 
22
    >>> manager.query.button('Next').click()
 
23
    >>> manager.query.button('Days of the week').click()
 
24
    >>> manager.query.button('Same time each day').click()
 
25
    >>> manager.query.id('field.times').clear()
 
26
    >>> times = '\n'.join([
 
27
    ...     '9:30-10:25',
 
28
    ...     '10:30-11:25',
 
29
    ...     '11:30-12:25',
 
30
    ... ])
 
31
    >>> manager.query.id('field.times').ui.set_value(times)
 
32
    >>> manager.query.button('Next').click()
 
33
    >>> manager.query.button('Have names').click()
 
34
    >>> manager.query.id('field.periods').ui.set_value('First\nSecond\nThird')
 
35
    >>> manager.query.button('Next').click()
 
36
    >>> manager.query.button('Same').click()
 
37
    >>> manager.query.button('Next').click()
 
38
    >>> manager.query.button('No').click()
 
39
 
 
40
    >>> manager.query.link('School').click()
 
41
    >>> manager.query.link('Timetables').click()
 
42
    >>> manager.query.link('Timetable').click()
 
43
    >>> manager.query.id('field.title').clear()
 
44
    >>> manager.query.id('field.title').ui.set_value('4 periods')
 
45
    >>> manager.query.button('Next').click()
 
46
    >>> manager.query.button('Days of the week').click()
 
47
    >>> manager.query.button('Same time each day').click()
 
48
    >>> manager.query.id('field.times').clear()
 
49
    >>> times = '\n'.join([
 
50
    ...     '9:00-10:00',
 
51
    ...     '10:00-11:00',
 
52
    ...     '11:00-12:00',
 
53
    ...     '12:00-13:00',
 
54
    ... ])
 
55
    >>> manager.query.id('field.times').ui.set_value(times)
 
56
    >>> manager.query.button('Next').click()
 
57
    >>> manager.query.button('Have names').click()
 
58
    >>> manager.query.id('field.periods').ui.set_value('A\nB\nC\nD')
 
59
    >>> manager.query.button('Next').click()
 
60
    >>> manager.query.button('Same').click()
 
61
    >>> manager.query.css('select[name="period_0"]').ui.set_value('C')
 
62
    >>> manager.query.css('select[name="period_1"]').ui.set_value('A')
 
63
    >>> manager.query.css('select[name="period_2"]').ui.set_value('D')
 
64
    >>> manager.query.css('select[name="period_3"]').ui.set_value('B')
 
65
    >>> manager.query.button('Next').click()
 
66
    >>> manager.query.button('Yes').click()
 
67
    >>> manager.query.id('homeroom_0_A').click()
 
68
    >>> manager.query.id('homeroom_1_A').click()
 
69
    >>> manager.query.id('homeroom_2_A').click()
 
70
    >>> manager.query.id('homeroom_3_A').click()
 
71
    >>> manager.query.id('homeroom_4_A').click()
 
72
    >>> manager.query.id('homeroom_5_A').click()
 
73
    >>> manager.query.id('homeroom_6_A').click()
 
74
    >>> manager.query.button('Next').click()
 
75
 
 
76
Check both timetables:
 
77
 
 
78
    >>> manager.query.link('School').click()
 
79
    >>> manager.query.link('2014').click()
 
80
    >>> manager.query.link('Timetables').click()
 
81
    >>> print_timetables_table(manager)
 
82
    3 periods, 2014-01-01, 2014-12-31
 
83
    4 periods, 2014-01-01, 2014-12-31
 
84
 
 
85
    >>> manager.query.link('3 periods').click()
 
86
    >>> print_timetable(manager)
 
87
    3 periods
 
88
    ---------
 
89
    Periods
 
90
    +---------------+---------------+---------------+---------------+---------------+---------------+---------------+
 
91
    | Monday        | Tuesday       | Wednesday     | Thursday      | Friday        | Saturday      | Sunday        |
 
92
    +---------------+---------------+---------------+---------------+---------------+---------------+---------------+
 
93
    | First Lesson  | First Lesson  | First Lesson  | First Lesson  | First Lesson  | First Lesson  | First Lesson  |
 
94
    | Second Lesson | Second Lesson | Second Lesson | Second Lesson | Second Lesson | Second Lesson | Second Lesson |
 
95
    | Third Lesson  | Third Lesson  | Third Lesson  | Third Lesson  | Third Lesson  | Third Lesson  | Third Lesson  |
 
96
    +---------------+---------------+---------------+---------------+---------------+---------------+---------------+
 
97
    Time schedule
 
98
    +-------------+-------------+-------------+-------------+-------------+----------+--------+
 
99
    | Monday      | Tuesday     | Wednesday   | Thursday    | Friday      | Saturday | Sunday |
 
100
    +-------------+-------------+-------------+-------------+-------------+----------+--------+
 
101
    | 09:30-10:25 | 09:30-10:25 | 09:30-10:25 | 09:30-10:25 | 09:30-10:25 |          |        |
 
102
    | 10:30-11:25 | 10:30-11:25 | 10:30-11:25 | 10:30-11:25 | 10:30-11:25 |          |        |
 
103
    | 11:30-12:25 | 11:30-12:25 | 11:30-12:25 | 11:30-12:25 | 11:30-12:25 |          |        |
 
104
    +-------------+-------------+-------------+-------------+-------------+----------+--------+
 
105
    >>> manager.query.link('Done').click()
 
106
    >>> manager.query.link('4 periods').click()
 
107
    >>> print_timetable(manager)
 
108
    4 periods
 
109
    ---------
 
110
    Periods
 
111
    +------------+------------+------------+------------+------------+------------+------------+
 
112
    | Monday     | Tuesday    | Wednesday  | Thursday   | Friday     | Saturday   | Sunday     |
 
113
    +------------+------------+------------+------------+------------+------------+------------+
 
114
    | C Lesson   | C Lesson   | C Lesson   | C Lesson   | C Lesson   | C Lesson   | C Lesson   |
 
115
    | A Homeroom | A Homeroom | A Homeroom | A Homeroom | A Homeroom | A Homeroom | A Homeroom |
 
116
    | D Lesson   | D Lesson   | D Lesson   | D Lesson   | D Lesson   | D Lesson   | D Lesson   |
 
117
    | B Lesson   | B Lesson   | B Lesson   | B Lesson   | B Lesson   | B Lesson   | B Lesson   |
 
118
    +------------+------------+------------+------------+------------+------------+------------+
 
119
    Time schedule
 
120
    +-------------+-------------+-------------+-------------+-------------+----------+--------+
 
121
    | Monday      | Tuesday     | Wednesday   | Thursday    | Friday      | Saturday | Sunday |
 
122
    +-------------+-------------+-------------+-------------+-------------+----------+--------+
 
123
    | 09:00-10:00 | 09:00-10:00 | 09:00-10:00 | 09:00-10:00 | 09:00-10:00 |          |        |
 
124
    | 10:00-11:00 | 10:00-11:00 | 10:00-11:00 | 10:00-11:00 | 10:00-11:00 |          |        |
 
125
    | 11:00-12:00 | 11:00-12:00 | 11:00-12:00 | 11:00-12:00 | 11:00-12:00 |          |        |
 
126
    | 12:00-13:00 | 12:00-13:00 | 12:00-13:00 | 12:00-13:00 | 12:00-13:00 |          |        |
 
127
    +-------------+-------------+-------------+-------------+-------------+----------+--------+
 
128
 
 
129
Add a new school year copying the timetables:
 
130
 
 
131
    >>> manager.query.link('School').click()
 
132
    >>> manager.query.link('School Year').click()
 
133
    >>> manager.query.id('form-widgets-title').ui.set_value('2015')
 
134
    >>> manager.query.id('form-widgets-first').ui.set_value('2015-02-01')
 
135
    >>> manager.query.id('form-widgets-last').ui.set_value('2015-12-01')
 
136
    >>> manager.query.css('input[name="importAllTimetables"]').click()
 
137
    >>> manager.query.id('form-buttons-add').click()
 
138
 
 
139
Go to the new year's timetables:
 
140
 
 
141
    >>> manager.query.link('School').click()
 
142
    >>> manager.query.link('2015').click()
 
143
    >>> manager.query.link('Timetables').click()
 
144
    >>> print_timetables_table(manager)
 
145
    3 periods, 2015-02-01, 2015-12-01
 
146
    4 periods, 2015-02-01, 2015-12-01
 
147
 
 
148
    >>> manager.query.link('3 periods').click()
 
149
    >>> print_timetable(manager)
 
150
    3 periods
 
151
    ---------
 
152
    Periods
 
153
    +---------------+---------------+---------------+---------------+---------------+---------------+---------------+
 
154
    | Monday        | Tuesday       | Wednesday     | Thursday      | Friday        | Saturday      | Sunday        |
 
155
    +---------------+---------------+---------------+---------------+---------------+---------------+---------------+
 
156
    | First Lesson  | First Lesson  | First Lesson  | First Lesson  | First Lesson  | First Lesson  | First Lesson  |
 
157
    | Second Lesson | Second Lesson | Second Lesson | Second Lesson | Second Lesson | Second Lesson | Second Lesson |
 
158
    | Third Lesson  | Third Lesson  | Third Lesson  | Third Lesson  | Third Lesson  | Third Lesson  | Third Lesson  |
 
159
    +---------------+---------------+---------------+---------------+---------------+---------------+---------------+
 
160
    Time schedule
 
161
    +-------------+-------------+-------------+-------------+-------------+----------+--------+
 
162
    | Monday      | Tuesday     | Wednesday   | Thursday    | Friday      | Saturday | Sunday |
 
163
    +-------------+-------------+-------------+-------------+-------------+----------+--------+
 
164
    | 09:30-10:25 | 09:30-10:25 | 09:30-10:25 | 09:30-10:25 | 09:30-10:25 |          |        |
 
165
    | 10:30-11:25 | 10:30-11:25 | 10:30-11:25 | 10:30-11:25 | 10:30-11:25 |          |        |
 
166
    | 11:30-12:25 | 11:30-12:25 | 11:30-12:25 | 11:30-12:25 | 11:30-12:25 |          |        |
 
167
    +-------------+-------------+-------------+-------------+-------------+----------+--------+
 
168
    >>> manager.query.link('Done').click()
 
169
    >>> manager.query.link('4 periods').click()
 
170
    >>> print_timetable(manager)
 
171
    4 periods
 
172
    ---------
 
173
    Periods
 
174
    +------------+------------+------------+------------+------------+------------+------------+
 
175
    | Monday     | Tuesday    | Wednesday  | Thursday   | Friday     | Saturday   | Sunday     |
 
176
    +------------+------------+------------+------------+------------+------------+------------+
 
177
    | C Lesson   | C Lesson   | C Lesson   | C Lesson   | C Lesson   | C Lesson   | C Lesson   |
 
178
    | A Homeroom | A Homeroom | A Homeroom | A Homeroom | A Homeroom | A Homeroom | A Homeroom |
 
179
    | D Lesson   | D Lesson   | D Lesson   | D Lesson   | D Lesson   | D Lesson   | D Lesson   |
 
180
    | B Lesson   | B Lesson   | B Lesson   | B Lesson   | B Lesson   | B Lesson   | B Lesson   |
 
181
    +------------+------------+------------+------------+------------+------------+------------+
 
182
    Time schedule
 
183
    +-------------+-------------+-------------+-------------+-------------+----------+--------+
 
184
    | Monday      | Tuesday     | Wednesday   | Thursday    | Friday      | Saturday | Sunday |
 
185
    +-------------+-------------+-------------+-------------+-------------+----------+--------+
 
186
    | 09:00-10:00 | 09:00-10:00 | 09:00-10:00 | 09:00-10:00 | 09:00-10:00 |          |        |
 
187
    | 10:00-11:00 | 10:00-11:00 | 10:00-11:00 | 10:00-11:00 | 10:00-11:00 |          |        |
 
188
    | 11:00-12:00 | 11:00-12:00 | 11:00-12:00 | 11:00-12:00 | 11:00-12:00 |          |        |
 
189
    | 12:00-13:00 | 12:00-13:00 | 12:00-13:00 | 12:00-13:00 | 12:00-13:00 |          |        |
 
190
    +-------------+-------------+-------------+-------------+-------------+----------+--------+