sakai-cle-test-api 0.0.75 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (101) hide show
  1. data/lib/sakai-cle-test-api.rb +4 -5
  2. data/lib/sakai-cle-test-api/base_page.rb +20 -0
  3. data/lib/sakai-cle-test-api/core-ext.rb +90 -0
  4. data/lib/sakai-cle-test-api/data_objects/announcement.rb +81 -0
  5. data/lib/sakai-cle-test-api/data_objects/assessment.rb +32 -0
  6. data/lib/sakai-cle-test-api/data_objects/assignment.rb +90 -0
  7. data/lib/sakai-cle-test-api/data_objects/event.rb +89 -0
  8. data/lib/sakai-cle-test-api/data_objects/lesson.rb +185 -0
  9. data/lib/sakai-cle-test-api/data_objects/resource.rb +209 -0
  10. data/lib/sakai-cle-test-api/data_objects/site.rb +208 -0
  11. data/lib/sakai-cle-test-api/data_objects/syllabus.rb +39 -0
  12. data/lib/sakai-cle-test-api/data_objects/web_content_tool.rb +51 -0
  13. data/lib/sakai-cle-test-api/data_objects/wiki.rb +53 -0
  14. data/lib/sakai-cle-test-api/gem_ext.rb +23 -0
  15. data/lib/sakai-cle-test-api/page_helper.rb +22 -0
  16. data/lib/sakai-cle-test-api/page_maker.rb +48 -0
  17. data/lib/sakai-cle-test-api/page_objects/account.rb +111 -0
  18. data/lib/sakai-cle-test-api/page_objects/aliases.rb +43 -0
  19. data/lib/sakai-cle-test-api/page_objects/announcements.rb +190 -0
  20. data/lib/sakai-cle-test-api/page_objects/assessments.rb +874 -0
  21. data/lib/sakai-cle-test-api/page_objects/assignments.rb +771 -0
  22. data/lib/sakai-cle-test-api/page_objects/basic_lti.rb +6 -0
  23. data/lib/sakai-cle-test-api/page_objects/blogger.rb +205 -0
  24. data/lib/sakai-cle-test-api/page_objects/blogs.rb +60 -0
  25. data/lib/sakai-cle-test-api/page_objects/calendar.rb +431 -0
  26. data/lib/sakai-cle-test-api/page_objects/calendar_summary.rb +1 -0
  27. data/lib/sakai-cle-test-api/page_objects/chat_room.rb +12 -0
  28. data/lib/sakai-cle-test-api/page_objects/drop_box.rb +9 -0
  29. data/lib/sakai-cle-test-api/page_objects/email_archive.rb +22 -0
  30. data/lib/sakai-cle-test-api/page_objects/evaluations.rb +158 -0
  31. data/lib/sakai-cle-test-api/page_objects/feedback.rb +36 -0
  32. data/lib/sakai-cle-test-api/page_objects/forms.rb +120 -0
  33. data/lib/sakai-cle-test-api/page_objects/forums.rb +289 -0
  34. data/lib/sakai-cle-test-api/page_objects/glossary.rb +117 -0
  35. data/lib/sakai-cle-test-api/page_objects/gradebook.rb +29 -0
  36. data/lib/sakai-cle-test-api/page_objects/gradebook2.rb +17 -0
  37. data/lib/sakai-cle-test-api/page_objects/home.rb +36 -0
  38. data/lib/sakai-cle-test-api/page_objects/jforums.rb +444 -0
  39. data/lib/sakai-cle-test-api/page_objects/job_scheduler.rb +121 -0
  40. data/lib/sakai-cle-test-api/page_objects/lessons.rb +360 -0
  41. data/lib/sakai-cle-test-api/page_objects/login.rb +28 -0
  42. data/lib/sakai-cle-test-api/page_objects/matrix.rb +241 -0
  43. data/lib/sakai-cle-test-api/page_objects/media_gallery.rb +13 -0
  44. data/lib/sakai-cle-test-api/page_objects/messages.rb +622 -0
  45. data/lib/sakai-cle-test-api/page_objects/my_workspace.rb +44 -0
  46. data/lib/sakai-cle-test-api/page_objects/news.rb +8 -0
  47. data/lib/sakai-cle-test-api/page_objects/podcasts.rb +27 -0
  48. data/lib/sakai-cle-test-api/page_objects/polls.rb +69 -0
  49. data/lib/sakai-cle-test-api/page_objects/portfolio_templates.rb +161 -0
  50. data/lib/sakai-cle-test-api/page_objects/portfolios.rb +162 -0
  51. data/lib/sakai-cle-test-api/page_objects/post_em.rb +1 -0
  52. data/lib/sakai-cle-test-api/page_objects/profile.rb +51 -0
  53. data/lib/sakai-cle-test-api/page_objects/profile2.rb +344 -0
  54. data/lib/sakai-cle-test-api/page_objects/public_search.rb +61 -0
  55. data/lib/sakai-cle-test-api/page_objects/realms.rb +19 -0
  56. data/lib/sakai-cle-test-api/page_objects/resources.rb +326 -0
  57. data/lib/sakai-cle-test-api/{resources_roster.rb → page_objects/resources_roster.rb} +0 -0
  58. data/lib/sakai-cle-test-api/page_objects/rosters.rb +70 -0
  59. data/lib/sakai-cle-test-api/page_objects/rwiki.rb +34 -0
  60. data/lib/sakai-cle-test-api/page_objects/search.rb +34 -0
  61. data/lib/sakai-cle-test-api/page_objects/sections.rb +295 -0
  62. data/lib/sakai-cle-test-api/page_objects/single_user.rb +1 -0
  63. data/lib/sakai-cle-test-api/page_objects/site_setup.rb +686 -0
  64. data/lib/sakai-cle-test-api/page_objects/site_statistics.rb +1 -0
  65. data/lib/sakai-cle-test-api/page_objects/sites.rb +255 -0
  66. data/lib/sakai-cle-test-api/page_objects/styles.rb +74 -0
  67. data/lib/sakai-cle-test-api/page_objects/syllabus.rb +166 -0
  68. data/lib/sakai-cle-test-api/page_objects/user_membership.rb +57 -0
  69. data/lib/sakai-cle-test-api/page_objects/users.rb +88 -0
  70. data/lib/sakai-cle-test-api/rich_text.rb +27 -0
  71. data/lib/sakai-cle-test-api/utilities.rb +260 -0
  72. data/lib/sakai-cle-test-api/workflows.rb +224 -0
  73. data/sakai-cle-test-api.gemspec +3 -5
  74. metadata +74 -64
  75. data/lib/sakai-cle-test-api/admin_page_elements.rb +0 -1030
  76. data/lib/sakai-cle-test-api/announcements.rb +0 -59
  77. data/lib/sakai-cle-test-api/assessments.rb +0 -194
  78. data/lib/sakai-cle-test-api/assignments.rb +0 -113
  79. data/lib/sakai-cle-test-api/basic_lti.rb +0 -5
  80. data/lib/sakai-cle-test-api/blogs.rb +0 -5
  81. data/lib/sakai-cle-test-api/calendar.rb +0 -65
  82. data/lib/sakai-cle-test-api/calendar_summary.rb +0 -0
  83. data/lib/sakai-cle-test-api/common_page_elements.rb +0 -1228
  84. data/lib/sakai-cle-test-api/drop_box.rb +0 -0
  85. data/lib/sakai-cle-test-api/email_archive.rb +0 -10
  86. data/lib/sakai-cle-test-api/forums.rb +0 -39
  87. data/lib/sakai-cle-test-api/gradebook.rb +0 -10
  88. data/lib/sakai-cle-test-api/gradebook2.rb +0 -6
  89. data/lib/sakai-cle-test-api/messages.rb +0 -119
  90. data/lib/sakai-cle-test-api/news.rb +0 -9
  91. data/lib/sakai-cle-test-api/polls.rb +0 -24
  92. data/lib/sakai-cle-test-api/post_em.rb +0 -0
  93. data/lib/sakai-cle-test-api/profile.rb +0 -17
  94. data/lib/sakai-cle-test-api/profile2.rb +0 -43
  95. data/lib/sakai-cle-test-api/rwiki.rb +0 -0
  96. data/lib/sakai-cle-test-api/sections.rb +0 -47
  97. data/lib/sakai-cle-test-api/single_user.rb +0 -0
  98. data/lib/sakai-cle-test-api/site_page_elements.rb +0 -2350
  99. data/lib/sakai-cle-test-api/site_statistics.rb +0 -0
  100. data/lib/sakai-cle-test-api/syllabus.rb +0 -77
  101. data/lib/sakai-cle-test-api/tools_menu.rb +0 -415
