Commit 52b670cf authored by Dan Davison's avatar Dan Davison

Merge branch 'qa-update-wiki-http-2ndry-spec' into 'master'

Correct push target for Geo E2E wiki push to secondary test

See merge request gitlab-org/gitlab!16580
parents 3f734b69 296f9d6f
...@@ -275,6 +275,7 @@ module QA ...@@ -275,6 +275,7 @@ module QA
autoload :Edit, 'qa/page/project/wiki/edit' autoload :Edit, 'qa/page/project/wiki/edit'
autoload :New, 'qa/page/project/wiki/new' autoload :New, 'qa/page/project/wiki/new'
autoload :Show, 'qa/page/project/wiki/show' autoload :Show, 'qa/page/project/wiki/show'
autoload :GitAccess, 'qa/page/project/wiki/git_access'
end end
module WebIDE module WebIDE
......
# frozen_string_literal: true
module QA
module Page
module Project
module Wiki
class GitAccess < Page::Base
include Page::Component::LegacyClonePanel
end
end
end
end
end
...@@ -21,14 +21,7 @@ module QA ...@@ -21,14 +21,7 @@ module QA
end end
def repository_http_uri def repository_http_uri
@repository_http_uri ||= begin @repository_http_uri ||= wiki.repository_http_location.uri
wiki.visit!
Page::Project::Wiki::Show.act do
click_clone_repository
choose_repository_clone_http
repository_location.uri
end
end
end end
def repository_ssh_uri def repository_ssh_uri
......
...@@ -12,6 +12,15 @@ module QA ...@@ -12,6 +12,15 @@ module QA
end end
end end
attribute :repository_http_location do
Page::Project::Wiki::Show.perform(&:click_clone_repository)
Page::Project::Wiki::GitAccess.perform do |git_access|
git_access.choose_repository_clone_http
git_access.repository_location
end
end
def fabricate! def fabricate!
project.visit! project.visit!
......
...@@ -48,14 +48,30 @@ module QA ...@@ -48,14 +48,30 @@ module QA
Page::Project::Menu.perform(&:click_wiki) Page::Project::Menu.perform(&:click_wiki)
# Perform a git push over HTTP at the secondary # Grab the HTTP URI for the secondary node and store as 'secondary_location'
Resource::Repository::WikiPush.fabricate! do |push| Page::Project::Wiki::Show.perform do |show|
show.wait_for_repository_replication
show.click_clone_repository
end
secondary_location = Page::Project::Wiki::GitAccess.perform do |git_access|
git_access.choose_repository_clone_http
git_access.repository_location
end
# Perform a git push over HTTP to the secondary node
push = Resource::Repository::WikiPush.fabricate! do |push|
push.wiki = wiki push.wiki = wiki
push.repository_http_uri = secondary_location.uri
push.file_name = 'Home.md' push.file_name = 'Home.md'
push.file_content = push_content push.file_content = push_content
push.commit_message = 'Update Home.md' push.commit_message = 'Update Home.md'
end end
# Check that the git cli produces the 'warning: redirecting to..(primary node)' output
primary_uri = wiki.repository_http_location.uri
expect(push.output).to match(/warning: redirecting to #{primary_uri.to_s}/)
# Validate git push worked and new content is visible # Validate git push worked and new content is visible
Page::Project::Menu.perform(&:click_wiki) Page::Project::Menu.perform(&:click_wiki)
......
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