Commit d37bee3b authored by Tomislav Nikić's avatar Tomislav Nikić Committed by Dan Davison

Page Object Modifications

Adding a new tag to the wiki directories
on the sidebar and using that in a PO
parent 645cacf4
%li %li{ data: { qa_selector: 'wiki_directory_content' } }
= wiki_directory.slug = wiki_directory.slug
%ul %ul
= render wiki_directory.pages, context: context = render wiki_directory.pages, context: context
...@@ -18,6 +18,10 @@ module QA ...@@ -18,6 +18,10 @@ module QA
base.view 'app/views/shared/wikis/_sidebar_wiki_page.html.haml' do base.view 'app/views/shared/wikis/_sidebar_wiki_page.html.haml' do
element :wiki_page_link element :wiki_page_link
end end
base.view 'app/views/shared/wikis/_wiki_directory.html.haml' do
element :wiki_directory_content
end
end end
def click_clone_repository def click_clone_repository
...@@ -35,6 +39,10 @@ module QA ...@@ -35,6 +39,10 @@ module QA
def has_page_listed?(page_title) def has_page_listed?(page_title)
has_element? :wiki_page_link, page_name: page_title has_element? :wiki_page_link, page_name: page_title
end end
def has_directory?(directory)
has_element? :wiki_directory_content, text: directory
end
end end
end end
end end
......
# frozen_string_literal: true
module QA
RSpec.describe 'Create' do
context 'Wiki' do
let(:initial_wiki) { Resource::Wiki::ProjectPage.fabricate_via_api! }
let(:new_path) { "a/new/path" }
before do
Flow::Login.sign_in
end
it 'has changed the directory' do
initial_wiki.visit!
Page::Project::Wiki::Show.perform(&:click_edit)
Page::Project::Wiki::Edit.perform do |edit|
edit.set_title("#{new_path}/home")
edit.set_message('changing the path of the home page')
end
Page::Project::Wiki::Edit.perform(&:click_save_changes)
Page::Project::Wiki::Show.perform do |wiki|
expect(wiki).to have_directory(new_path)
end
end
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