@@ -1,16 +1,14 @@
1
1
  spec = Gem::Specification.new do |s|
2
2
  s.name = 'sakai-cle-test-api'
3
- s.version = '0.0.75'
3
+ s.version = '0.1.0'
4
4
  s.summary = %q{Sakai-CLE functional testing API for the rSmart Collaborative Learning Environment}
5
- s.description = %q{The Sakai-OAE gem provides an API for interacting with pages and page elements in rSmart's deployment of the Sakai Collaborative Learning Environment.}
5
+ s.description = %q{The Sakai-CLE gem provides an API for interacting with pages and page elements in rSmart's deployment of the Sakai Collaborative Learning Environment.}
6
6
  s.files = Dir.glob("**/**/**")
7
7
  s.test_files = Dir.glob("test/*test_rb")
8
8
  s.authors = ["Abraham Heward"]
9
9
  s.email = %w{"aheward@rsmart.com"}
10
- s.homepage = 'https://github.com/aheward/Kuali-Sakai-Functional-Test-Automation-Framework/tree/master/Sakai/CLE/API'
11
- s.add_dependency 'page-object', '>= 0.6.6'
10
+ s.homepage = 'https://github.com/aheward/sambal/tree/master/Sakai/CLE/API'
12
11
  s.add_dependency 'watir-webdriver', '>= 0.5.5'
13
12
  s.add_dependency 'selenium-webdriver', '>= 2.21.2'
14
- s.add_dependency 'kuali-sakai-common-lib', '= 0.0.7'
15
13
  s.required_ruby_version = '>= 1.9.2'
16
14
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sakai-cle-test-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.75
4
+ version: 0.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,24 +9,8 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-07-20 00:00:00.000000000 Z
12
+ date: 2012-09-21 00:00:00.000000000 Z
13
13
  dependencies:
14
- - !ruby/object:Gem::Dependency
15
- name: page-object
16
- requirement: !ruby/object:Gem::Requirement
17
- none: false
18
- requirements:
19
- - - ! '>='
20
- - !ruby/object:Gem::Version
21
- version: 0.6.6
22
- type: :runtime
23
- prerelease: false
24
- version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
- requirements:
27
- - - ! '>='
28
- - !ruby/object:Gem::Version
29
- version: 0.6.6
30
14
  - !ruby/object:Gem::Dependency
31
15
  name: watir-webdriver
32
16
  requirement: !ruby/object:Gem::Requirement
@@ -59,23 +43,7 @@ dependencies:
59
43
  - - ! '>='
60
44
  - !ruby/object:Gem::Version
61
45
  version: 2.21.2
62
- - !ruby/object:Gem::Dependency
63
- name: kuali-sakai-common-lib
64
- requirement: !ruby/object:Gem::Requirement
65
- none: false
66
- requirements:
67
- - - '='
68
- - !ruby/object:Gem::Version
69
- version: 0.0.7
70
- type: :runtime
71
- prerelease: false
72
- version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
- requirements:
75
- - - '='
76
- - !ruby/object:Gem::Version
77
- version: 0.0.7
78
- description: The Sakai-OAE gem provides an API for interacting with pages and page
46
+ description: The Sakai-CLE gem provides an API for interacting with pages and page
79
47
  elements in rSmart's deployment of the Sakai Collaborative Learning Environment.
80
48
  email:
81
49
  - ! '"aheward@rsmart.com"'
@@ -84,39 +52,81 @@ extensions: []
84
52
  extra_rdoc_files: []
85
53
  files:
86
54
  - Gemfile
87
- - lib/sakai-cle-test-api/admin_page_elements.rb
88
- - lib/sakai-cle-test-api/announcements.rb
89
- - lib/sakai-cle-test-api/assessments.rb
90
- - lib/sakai-cle-test-api/assignments.rb
91
- - lib/sakai-cle-test-api/basic_lti.rb
92
- - lib/sakai-cle-test-api/blogs.rb
93
- - lib/sakai-cle-test-api/calendar.rb
94
- - lib/sakai-cle-test-api/calendar_summary.rb
95
- - lib/sakai-cle-test-api/common_page_elements.rb
96
- - lib/sakai-cle-test-api/drop_box.rb
97
- - lib/sakai-cle-test-api/email_archive.rb
98
- - lib/sakai-cle-test-api/forums.rb
99
- - lib/sakai-cle-test-api/gradebook.rb
100
- - lib/sakai-cle-test-api/gradebook2.rb
101
- - lib/sakai-cle-test-api/messages.rb
102
- - lib/sakai-cle-test-api/news.rb
103
- - lib/sakai-cle-test-api/polls.rb
104
- - lib/sakai-cle-test-api/post_em.rb
105
- - lib/sakai-cle-test-api/profile.rb
106
- - lib/sakai-cle-test-api/profile2.rb
107
- - lib/sakai-cle-test-api/resources_roster.rb
108
- - lib/sakai-cle-test-api/rwiki.rb
109
- - lib/sakai-cle-test-api/sections.rb
110
- - lib/sakai-cle-test-api/single_user.rb
111
- - lib/sakai-cle-test-api/site_page_elements.rb
112
- - lib/sakai-cle-test-api/site_statistics.rb
113
- - lib/sakai-cle-test-api/syllabus.rb
114
- - lib/sakai-cle-test-api/tools_menu.rb
55
+ - lib/sakai-cle-test-api/base_page.rb
56
+ - lib/sakai-cle-test-api/core-ext.rb
57
+ - lib/sakai-cle-test-api/data_objects/announcement.rb
58
+ - lib/sakai-cle-test-api/data_objects/assessment.rb
59
+ - lib/sakai-cle-test-api/data_objects/assignment.rb
60
+ - lib/sakai-cle-test-api/data_objects/event.rb
61
+ - lib/sakai-cle-test-api/data_objects/lesson.rb
62
+ - lib/sakai-cle-test-api/data_objects/resource.rb
63
+ - lib/sakai-cle-test-api/data_objects/site.rb
64
+ - lib/sakai-cle-test-api/data_objects/syllabus.rb
65
+ - lib/sakai-cle-test-api/data_objects/web_content_tool.rb
66
+ - lib/sakai-cle-test-api/data_objects/wiki.rb
67
+ - lib/sakai-cle-test-api/gem_ext.rb
68
+ - lib/sakai-cle-test-api/page_helper.rb
69
+ - lib/sakai-cle-test-api/page_maker.rb
70
+ - lib/sakai-cle-test-api/page_objects/account.rb
71
+ - lib/sakai-cle-test-api/page_objects/aliases.rb
72
+ - lib/sakai-cle-test-api/page_objects/announcements.rb
73
+ - lib/sakai-cle-test-api/page_objects/assessments.rb
74
+ - lib/sakai-cle-test-api/page_objects/assignments.rb
75
+ - lib/sakai-cle-test-api/page_objects/basic_lti.rb
76
+ - lib/sakai-cle-test-api/page_objects/blogger.rb
77
+ - lib/sakai-cle-test-api/page_objects/blogs.rb
78
+ - lib/sakai-cle-test-api/page_objects/calendar.rb
79
+ - lib/sakai-cle-test-api/page_objects/calendar_summary.rb
80
+ - lib/sakai-cle-test-api/page_objects/chat_room.rb
81
+ - lib/sakai-cle-test-api/page_objects/drop_box.rb
82
+ - lib/sakai-cle-test-api/page_objects/email_archive.rb
83
+ - lib/sakai-cle-test-api/page_objects/evaluations.rb
84
+ - lib/sakai-cle-test-api/page_objects/feedback.rb
85
+ - lib/sakai-cle-test-api/page_objects/forms.rb
86
+ - lib/sakai-cle-test-api/page_objects/forums.rb
87
+ - lib/sakai-cle-test-api/page_objects/glossary.rb
88
+ - lib/sakai-cle-test-api/page_objects/gradebook.rb
89
+ - lib/sakai-cle-test-api/page_objects/gradebook2.rb
90
+ - lib/sakai-cle-test-api/page_objects/home.rb
91
+ - lib/sakai-cle-test-api/page_objects/jforums.rb
92
+ - lib/sakai-cle-test-api/page_objects/job_scheduler.rb
93
+ - lib/sakai-cle-test-api/page_objects/lessons.rb
94
+ - lib/sakai-cle-test-api/page_objects/login.rb
95
+ - lib/sakai-cle-test-api/page_objects/matrix.rb
96
+ - lib/sakai-cle-test-api/page_objects/media_gallery.rb
97
+ - lib/sakai-cle-test-api/page_objects/messages.rb
98
+ - lib/sakai-cle-test-api/page_objects/my_workspace.rb
99
+ - lib/sakai-cle-test-api/page_objects/news.rb
100
+ - lib/sakai-cle-test-api/page_objects/podcasts.rb
101
+ - lib/sakai-cle-test-api/page_objects/polls.rb
102
+ - lib/sakai-cle-test-api/page_objects/portfolio_templates.rb
103
+ - lib/sakai-cle-test-api/page_objects/portfolios.rb
104
+ - lib/sakai-cle-test-api/page_objects/post_em.rb
105
+ - lib/sakai-cle-test-api/page_objects/profile.rb
106
+ - lib/sakai-cle-test-api/page_objects/profile2.rb
107
+ - lib/sakai-cle-test-api/page_objects/public_search.rb
108
+ - lib/sakai-cle-test-api/page_objects/realms.rb
109
+ - lib/sakai-cle-test-api/page_objects/resources.rb
110
+ - lib/sakai-cle-test-api/page_objects/resources_roster.rb
111
+ - lib/sakai-cle-test-api/page_objects/rosters.rb
112
+ - lib/sakai-cle-test-api/page_objects/rwiki.rb
113
+ - lib/sakai-cle-test-api/page_objects/search.rb
114
+ - lib/sakai-cle-test-api/page_objects/sections.rb
115
+ - lib/sakai-cle-test-api/page_objects/single_user.rb
116
+ - lib/sakai-cle-test-api/page_objects/site_setup.rb
117
+ - lib/sakai-cle-test-api/page_objects/site_statistics.rb
118
+ - lib/sakai-cle-test-api/page_objects/sites.rb
119
+ - lib/sakai-cle-test-api/page_objects/styles.rb
120
+ - lib/sakai-cle-test-api/page_objects/syllabus.rb
121
+ - lib/sakai-cle-test-api/page_objects/user_membership.rb
122
+ - lib/sakai-cle-test-api/page_objects/users.rb
123
+ - lib/sakai-cle-test-api/rich_text.rb
115
124
  - lib/sakai-cle-test-api/utilities.rb
125
+ - lib/sakai-cle-test-api/workflows.rb
116
126
  - lib/sakai-cle-test-api.rb
117
127
  - README.md
118
128
  - sakai-cle-test-api.gemspec
119
- homepage: https://github.com/aheward/Kuali-Sakai-Functional-Test-Automation-Framework/tree/master/Sakai/CLE/API
129
+ homepage: https://github.com/aheward/sambal/tree/master/Sakai/CLE/API
120
130
  licenses: []
121
131
  post_install_message:
122
132
  rdoc_options: []
@@ -1,1030 +0,0 @@
1
- # Navigation links in Sakai's non-site pages
2
- #
3
- # == Synopsis
4
- #
5
- # Defines all objects in Sakai Pages that are found in the
6
- # context of the Admin user, in "My Workspace". No classes in this
7
- # script should refer to pages that appear in the context of
8
- # a particular Site, even though, as in the case of Resources,
9
- # Announcements, and Help, the page may exist in both contexts.
10
- #
11
- # Most classes use the PageObject gem
12
- # to create methods to interact with the objects on the pages.
13
- #
14
- # Author :: Abe Heward (aheward@rsmart.com)
15
-
16
- # Page-object is the gem that parses each of the listed objects.
17
- # For an introduction to the tool, written by the author, visit:
18
- # http://www.cheezyworld.com/2011/07/29/introducing-page-object-gem/
19
- #
20
- # For more extensive detail, visit:
21
- # https://github.com/cheezy/page-object/wiki/page-object
22
- #
23
- # Also, see the bottom of this script for a Page Class template for
24
- # copying when you create a new class.
25
-
26
- #require 'page-object'
27
- #require File.dirname(__FILE__) + '/app_functions.rb'
28
-
29
- #================
30
- # Aliases Pages
31
- #================
32
-
33
- # The Aliases page - "icon-sakai-aliases", found in the Administration Workspace
34
- class Aliases
35
-
36
- include PageObject
37
- include ToolsMenu
38
-
39
- in_frame(:index=>0) do |frame|
40
- link(:new_alias, :text=>"New Alias", :frame=>frame)
41
- text_field(:search_field, :id=>"search", :frame=>frame)
42
- link(:search_button, :text=>"Search", :frame=>frame)
43
- select_list(:select_page_size, :id=>"selectPageSize", :frame=>frame)
44
- button(:next, :name=>"eventSubmit_doList_next", :frame=>frame)
45
- button(:last, :name=>"eventSubmit_doList_last", :frame=>frame)
46
- button(:previous, :name=>"eventSubmit_doList_prev", :frame=>frame)
47
- button(:first, :name=>"eventSubmit_doList_first", :frame=>frame)
48
- end
49
-
50
- end
51
-
52
- # The Page that appears when you create a New Alias
53
- class AliasesCreate
54
-
55
- include PageObject
56
- include ToolsMenu
57
-
58
- in_frame(:class=>"portletMainIframe") do |frame|
59
- text_field(:alias_name, :id=>"id", :frame=>frame)
60
- text_field(:target, :id=>"target", :frame=>frame)
61
- button(:save, :name=>"eventSubmit_doSave", :frame=>frame)
62
- button(:cancel, :name=>"eventSubmit_doCancel", :frame=>frame)
63
-
64
- end
65
-
66
- end
67
-
68
- # Page for editing an existing Alias record
69
- class EditAlias
70
-
71
- include PageObject
72
- include ToolsMenu
73
-
74
- in_frame(:class=>"portletMainIframe") do |frame|
75
- link(:remove_alias, :text=>"Remove Alias", :frame=>frame)
76
- text_field(:target, :id=>"target", :frame=>frame)
77
- button(:save, :name=>"eventSubmit_doSave", :frame=>frame)
78
- button(:cancel, :name=>"eventSubmit_doCancel", :frame=>frame)
79
-
80
- end
81
-
82
- end
83
-
84
-
85
- #================
86
- # Login Pages
87
- #================
88
-
89
- # This is the page where users log in to the site.
90
- class Login
91
-
92
- include ToolsMenu
93
-
94
- def search_public_courses_and_projects
95
- @browser.frame(:index=>0).link(:text=>"Search Public Courses and Projects").click
96
- SearchPublic.new(@browser)
97
- end
98
-
99
- # Logs in to Sakai using the
100
- # specified credentials. Then it
101
- # instantiates the MyWorkspace class.
102
- def login(username, password)
103
- frame = @browser.frame(:id, "ifrm")
104
- frame.text_field(:id, "eid").set username
105
- frame.text_field(:id, "pw").set password
106
- frame.form(:method, "post").submit
107
- return MyWorkspace.new(@browser)
108
- end
109
- alias log_in login
110
- alias sign_in login
111
-
112
- end
113
-
114
- # The page where you search for public courses and projects.
115
- class SearchPublic
116
-
117
- include ToolsMenu
118
-
119
- def home
120
- @browser.frame(:index=>0).link(:text=>"Home").click
121
- Login.new(@browser)
122
- end
123
-
124
- def search_for=(string)
125
- @browser.frame(:index=>0).text_field(:id=>"searchbox").set(Regexp.escape(string))
126
- end
127
-
128
- def search_for_sites
129
- @browser.frame(:index=>0).button(:value=>"Search for Sites").click
130
- SearchPublicResults.new(@browser)
131
- end
132
-
133
- end
134
-
135
- # The page showing the results list of Site matches to a search of public sites/projects.
136
- class SearchPublicResults
137
-
138
- include ToolsMenu
139
-
140
- def click_site(site_name)
141
- @browser.frame(:index=>0).link(:text=>site_name).click
142
- SiteSummaryPage.new(@browser)
143
- end
144
-
145
- def home
146
- @browser.frame(:id=>"ifrm").link(:text=>"Home").click
147
- Login.new(@browser)
148
- end
149
-
150
- end
151
-
152
- # The page that appears when you click a Site in the Site Search Results page, when not logged
153
- # in to Sakai.
154
- class SiteSummaryPage
155
-
156
- include ToolsMenu
157
-
158
- def return_to_list
159
- @browser.frame(:index=>0).button(:value=>"Return to List").click
160
- SearchPublicResults.new(@browser)
161
- end
162
-
163
- def syllabus_attachments
164
- links = []
165
- @browser.frame(:id=>"ifrm").links.each do |link|
166
- if link.href=~/Syllabus/
167
- links << link.text
168
- end
169
- end
170
- return links
171
- end
172
-
173
- end
174
-
175
-
176
-
177
-
178
-
179
-
180
-
181
-
182
- #================
183
- # Realms Pages
184
- #================
185
-
186
- # Realms page
187
- class Realms
188
-
189
- include PageObject
190
- include ToolsMenu
191
-
192
- in_frame(:class=>"portletMainIframe") do |frame|
193
- link(:new_realm, :text=>"New Realm", :frame=>frame)
194
- link(:search, :text=>"Search", :frame=>frame)
195
- select_list(:select_page_size, :name=>"selectPageSize", :frame=>frame)
196
- button(:next, :name=>"eventSubmit_doList_next", :frame=>frame)
197
- button(:last, :name=>"eventSubmit_doList_last", :frame=>frame)
198
- button(:previous, :name=>"eventSubmit_doList_prev", :frame=>frame)
199
- button(:first, :name=>"eventSubmit_doList_first", :frame=>frame)
200
-
201
- end
202
-
203
- end
204
-
205
- #================
206
- # Sections - Site Management
207
- #================
208
-
209
- # The Add Sections Page in Site Management
210
- class AddSections
211
-
212
- include PageObject
213
- include ToolsMenu
214
-
215
- in_frame(:class=>"portletMainIframe") do |frame|
216
- link(:overview, :id=>"addSectionsForm:_idJsp3", :frame=>frame)
217
- link(:student_memberships, :id=>"addSectionsForm:_idJsp12", :frame=>frame)
218
- link(:options, :id=>"addSectionsForm:_idJsp17", :frame=>frame)
219
- select_list(:num_to_add, :id=>"addSectionsForm:numToAdd", :frame=>frame)
220
- select_list(:category, :id=>"addSectionsForm:category", :frame=>frame)
221
- button(:add_sections, :id=>"addSectionsForm:_idJsp89", :frame=>frame)
222
- button(:cancel, :id=>"addSectionsForm:_idJsp90", :frame=>frame)
223
-
224
- # Note that the following field definitions are appropriate for
225
- # ONLY THE FIRST instance of each of the fields. The Add Sections page
226
- # allows for an arbitrary number of these fields to exist.
227
- # If you are going to test the addition of multiple sections
228
- # and/or meetings, then their elements will have to be
229
- # explicitly called or defined in the test scripts themselves.
230
- text_field(:name, :id=>"addSectionsForm:sectionTable:0:titleInput", :frame=>frame)
231
- radio_button(:unlimited_size, :name=>"addSectionsForm:sectionTable:0:limit", :index=>0, :frame=>frame)
232
- radio_button(:limited_size, :name=>"addSectionsForm:sectionTable:0:limit", :index=>1, :frame=>frame)
233
- text_field(:max_enrollment, :id=>"addSectionsForm:sectionTable:0:maxEnrollmentInput", :frame=>frame)
234
- checkbox(:monday, :id=>"addSectionsForm:sectionTable:0:meetingsTable:0:monday", :frame=>frame)
235
- checkbox(:tuesday, :id=>"addSectionsForm:sectionTable:0:meetingsTable:0:tuesday", :frame=>frame)
236
- checkbox(:wednesday, :id=>"addSectionsForm:sectionTable:0:meetingsTable:0:wednesday", :frame=>frame)
237
- checkbox(:thursday, :id=>"addSectionsForm:sectionTable:0:meetingsTable:0:thursday", :frame=>frame)
238
- checkbox(:friday, :id=>"addSectionsForm:sectionTable:0:meetingsTable:0:friday", :frame=>frame)
239
- checkbox(:saturday, :id=>"addSectionsForm:sectionTable:0:meetingsTable:0:saturday", :frame=>frame)
240
- checkbox(:sunday, :id=>"addSectionsForm:sectionTable:0:meetingsTable:0:sunday", :frame=>frame)
241
- text_field(:start_time, :id=>"addSectionsForm:sectionTable:0:meetingsTable:0:startTime", :frame=>frame)
242
- radio_button(:start_am, :name=>"addSectionsForm:sectionTable:0:meetingsTable:0:startTimeAm", :index=>0, :frame=>frame)
243
- radio_button(:start_pm, :name=>"addSectionsForm:sectionTable:0:meetingsTable:0:startTimeAm", :index=>1, :frame=>frame)
244
- text_field(:end_time, :id=>"addSectionsForm:sectionTable:0:meetingsTable:0:endTime", :frame=>frame)
245
- radio_button(:end_am, :name=>"addSectionsForm:sectionTable:0:meetingsTable:0:endTimeAm", :index=>0, :frame=>frame)
246
- radio_button(:end_pm, :name=>"addSectionsForm:sectionTable:0:meetingsTable:0:endTimeAm", :index=>1, :frame=>frame)
247
- text_field(:location, :id=>"addSectionsForm:sectionTable:0:meetingsTable:0:location", :frame=>frame)
248
- link(:add_days, :id=>"addSectionsForm:sectionTable:0:addMeeting", :frame=>frame)
249
-
250
- end
251
-
252
- end
253
-
254
-
255
- # Exactly like the Add Sections page, but used when editing an existing section
256
- class EditSections
257
-
258
- include PageObject
259
- include ToolsMenu
260
-
261
- in_frame(:class=>"portletMainIframe") do |frame|
262
- link(:overview, :id=>"editSectionsForm:_idJsp3", :frame=>frame)
263
- link(:student_memberships, :id=>"editSectionsForm:_idJsp12", :frame=>frame)
264
- link(:options, :id=>"editSectionsForm:_idJsp17", :frame=>frame)
265
- select_list(:num_to_add, :id=>"editSectionsForm:numToAdd", :frame=>frame)
266
- select_list(:category, :id=>"editSectionsForm:category", :frame=>frame)
267
- button(:add_sections, :id=>"editSectionsForm:_idJsp89", :frame=>frame)
268
- button(:cancel, :id=>"editSectionsForm:_idJsp90", :frame=>frame)
269
-
270
- # Note that the following field definitions are appropriate for
271
- # ONLY THE FIRST instance of each of the fields. The Edit Sections page
272
- # allows for an arbitrary number of these fields to exist.
273
- # If you are going to test the editing of multiple sections
274
- # and/or meetings, then their elements will have to be
275
- # explicitly called or defined in the test scripts themselves.
276
- text_field(:name, :id=>"editSectionsForm:sectionTable:0:titleInput", :frame=>frame)
277
- radio_button(:unlimited_size, :name=>"editSectionsForm:sectionTable:0:limit", :index=>0, :frame=>frame)
278
- radio_button(:limited_size, :name=>"editSectionsForm:sectionTable:0:limit", :index=>1, :frame=>frame)
279
- text_field(:max_enrollment, :id=>"editSectionsForm:sectionTable:0:maxEnrollmentInput", :frame=>frame)
280
- checkbox(:monday, :id=>"editSectionsForm:sectionTable:0:meetingsTable:0:monday", :frame=>frame)
281
- checkbox(:tuesday, :id=>"editSectionsForm:sectionTable:0:meetingsTable:0:tuesday", :frame=>frame)
282
- checkbox(:wednesday, :id=>"editSectionsForm:sectionTable:0:meetingsTable:0:wednesday", :frame=>frame)
283
- checkbox(:thursday, :id=>"editSectionsForm:sectionTable:0:meetingsTable:0:thursday", :frame=>frame)
284
- checkbox(:friday, :id=>"editSectionsForm:sectionTable:0:meetingsTable:0:friday", :frame=>frame)
285
- checkbox(:saturday, :id=>"editSectionsForm:sectionTable:0:meetingsTable:0:saturday", :frame=>frame)
286
- checkbox(:sunday, :id=>"editSectionsForm:sectionTable:0:meetingsTable:0:sunday", :frame=>frame)
287
- text_field(:start_time, :id=>"editSectionsForm:sectionTable:0:meetingsTable:0:startTime", :frame=>frame)
288
- radio_button(:start_am, :name=>"editSectionsForm:sectionTable:0:meetingsTable:0:startTimeAm", :index=>0, :frame=>frame)
289
- radio_button(:start_pm, :name=>"editSectionsForm:sectionTable:0:meetingsTable:0:startTimeAm", :index=>1, :frame=>frame)
290
- text_field(:end_time, :id=>"editSectionsForm:sectionTable:0:meetingsTable:0:endTime", :frame=>frame)
291
- radio_button(:end_am, :name=>"editSectionsForm:sectionTable:0:meetingsTable:0:endTimeAm", :index=>0, :frame=>frame)
292
- radio_button(:end_pm, :name=>"editSectionsForm:sectionTable:0:meetingsTable:0:endTimeAm", :index=>1, :frame=>frame)
293
- text_field(:location, :id=>"editSectionsForm:sectionTable:0:meetingsTable:0:location", :frame=>frame)
294
- link(:add_days, :id=>"editSectionsForm:sectionTable:0:addMeeting", :frame=>frame)
295
-
296
- end
297
-
298
- end
299
-
300
- # Options page for Sections
301
- class SectionsOptions
302
-
303
- include PageObject
304
- include ToolsMenu
305
-
306
- in_frame(:class=>"portletMainIframe") do |frame|
307
- checkbox(:students_can_sign_up, :id=>"optionsForm:selfRegister", :frame=>frame)
308
- checkbox(:students_can_switch_sections, :id=>"optionsForm:selfSwitch", :frame=>frame)
309
- button(:update, :id=>"optionsForm:_idJsp50", :frame=>frame)
310
- button(:cancel, :id=>"optionsForm:_idJsp51", :frame=>frame)
311
- link(:overview, :id=>"optionsForm:_idJsp3", :frame=>frame)
312
- link(:add_sections, :id=>"optionsForm:_idJsp8", :frame=>frame)
313
- link(:student_memberships, :id=>"optionsForm:_idJsp12", :frame=>frame)
314
-
315
- end
316
-
317
- end
318
-
319
- # The Sections page
320
- # found in the SITE MANAGEMENT menu for a Site
321
- class SectionsOverview
322
-
323
- include PageObject
324
- include ToolsMenu
325
-
326
- in_frame(:class=>"portletMainIframe") do |frame|
327
- link(:add_sections, :id=>"overviewForm:_idJsp8", :frame=>frame)
328
- link(:student_memberships, :id=>"overviewForm:_idJsp12", :frame=>frame)
329
- link(:options, :id=>"overviewForm:_idJsp17", :frame=>frame)
330
- link(:sort_name, :id=>"overviewForm:sectionsTable:_idJsp54", :frame=>frame)
331
- link(:sort_ta, :id=>"overviewForm:sectionsTable:_idJsp73", :frame=>frame)
332
- link(:sort_day, :id=>"overviewForm:sectionsTable:_idJsp78", :frame=>frame)
333
- link(:sort_time, :id=>"overviewForm:sectionsTable:_idJsp83", :frame=>frame)
334
- link(:sort_location, :id=>"overviewForm:sectionsTable:_idJsp88", :frame=>frame)
335
- link(:sort_current_size, :id=>"overviewForm:sectionsTable:_idJsp93", :frame=>frame)
336
- link(:sort_avail, :id=>"overviewForm:sectionsTable:_idJsp97", :frame=>frame)
337
-
338
- end
339
-
340
- end
341
-
342
- #================
343
- # Sites Page - from Administration Workspace
344
- #================
345
-
346
- # Sites page - arrived at via the link with class="icon-sakai-sites"
347
- class Sites
348
-
349
- include PageObject
350
- include ToolsMenu
351
-
352
- # Clicks the first site Id link
353
- # listed. Useful when you've run a search and
354
- # you're certain you've got the result you want.
355
- # It then instantiates the EditSiteInfo page class.
356
- def click_top_item
357
- frm.link(:href, /#{Regexp.escape("&panel=Main&sakai_action=doEdit")}/).click
358
- EditSiteInfo.new(@browser)
359
- end
360
-
361
- # Clicks the specified Site in the list, using the
362
- # specified id value to determine which item to click.
363
- # It then instantiates the EditSiteInfo page class.
364
- # Use this method when you know the target site ID.
365
- def edit_site_id(id)
366
- frm.text_field(:id=>"search_site").value=id
367
- frm.link(:text=>"Site ID").click
368
- frm.link(:text, id).click
369
- EditSiteInfo.new(@browser)
370
- end
371
-
372
- # Clicks the New Site button, then instantiates
373
- # the EditSiteInfo page class.
374
- def new_site
375
- frm.link(:text, "New Site").click
376
- EditSiteInfo.new(@browser)
377
- end
378
-
379
- in_frame(:index=>0) do |frame|
380
- text_field(:search_field, :id=>"search", :frame=>frame)
381
- link(:search_button, :text=>"Search", :frame=>frame)
382
- text_field(:search_site_id, :id=>"search_site", :frame=>frame)
383
- link(:search_site_id_button, :text=>"Site ID", :frame=>frame)
384
- text_field(:search_user_id, :id=>"search_user", :frame=>frame)
385
- link(:search_user_id_button, :text=>"User ID", :frame=>frame)
386
- button(:next, :name=>"eventSubmit_doList_next", :frame=>frame)
387
- button(:last, :name=>"eventSubmit_doList_last", :frame=>frame)
388
- button(:previous, :name=>"eventSubmit_doList_prev", :frame=>frame)
389
- button(:first, :name=>"eventSubmit_doList_first", :frame=>frame)
390
- select_list(:select_page_size, :name=>"selectPageSize", :frame=>frame)
391
- button(:next, :name=>"eventSubmit_doList_next", :frame=>frame)
392
- button(:last, :name=>"eventSubmit_doList_last", :frame=>frame)
393
- button(:previous, :name=>"eventSubmit_doList_prev", :frame=>frame)
394
- button(:first, :name=>"eventSubmit_doList_first", :frame=>frame)
395
- end
396
-
397
- end
398
-
399
- # Page that appears when you've clicked a Site ID in the
400
- # Sites section of the Administration Workspace.
401
- class EditSiteInfo
402
-
403
- include PageObject
404
- include ToolsMenu
405
-
406
- # Clicks the Remove Site button, then instantiates
407
- # the RemoveSite page class.
408
- def remove_site
409
- frm.link(:text, "Remove Site").click
410
- RemoveSite.new(@browser)
411
- end
412
-
413
- # Clicks the Save button, then instantiates the Sites
414
- # page class.
415
- def save
416
- frm.button(:value=>"Save").click
417
- Sites.new(@browser)
418
- end
419
-
420
- # Clicks the Save As link, then instantiates
421
- # the SiteSaveAs page class.
422
- def save_as
423
- frm.link(:text, "Save As").click
424
- SiteSaveAs.new(@browser)
425
- end
426
-
427
- # Gets the Site ID from the page.
428
- def site_id_read_only
429
- @browser.frame(:index=>0).table(:class=>"itemSummary").td(:class=>"shorttext", :index=>0).text
430
- end
431
-
432
- # Enters the specified text string in the text area of
433
- # the FCKEditor.
434
- def description=(text)
435
- editor.td(:id, "xEditingArea").frame(:index=>0).send_keys(text)
436
- end
437
-
438
- # The FCKEditor object. Use this object for
439
- # wait commands when the site is slow
440
- def editor
441
- @browser.frame(:index=>0).frame(:id, "description___Frame")
442
- end
443
-
444
- # Clicks the Properties button on the page,
445
- # then instantiates the AddEditSiteProperties
446
- # page class.
447
- def properties
448
- frm.button(:value=>"Properties").click
449
- AddEditSiteProperties.new(@browser)
450
- end
451
-
452
- # Clicks the Pages button, then instantiates
453
- # the AddEditPages page class.
454
- def pages
455
- frm.button(:value=>"Pages").click
456
- AddEditPages.new(@browser)
457
- end
458
-
459
- in_frame(:class=>"portletMainIframe") do |frame|
460
- # Non-navigating, interactive page objects go here
461
- text_field(:site_id, :id=>"id", :frame=>frame)
462
- text_field(:title, :id=>"title", :frame=>frame)
463
- text_field(:type, :id=>"type", :frame=>frame)
464
- text_area(:short_description, :id=>"shortDescription", :frame=>frame)
465
- radio_button(:unpublished, :id=>"publishedfalse", :frame=>frame)
466
- radio_button(:published, :id=>"publishedtrue", :frame=>frame)
467
- radio_button(:public_view_yes, :id=>"pubViewtrue", :frame=>frame)
468
- end
469
-
470
- end
471
-
472
- # The page you come to when editing a Site in Sites
473
- # and you click on the Pages button
474
- class AddEditPages
475
-
476
- include PageObject
477
- include ToolsMenu
478
-
479
- # Clicks the link for New Page, then
480
- # instantiates the NewPage page class.
481
- def new_page
482
- frm.link(:text=>"New Page").click
483
- NewPage.new(@browser)
484
- end
485
-
486
- end
487
-
488
- # Page for adding a new page to a Site.
489
- class NewPage
490
-
491
- include PageObject
492
- include ToolsMenu
493
-
494
- # Clicks the Tools button, then instantiates
495
- # the AddEditTools class.
496
- def tools
497
- frm.button(:value=>"Tools").click
498
- AddEditTools.new(@browser)
499
- end
500
-
501
- in_frame(:class=>"portletMainIframe") do |frame|
502
- # Interactive page objects that do no navigation
503
- # or page refreshes go here.
504
- text_field(:title, :id=>"title", :frame=>frame)
505
- end
506
-
507
- end
508
-
509
- # Page when editing a Site and adding/editing tools for pages.
510
- class AddEditTools
511
-
512
- include PageObject
513
- include ToolsMenu
514
-
515
- # Clicks the New Tool link, then instantiates
516
- # the NewTool class.
517
- def new_tool
518
- frm.link(:text=>"New Tool").click
519
- NewTool.new(@browser)
520
- end
521
-
522
- # Clicks the Save button, then
523
- # instantiates the AddEditPages class.
524
- def save
525
- frm.button(:value=>"Save").click
526
- AddEditPages.new(@browser)
527
- end
528
-
529
- end
530
-
531
- # Page for creating a new tool for a page in a site
532
- class NewTool
533
-
534
- include PageObject
535
- include ToolsMenu
536
-
537
- # Clicks the Done button, the instantiates
538
- # The AddEditTools class.
539
- def done
540
- frm.button(:value=>"Done").click
541
- AddEditTools.new(@browser)
542
- end
543
-
544
- in_frame(:class=>"portletMainIframe") do |frame|
545
- # Interactive page objects that do no navigation
546
- # or page refreshes go here.
547
- text_field(:title, :id=>"title", :frame=>frame)
548
- text_field(:layout_hints, :id=>"layoutHints", :frame=>frame)
549
- radio_button(:resources, :id=>"feature80", :frame=>frame)
550
- end
551
-
552
- end
553
-
554
- # Page that appears when you click "Remove Site" when editing a Site in Sites
555
- class RemoveSite
556
-
557
- include PageObject
558
- include ToolsMenu
559
-
560
- # Clicks the Remove button, then
561
- # instantiates the Sites class.
562
- def remove
563
- frm.button(:value=>"Remove").click
564
- Sites.new(@browser)
565
- end
566
-
567
- end
568
-
569
- # Page that appears when you click "Save As" when editing a Site in Sites
570
- class SiteSaveAs
571
-
572
- include PageObject
573
- include ToolsMenu
574
-
575
- # Clicks the Save button, then
576
- # instantiates the Sites class.
577
- def save
578
- frm.button(:value, "Save").click
579
- Sites.new(@browser)
580
- end
581
-
582
- in_frame(:class=>"portletMainIframe") do |frame|
583
- text_field(:site_id, :id=>"id", :frame=>frame)
584
- end
585
-
586
- end
587
-
588
- class AddEditSiteProperties
589
-
590
- include PageObject
591
- include ToolsMenu
592
-
593
- # Clicks the New Property button
594
- def new_property
595
- frm.button(:value=>"New Property").click
596
- #Class.new(@browser)
597
- end
598
-
599
- # Clicks the Done button, then instantiates
600
- # the EditSiteInfo class.
601
- def done
602
- frm.button(:value=>"Done").click
603
- EditSiteInfo.new(@browser)
604
- end
605
-
606
- # Clicks the Save button, then instantiates
607
- # the Sites page class.
608
- def save
609
- frm.button(:value=>"Save").click
610
- Sites.new(@browser)
611
- end
612
-
613
- in_frame(:class=>"portletMainIframe") do |frame|
614
- text_field(:name, :id=>"new_name", :frame=>frame)
615
- text_field(:value, :id=>"new_value", :frame=>frame)
616
- end
617
- end
618
-
619
-
620
-
621
- #================
622
- # User's Account Page - in "My Settings"
623
- #================
624
-
625
- # The Page for editing User Account details
626
- class EditAccount
627
-
628
- include PageObject
629
- include ToolsMenu
630
-
631
- # Clicks the update details button then
632
- # makes sure there isn't any error message present.
633
- # If there is, it reinstantiates the Edit Account Class,
634
- # otherwise it instantiates the UserAccount Class.
635
- def update_details
636
- frm.button(:value=>"Update Details").click
637
- # Need to check if the update took...
638
- if frm.div(:class=>"portletBody").h3.text=="My Account Details"
639
- # Apparently it did...
640
- UserAccount.new(@browser)
641
- elsif frm.div(:class=>"portletBody").h3.text=="Account Details"
642
- # We are on the edit page (or we're using the Admin account)...
643
- EditAccount.new(@browser)
644
- elsif frm.div(:class=>"portletBody").h3.text=="Users"
645
- Users.new(@browser)
646
- end
647
- end
648
-
649
- in_frame(:class=>"portletMainIframe") do |frame|
650
- text_field(:first_name, :id=>"first-name", :frame=>frame)
651
- text_field(:last_name, :id=>"last-name", :frame=>frame)
652
- text_field(:email, :id=>"email", :frame=>frame)
653
- text_field(:current_password, :id=>"pwcur", :frame=>frame)
654
- text_field(:create_new_password, :id=>"pw", :frame=>frame)
655
- text_field(:verify_new_password, :id=>"pw0", :frame=>frame)
656
- end
657
-
658
- end
659
-
660
- # A Non-Admin User's Account page
661
- # Accessible via the "Account" link in "MY SETTINGS"
662
- #
663
- # IMPORTANT: this class does not use PageObject or the ToolsMenu!!
664
- # So, the only available method to navigate away from this page is
665
- # Home. Otherwise, you'll have to call the navigation link
666
- # Explicitly in the test case itself.
667
- #
668
- # Objects and methods used in this class must be explicitly
669
- # defined using Watir and Ruby code.
670
- #
671
- # Do NOT use the PageObject syntax in this class.
672
- class UserAccount
673
-
674
- def initialize(browser)
675
- @browser = browser
676
- end
677
-
678
- # Clicks the Modify Details button. Instantiates the EditAccount class.
679
- def modify_details
680
- @browser.frame(:index=>0).button(:name=>"eventSubmit_doModify").click
681
- EditAccount.new(@browser)
682
- end
683
-
684
- # Gets the text of the User ID field.
685
- def user_id
686
- @browser.frame(:index=>0).table(:class=>"itemSummary", :index=>0)[0][1].text
687
- end
688
-
689
- # Gets the text of the First Name field.
690
- def first_name
691
- @browser.frame(:index=>0).table(:class=>"itemSummary", :index=>0)[1][1].text
692
- end
693
-
694
- # Gets the text of the Last Name field.
695
- def last_name
696
- @browser.frame(:index=>0).table(:class=>"itemSummary", :index=>0)[2][1].text
697
- end
698
-
699
- # Gets the text of the Email field.
700
- def email
701
- @browser.frame(:index=>0).table(:class=>"itemSummary", :index=>0)[3][1].text
702
- end
703
-
704
- # Gets the text of the Type field.
705
- def type
706
- @browser.frame(:index=>0).table(:class=>"itemSummary", :index=>0)[4][1].text
707
- end
708
-
709
- # Gets the text of the Created By field.
710
- def created_by
711
- @browser.frame(:index=>0).table(:class=>"itemSummary", :index=>1)[0][1].text
712
- end
713
-
714
- # Gets the text of the Created field.
715
- def created
716
- @browser.frame(:index=>0).table(:class=>"itemSummary", :index=>1)[1][1].text
717
- end
718
-
719
- # Gets the text of the Modified By field.
720
- def modified_by
721
- @browser.frame(:index=>0).table(:class=>"itemSummary", :index=>1)[2][1].text
722
- end
723
-
724
- # Gets the text of the Modified (date) field.
725
- def modified
726
- @browser.frame(:index=>0).table(:class=>"itemSummary", :index=>1)[3][1].text
727
- end
728
-
729
- # Clicks the Home buton in the left menu.
730
- # instantiates the Home Class.
731
- def home
732
- @browser.link(:text, "Home").click
733
- Home.new(@browser)
734
- end
735
-
736
- end
737
-
738
- #================
739
- # Users Pages - From the Workspace
740
- #================
741
-
742
- # The Page for editing User Account details
743
- class EditUser
744
-
745
- include PageObject
746
- include ToolsMenu
747
-
748
- in_frame(:class=>"portletMainIframe") do |frame|
749
- link(:remove_user, :text=>"Remove User", :frame=>frame)
750
- text_field(:first_name, :id=>"first-name", :frame=>frame)
751
- text_field(:last_name, :id=>"last-name", :frame=>frame)
752
- text_field(:email, :id=>"email", :frame=>frame)
753
- text_field(:create_new_password, :id=>"pw", :frame=>frame)
754
- text_field(:verify_new_password, :id=>"pw0", :frame=>frame)
755
- button(:update_details, :name=>"eventSubmit_doSave", :frame=>frame)
756
- button(:cancel_changes, :name=>"eventSubmit_doCancel", :frame=>frame)
757
- end
758
-
759
- end
760
-
761
- # The Users page - "icon-sakai-users"
762
- class Users
763
-
764
- include PageObject
765
- include ToolsMenu
766
-
767
- def new_user
768
- frm.link(:text=>"New User").click
769
- CreateNewUser.new @browser
770
- end
771
-
772
- # Returns the contents of the Name cell
773
- # based on the specified user ID value.
774
- def name(user_id)
775
- frm.table(:class=>"listHier lines").row(:text=>/#{Regexp.escape(user_id)}/i)[1].text
776
- end
777
-
778
- # Returns the contents of the Email cell
779
- # based on the specified user ID value.
780
- def email(user_id)
781
- frm.table(:class=>"listHier lines").row(:text=>/#{Regexp.escape(user_id)}/i)[2].text
782
- end
783
-
784
- # Returns the contents of the Type cell
785
- # based on the specified user ID value.
786
- def type(user_id)
787
- frm.table(:class=>"listHier lines").row(:text=>/#{Regexp.escape(user_id)}/i)[3].text
788
- end
789
-
790
- def search_button
791
- frm.link(:text=>"Search").click
792
- frm.table(:class=>"listHier lines").wait_until_present
793
- Users.new @browser
794
- end
795
-
796
- in_frame(:class=>"portletMainIframe") do |frame|
797
- link(:clear_search, :text=>"Clear Search", :frame=>frame)
798
- text_field(:search_field, :id=>"search", :frame=>frame)
799
- select_list(:select_page_size, :name=>"selectPageSize", :frame=>frame)
800
- button(:next, :name=>"eventSubmit_doList_next", :frame=>frame)
801
- button(:last, :name=>"eventSubmit_doList_last", :frame=>frame)
802
- button(:previous, :name=>"eventSubmit_doList_prev", :frame=>frame)
803
- button(:first, :name=>"eventSubmit_doList_first", :frame=>frame)
804
- end
805
-
806
- end
807
-
808
- # The Create New User page
809
- class CreateNewUser
810
-
811
- include PageObject
812
- include ToolsMenu
813
-
814
- def save_details
815
- frm.button(:name=>"eventSubmit_doSave").click
816
- Users.new(@browser)
817
- end
818
-
819
- in_frame(:class=>"portletMainIframe") do |frame|
820
- text_field(:user_id, :id=>"eid", :frame=>frame)
821
- text_field(:first_name, :id=>"first-name", :frame=>frame)
822
- text_field(:last_name, :id=>"last-name", :frame=>frame)
823
- text_field(:email, :id=>"email", :frame=>frame)
824
- text_field(:create_new_password, :id=>"pw", :frame=>frame)
825
- text_field(:verify_new_password, :id=>"pw0", :frame=>frame)
826
- select_list(:type, :name=>"type", :frame=>frame)
827
- button(:cancel_changes, :name=>"eventSubmit_doCancel", :frame=>frame)
828
- end
829
-
830
- end
831
-
832
-
833
- #================
834
- # User Membership Pages from Administration Workspace
835
- #================
836
-
837
- # User Membership page for admin users - "icon-sakai-usermembership"
838
- class UserMembership
839
-
840
- include PageObject
841
- include ToolsMenu
842
-
843
- # Returns an array containing the user names displayed in the search results.
844
- def names
845
- names = []
846
- frm.table(:class=>/listHier/).rows.each do |row|
847
- names << row[2].text
848
- end
849
- names.delete_at(0)
850
- return names
851
- end
852
-
853
- # Returns the user id of the specified user (assuming that person
854
- # appears in the search results list, otherwise this method will
855
- # throw an error.)
856
- def user_id(name)
857
- frm.table(:class=>/listHier/).row(:text=>/#{Regexp.escape(name)}/)[0].text
858
- end
859
-
860
- # Returns the user type of the specified user (assuming that person
861
- # appears in the search results list, otherwise this method will
862
- # throw an error.)
863
- def type(name)
864
- frm.table(:class=>/listHier/).row(:text=>/#{Regexp.escape(name)}/)[4].text
865
- end
866
-
867
- # Returns the text contents of the "instruction" paragraph that
868
- # appears when there are no search results.
869
- def alert_text
870
- frm.p(:class=>"instruction").text
871
- end
872
-
873
- in_frame(:class=>"portletMainIframe") do |frame|
874
- select_list(:user_type, :id=>"userlistForm:selectType", :frame=>frame)
875
- select_list(:user_authority, :id=>"userlistForm:selectAuthority", :frame=>frame)
876
- text_field(:search_field, :id=>"userlistForm:inputSearchBox", :frame=>frame)
877
- button(:search, :id=>"userlistForm:searchButton", :frame=>frame)
878
- button(:clear_search, :id=>"userlistForm:clearSearchButton", :frame=>frame)
879
- select_list(:page_size, :id=>"userlistForm:pager_pageSize", :frame=>frame)
880
- button(:export_csv, :id=>"userlistForm:exportCsv", :frame=>frame)
881
- button(:export_excel, :id=>"userlistForm:exportXls", :frame=>frame)
882
- link(:sort_user_id, :id=>"userlistForm:_idJsp13:_idJsp14", :frame=>frame)
883
- link(:sort_internal_user_id, :id=>"userlistForm:_idJsp13:_idJsp18", :frame=>frame)
884
- link(:sort_name, :id=>"userlistForm:_idJsp13:_idJsp21", :frame=>frame)
885
- link(:sort_email, :id=>"userlistForm:_idJsp13:_idJsp24", :frame=>frame)
886
- link(:sort_type, :id=>"userlistForm:_idJsp13:_idJsp28", :frame=>frame)
887
- link(:sort_authority, :id=>"userlistForm:_idJsp13:_idJsp31", :frame=>frame)
888
- link(:sort_created_on, :id=>"userlistForm:_idJsp13:_idJsp34", :frame=>frame)
889
- link(:sort_modified_on, :id=>"userlistForm:_idJsp13:_idJsp37", :frame=>frame)
890
- #(:, =>"", :frame=>frame)
891
-
892
- end
893
-
894
- end
895
-
896
- #================
897
- # Job Scheduler pages in Admin Workspace
898
- #================
899
-
900
- # The topmost page in the Job Scheduler in Admin Workspace
901
- class JobScheduler
902
-
903
- include PageObject
904
- include ToolsMenu
905
-
906
- # Clicks the Jobs link, then instantiates
907
- # the JobList Class.
908
- def jobs
909
- frm.link(:text=>"Jobs").click
910
- JobList.new(@browser)
911
- end
912
-
913
- end
914
-
915
- # The list of Jobs (click the Jobs button on Job Scheduler)
916
- class JobList
917
-
918
- include PageObject
919
- include ToolsMenu
920
-
921
- # Clicks the New Job link, then
922
- # instantiates the CreateNewJob Class.
923
- def new_job
924
- frm.link(:text=>"New Job").click
925
- CreateNewJob.new(@browser)
926
- end
927
-
928
- # Clicks the link with the text "Triggers" associated with the
929
- # specified job name,
930
- # then instantiates the EditTriggers Class.
931
- def triggers(job_name)
932
- frm.div(:class=>"portletBody").table(:class=>"listHier lines").row(:text=>/#{Regexp.escape(job_name)}/).link(:text=>/Triggers/).click
933
- sleep 1
934
- EditTriggers.new(@browser)
935
- end
936
-
937
- def event_log
938
- frm.link(:text=>"Event Log").click
939
- EventLog.new(@browser)
940
- end
941
-
942
- end
943
-
944
- # The Create New Job page
945
- class CreateNewJob
946
-
947
- include PageObject
948
- include ToolsMenu
949
-
950
- # Clicks the Post button, then
951
- # instantiates the JobList Class.
952
- def post
953
- frm.button(:value=>"Post").click
954
- JobList.new(@browser)
955
- end
956
-
957
- in_frame(:class=>"portletMainIframe") do |frame|
958
- text_field(:job_name, :id=>"_id2:job_name", :frame=>frame)
959
- select_list(:type, :name=>"_id2:_id10", :frame=>frame)
960
- end
961
- end
962
-
963
- # The page for Editing Triggers
964
- class EditTriggers
965
-
966
- include PageObject
967
- include ToolsMenu
968
-
969
- # Clicks the "Run Job Now" link, then
970
- # instantiates the RunJobConfirmation Class.
971
- def run_job_now
972
- frm.div(:class=>"portletBody").link(:text=>"Run Job Now").click
973
- RunJobConfirmation.new(@browser)
974
- end
975
-
976
- def return_to_jobs
977
- frm.link(:text=>"Return_to_Jobs").click
978
- JobList.new(@browser)
979
- end
980
-
981
- def new_trigger
982
- frm.link(:text=>"New Trigger").click
983
- CreateTrigger.new(@browser)
984
- end
985
-
986
- end
987
-
988
- # The Create Trigger page
989
- class CreateTrigger
990
-
991
- include PageObject
992
- include ToolsMenu
993
-
994
- def post
995
- frm.button(:value=>"Post").click
996
- EditTriggers.new(@browser)
997
- end
998
-
999
- in_frame(:index=>0) do |frame|
1000
- text_field(:name, :id=>"_id2:trigger_name", :frame=>frame)
1001
- text_field(:cron_expression, :id=>"_id2:trigger_expression", :frame=>frame)
1002
- end
1003
- end
1004
-
1005
-
1006
- # The page for confirming you want to run a job
1007
- class RunJobConfirmation
1008
-
1009
- include PageObject
1010
- include ToolsMenu
1011
-
1012
- # Clicks the "Run Now" button, then
1013
- # instantiates the JobList Class.
1014
- def run_now
1015
- frm.button(:value=>"Run Now").click
1016
- JobList.new(@browser)
1017
- end
1018
-
1019
- in_frame(:index=>0) do |frame|
1020
- #(:, =>"", :frame=>frame)
1021
- end
1022
- end
1023
-
1024
- # The page containing the Event Log
1025
- class EventLog
1026
-
1027
- include PageObject
1028
- include ToolsMenu
1029
-
1030
- end