Commit 83ccd0c2 authored by Tiffany Rea's avatar Tiffany Rea

Merge branch '357112-enable-license-compliance-qa-test-ff' into 'master'

Support license compliance feature flag in qa test

See merge request gitlab-org/gitlab!84206
parents 5a279697 867a00d7
...@@ -31,11 +31,11 @@ module QA ...@@ -31,11 +31,11 @@ module QA
end end
end end
def approve_license(license) def approve_license(license, selector = :approved_license_radio)
click_element(:license_add_button) click_element(:license_add_button)
expand_select_list expand_select_list
search_and_select_exact(license) search_and_select_exact(license)
choose_element(:approved_license_radio, true) choose_element(selector, true)
click_element(:add_license_submit_button) click_element(:add_license_submit_button)
has_approved_license?(license) has_approved_license?(license)
...@@ -48,11 +48,11 @@ module QA ...@@ -48,11 +48,11 @@ module QA
end end
end end
def deny_license(license) def deny_license(license, selector = :blacklisted_license_radio)
click_element(:license_add_button) click_element(:license_add_button)
expand_select_list expand_select_list
search_and_select_exact(license) search_and_select_exact(license)
choose_element(:blacklisted_license_radio, true) choose_element(selector, true)
click_element(:add_license_submit_button) click_element(:add_license_submit_button)
has_denied_license?(license) has_denied_license?(license)
......
# frozen_string_literal: true # frozen_string_literal: true
module QA module QA
RSpec.describe 'Secure', :runner do RSpec.describe 'Secure', :runner, :requires_admin do
describe 'License Compliance' do describe 'License Compliance' do
before(:all) do before(:all) do
@project = Resource::Project.fabricate_via_api! do |project| @project = Resource::Project.fabricate_via_api! do |project|
...@@ -60,8 +60,12 @@ module QA ...@@ -60,8 +60,12 @@ module QA
Page::Project::Menu.perform(&:click_on_license_compliance) Page::Project::Menu.perform(&:click_on_license_compliance)
EE::Page::Project::Secure::LicenseCompliance.perform do |license_compliance| EE::Page::Project::Secure::LicenseCompliance.perform do |license_compliance|
license_compliance.open_tab license_compliance.open_tab
license_compliance.approve_license(approved_license_name)
license_compliance.deny_license(denied_license_name) selector = Runtime::Feature.enabled?(:lc_remove_legacy_approval_status) ? :allowed_license_radio : :approved_license_radio
license_compliance.approve_license(approved_license_name, selector)
selector = Runtime::Feature.enabled?(:lc_remove_legacy_approval_status) ? :denied_license_radio : :blacklisted_license_radio
license_compliance.deny_license(denied_license_name, selector)
end end
end end
......
...@@ -8,14 +8,10 @@ module QA ...@@ -8,14 +8,10 @@ module QA
let(:executor) { "qa-runner-#{Time.now.to_i}" } let(:executor) { "qa-runner-#{Time.now.to_i}" }
after do after do
Runtime::Feature.enable(:lc_remove_legacy_approval_status) if @feature_was_enabled
@runner.remove_via_api! @runner.remove_via_api!
end end
before do before do
@feature_was_enabled = Runtime::Feature.enabled?(:lc_remove_legacy_approval_status)
Runtime::Feature.disable(:lc_remove_legacy_approval_status)
Flow::Login.sign_in Flow::Login.sign_in
@project = Resource::Project.fabricate_via_api! do |project| @project = Resource::Project.fabricate_via_api! do |project|
...@@ -115,8 +111,12 @@ module QA ...@@ -115,8 +111,12 @@ module QA
EE::Page::Project::Secure::LicenseCompliance.perform do |license_compliance| EE::Page::Project::Secure::LicenseCompliance.perform do |license_compliance|
license_compliance.open_tab license_compliance.open_tab
license_compliance.approve_license approved_license_name
license_compliance.deny_license denied_license_name selector = Runtime::Feature.enabled?(:lc_remove_legacy_approval_status) ? :allowed_license_radio : :approved_license_radio
license_compliance.approve_license(approved_license_name, selector)
selector = Runtime::Feature.enabled?(:lc_remove_legacy_approval_status) ? :denied_license_radio : :blacklisted_license_radio
license_compliance.deny_license(denied_license_name, selector)
end end
@merge_request.visit! @merge_request.visit!
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment