mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
cbc0b0a849
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.4@104078 467b73ca-7a2a-4603-9d3b-597d59a354a9
41 lines
1.1 KiB
Ruby
41 lines
1.1 KiB
Ruby
##
|
|
## General rules for the SilverStripe CMS as a whole. They mostly have to do with the LeftAndMain
|
|
## interface
|
|
|
|
# Match general CMS tabs, ModelAdmin needs another system
|
|
Given /I click on the "([^\"]*)" tab/ do |tab|
|
|
found = nil
|
|
links = @salad.browser.links()
|
|
links.each {|link|
|
|
if /^tab-.+/.match(link.id) then
|
|
if link.innerText == tab or /^tab-.*#{tab}(_set)?/.match(link.id) then
|
|
found = link
|
|
break
|
|
end
|
|
end
|
|
}
|
|
if found then
|
|
Given "I click the \"#{found.id}\" link"
|
|
else
|
|
fail("Could not find the \"#{tab}\" tab")
|
|
end
|
|
end
|
|
|
|
Given /I wait for a status message/ do
|
|
Watir::Waiter::wait_until {
|
|
@browser.p(:id, 'statusMessage').exists? && @browser.p(:id, 'statusMessage').visible?
|
|
}
|
|
end
|
|
|
|
Given /I wait for a success message/ do
|
|
# We have to wait until after messages of the form 'Saving...', to get either a good message or
|
|
# a bad message
|
|
Watir::Waiter::wait_until {
|
|
@browser.p(:id, 'statusMessage').exists? && @browser.p(:id, 'statusMessage').visible? && @browser.p(:id, 'statusMessage').class_name != ""
|
|
}
|
|
|
|
@browser.p(:id, 'statusMessage').class_name.should == 'good'
|
|
end
|
|
|
|
|