sakai-oae-test-api 0.0.3 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (34) hide show
  1. data/Gemfile.lock +34 -0
  2. data/README.md +48 -40
  3. data/lib/sakai-oae-test-api.rb +7 -3
  4. data/lib/sakai-oae-test-api/cle_announcements.rb +0 -0
  5. data/lib/sakai-oae-test-api/cle_assessments.rb +146 -0
  6. data/lib/sakai-oae-test-api/cle_assignments.rb +87 -0
  7. data/lib/sakai-oae-test-api/cle_basic_lti.rb +0 -0
  8. data/lib/sakai-oae-test-api/cle_blogs.rb +0 -0
  9. data/lib/sakai-oae-test-api/cle_calendar.rb +65 -0
  10. data/lib/sakai-oae-test-api/cle_calendar_summary.rb +0 -0
  11. data/lib/sakai-oae-test-api/cle_chat_room.rb +0 -0
  12. data/lib/sakai-oae-test-api/cle_drop_box.rb +0 -0
  13. data/lib/sakai-oae-test-api/cle_email_archive.rb +27 -0
  14. data/lib/sakai-oae-test-api/cle_forums.rb +62 -0
  15. data/lib/sakai-oae-test-api/cle_gradebook.rb +20 -0
  16. data/lib/sakai-oae-test-api/cle_gradebook2.rb +21 -0
  17. data/lib/sakai-oae-test-api/cle_messages.rb +133 -0
  18. data/lib/sakai-oae-test-api/cle_news.rb +19 -0
  19. data/lib/sakai-oae-test-api/cle_polls.rb +34 -0
  20. data/lib/sakai-oae-test-api/cle_post_em.rb +13 -0
  21. data/lib/sakai-oae-test-api/cle_profile.rb +27 -0
  22. data/lib/sakai-oae-test-api/cle_profile2.rb +57 -0
  23. data/lib/sakai-oae-test-api/cle_resources_roster.rb +0 -0
  24. data/lib/sakai-oae-test-api/cle_rwiki.rb +0 -0
  25. data/lib/sakai-oae-test-api/cle_sections.rb +57 -0
  26. data/lib/sakai-oae-test-api/cle_single_user.rb +13 -0
  27. data/lib/sakai-oae-test-api/cle_site_statistics.rb +13 -0
  28. data/lib/sakai-oae-test-api/cle_syllabus.rb +55 -0
  29. data/lib/sakai-oae-test-api/global_methods.rb +1 -1
  30. data/lib/sakai-oae-test-api/page_classes.rb +0 -62
  31. data/lib/sakai-oae-test-api/pop_up_dialogs.rb +2 -1
  32. data/sakai-oae-test-api.gemspec +3 -3
  33. metadata +32 -7
  34. data/lib/sakai-oae-test-api/cle_frame_classes.rb +0 -2160
data/Gemfile.lock ADDED
@@ -0,0 +1,34 @@
1
+ GEM
2
+ remote: http://rubygems.org/
3
+ specs:
4
+ addressable (2.2.7)
5
+ childprocess (0.3.1)
6
+ ffi (~> 1.0.6)
7
+ ffi (1.0.9)
8
+ kuali-sakai-common-lib (0.0.1)
9
+ libwebsocket (0.1.3)
10
+ addressable
11
+ multi_json (1.2.0)
12
+ page-object (0.6.6)
13
+ selenium-webdriver (>= 2.21.2)
14
+ watir-webdriver (>= 0.5.5)
15
+ rake (0.9.2)
16
+ rubyzip (0.9.7)
17
+ selenium-webdriver (2.21.2)
18
+ childprocess (>= 0.2.5)
19
+ ffi (~> 1.0)
20
+ libwebsocket (~> 0.1.3)
21
+ multi_json (~> 1.0)
22
+ rubyzip
23
+ watir-webdriver (0.5.5)
24
+ selenium-webdriver (>= 2.18.0)
25
+
26
+ PLATFORMS
27
+ ruby
28
+
29
+ DEPENDENCIES
30
+ kuali-sakai-common-lib
31
+ page-object
32
+ rake
33
+ selenium-webdriver
34
+ watir-webdriver
data/README.md CHANGED
@@ -7,6 +7,10 @@ This is the development project for the Sakai OAE Functional Testing API gem for
7
7
  This API provides a framework for interacting with web sites for Sakai-OAE, using
8
8
  Ruby and Watir-webdriver--but without needing to know either in detail.
9
9
 
