Commit e4fc28ee authored by Winnie Hellmann's avatar Winnie Hellmann Committed by Rémy Coutable
Browse files

Enable Capybara/FeatureMethods cop

parent a000623d31ae
......@@ -10,10 +10,6 @@
Capybara/CurrentPathExpectation:
Enabled: false
# Offense count: 956
Capybara/FeatureMethods:
Enabled: false
# Offense count: 23
FactoryBot/DynamicAttributeDefinedStatically:
Exclude:
......
require 'securerandom'
module QA
feature 'API basics', :core do
describe 'API basics', :core do
before(:context) do
@api_client = Runtime::API::Client.new(:gitlab)
end
......@@ -9,7 +9,7 @@ module QA
let(:project_name) { "api-basics-#{SecureRandom.hex(8)}" }
let(:sanitized_project_path) { CGI.escape("#{Runtime::User.name}/#{project_name}") }
scenario 'user creates a project with a file and deletes them afterwards' do
it 'user creates a project with a file and deletes them afterwards' do
create_project_request = Runtime::API::Request.new(@api_client, '/projects')
post create_project_request.url, path: project_name, name: project_name
......
module QA
feature 'API users', :core do
describe 'API users', :core do
before(:context) do
@api_client = Runtime::API::Client.new(:gitlab)
end
......@@ -7,13 +7,13 @@ module QA
context 'when authenticated' do
let(:request) { Runtime::API::Request.new(@api_client, '/users') }
scenario 'get list of users' do
it 'get list of users' do
get request.url
expect_status(200)
end
scenario 'submit request with a valid user name' do
it 'submit request with a valid user name' do
get request.url, { params: { username: Runtime::User.name } }
expect_status(200)
......@@ -22,7 +22,7 @@ module QA
)
end
scenario 'submit request with an invalid user name' do
it 'submit request with an invalid user name' do
get request.url, { params: { username: SecureRandom.hex(10) } }
expect_status(200)
......@@ -30,7 +30,7 @@ module QA
end
end
scenario 'submit request with an invalid token' do
it 'submit request with an invalid token' do
request = Runtime::API::Request.new(@api_client, '/users', private_token: 'invalid')
get request.url
......
module QA
feature 'LDAP user login', :ldap do
describe 'LDAP user login', :ldap do
before do
Runtime::Env.user_type = 'ldap'
end
scenario 'user logs in using LDAP credentials' do
it 'user logs in using LDAP credentials' do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials }
......
module QA
feature 'standard user login', :core do
scenario 'user logs in using credentials' do
describe 'standard user login', :core do
it 'user logs in using credentials' do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials }
......
module QA
feature 'create a new group', :mattermost do
scenario 'creating a group with a mattermost team' do
describe 'create a new group', :mattermost do
it 'creating a group with a mattermost team' do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials }
Page::Menu::Main.act { go_to_groups }
......
module QA
feature 'logging in to Mattermost', :mattermost do
scenario 'can use gitlab oauth' do
describe 'logging in to Mattermost', :mattermost do
it 'can use gitlab oauth' do
Runtime::Browser.visit(:gitlab, Page::Main::Login) do
Page::Main::Login.act { sign_in_using_credentials }
......
module QA
feature 'creates a merge request', :core do
scenario 'user creates a new merge request' do
describe 'creates a merge request', :core do
it 'user creates a new merge request' do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials }
......
module QA
feature 'merge request rebase', :core do
scenario 'rebases source branch of merge request' do
describe 'merge request rebase', :core do
it 'rebases source branch of merge request' do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials }
......
module QA
feature 'merge request squash commits', :core do
scenario 'when squash commits is marked before merge' do
describe 'merge request squash commits', :core do
it 'when squash commits is marked before merge' do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials }
......
module QA
feature 'activity page', :core do
scenario 'push creates an event in the activity page' do
describe 'activity page', :core do
it 'push creates an event in the activity page' do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials }
......
module QA
feature 'deploy keys support', :core do
scenario 'user adds a deploy key' do
describe 'deploy keys support', :core do
it 'user adds a deploy key' do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials }
......
module QA
feature 'secret variables support', :core do
scenario 'user adds a secret variable' do
describe 'secret variables support', :core do
it 'user adds a secret variable' do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials }
......
require 'pathname'
module QA
feature 'Auto Devops', :kubernetes do
describe 'Auto Devops', :kubernetes do
after do
@cluster&.remove!
end
scenario 'user creates a new project and runs auto devops' do
it 'user creates a new project and runs auto devops' do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials }
......
module QA
feature 'creates issue', :core do
describe 'creates issue', :core do
let(:issue_title) { 'issue title' }
scenario 'user creates issue' do
it 'user creates issue' do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials }
......
module QA
feature 'create a new project', :core do
scenario 'user creates a new project' do
describe 'create a new project', :core do
it 'user creates a new project' do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials }
......
require 'digest/sha1'
module QA
feature 'cloning code using a deploy key', :core, :docker do
describe 'cloning code using a deploy key', :core, :docker do
def login
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials }
......@@ -39,7 +39,7 @@ def login
]
keys.each do |(key_class, bits)|
scenario "user sets up a deploy key with #{key_class}(#{bits}) to clone code using pipelines" do
it "user sets up a deploy key with #{key_class}(#{bits}) to clone code using pipelines" do
key = key_class.new(*bits)
login
......
module QA
feature 'CI/CD Pipelines', :core, :docker do
describe 'CI/CD Pipelines', :core, :docker do
let(:executor) { "qa-runner-#{Time.now.to_i}" }
after do
Service::Runner.new(executor).remove!
end
scenario 'user registers a new specific runner' do
it 'user registers a new specific runner' do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials }
......@@ -25,7 +25,7 @@ module QA
end
end
scenario 'users creates a new pipeline' do
it 'users creates a new pipeline' do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials }
......
module QA
feature 'Wiki Functionality', :core do
describe 'Wiki Functionality', :core do
def login
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials }
......@@ -14,7 +14,7 @@ def validate_content(content)
login
end
scenario 'User creates, edits, clones, and pushes to the wiki' do
it 'User creates, edits, clones, and pushes to the wiki' do
wiki = Factory::Resource::Wiki.fabricate! do |resource|
resource.title = 'Home'
resource.content = '# My First Wiki Content'
......
module QA
feature 'clone code from the repository', :core do
describe 'clone code from the repository', :core do
context 'with regular account over http' do
given(:location) do
let(:location) do
Page::Project::Show.act do
choose_repository_clone_http
repository_location
......@@ -31,7 +31,7 @@ module QA
end
end
scenario 'user performs a deep clone' do
it 'user performs a deep clone' do
Git::Repository.perform do |repository|
repository.uri = location.uri
repository.use_default_credentials
......@@ -42,7 +42,7 @@ module QA
end
end
scenario 'user performs a shallow clone' do
it 'user performs a shallow clone' do
Git::Repository.perform do |repository|
repository.uri = location.uri
repository.use_default_credentials
......
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