~justas.sadzevicius/schooltool.lyceum.journal/scoresystems

« back to all changes in this revision

Viewing changes to src/schooltool/lyceum/journal/stests/sidebar_groups_order.txt

  • Committer: Douglas Cerna
  • Date: 2012-04-11 17:40:25 UTC
  • Revision ID: douglascerna@yahoo.com-20120411174025-0sli8tyq6ke8k040
Fixed the order of sidebar groups

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Test for the order of the sidebar groups in the journal
 
2
=======================================================
 
3
 
 
4
Log in as manager:
 
5
 
 
6
    >>> manager = browsers.manager
 
7
    >>> manager.ui.login('manager', 'schooltool')
 
8
 
 
9
Set today's date:
 
10
 
 
11
    >>> manager.open('http://localhost/time?value=2011-09-23')
 
12
 
 
13
Add a school year:
 
14
 
 
15
    >>> manager.ui.schoolyear.add('2011', '2011-01-01', '2011-12-31')
 
16
 
 
17
Add a term:
 
18
 
 
19
    >>> manager.query.link('School').click()
 
20
    >>> manager.query.link('Terms').click()
 
21
    >>> manager.query.link('Term').click()
 
22
    >>> manager.query.name('form.widgets.title').ui.set_value('2011')
 
23
    >>> manager.query.name('form.widgets.first').ui.set_value('2011-01-01')
 
24
    >>> manager.query.name('form.widgets.last').ui.set_value('2011-12-31')
 
25
    >>> manager.query.button('Next').click()
 
26
    >>> manager.query.button('Saturday').click()
 
27
    >>> manager.query.button('Sunday').click()
 
28
    >>> manager.query.button('Submit').click()
 
29
 
 
30
Add a timetable:
 
31
 
 
32
    >>> manager.query.link('School').click()
 
33
    >>> manager.query.link('Timetables').click()
 
34
    >>> manager.query.link('Timetable').click()
 
35
    >>> manager.query.button('Next').click()
 
36
    >>> manager.query.button('Days of the week').click()
 
37
    >>> manager.query.button('Same time each day').click()
 
38
    >>> manager.query.button('Next').click()
 
39
    >>> manager.query.button('Designated by time').click()
 
40
    >>> manager.query.button('No').click()
 
41
 
 
42
Add a course and a section:
 
43
 
 
44
    >>> manager.ui.course.add('2011', 'Math')
 
45
    >>> manager.ui.section.add('2011', '2011', 'Math')
 
46
 
 
47
Set a schedule for the section:
 
48
 
 
49
    >>> manager.ui.section.go('2011', '2011', 'Math (1)')
 
50
    >>> manager.query.link('Schedule').click()
 
51
    >>> sel = '//div[contains(@class, "sidebar")]//a[text()="Schedule"]'
 
52
    >>> manager.query.xpath(sel).click()
 
53
    >>> manager.query.button('Submit').click()
 
54
    >>> manager.query.xpath('//input[@name="period.0-.Period-"]').click()
 
55
    >>> manager.query.xpath('//input[@name="period.1-.Period-"]').click()
 
56
    >>> manager.query.xpath('//input[@name="period.2-.Period-"]').click()
 
57
    >>> manager.query.xpath('//input[@name="period.3-.Period-"]').click()
 
58
    >>> manager.query.xpath('//input[@name="period.4-.Period-"]').click()
 
59
    >>> manager.query.button('Save').click()
 
60
 
 
61
Set up people:
 
62
 
 
63
    >>> manager.ui.person.add('Tom', 'Hoffman', 'tom', 'pwd')
 
64
    >>> manager.ui.person.add('Camila', 'Cerna', 'camila', 'pwd')
 
65
 
 
66
Set Tom as instructor of the section and Camila as a student:
 
67
 
 
68
    >>> manager.ui.section.instructors.add('2011', '2011', 'Math (1)', ['tom'])
 
69
    >>> manager.ui.section.students.add('2011', '2011', 'Math (1)', ['camila'])
 
70
 
 
71
Log in as tom and go to the journal of the section:
 
72
 
 
73
    >>> tom = browsers.tom
 
74
    >>> tom.ui.login('tom', 'pwd')
 
75
    >>> sel = '//div[@class="event-body"]//a[text()="Journal"]'
 
76
    >>> tom.query.xpath(sel).click()
 
77
    >>> print tom.url
 
78
    http://localhost/schoolyears/2011/2011/sections/1/journal/index.html...
 
79
 
 
80
Print the journal sidebar groups:
 
81
 
 
82
    >>> for el in tom.query_all.css('.sidebar .content .header'):
 
83
    ...     print el.text
 
84
    Section
 
85
    Term
 
86
    Year
 
87
    Actions