Skip to content

Commit

Permalink
update watir-rspec with new UI changes
Browse files Browse the repository at this point in the history
  • Loading branch information
unknown authored and unknown committed Jul 3, 2012
1 parent 99dc4d8 commit e4e5838
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 24 deletions.
2 changes: 1 addition & 1 deletion watir-cucumber/adminwise-watir-cucumber.tpr
Expand Up @@ -22,7 +22,7 @@
</entry>
</environments>
<exclude_dirs></exclude_dirs>
<exclude_files>;tmp_syntax_check.feature;tmp_syntax_check.feature;tmp_syntax_check.feature;tmp_syntax_check.feature;tmp_syntax_check.feature;tmp_syntax_check.feature;tmp_syntax_check.feature;tmp_syntax_check.feature;tmp_syntax_check.feature;tmp_syntax_check.feature;tmp_syntax_check.feature;tmp_syntax_check.feature;tmp_syntax_check.feature;tmp_syntax_check.feature;tmp_syntax_check.feature;tmp_syntax_check.feature;tmp_syntax_check.feature;tmp_syntax_check.feature;tmp_syntax_check.feature;tmp_syntax_check.feature;tmp_syntax_check.feature;tmp_syntax_check.feature;tmp_syntax_check.feature;tmp_syntax_check.feature</exclude_files>
<exclude_files>;tmp_syntax_check.feature;tmp_syntax_check.feature;tmp_syntax_check.feature;tmp_syntax_check.feature;tmp_syntax_check.feature;tmp_syntax_check.feature;tmp_syntax_check.feature;tmp_syntax_check.feature;tmp_syntax_check.feature;tmp_syntax_check.feature;tmp_syntax_check.feature;tmp_syntax_check.feature;tmp_syntax_check.feature;tmp_syntax_check.feature;tmp_syntax_check.feature;tmp_syntax_check.feature;tmp_syntax_check.feature;tmp_syntax_check.feature;tmp_syntax_check.feature;tmp_syntax_check.feature;tmp_syntax_check.feature;tmp_syntax_check.feature;tmp_syntax_check.feature;tmp_syntax_check.feature;tmp_syntax_check.feature;tmp_syntax_check.feature;tmp_syntax_check.feature;tmp_syntax_check.feature;tmp_syntax_check.feature;tmp_syntax_check.feature;tmp_syntax_check.feature;tmp_syntax_check.feature;tmp_syntax_check.feature;tmp_syntax_check.feature;tmp_syntax_check.feature</exclude_files>
<test_named_as>test_suite</test_named_as>
<spec_template></spec_template>
<page_template></page_template>
Expand Down
4 changes: 2 additions & 2 deletions watir-rspec/adminwise-watir-rspec.tpr
Expand Up @@ -8,13 +8,13 @@
<entry name="dev" default="false">
<base_url>http://10.0.0.3:3000</base_url>
</entry>
<entry name="development" default="true">
<entry name="development" default="false">
<base_url>http://localhost:3000</base_url>
</entry>
<entry name="special" default="false">
<base_url>http://adminwise.macmini</base_url>
</entry>
<entry name="test" default="false">
<entry name="test" default="true">
<base_url>http://adminwise.herokuapp.com</base_url>
</entry>
</environments>
Expand Down
8 changes: 4 additions & 4 deletions watir-rspec/create_user_test.rb
Expand Up @@ -15,9 +15,9 @@

it "[482] Create new user, then login" do
login_as("admin")
@browser.link(:text, "Control Panel").click
@browser.link(:text, "Manage Users").click
@browser.link(:text, "Add new user").click
@browser.link(:text, "Administration").click
@browser.link(:text, "Manage users").click
@browser.link(:text, "Add user").click

create_user_page = CreateUserPage.new(@browser)
create_user_page.enter_username("mike")
Expand All @@ -28,7 +28,7 @@

logout
login_as("mike", "pass")
assert_link_present_with_text("Logout") # checkpoint: login sucessuflly
logout
end

end
7 changes: 3 additions & 4 deletions watir-rspec/membership_test.rb
Expand Up @@ -16,7 +16,7 @@
end

before(:each) do
visit "/home"
visit "/home"
end

