From 4999699d7614f214eb8718b85c5c30e9fb382c23 Mon Sep 17 00:00:00 2001 From: Manoj Date: Fri, 17 Jul 2015 14:39:04 -0400 Subject: [PATCH] 6652-Added tests for the system menu and each of the pages in the dropdown menu. --- .../test/integration/system_menu_test.rb | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 apps/workbench/test/integration/system_menu_test.rb diff --git a/apps/workbench/test/integration/system_menu_test.rb b/apps/workbench/test/integration/system_menu_test.rb new file mode 100644 index 0000000000..7e67b1b2cd --- /dev/null +++ b/apps/workbench/test/integration/system_menu_test.rb @@ -0,0 +1,42 @@ +require 'integration_helper' + +class SystemMenuTest < ActionDispatch::IntegrationTest + # These tests don't do state-changing API calls. Save some time by + # skipping the database reset. + reset_api_fixtures :after_each_test, false + reset_api_fixtures :after_suite, true + + setup do + need_javascript + end + + [ + #['Repositories','repository','Attributes'], Fails due to #6652 + ['Virtual machines','virtual machine','current_user_logins'], + ['SSH keys','authorized key','public_key'], + ['Links','link','link_class'], + ['Groups','group','group_class'], + ['Compute nodes','node','info[ping_secret'], + ['Keep services','keep service','service_ssl_flag'], + ['Keep disks', 'keep disk','bytes_free'], + ].each do |page_name, add_button_text, look_for| + + test "test system menu #{page_name} link" do + visit page_with_token('admin') + within('.navbar-fixed-top') do + page.find("#system-menu").click + within('.dropdown-menu') do + assert_selector 'a', text: page_name + find('a', text: page_name).click + end + end + + # click the add button + assert_selector 'button', text: "Add a new #{add_button_text}" + find('button', text: "Add a new #{add_button_text}").click + + # look for unique property in the created object page + assert page.has_text? look_for + end + end +end -- 2.30.2