Commit 5c791e55 authored by Alexander Turinske's avatar Alexander Turinske

Fix broken e2e tests for policies page

- fixed tests by adding appropriate getters
- added appropriate page objects
parent 254e70eb
......@@ -14,12 +14,11 @@ module QA
element :new_policy_button
end
def policies_list?
def has_policies_list?
has_element?(:policies_list)
end
def click_new_policy_button
within_element(:policies_container) do
click_element(:new_policy_button)
end
end
......@@ -27,5 +26,4 @@ module QA
end
end
end
end
end
# frozen_string_literal: true
module QA
module EE
module Page
module Project
module Policies
class PolicyEditor < QA::Page::Base
view 'ee/app/assets/javascripts/threat_monitoring/components/policy_editor/policy_editor.vue' do
element :policy_type_form_select
end
def has_policy_type_form_select?
has_element?(:policy_type_form_select)
end
end
end
end
end
end
end
......@@ -26,9 +26,9 @@ module QA
it 'can load Policies page and view the policies list', :smoke, testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1892' do
Page::Project::Menu.perform(&:click_on_policies)
EE::Page::Project::Policies.perform do |policies_list|
EE::Page::Project::Policies::Index.perform do |policies_page|
aggregate_failures do
expect(policies_list).to have_policies_list
expect(policies_page).to have_policies_list
end
end
end
......@@ -36,11 +36,11 @@ module QA
it 'can navigate to Policy Editor page', :smoke, testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1892' do
Page::Project::Menu.perform(&:click_on_policies)
EE::Page::Project::Policies.perform(&:click_new_policy_button)
EE::Page::Project::Policies::Index.perform(&:click_new_policy_button)
EE::Page::Project::Policies.perform do |policy_editor|
EE::Page::Project::Policies::PolicyEditor.perform do |policy_editor|
aggregate_failures do
expect(policies_editor).to have_policy_type_form_select
expect(policy_editor).to have_policy_type_form_select
end
end
end
......
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