Skip to content
Browse files

enhanced protected_page test to check for a normal user AND the anony…

…mous

user;

Change-Id: I3bd72f2b02c6204d83cd3de9daa107cec7e648d2
  • Loading branch information...
1 parent 7a14be6 commit f741ce839de4d480e438c43024820ec74343c43b @tobijat tobijat committed Aug 21, 2012
Showing with 28 additions and 5 deletions.
  1. +28 −5 repo/tests/selenium/item/protected_page_spec.rb
View
33 repo/tests/selenium/item/protected_page_spec.rb
@@ -28,15 +28,38 @@
end
context "check functionality of protected page" do
+ it "should be logged in with normal user, and check if label/description of protected item could not be edited" do
+ visit_page(LoginPage) do |page|
+ page.login_with(WIKI_ORDINARY_USERNAME, WIKI_ORDINARY_PASSWORD)
+ end
+ on_page(NewItemPage) do |page|
+ page.navigate_to_item
+ page.wait_for_item_to_load
+ #label
+ page.editLabelLink?.should be_false
+ page.editLabelLinkDisabled?.should be_true
+ page.editLabelLinkDisabled_element.click
+ page.wbTooltip?.should be_true
+ page.labelInputField?.should be_false
+ page.itemLabelSpan_element.click
+ # description
+ page.editDescriptionLink?.should be_false
+ page.editDescriptionLinkDisabled?.should be_true
+ page.editDescriptionLinkDisabled_element.click
+ page.wbTooltip?.should be_true
+ page.descriptionInputField?.should be_false
+ end
+ end
+ end
+
+ context "check functionality of protected page" do
it "should be logged out, and check if label/description of protected item could not be edited" do
+ visit_page(LoginPage) do |page|
+ page.logout_user
+ end
on_page(NewItemPage) do |page|
page.navigate_to_item
page.wait_for_item_to_load
- if page.logoutLink? == true
- page.logoutLink
- page.navigate_to_item
- page.wait_for_item_to_load
- end
#label
page.editLabelLink?.should be_false
page.editLabelLinkDisabled?.should be_true

0 comments on commit f741ce8

Please sign in to comment.
Something went wrong with that request. Please try again.