Commit 7945878d authored by Lin Jen-Shin's avatar Lin Jen-Shin

Introduce common project settings and just put

everything in the scenario without a before block.
parent 9f7fe677
......@@ -93,6 +93,7 @@ module QA
autoload :Show, 'qa/page/project/show'
module Settings
autoload :Common, 'qa/page/project/settings/common'
autoload :Repository, 'qa/page/project/settings/repository'
autoload :DeployKeys, 'qa/page/project/settings/deploy_keys'
end
......
module QA
module Page
module Project
module Settings
module Common
def expand(selector)
page.within('#content-body') do
find(selector).click
yield
end
end
end
end
end
end
end
......@@ -3,21 +3,13 @@ module QA
module Project
module Settings
class Repository < Page::Base
include Common
def expand_deploy_keys(&block)
expand('.qa-expand-deploy-keys') do
DeployKeys.perform(&block)
end
end
private
def expand(selector)
page.within('#content-body') do
find(selector).click
yield
end
end
end
end
end
......
module QA
feature 'deploy keys support', :core do
before do
given(:deploy_key_title) { 'deploy key title' }
given(:deploy_key_value) { Runtime::User.ssh_key }
scenario 'user adds a deploy key' do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials }
......@@ -8,12 +11,7 @@ module QA
deploy_key.title = deploy_key_title
deploy_key.key = deploy_key_value
end
end
given(:deploy_key_title) { 'deploy key title' }
given(:deploy_key_value) { Runtime::User.ssh_key }
scenario 'user adds a deploy key' do
Page::Project::Settings::Repository.perform do |setting|
setting.expand_deploy_keys do |page|
expect(page).to have_key_title(deploy_key_title)
......
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