From 8f4e0b01d1e83ff768d560d2b2b420c3040390aa Mon Sep 17 00:00:00 2001 From: Etheryte Date: Tue, 24 Oct 2023 11:35:14 +0200 Subject: [PATCH] Update tests to remove Select2 --- .../reference_srv_sync_products_extra.feature | 2 +- .../reposync/srv_sync_products.feature | 2 +- .../srv_dist_channel_mapping.feature | 24 +++++++++---------- .../step_definitions/navigation_steps.rb | 9 ------- .../features/step_definitions/setup_steps.rb | 8 ------- .../manager/admin/setup/products/products.tsx | 2 +- 6 files changed, 15 insertions(+), 32 deletions(-) diff --git a/testsuite/features/reposync/reference_srv_sync_products_extra.feature b/testsuite/features/reposync/reference_srv_sync_products_extra.feature index b79b45084386..02ab0e22a20b 100644 --- a/testsuite/features/reposync/reference_srv_sync_products_extra.feature +++ b/testsuite/features/reposync/reference_srv_sync_products_extra.feature @@ -37,7 +37,7 @@ Feature: Synchronize extra products in the products page of the Setup Wizard When I follow the left menu "Admin > Setup Wizard > Products" And I wait until I do not see "Loading" text And I enter "Ubuntu" as the filtered product description - And I select "amd64-deb" in the dropdown list of the architecture filter + And I select "amd64-deb" from "product-arch-filter" And I wait until I see "Ubuntu 22.04" text And I select "Ubuntu 22.04" as a product Then I should see the "Ubuntu 22.04" selected diff --git a/testsuite/features/reposync/srv_sync_products.feature b/testsuite/features/reposync/srv_sync_products.feature index 3ef6c12dadf6..77b11ab196d6 100644 --- a/testsuite/features/reposync/srv_sync_products.feature +++ b/testsuite/features/reposync/srv_sync_products.feature @@ -18,7 +18,7 @@ Feature: Synchronize products in the products page of the Setup Wizard And I wait until I do not see "Loading" text And I enter "RHEL or SLES ES" as the filtered product description Then I should see a "RHEL or SLES ES or CentOS 8 Base" text - When I select "x86_64" in the dropdown list of the architecture filter + When I select "x86_64" from "product-arch-filter" Then I should see a "RHEL or SLES ES or CentOS 8 Base" text @scc_credentials diff --git a/testsuite/features/secondary/srv_dist_channel_mapping.feature b/testsuite/features/secondary/srv_dist_channel_mapping.feature index 7e18c28439d1..da972ab9d32b 100644 --- a/testsuite/features/secondary/srv_dist_channel_mapping.feature +++ b/testsuite/features/secondary/srv_dist_channel_mapping.feature @@ -25,8 +25,8 @@ Feature: Distribution Channel Mapping Then I should see a "Create Distribution Channel Map" text When I enter "SUSE Linux Enterprise Server 15 SP 4" as "os" And I enter "15.5" as "release" - And I select "x86_64" from "architecture" dropdown - And I select "SLE-Product-SLES15-SP4-Pool for x86_64" from "channel_label" dropdown + And I select "x86_64" from "architecture" + And I select "SLE-Product-SLES15-SP4-Pool for x86_64" from "channel_label" And I click on "Create Mapping" Then I should see a "SUSE Linux Enterprise Server 15 SP 4" link in the content area @@ -37,8 +37,8 @@ Feature: Distribution Channel Mapping Then I should see a "Create Distribution Channel Map" text When I enter "openSUSE Leap 15.5" as "os" And I enter "15.5" as "release" - And I select "x86_64" from "architecture" dropdown - And I select "openSUSE Leap 15.5 (x86_64)" from "channel_label" dropdown + And I select "x86_64" from "architecture" + And I select "openSUSE Leap 15.5 (x86_64)" from "channel_label" And I click on "Create Mapping" Then I should see a "openSUSE Leap 15.5" link in the content area @@ -48,8 +48,8 @@ Feature: Distribution Channel Mapping Then I should see a "Create Distribution Channel Map" text When I enter "Ubuntu 22.04.01 LTS" as "os" And I enter "22.04" as "release" - And I select "x86_64" from "architecture" dropdown - And I select "Fake-Base-Channel" from "channel_label" dropdown + And I select "x86_64" from "architecture" + And I select "Fake-Base-Channel" from "channel_label" And I click on "Create Mapping" Then I should see a "Ubuntu 22.04.01 LTS" link in the content area @@ -60,8 +60,8 @@ Feature: Distribution Channel Mapping Then I should see a "Create Distribution Channel Map" text When I enter "SUSE Linux Enterprise Server 15 SP 4 iSeries" as "os" And I enter "15.5" as "release" - And I select "iSeries" from "architecture" dropdown - And I select "Fake-Base-Channel-i586" from "channel_label" dropdown + And I select "iSeries" from "architecture" + And I select "Fake-Base-Channel-i586" from "channel_label" And I click on "Create Mapping" Then I should see a "SUSE Linux Enterprise Server 15 SP 4 iSeries" link in the content area @@ -75,7 +75,7 @@ Feature: Distribution Channel Mapping When I follow "SUSE Linux Enterprise Server 15 SP 4" Then I should see a "Update Distribution Channel Map" text When I enter "SUSE Linux Enterprise Server 15 SP 4 modified" as "os" - And I select "SLE-Product-SLES15-SP4-Pool for x86_64" from "channel_label" dropdown + And I select "SLE-Product-SLES15-SP4-Pool for x86_64" from "channel_label" And I click on "Update Mapping" Then I should see the text "SUSE Linux Enterprise Server 15 SP 4 modified" in the Operating System field And I should see the text "sle-product-sles15-sp4-pool-x86_64" in the Channel Label field @@ -89,7 +89,7 @@ Feature: Distribution Channel Mapping When I follow "openSUSE Leap 15.5" Then I should see a "Update Distribution Channel Map" text When I enter "openSUSE Leap 15.5 modified" as "os" - And I select "openSUSE Leap 15.5 (x86_64)" from "channel_label" dropdown + And I select "openSUSE Leap 15.5 (x86_64)" from "channel_label" And I click on "Update Mapping" Then I should see the text "openSUSE Leap 15.5 modified" in the Operating System field And I should see the text "opensuse_leap15_5-x86_64" in the Channel Label field @@ -101,7 +101,7 @@ Feature: Distribution Channel Mapping And I should see the text "sle-product-sles15-sp4-pool-x86_64" in the Channel Label field When I follow "Ubuntu 22.04.01 LTS" And I enter "Ubuntu 22.04.01 LTS modified" as "os" - And I select "Fake-Base-Channel" from "channel_label" dropdown + And I select "Fake-Base-Channel" from "channel_label" And I click on "Update Mapping" Then I should see the text "Ubuntu 22.04.01 LTS modified" in the Operating System field And I should see the text "fake-base-channel" in the Channel Label field @@ -114,7 +114,7 @@ Feature: Distribution Channel Mapping And I should see the text "fake-base-channel-i586" in the Channel Label field When I follow "SUSE Linux Enterprise Server 15 SP 4 iSeries" And I enter "SUSE Linux Enterprise Server 15 SP 4 iSeries modified" as "os" - And I select "Fake-Base-Channel-Debian-like" from "channel_label" dropdown + And I select "Fake-Base-Channel-Debian-like" from "channel_label" And I click on "Update Mapping" Then I should see the text "SUSE Linux Enterprise Server 15 SP 4 iSeries modified" in the Operating System field And I should see the text "fake-base-channel-debian-like" in the Channel Label field diff --git a/testsuite/features/step_definitions/navigation_steps.rb b/testsuite/features/step_definitions/navigation_steps.rb index b4d11f32ae23..1ff5f536ec79 100644 --- a/testsuite/features/step_definitions/navigation_steps.rb +++ b/testsuite/features/step_definitions/navigation_steps.rb @@ -192,15 +192,6 @@ end end -# select an item from any dropdown -When(/^I select "(.*?)" from "([^"]*)" dropdown/) do |selection, label| - # let the the select2js box filter open the hidden options - xpath_query = "//select[@name='#{label}']" - raise "xpath: #{xpath_query} not found" unless find(:xpath, xpath_query).click - # select the desired option - raise "#{label} #{selection} not found" unless find(:xpath, "//select[@name='#{label}']/option[contains(text(), '#{selection}')]").click -end - When(/^I select the parent channel for the "([^"]*)" from "([^"]*)"$/) do |client, from| product_key = $is_container_provider ? 'Fake' : product select(BASE_CHANNEL_BY_CLIENT[product_key][client], from: from, exact: false) diff --git a/testsuite/features/step_definitions/setup_steps.rb b/testsuite/features/step_definitions/setup_steps.rb index 89a0cc481f9d..6c0beb85c1b5 100644 --- a/testsuite/features/step_definitions/setup_steps.rb +++ b/testsuite/features/step_definitions/setup_steps.rb @@ -72,14 +72,6 @@ end end -When(/^I select "(.*?)" in the dropdown list of the architecture filter$/) do |architecture| - # let the the select2js box filter open the hidden options - xpath_query = '//div[@id=\'s2id_product-arch-filter\']/ul/li/input' - raise "xpath: #{xpath_query} not found" unless find(:xpath, xpath_query).click - # select the desired option - raise "Architecture #{architecture} not found" unless find(:xpath, "//div[@id='select2-drop']/ul/li/div[contains(text(), '#{architecture}')]").click -end - When(/^I (deselect|select) "([^\"]*)" as a product$/) do |select, product| # click on the checkbox to select the product xpath = "//span[contains(text(), '#{product}')]/ancestor::div[contains(@class, 'product-details-wrapper')]/div/input[@type='checkbox']" diff --git a/web/html/src/manager/admin/setup/products/products.tsx b/web/html/src/manager/admin/setup/products/products.tsx index ac2931820e93..1cc3770e91e2 100644 --- a/web/html/src/manager/admin/setup/products/products.tsx +++ b/web/html/src/manager/admin/setup/products/products.tsx @@ -555,7 +555,7 @@ class Products extends React.Component { {/* TODO: Remove this
wrapper once https://github.com/SUSE/spacewalk/issues/14250 is implemented */}