From cbc0b0a84969a8f931e2bf7441b7cd293e09065e Mon Sep 17 00:00:00 2001 From: Luke Hudson Date: Tue, 4 May 2010 22:30:26 +0000 Subject: [PATCH] MINOR: Tweaks to ModelAdmin tabs HTML, and salad tests git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.4@104078 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- templates/Includes/ModelAdmin_left.ss | 4 ++-- tests/salad/step_definitions/general.rb | 17 ++++++++++++++++- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/templates/Includes/ModelAdmin_left.ss b/templates/Includes/ModelAdmin_left.ss index 006ba86d..3503eca5 100755 --- a/templates/Includes/ModelAdmin_left.ss +++ b/templates/Includes/ModelAdmin_left.ss @@ -6,7 +6,7 @@ <% if SearchClassSelector = tabs %> <% end_if %> @@ -28,4 +28,4 @@ <% end_control %> - \ No newline at end of file + diff --git a/tests/salad/step_definitions/general.rb b/tests/salad/step_definitions/general.rb index 487769fc..994689bf 100644 --- a/tests/salad/step_definitions/general.rb +++ b/tests/salad/step_definitions/general.rb @@ -2,8 +2,23 @@ ## 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| - Given "I click the \"tab-Root_Content_set_#{tab}\" link" + 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