Permalink
Browse files

cucumber tests

  • Loading branch information...
1 parent 45d8872 commit cd701eb2203ea129885c57d72819f0a2a65fe8ea unknown committed Sep 2, 2012
@@ -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;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;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>
@@ -7,6 +7,6 @@ Feature: Event
When click new event link
And enter event name and details
When I click "Create"
- Then I shall see the new event shown in the list
+ Then I shall see "Event was successfully created."
@@ -1,4 +1,4 @@
-#begin require 'rspec/expectations'; rescue LoadError; require 'spec/expectations'; end
+#begin require 'rspec/expectations'; rescue LoadError; require 'spec/expectations'; end
#require 'cucumber/formatter/unicode'
Given /^I login as "(\w+)" and on Password Change Page$/ do |username|
@@ -8,36 +8,37 @@
home_page.enter_login(username)
home_page.enter_password("test")
home_page.click_login
- @browser.find_element(:link_text, "profile").click
- @browser.find_element(:link_text, "Change password").click
+ @browser.find_element(:id, "user_nav_link").click
+ sleep 0.5
+ @browser.find_element(:id, "profile_link").click
+ @browser.find_element(:link_text, "Change password").click
@password_change_page = PasswordChangePage.new(@browser)
- # @password_change_page = Object.const_get(page_name.gsub(" ","")).new(@browser)
end
-When /^I enter current password "([^"]*)"$/ do |term|
+When /^I enter current password "(.*?)"$/ do |term|
@password_change_page.enter_current term
end
-Then /^I can relogin as "(\w+)" with new password "([^"]*)"$/ do |username, new_pass|
+Then /^I can relogin as "(\w+)" with new password "(.*?)"$/ do |username, new_pass|
logout
home_page = HomePage.new(@browser)
home_page.enter_login(username)
home_page.enter_password(new_pass)
home_page.click_login
- @browser.find_element(:link_text, "profile").click
+ @browser.page_source.include?("Sign in successfully")
end
-Then /^I should get error "([^"]*)"$/ do |message|
+Then /^I should get error "(.*?)"$/ do |message|
assert @browser.page_source.include?(message)
end
-When /^enter new password "([^"]*)"$/ do |new_pass|
- @password_change_page.enter_new new_pass
+When /^enter new password "(.*?)"$/ do |new_pass|
+ @password_change_page.enter_new new_pass
end
-When /^enter confirmation "([^"]*)"$/ do |confirm_password|
+When /^enter confirmation "(.*?)"$/ do |confirm_password|
@password_change_page.enter_confirm(confirm_password)
end
@@ -47,5 +48,7 @@
def logout
- @browser.find_element(:link_text, "logout").click
+ @browser.find_element(:id, "user_nav_link").click
+ sleep 0.5
+ @browser.find_element(:id, "sign_out_link").click
end
@@ -10,7 +10,7 @@
end
When /^click new event link$/ do
- @browser.find_element(:link_text, "EVENTS").click
+ @browser.find_element(:link_text, "Events").click
event_list_page = EventListPage.new(@browser)
@event_page = event_list_page.click_new
end
@@ -26,6 +26,6 @@
@event_page.click_create
end
-Then /^I shall see the new event shown in the list$/ do
- assert @browser.page_source.include?("3 events")
+Then /^I shall see "(.*?)"$/ do |arg1|
+ assert @browser.page_source.include?(arg1)
end
@@ -1,6 +1,10 @@
Given /^I am on Home Page$/ do
- begin; @browser.find_element(:link_text, "logout").click; rescue => e; end
+ begin;
+ @browser.find_element(:id, "user_nav_link").click
+ sleep 0.5
+ @browser.find_element(:id, "sign_out_link").click
+ rescue => e; end
@browser.navigate.to($BASE_URL)
@home_page = HomePage.new(@browser)
end
@@ -9,15 +13,15 @@
@home_page.enter_password(password)
end
-Given /^I have entered userame (\w+) on login page$/ do |username|
- debug("enter user '#{username}'") # showing message in TestWise console
+Given /^I have entered userame (\w+) on login page$/ do |username|
+ # debug("enter user '#{username}'") # showing message in TestWise console
@home_page.enter_login(username)
end
When /^I press '([^"]*)' button$/ do |button_name|
- if button_name == 'Log in'
+ if button_name == 'Sign in'
@home_page.click_login
- end
+ end
end
Then /^the text (.*) should be on the screen$/ do |message|
@@ -4,9 +4,9 @@ Feature: Event
Scenario: I can create a new event
Given I logged in
- When click link "New Event"
+ When click new event link
And enter event name and details
When I click "Create"
- Then I shall see the new event shown in the list
+ Then I shall see "Event was successfully created."
@@ -6,12 +6,12 @@ Feature: Authentication
Given I am on Home Page
And I have entered userame <username> on login page
And I have entered password <password> on login page
- When I press 'Log in' button
+ When I press 'Sign in' button
Then the text <expected_text> should be on the screen
Scenarios:
| username | password | expected_text|
-# | bob | badpass | Invalid email or password.|
- | bob | test | Profile |
- | admin | test | Control Panel|
+ | bob | badpass | Invalid password|
+ | bob | test | Sign in successfully |
+ | admin | test | Manage company|
@@ -11,7 +11,7 @@ def enter_venue(event_venue)
end
def click_create
- browser.find_element(:id, "event_submit").click
+ browser.find_element(:name, "commit").click
end
def enter_presenters(event_presenters)
@@ -7,16 +7,16 @@ def initialize(browser, identity_text='')
end
def enter_password(password)
- browser.find_element(:name, "user[password]").clear
- browser.find_element(:name, "user[password]").send_keys(password)
+ browser.find_element(:name, "password").clear
+ browser.find_element(:name, "password").send_keys(password)
end
def click_login
- browser.find_element(:name, 'user[password]').submit();
+ browser.find_element(:name, 'password').submit();
end
def enter_login(username)
- browser.find_element(:name, "user[username]").send_keys(username)
+ browser.find_element(:name, "username").send_keys(username)
end
end
@@ -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;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;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>
@@ -1,14 +1,17 @@
<?xml version="1.1" encoding="US-ASCII"?>
<project>
<name>watir-webdriver-cucumber</name>
- <default_browser></default_browser>
- <test_framework>Watir</test_framework>
- <syntax_framework>RWebSpec</syntax_framework>
+ <default_browser>Internet Explorer</default_browser>
+ <test_framework>Watir-WebDriver</test_framework>
+ <syntax_framework>Cucumber</syntax_framework>
<environments>
+ <entry name="development" default="true">
+ <base_url>http://localhost</base_url>
+ </entry>
</environments>
<exclude_dirs></exclude_dirs>
- <exclude_files>;tmp_syntax_check.feature;tmp_syntax_check.feature;tmp_syntax_check.feature</exclude_files>
- <test_named_as></test_named_as>
+ <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</exclude_files>
+ <test_named_as>test_suite</test_named_as>
<spec_template></spec_template>
<page_template></page_template>
<storywise_url></storywise_url>

0 comments on commit cd701eb

Please sign in to comment.