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
autoload :Edit, 'qa/page/project/wiki/edit'
autoload :New, 'qa/page/project/wiki/new'
autoload :Show, 'qa/page/project/wiki/show'
autoload :GitAccess, 'qa/page/project/wiki/git_access'
end
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
end
def repository_http_uri
@repository_http_uri ||= begin
wiki.visit!
Page::Project::Wiki::Show.act do
click_clone_repository
choose_repository_clone_http
repository_location.uri
end
end
@repository_http_uri ||= wiki.repository_http_location.uri
end
def repository_ssh_uri
......
......@@ -12,6 +12,15 @@ module QA
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!
project.visit!
......
......@@ -48,14 +48,30 @@ module QA
Page::Project::Menu.perform(&:click_wiki)
# Perform a git push over HTTP at the secondary
Resource::Repository::WikiPush.fabricate! do |push|
# Grab the HTTP URI for the secondary node and store as 'secondary_location'
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.repository_http_uri = secondary_location.uri
push.file_name = 'Home.md'
push.file_content = push_content
push.commit_message = 'Update Home.md'
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
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