10
+ ## Documentation:
11
+
12
+ RDocs for this project can be found at [rubydoc.info](http://rubydoc.info/gems/sakai-oae-test-api)
13
+
10
14
  ## Requirements:
11
15
 
12
16
  ### Ruby 1.9.2 or higher
@@ -17,73 +21,77 @@ This repo is here if you're going to take part in extending the API's capabiliti
17
21
 
18
22
  ## A Basic Usage Example for OAE:
19
23
 
24
+ Require the gem...
20
25
  ````ruby
21
26
  #!/usr/bin/env ruby
22
27
  require 'sakai-oae-test-api'
28
+ ````
23
29
 
24
- # Create an instance of the SakaiOAE class, specifying your test browser
25
- # and the URL of your test site's OAE welcome page.
30
+ Create an instance of the SakaiOAE class, specifying your test browser and the URL of your test site's OAE welcome page.
31
+ ````ruby
26
32
  sakai = SakaiOAE.new(:firefox, "https://academic.rsmart.com/")
33
+ ````
27
34
 
28
- # define the LoginPage class object, which allows you to interact with elements
29
- # on the login page. This is available via the SakaiOAE class, "page" method...
35
+ Define the LoginPage class object, which allows you to interact with elements on the login page. This is available via the `SakaiOAE` class, "page" method...
36
+ ````ruby
30
37
  login_page = sakai.page
38
+ ````
31
39
 
32
- # Define the browser object using SakaiOAE's 'browser' method. This is Ruby/Watir's
33
- # representation of the test browser itself and is used by every page class in the
34
- # Sakai-OAE-test-api, so it *must* be explicitly defined here as "@browser"...
40
+ Define the browser object using the `SakaiOAE` 'browser' method. This is Ruby/Watir's representation of the test browser itself and is used by every page class in the Sakai-OAE-test-api, so it **must** be explicitly defined here as `@browser` ...
41
+ ````ruby
35
42
  @browser = sakai.browser
43
+ ````
36
44
 
37
- # The above code is all necessary for proper setup and usage of the API. Below, we
38
- # present a short and simple example of how you can use the API to interact with
39
- # the Open Academic Environment...
45
+ The above code is all necessary for proper setup and usage of the API. Below, we present a short and simple example of how you can use the API to interact with the Open Academic Environment...
46
+
47
+ First, log in...
48
+ ````ruby
40
49
  dash = login_page.login("username", "password")
50
+ ````
41
51
 
42
- # There are two ways to invoke page classes. The first way, hinted at in the code
43
- # above, will be explained below. The second way uses the "on_page" method,
44
- # and is most useful when you are going to stay on the given page for a while. It
45
- # requires that you know the name of the relevant page class..
52
+ Next, invoke the current page's 'class'. Note that there are two ways to invoke page classes. The first way, hinted at in the code above, will be explained below. The second way uses the "on_page" method, and is most useful when you are going to stay on the given page for a while. It requires that you know the name of the page class you want...
53
+ ````ruby
46
54
  on_page MyDashboard do |page|
47
- page.add_content
48
- page.upload_file=("filename.doc", "Full/Path/To/File")
49
- page.file_title="Title"
50
- page.file_description="This is a file description."
51
- page.tags_and_categories="document"
52
- page.add
53
- page.done_add_collected
55
+ page.add_content # Click the 'Add content' button
56
+ page.upload_file=("filename.doc", "Full/Path/To/File") # Enter the filename and full path. The path value is an optional parameter (but recommended)
57
+ page.file_title="Title" # Enter 'Title' in the title field.
58
+ page.file_description="This is a file description." # Enter the file description.
59
+ page.tags_and_categories="document" # Enter the tag 'document'
60
+ page.add # Click the 'Add' button
61
+ page.done_add_collected # Click the 'Done, add collected' button
54
62
  end
63
+ ````
55
64
 
56
- # So, back to the first way, which is most useful when you're doing lots of quick
57
- # navigating around the site, not staying on a given page for too long.
58
- # You'll notice by looking at the available methods in the page classes that those
59
- # methods involving navigating to new pages will return the target page's page class.
60
- # So, for example, going from My Dashboard to Explore Content (notice we're using
61
- # the "dash" object defined earlier, here...
62
- explore = dash.explore_content
65
+ So, back to the first way to invoke a page's class, which is most useful when you're doing lots of quick navigating around the site, not staying on a given page for too long. You'll notice by looking at the available methods in the page classes that those methods involving navigating to new pages will return the target page's page class. So, for example, going from My Dashboard to Explore Content (notice we're using the "dash" object defined earlier, here)...
66
+ ````ruby
67
+ explore = dash.explore_content # Click the 'Explore Content' command in the drop-down menu
68
+ ````
63
69
 
64
- # Now we can use the "explore" object to interact with the "Explore Content" page...
65
- explore.search_for="Title"
70
+ Now we can use the "explore" object to interact with the "Explore Content" page...
71
+ ````ruby
72
+ explore.search_for="Title" # Enter 'Title' in the Search field and search
73
+ ````
66
74
 
67
- # A bit of verification code (use your own favorite test framework, here, if
68
- # writing Ruby conditionals isn't too your liking)...
75
+ A bit of verification code (use your own favorite test framework, here, if writing Ruby conditionals isn't to your liking)...
76
+ ````
69
77
  if explore.results.include?("Title")
70
78
  puts "Passed"
71
79
  else
72
80
  puts "Failed"
73
81
  end
74
-
75
- # Enjoy!
76
82
  ````
77
83
 
78
- For much more extensive usage examples, please see the OAE Cucumber directory in this repo.
84
+ For much more extensive usage examples, please see the tests created by rSmart and current kept at the github repository here:
85
+ [https://github.com/aheward/Kuali-Sakai-Functional-Test-Automation-Framework](https://github.com/aheward/Kuali-Sakai-Functional-Test-Automation-Framework)
86
+
87
+ ## Support
88
+
89
+ If you have questions, bugs to report, or requests to add any page elements that are currently missing (and there are many) then please contact us.
79
90
 
80
91
  ## Contribute
81
92
 
82
93
  * Fork the project.
83
- * Test drive your feature addition or bug fix. Adding specs is important and I will not accept a pull request that does not have tests.
84
- * Make sure you describe your new feature with a cucumber scenario.
85
- * Make sure you provide RDoc comments for any new public method you add. Remember, others will be using this gem.
86
- * Commit, do not mess with Rakefile, version, or ChangeLog.
87
- (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
94
+ * Additional or bug-fixed Classes, Elements, or Methods should be demonstrated in accompanying tests. Pull requests that do not include test scripts that use the new code won't be accepted.
95
+ * Make sure you provide RDoc comments for any new public method or page class you add. Remember, others will be using this gem.
88
96
  * Send me a pull request. Bonus points for topic branches.
89
97
 
@@ -1,6 +1,4 @@
1
1
  require 'kuali-sakai-common-lib'
2
- require 'watir-webdriver'
3
- require 'page-object'
4
2
  require 'cgi'
5
3
 
6
4
  PageObject.javascript_framework = :jquery
@@ -11,7 +9,13 @@ require 'sakai-oae-test-api/pop_up_dialogs'
11
9
  require 'sakai-oae-test-api/toolbars_and_menus'
12
10
  require 'sakai-oae-test-api/widgets'
13
11
  require 'sakai-oae-test-api/page_classes'
14
- require 'sakai-oae-test-api/cle_frame_classes'
12
+ =begin
13
+ require 'sakai-oae-test-api/cle_assessments'
14
+ require 'sakai-oae-test-api/cle_assignments'
15
+ require 'sakai-oae-test-api/cle_forums'
16
+ require 'sakai-oae-test-api/cle_gradebook2'
17
+ =end
18
+ Dir["#{File.dirname(__FILE__)}/sakai-oae-test-api/cle_*.rb"].each {|f| require f }
15
19
 
16
20
  # Initialize this class at the start of your test cases to
17
21
  # open the specified test browser at the specified Sakai welcome page URL.
File without changes
@@ -0,0 +1,146 @@
1
+ # TODO - describe class
2
+ module AssessmentsFrame
3
+
4
+ include PageObject
5
+ include GlobalMethods
6
+ include HeaderFooterBar
7
+ include LeftMenuBar
8
+ include HeaderBar
9
+ include DocButtons
10
+
11
+ # The frame object that contains all of the CLE Tests and Quizzes objects
12
+ def frm
13
+ self.frame(:src=>/sakai2samigo.launch.html/)
14
+ end
15
+
16
+ end
17
+
18
+ class AssessmentsList
19
+ include AssessmentsFrame
20
+ CLEElements.modularize(AssessmentsListMethods, :index=>2)
21
+ end
22
+
23
+ class PreviewOverview
24
+ include AssessmentsFrame
25
+ CLEElements.modularize(PreviewOverviewMethods, :index=>2)
26
+ end
27
+
28
+ class AssessmentSettings
29
+ include AssessmentsFrame
30
+ CLEElements.modularize(AssessmentSettingsMethods, :index=>2)
31
+ end
32
+
33
+ class AssessmentTotalScores
34
+ include AssessmentsFrame
35
+ include AssessmentTotalScoresMethods
36
+ end
37
+
38
+ class EditAssessment
39
+ include AssessmentsFrame
40
+ CLEElements.modularize(EditAssessmentMethods, :index=>2)
41
+ end
42
+
43
+ class AddEditAssessmentPart
44
+ include AssessmentsFrame
45
+ CLEElements.modularize(AddEditAssessmentPartMethods, :index=>2)
46
+ end
47
+
48
+ class PublishAssessment
49
+ include AssessmentsFrame
50
+ CLEElements.modularize(PublishAssessmentMethods, :index=>2)
51
+ end
52
+
53
+ class MultipleChoice
54
+ include AssessmentsFrame
55
+ CLEElements.modularize(MultipleChoiceMethods, :index=>2)
56
+ end
57
+
58
+ class Survey
59
+ include AssessmentsFrame
60
+ CLEElements.modularize(SurveyMethods, :index=>2)
61
+ end
62
+
63
+ class ShortAnswer
64
+ include AssessmentsFrame
65
+ CLEElements.modularize(ShortAnswerMethods, :index=>2)
66
+ end
67
+
68
+ class FillInBlank
69
+ include AssessmentsFrame
70
+ CLEElements.modularize(FillInBlankMethods, :index=>2)
71
+ end
72
+
73
+ class NumericResponse
74
+ include AssessmentsFrame
75
+ CLEElements.modularize(NumericResponseMethods, :index=>2)
76
+ end
77
+
78
+ class Matching
79
+ include AssessmentsFrame
80
+ CLEElements.modularize(MatchingMethods, :index=>2)
81
+ end
82
+
83
+ class TrueFalse
84
+ include AssessmentsFrame
85
+ CLEElements.modularize(TrueFalseMethods, :index=>2)
86
+ end
87
+
88
+ class AudioRecording
89
+ include AssessmentsFrame
90
+ CLEElements.modularize(AudioRecordingMethods, :index=>2)
91
+ end
92
+
93
+ class FileUpload
94
+ include AssessmentsFrame
95
+ CLEElements.modularize(FileUploadMethods, :index=>2)
96
+ end
97
+
98
+ class EditAssessmentType
99
+ include AssessmentsFrame
100
+ CLEElements.modularize(EditAssessmentTypeMethods, :index=>2)
101
+ end
102
+
103
+ class AddQuestionPool
104
+ include AssessmentsFrame
105
+ CLEElements.modularize(AddQuestionPoolMethods, :index=>2)
106
+ end
107
+
108
+ class EditQuestionPool
109
+ include AssessmentsFrame
110
+ CLEElements.modularize(EditQuestionPoolMethods, :index=>2)
111
+ end
112
+
113
+ class QuestionPoolsList
114
+ include AssessmentsFrame
115
+ CLEElements.modularize(QuestionPoolsListMethods, :index=>2)
116
+ end
117
+
118
+ class PoolImport
119
+ include AssessmentsFrame
120
+ include PoolImportMethods
121
+ end
122
+
123
+ class SelectQuestionType
124
+ include AssessmentsFrame
125
+ CLEElements.modularize(SelectQuestionTypeMethods, :index=>2)
126
+ end
127
+
128
+ class TakeAssessmentList
129
+ include AssessmentsFrame
130
+ include TakeAssessmentListMethods
131
+ end
132
+
133
+ class BeginAssessment
134
+ include AssessmentsFrame
135
+ include BeginAssessmentMethods
136
+ end
137
+
138
+ class ConfirmSubmission
139
+ include AssessmentsFrame
140
+ CLEElements.modularize(ConfirmSubmissionMethods, :index=>2)
141
+ end
142
+
143
+ class SubmissionSummary
144
+ include AssessmentsFrame
145
+ CLEElements.modularize(SubmissionSummaryMethods, :index=>2)
146
+ end
@@ -0,0 +1,87 @@
1
+ module AssignmentsFrame
2
+
3
+ include PageObject
4
+ include GlobalMethods
5
+ include HeaderFooterBar
6
+ include LeftMenuBar
7
+ include HeaderBar
8
+ include DocButtons
9
+
10
+ # The frame object that contains all of the CLE Tests and Quizzes objects
11
+ def frm
12
+ self.frame(:src=>/sakai2assignments.launch.html/)
13
+ end
14
+
15
+ end
16
+
17
+ #
18
+ class AssignmentsList
19
+ include AssignmentsFrame
20
+ CLEElements.modularize( AssignmentsListMethods, :index=>2)
21
+ end
22
+
23
+ #
24
+ class AssignmentAdd
25
+ include AssignmentsFrame
26
+ CLEElements.modularize( AssignmentAddMethods, :index=>2)
27
+ end
28
+
29
+ #
30
+ class AssignmentsPermissions
31
+ include AssignmentsFrame
32
+ CLEElements.modularize( AssignmentsPermissionsMethods, :index=>2)
33
+ end
34
+
35
+ #
36
+ class AssignmentsPreview
37
+ include AssignmentsFrame
38
+ CLEElements.modularize( AssignmentsPreviewMethods, :index=>2)
39
+ end
40
+
41
+ #
42
+ class AssignmentsReorder
43
+ include AssignmentsFrame
44
+ CLEElements.modularize( AssignmentsReorderMethods, :index=>2)
45
+ end
46
+
47
+ #
48
+ class AssignmentStudent
49
+ include AssignmentsFrame
50
+ CLEElements.modularize( AssignmentStudentMethods, :index=>2)
51
+ end
52
+
53
+ #
54
+ class AssignmentStudentPreview
55
+ include AssignmentsFrame
56
+ include AssignmentStudentPreviewMethods
57
+ end
58
+
59
+ #
60
+ class SubmissionConfirmation
61
+ include AssignmentsFrame
62
+ include SubmissionConfirmationMethods
63
+ end
64
+
65
+ #
66
+ class AssignmentSubmissionList
67
+ include AssignmentsFrame
68
+ CLEElements.modularize( AssignmentSubmissionListMethods, :index=>2)
69
+ end
70
+
71
+ #
72
+ class AssignmentSubmission
73
+ include AssignmentsFrame
74
+ CLEElements.modularize( AssignmentSubmissionMethods, :index=>2)
75
+ end
76
+
77
+ #
78
+ class GradeReport
79
+ include AssignmentsFrame
80
+ include GradeReportMethods
81
+ end
82
+
83
+ #
84
+ class StudentView
85
+ include AssignmentsFrame
86
+ CLEElements.modularize( StudentViewMethods, :index=>2)
87
+ end
File without changes
File without changes
@@ -0,0 +1,65 @@
1
+ # TODO - Write a description
2
+ module CalendarFrame
3
+
4
+ include PageObject
5
+ include HeaderFooterBar
6
+ include LeftMenuBar
7
+ include HeaderBar
8
+ include DocButtons
9
+ include GlobalMethods
10
+
11
+ def calendar_frame
12
+ self.frame(:src=>/sakai2calendar.launch.html/)
13
+ end
14
+
15
+ end
16
+
17
+ # Top page of the Calendar
18
+ # For now it includes all views, though that probably
19
+ # means it will have to be re-instantiated every time
20
+ # a new view is selected.
21
+ class Calendar
22
+ include CalendarFrame
23
+ include CalendarTools
24
+ include CalendarMethods
25
+ end
26
+
27
+ # The page that appears when you click on an event in the Calendar
28
+ class EventDetail
29
+ include CalendarFrame
30
+ include CalendarTools
31
+ include EventDetailMethods
32
+ end
33
+
34
+ #
35
+ class AddEditEvent
36
+ include CalendarFrame
37
+ CLEElements.modularize(AddEditEventMethods, :class=>"portletMainIframe")
38
+ end
39
+
40
+ # The page that appears when the Frequency button is clicked on the Add/Edit
41
+ # Event page.
42
+ class EventFrequency
43
+ include CalendarFrame
44
+ CLEElements.modularize(EventFrequencyMethods, :class=>"portletMainIframe")
45
+ end
46
+
47
+ class AddEditFields
48
+ include CalendarFrame
49
+ CLEElements.modularize(AddEditFieldsMethods, :class=>"portletMainIframe")
50
+ end
51
+
52
+ class ImportStepOne
53
+ include CalendarFrame
54
+ CLEElements.modularize(ImportStepOneMethods, :class=>"portletMainIframe")
55
+ end
56
+
57
+ class ImportStepTwo
58
+ include CalendarFrame
59
+ include ImportStepTwoMethods
60
+ end
61
+
62
+ class ImportStepThree
63
+ include CalendarFrame
64
+ CLEElements.modularize(ImportStepThreeMethods, :class=>"portletMainIframe")
65
+ end