it "Admin user can search an existing member by surname " do
Expand Down Expand Up @@ -44,9 +44,8 @@
membership_page.enter_phone("33440566")
membership_page.enter_mobile("0411231764")
membership_page.enter_email("cindy@agileway.com.au")
membership_page.click_member_type("family_1")
membership_page.select_member_type("Family")
membership_page.click_mail_out("true")
membership_page.click_doing_aba("true")
membership_page.select_aware_from("family/ friend")
membership_page.click_create_member
membership_page.click_membership
Expand All @@ -65,7 +64,7 @@
membership_page.enter_postcode("4054")
membership_page.enter_phone("3972 5844")
membership_page.enter_email("mwind@carelink.com.au")
membership_page.click_member_type("school")
membership_page.select_member_type("School/Organisation")
membership_page.select_aware_from("conference/ workshop")
membership_page.click_create_member
membership_page.click_membership
Expand Down
8 changes: 4 additions & 4 deletions watir-rspec/pages/create_user_page.rb
Expand Up @@ -5,18 +5,18 @@ def initialize(driver)
end

def enter_username(username)
browser.text_field(:name, "username").set username
browser.text_field(:name, "user[username]").set username
end

def enter_email(email)
browser.text_field(:name, "email").set email
browser.text_field(:name, "user[email]").set email
end

def enter_password(password)
browser.text_field(:name, "password").set password
browser.text_field(:name, "user[password]").set password
end

def click_create
browser.button(:value, "Create User").click
browser.button(:value, "Create").click
end
end
2 changes: 1 addition & 1 deletion watir-rspec/pages/event_page.rb
Expand Up @@ -23,7 +23,7 @@ def enter_date(event_date_from)
end

def click_update
browser.button(:value, "Update").click
browser.button(:value, "Save").click
end

def enter_name(name)
Expand Down
6 changes: 3 additions & 3 deletions watir-rspec/pages/membership_page.rb
Expand Up @@ -44,8 +44,8 @@ def enter_email(member_email)
browser.text_field(:name, "member[email]").set member_email
end

def click_member_type(member_member_type)
browser.radio(:name => "member[member_type]", :value => member_member_type).set
def select_member_type(member_member_type)
browser.select_list(:name, "member[member_type]").select member_member_type
end

def click_mail_out(member_mail_out)
Expand All @@ -61,7 +61,7 @@ def select_aware_from(member_aware_from)
end

def click_create_member
browser.button(:value, "Create Member").click
browser.button(:value, "Create").click
end

def click_membership
Expand Down
10 changes: 7 additions & 3 deletions watir-rspec/profile_test.rb
Expand Up @@ -16,23 +16,27 @@

it "[481] User can change password", :tag => "must" do
login_as("bob", "test")
@browser.link(:text, "Profile").click
@browser.link(:id, "user_nav_link").click;
sleep 0.5
@browser.link(:id, "profile_link").click;

@browser.link(:text, "Change password").click

password_change_page = PasswordChangePage.new(@browser)
password_change_page = PasswordChangePage.new(@browser)
password_change_page.enter_current("test")
password_change_page.enter_new("newpass")
password_change_page.enter_confirm("newpass2")
password_change_page.click_change

@browser.text.should include("Password doesn't match confirmation")
password_change_page.enter_current("test")
password_change_page.enter_new("newpass")
password_change_page.enter_confirm("newpass")
password_change_page.click_change

logout
login_as("bob", "newpass")
assert_link_present_with_text("Profile") # login Ok
@browser.text.should include("Sign in successfully")
end

end
7 changes: 5 additions & 2 deletions watir-rspec/test_helper.rb
Expand Up @@ -13,7 +13,6 @@

Watir::Browser.default = 'ie'


$BASE_URL = ENV['ADMINWISE_URL'] || "http://adminwise.herokuapp.com"
#localhost:2800"
#$BASE_URL = "http://demo.adminwise.com"
Expand All @@ -40,7 +39,11 @@ def login_as(username, password = "test")
alias login login_as

def logout
begin; @browser.link(:text, "Logout").click; rescue => e; end
begin;
@browser.link(:id, "user_nav_link").click;
sleep 0.5
@browser.link(:id, "sign_out_link").click;
rescue => e; end
end


Expand Down

0 comments on commit e4e5838

Please sign in to comment.