Commit 90f05d39 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Test Geo repository replication in QA test scenario

parent 972c7158
......@@ -72,6 +72,7 @@ module QA
end
module Dashboard
autoload :Projects, 'qa/page/dashboard/projects'
autoload :Groups, 'qa/page/dashboard/groups'
end
......
......@@ -24,10 +24,10 @@ module QA
enable_hashed_storage
set_replication_password
set_primary_node
add_secondary_node
end
Geo::Secondary.act { replicate_database }
Geo::Primary.act { add_secondary_node }
end
Specs::Runner.perform do |specs|
......@@ -108,6 +108,9 @@ module QA
end
puts 'Waiting until secondary node services are restarted ...'
# TODO, use Capybara helper to wait for HTTP status 200 on secondary
#
sleep 60
end
end
......
module QA
module Page
module Dashboard
class Projects < Page::Base
def go_to_project(name)
find_link(text: name).click
end
end
end
end
end
......@@ -7,7 +7,10 @@ module QA
end
def go_to_projects
within_top_menu { click_link 'Projects' }
within_top_menu do
click_link 'Projects'
click_link 'Your projects'
end
end
def go_to_admin_area
......
......@@ -14,6 +14,10 @@ module QA
find('#project_clone').value
end
def project_name
find('.project-title').text
end
def wait_for_push
sleep 5
end
......
......@@ -9,6 +9,9 @@ module QA
scenario.description = 'Geo test project'
end
geo_project_name = Page::Project::Show.act { project_name }
expect(geo_project_name).to include 'geo-project'
Git::Repository.perform do |repository|
repository.location = Page::Project::Show.act do
choose_repository_clone_http
......@@ -34,8 +37,22 @@ module QA
expect(page).to have_content 'You are on a secondary (read-only) Geo node'
Page::Main::Menu.act { go_to_projects }
expect(page).to have_content 'geo-project'
Page::Main::Menu.perform do |menu|
menu.go_to_projects
expect(page).to have_content(geo_project_name)
end
sleep 10 # wait for repository replication
Page::Dashboard::Projects.perform do |dashboard|
dashboard.go_to_project(geo_project_name)
end
Page::Project::Show.perform do
expect(page).to have_content 'README.md'
expect(page).to have_content 'This is Geo project!'
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