From 7833bf3eb06bd1751991db51cc29151602a5b7f8 Mon Sep 17 00:00:00 2001 From: Maxime Noel Date: Wed, 20 Dec 2023 15:34:04 +1300 Subject: [PATCH 1/2] backport BV stability improvement --- .../smoke_tests/smoke_tests.template | 17 +++++++++++++++++ .../features/step_definitions/common_steps.rb | 2 +- .../step_definitions/navigation_steps.rb | 2 +- .../features/step_definitions/setup_steps.rb | 14 ++++++++++---- testsuite/features/support/env.rb | 2 +- 5 files changed, 30 insertions(+), 7 deletions(-) diff --git a/testsuite/features/build_validation/smoke_tests/smoke_tests.template b/testsuite/features/build_validation/smoke_tests/smoke_tests.template index 5669a4c6b0da..22beb809dace 100644 --- a/testsuite/features/build_validation/smoke_tests/smoke_tests.template +++ b/testsuite/features/build_validation/smoke_tests/smoke_tests.template @@ -35,7 +35,9 @@ Feature: Smoke tests for @skip_for_debianlike Scenario: Install a patch on the When I follow "Software" in the content area + And I wait until I see "Upgrade Packages" text And I follow "Patches" in the content area + When I wait until I see "Relevant Patches" text And I select "Non-Critical" from "type" And I click on "Show" When I check the first patch in the list @@ -48,7 +50,9 @@ Feature: Smoke tests for @skip_for_sle_micro_ssh_minion Scenario: Install a package on the When I follow "Software" in the content area + And I wait until I see "Upgrade Packages" text And I follow "Install" + And I wait until I see "Installable Packages" text And I enter the package for "" as the filtered package name And I click on the filter button And I check the package for "" in the list @@ -61,6 +65,7 @@ Feature: Smoke tests for @skip_for_sle_micro_ssh_minion Scenario: Remove package from When I follow "Software" in the content area + And I wait until I see "Upgrade Packages" text And I follow "List / Remove" And I enter the package for "" as the filtered package name And I click on the filter button @@ -87,20 +92,26 @@ Feature: Smoke tests for Scenario: Check that Software package refresh works on a Given I am on the Systems overview page of this "" When I follow "Software" in the content area + And I wait until I see "Upgrade Packages" text And I click on "Update Package List" And I wait until event "Package List Refresh scheduled by admin" is completed Scenario: Check that Hardware Refresh button works on a When I follow "Details" in the content area + And I wait until I see "System Status" text And I follow "Hardware" + And I wait until I see "Refresh Hardware List" text And I click on "Schedule Hardware Refresh" Then I should see a "You have successfully scheduled a hardware profile refresh" text And I wait until event "Hardware List Refresh scheduled by admin" is completed Scenario: Subscribe a to the configuration channel When I follow "Configuration" in the content area + And I wait until I see "Configuration Overview" text And I follow "Manage Configuration Channels" in the content area + And I wait until I see "centrally-managed configuration" text And I follow first "Subscribe to Channels" in the content area + And I wait until I see "Select Channels for Subscription" text And I check "Mixed Channel" in the list And I click on "Continue" And I click on "Update Channel Rankings" @@ -109,8 +120,11 @@ Feature: Smoke tests for Scenario: Deploy the configuration file to And I follow the left menu "Configuration > Channels" + And I wait until I see "Centrally Managed Configuration Channel" text And I follow "Mixed Channel" + And I wait until I see "Channel Properties" text And I follow "Deploy all configuration files to selected subscribed systems" + And I wait until I see "Select Systems for Deployment" text And I enter the hostname of "" as the filtered system name And I click on the filter button And I check the "" client @@ -135,8 +149,11 @@ Feature: Smoke tests for @skip_for_sle_micro # The client tools of SLE Micro (intentionally) do not contain spacecmd Scenario: Install spacecmd from the client tools on the + Given I am on the Systems overview page of this "" When I follow "Software" in the content area + And I wait until I see "Upgrade Packages" text And I follow "Install" + And I wait until I see "Installable Packages" text And I enter "spacecmd" as the filtered package name And I click on the filter button And I check "spacecmd" in the list diff --git a/testsuite/features/step_definitions/common_steps.rb b/testsuite/features/step_definitions/common_steps.rb index 61889612503c..498c4a90251d 100644 --- a/testsuite/features/step_definitions/common_steps.rb +++ b/testsuite/features/step_definitions/common_steps.rb @@ -173,7 +173,7 @@ end When(/^I wait at most (\d+) seconds until event "([^"]*)" is completed$/) do |final_timeout, event| - step %(I wait 90 seconds until the event is picked up and #{final_timeout} seconds until the event "#{event}" is completed) + step %(I wait 180 seconds until the event is picked up and #{final_timeout} seconds until the event "#{event}" is completed) end When(/^I wait until I see the event "([^"]*)" completed during last minute, refreshing the page$/) do |event| diff --git a/testsuite/features/step_definitions/navigation_steps.rb b/testsuite/features/step_definitions/navigation_steps.rb index 71f318f347b6..b741b8286e50 100644 --- a/testsuite/features/step_definitions/navigation_steps.rb +++ b/testsuite/features/step_definitions/navigation_steps.rb @@ -582,7 +582,7 @@ Then(/^I should be logged in$/) do xpath_query = '//a[@href=\'/rhn/Logout.do\']' # Check if the user is logged in, using the specified wait_time - raise ScriptError, 'User is not logged in' unless has_selector?(:xpath, xpath_query, wait: Capybara.default_max_wait_time * 2) + raise ScriptError, 'User is not logged in' unless has_selector?(:xpath, xpath_query, wait: Capybara.default_max_wait_time * 3) end Then(/^I am logged in$/) do diff --git a/testsuite/features/step_definitions/setup_steps.rb b/testsuite/features/step_definitions/setup_steps.rb index 495beeb3a477..9fe16dac07ac 100644 --- a/testsuite/features/step_definitions/setup_steps.rb +++ b/testsuite/features/step_definitions/setup_steps.rb @@ -199,10 +199,17 @@ When I follow the left menu "Systems > System List > All" And I wait until I see the name of "#{host}", refreshing the page And I follow this "#{host}" link - And I wait 180 seconds until the event is picked up and 500 seconds until the event "Apply states" is completed - And I wait 180 seconds until the event is picked up and 500 seconds until the event "Hardware List Refresh" is completed - And I wait 180 seconds until the event is picked up and 500 seconds until the event "Package List Refresh" is completed + And I wait until I see "System Status" text ) + if get_client_type(host) == 'traditional' and is_salt.empty? + get_target(host).run('rhn_check -vvv') + else + steps %( + And I wait 180 seconds until the event is picked up and #{DEFAULT_TIMEOUT} seconds until the event "Apply states" is completed + And I wait 180 seconds until the event is picked up and #{DEFAULT_TIMEOUT} seconds until the event "Hardware List Refresh" is completed + And I wait 180 seconds until the event is picked up and #{DEFAULT_TIMEOUT} seconds until the event "Package List Refresh" is completed + ) + end end Then(/^I should see "([^"]*)" via spacecmd$/) do |host| @@ -212,7 +219,6 @@ get_target('server').run('spacecmd -u admin -p admin clear_caches') result, _code = get_target('server').run(command, check_errors: false, verbose: true) break if result.include? system_name - sleep 1 end end diff --git a/testsuite/features/support/env.rb b/testsuite/features/support/env.rb index 987fd8f6660d..aef72dbe1d9e 100644 --- a/testsuite/features/support/env.rb +++ b/testsuite/features/support/env.rb @@ -77,7 +77,7 @@ def capybara_register_driver Capybara.register_driver(:headless_chrome) do |app| client = Selenium::WebDriver::Remote::Http::Default.new # WORKAROUND failure at Scenario: Test IPMI functions: increase from 60 s to 180 s - client.read_timeout = 180 + client.read_timeout = 240 # Chrome driver options chrome_options = %w[no-sandbox disable-dev-shm-usage ignore-certificate-errors disable-gpu window-size=2048,2048 js-flags=--max_old_space_size=2048] chrome_options << 'headless' unless $debug_mode From bfd3502ff5c64dcd195d410c354ced2b4ddf0645 Mon Sep 17 00:00:00 2001 From: Maxime Noel Date: Thu, 21 Dec 2023 09:44:42 +1300 Subject: [PATCH 2/2] RUBOCOP --- testsuite/features/step_definitions/setup_steps.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/testsuite/features/step_definitions/setup_steps.rb b/testsuite/features/step_definitions/setup_steps.rb index 9fe16dac07ac..8127d959d96d 100644 --- a/testsuite/features/step_definitions/setup_steps.rb +++ b/testsuite/features/step_definitions/setup_steps.rb @@ -201,7 +201,7 @@ And I follow this "#{host}" link And I wait until I see "System Status" text ) - if get_client_type(host) == 'traditional' and is_salt.empty? + if get_client_type(host) == 'traditional' && is_salt.empty? get_target(host).run('rhn_check -vvv') else steps %( @@ -219,6 +219,7 @@ get_target('server').run('spacecmd -u admin -p admin clear_caches') result, _code = get_target('server').run(command, check_errors: false, verbose: true) break if result.include? system_name + sleep 1 end end