Module: HeaderFooterBar
- Includes:
- PageObject
- Included in:
- Acknowledgements, AllCategoriesPage, CalendarFrame, Comments, ContentDetailsPage, CreateCourses, CreateGroups, CreateNewAccount, CreateResearch, Discussions, ExploreAll, ExploreContent, ExploreCourses, ExploreGroups, ExplorePeople, ExploreResearch, Files, FourOhFourPage, FourOhThreePage, Gadget, GoogleMaps, GradebookFrame, LTI, Library, LoginPage, MessagesFrame, MyContacts, MyDashboard, MyLibrary, MyMemberships, MyMessages, MyProfileAboutMe, MyProfileBasicInfo, MyProfileContactInfo, MyProfileOnline, MyProfilePublications, Participants, PollsFrame, PostEmFrame, RSS, Remote, ResearchIntro, SingleUserFrame, SiteStatisticsFrame, ViewPerson
- Defined in:
- lib/sakai-oae-test-api/toolbars_and_menus.rb
Overview
The Topmost Header menu bar, present on most pages, plus the Footer contents, too. This module also contains references to the notification pop-ups that appear in the upper right.
Instance Method Summary collapse
-
#acknowledgements ⇒ Object
Clicks the Acknowledgements link in the page Footer.
- #add_collection ⇒ Object
-
#add_content ⇒ Object
Opens the Create + Add menu in the header bar, clicks on the Add Content item, waits for the Pop Up dialog to appear, then includes the AddContentContainer module in the currently instantiated Class Object.
-
#browse_footer ⇒ Object
Clicks the Browse button in the footer And returns the AllCategories page class.
-
#browse_footer_link ⇒ Object
The page object for the Browse link the footer.
-
#change_language ⇒ Object
Clicks the language button in the page footer.
-
#change_location ⇒ Object
Clicks the location link in the page footer.
-
#click_link(string) ⇒ Object
A generic link-clicking method.
-
#explore_footer ⇒ Object
Clicks the Explore button in the footer and returns the Page class for the main login page (since that’s the page that loads).
-
#explore_footer_link ⇒ Object
The page object for the Explore link the footer.
-
#login(username, password) ⇒ Object
(also: #sign_in, #log_in)
Logs in with the specified username and password variables.
-
#messages_container ⇒ Object
Clicks the messages container button.
-
#my_account ⇒ Object
Opens the User Options menu in the header menu bar, clicks the Preferences item, waits for the Account Preferences Pop up dialog to appear, and then includes the AccountPreferencesPopUp module in the currently instantiated Class Object.
-
#sign_out ⇒ Object
(also: #logout, #log_out)
Clicks the Sign out command in the user menu in the header bar.
-
#sign_up ⇒ Object
Clicks the “Sign up” link.
-
#toggle_collector ⇒ Object
Clicks the Colector icon in the header bar, to either display or hide the collector widget, depending on its current state.
-
#user_agreement ⇒ Object
Clicks the User Agreement link in the page footer.
Methods included from PageObject
#method_missing, #name_li, #name_link
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class PageObject
Instance Method Details
#acknowledgements ⇒ Object
Clicks the Acknowledgements link in the page Footer.
96 97 98 99 100 101 |
# File 'lib/sakai-oae-test-api/toolbars_and_menus.rb', line 96 def acknowledgements self.acknowledgements_link sleep 1 self.wait_for_ajax Acknowledgements.new @browser end |
#add_collection ⇒ Object
188 189 190 |
# File 'lib/sakai-oae-test-api/toolbars_and_menus.rb', line 188 def add_collection end |
#add_content ⇒ Object
Opens the Create + Add menu in the header bar, clicks on the Add Content item, waits for the Pop Up dialog to appear, then includes the AddContentContainer module in the currently instantiated Class Object.
181 182 183 184 185 186 |
# File 'lib/sakai-oae-test-api/toolbars_and_menus.rb', line 181 def add_content self.link(:id=>"navigation_create_and_add_link").fire_event("onmouseover") self.link(:text=>"Add content").click self.wait_until { self.text.include? "Collected items" } self.class.class_eval { include AddContentContainer } end |
#browse_footer ⇒ Object
Clicks the Browse button in the footer And returns the AllCategories page class.
89 90 91 92 93 |
# File 'lib/sakai-oae-test-api/toolbars_and_menus.rb', line 89 def .click self.wait_for_ajax AllCategoriesPage.new @browser end |
#browse_footer_link ⇒ Object
The page object for the Browse link the footer. Defined as a custom method because of issues using PageObject to do it.
83 84 85 |
# File 'lib/sakai-oae-test-api/toolbars_and_menus.rb', line 83 def self.span(:id=>"footer_links_right").link(:text=>"Browse") end |
#change_language ⇒ Object
Clicks the language button in the page footer.
119 120 121 122 123 |
# File 'lib/sakai-oae-test-api/toolbars_and_menus.rb', line 119 def change_language self. self.wait_for_ajax self.class.class_eval { include AccountPreferencesPopUp } end |
#change_location ⇒ Object
Clicks the location link in the page footer
112 113 114 115 116 |
# File 'lib/sakai-oae-test-api/toolbars_and_menus.rb', line 112 def change_location self. self.wait_for_ajax self.class.class_eval { include AccountPreferencesPopUp } end |
#click_link(string) ⇒ Object
A generic link-clicking method. It clicks on a page link with text that matches the supplied string. Since it uses Regex to find a match, the string can be a substring of the desired link’s full text.
This method should be used as AN ABSOLUTE LAST RESORT, however, since it does not instantiate a new page class. You will have to instantiate the target page class explicitly in the test script itself, if required.
132 133 134 135 |
# File 'lib/sakai-oae-test-api/toolbars_and_menus.rb', line 132 def click_link(string) name_link(string).click self.wait_for_ajax end |
#explore_footer ⇒ Object
Clicks the Explore button in the footer and returns the Page class for the main login page (since that’s the page that loads).
74 75 76 77 78 79 |
# File 'lib/sakai-oae-test-api/toolbars_and_menus.rb', line 74 def .click sleep 1 self.wait_for_ajax LoginPage.new @browser end |
#explore_footer_link ⇒ Object
The page object for the Explore link the footer. Defined as a custom method using Watir-webdriver, because of issues using PageObject to do it.
68 69 70 |
# File 'lib/sakai-oae-test-api/toolbars_and_menus.rb', line 68 def self.span(:id=>"footer_links_right").link(:text=>"Explore") end |
#login(username, password) ⇒ Object Also known as: sign_in, log_in
Logs in with the specified username and password variables. Returns the MyDashboard class object.
150 151 152 153 154 155 156 157 158 159 160 161 |
# File 'lib/sakai-oae-test-api/toolbars_and_menus.rb', line 150 def login(username, password) self.div(:id=>"topnavigation_user_options_login_wrapper").fire_event("onmouseover") self.text_field(:id=>"topnavigation_user_options_login_fields_username").set username self.text_field(:name=>"topnav_login_password").set password self.(:id=>"topnavigation_user_options_login_button_login").click sleep 3 # TODO : Make into a wait clause if self.(:id=>"emailverify_continue_button").present? self.(:id=>"emailverify_continue_button").click end self.linger_for_ajax(2) MyDashboard.new @browser end |
#messages_container ⇒ Object
Clicks the messages container button
201 202 203 204 205 |
# File 'lib/sakai-oae-test-api/toolbars_and_menus.rb', line 201 def self. self.wait_for_ajax self.class.class_eval { include MessagesContainerPopUp } end |
#my_account ⇒ Object
Opens the User Options menu in the header menu bar, clicks the Preferences item, waits for the Account Preferences Pop up dialog to appear, and then includes the AccountPreferencesPopUp module in the currently instantiated Class Object.
141 142 143 144 145 146 |
# File 'lib/sakai-oae-test-api/toolbars_and_menus.rb', line 141 def my_account self.link(:id=>"topnavigation_user_options_name").fire_event("onmouseover") self.link(:id=>"subnavigation_preferences_link").click self.wait_for_ajax self.class.class_eval { include AccountPreferencesPopUp } end |
#sign_out ⇒ Object Also known as: logout, log_out
Clicks the Sign out command in the user menu in the header bar. returns the LoginPage class object.
167 168 169 170 171 172 173 |
# File 'lib/sakai-oae-test-api/toolbars_and_menus.rb', line 167 def sign_out self.link(:id=>"topnavigation_user_options_name").fire_event("onmouseover") self.link(:id=>"subnavigation_logout_link").click self.link(:text=>"Explore").wait_until_present self.linger_for_ajax(2) LoginPage.new @browser end |
#sign_up ⇒ Object
Clicks the “Sign up” link. Returns the CreateNewAccount class object
208 209 210 211 212 213 |
# File 'lib/sakai-oae-test-api/toolbars_and_menus.rb', line 208 def sign_up self.sign_up_link self.(:id=>"save_account").wait_until_present sleep 3 CreateNewAccount.new @browser end |
#toggle_collector ⇒ Object
Clicks the Colector icon in the header bar, to either display or hide the collector widget, depending on its current state.
194 195 196 197 198 |
# File 'lib/sakai-oae-test-api/toolbars_and_menus.rb', line 194 def toggle_collector self.collector self.wait_for_ajax self.class.class_eval { include CollectorWidget } end |
#user_agreement ⇒ Object
Clicks the User Agreement link in the page footer.
104 105 106 107 108 109 |
# File 'lib/sakai-oae-test-api/toolbars_and_menus.rb', line 104 def user_agreement self.user_agreement_link sleep 1 #wait_for_ajax # New Class goes here.new @browser end |