Commit 0d52bf56 authored by Andrejs Cunskis's avatar Andrejs Cunskis

Merge branch '346162-update-policy-smoke-test' into 'master'

Update policy selection page to have qa selector

See merge request gitlab-org/gitlab!84399
parents 6bf24d00 517c4974
......@@ -74,7 +74,10 @@ export default {
};
</script>
<template>
<div class="gl-display-grid gl-md-grid-template-columns-2 gl-gap-6">
<div
class="gl-display-grid gl-md-grid-template-columns-2 gl-gap-6"
data-qa-selector="policy_selection_wizard"
>
<gl-card
v-for="option in $options.policies"
:key="option.title"
......
......@@ -10,8 +10,13 @@ module QA
element :policy_type_form_select
end
def has_policy_type_form_select?
has_element?(:policy_type_form_select)
# Switch to just this when removing the :container_security_policy_selection feature flag
view 'ee/app/assets/javascripts/threat_monitoring/components/policy_editor/policy_selection.vue' do
element :policy_selection_wizard
end
def has_policy_selection?(selector)
has_element?(selector)
end
end
end
......
......@@ -17,7 +17,10 @@ module QA
project.remove_via_api!
end
context 'without k8s cluster' do
# TODO: Remove :requires_admin when the `Runtime::Feature.enable` method call is removed
context 'without k8s cluster', :requires_admin do
let!(:feature_enabled) { Runtime::Feature.enabled?(:container_security_policy_selection)}
before do
Flow::Login.sign_in
project.visit!
......@@ -40,13 +43,15 @@ module QA
EE::Page::Project::Policies::PolicyEditor.perform do |policy_editor|
aggregate_failures do
expect(policy_editor).to have_policy_type_form_select
# TODO: Remove the selector conditional when the `Runtime::Feature.enable` method call is removed
selector = feature_enabled ? :policy_selection_wizard : :policy_type_form_select
expect(policy_editor).to have_policy_selection(selector)
end
end
end
end
context 'with k8s cluster', :require_admin, :kubernetes, :orchestrated, :runner, quarantine: { issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/335202', type: :broken } do
context 'with k8s cluster', :requires_admin, :kubernetes, :orchestrated, :runner, quarantine: { issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/335202', type: :broken } do
let(:policy_name) { 'l3-rule' }
let!(:cluster) { Service::KubernetesCluster.new(provider_class: Service::ClusterProvider::K3sCilium).create! }
let!(:runner) do
......
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