Commit ed9bb8af authored by Rémy Coutable's avatar Rémy Coutable

Improve QA scenarios contexts & descriptions consistency

Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent 7cd3fbb6
...@@ -31,7 +31,7 @@ module QA ...@@ -31,7 +31,7 @@ module QA
if rspec_options.any? if rspec_options.any?
rspec_options rspec_options
else else
['--tag', self.class.focus.join(','), '--', ::File.expand_path('../../specs/features', __dir__)] ['--', ::File.expand_path('../../specs/features', __dir__)]
end end
end end
end end
......
# frozen_string_literal: true
module QA module QA
describe 'API users' do context :manage do
describe 'Users API' do
before(:context) do before(:context) do
@api_client = Runtime::API::Client.new(:gitlab) @api_client = Runtime::API::Client.new(:gitlab)
end end
context 'when authenticated' do
let(:request) { Runtime::API::Request.new(@api_client, '/users') } let(:request) { Runtime::API::Request.new(@api_client, '/users') }
it 'get list of users' do it 'GET /users' do
get request.url get request.url
expect_status(200) expect_status(200)
end end
it 'submit request with a valid user name' do it 'GET /users/:username with a valid username' do
get request.url, { params: { username: Runtime::User.username } } get request.url, { params: { username: Runtime::User.username } }
expect_status(200) expect_status(200)
...@@ -22,20 +24,12 @@ module QA ...@@ -22,20 +24,12 @@ module QA
) )
end end
it 'submit request with an invalid user name' do it 'GET /users/:username with an invalid username' do
get request.url, { params: { username: SecureRandom.hex(10) } } get request.url, { params: { username: SecureRandom.hex(10) } }
expect_status(200) expect_status(200)
expect(json_body).to eq([]) expect(json_body).to eq([])
end end
end end
it 'submit request with an invalid token' do
request = Runtime::API::Request.new(@api_client, '/users', private_token: 'invalid')
get request.url
expect_status(401)
end
end end
end end
# frozen_string_literal: true
module QA module QA
describe 'LDAP user login', :orchestrated, :ldap do context :manage, :orchestrated, :ldap do
describe 'LDAP login' do
before do before do
Runtime::Env.user_type = 'ldap' Runtime::Env.user_type = 'ldap'
end end
it 'user logs in using LDAP credentials' do it 'user logs into GitLab using LDAP credentials' do
Runtime::Browser.visit(:gitlab, Page::Main::Login) Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials } Page::Main::Login.act { sign_in_using_credentials }
...@@ -16,4 +19,5 @@ module QA ...@@ -16,4 +19,5 @@ module QA
end end
end end
end end
end
end end
# frozen_string_literal: true
module QA module QA
describe 'logging in to Mattermost', :orchestrated, :mattermost do context :manage, :orchestrated, :mattermost do
it 'can use gitlab oauth' do describe 'Mattermost login' do
it 'user logs into Mattermost using GitLab OAuth' do
Runtime::Browser.visit(:gitlab, Page::Main::Login) do Runtime::Browser.visit(:gitlab, Page::Main::Login) do
Page::Main::Login.act { sign_in_using_credentials } Page::Main::Login.act { sign_in_using_credentials }
...@@ -14,4 +17,5 @@ module QA ...@@ -14,4 +17,5 @@ module QA
end end
end end
end end
end
end end
# frozen_string_literal: true
module QA module QA
describe 'create a new project', :smoke do context :manage, :smoke do
describe 'Project creation' do
it 'user creates a new project' do it 'user creates a new project' do
Runtime::Browser.visit(:gitlab, Page::Main::Login) Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials } Page::Main::Login.act { sign_in_using_credentials }
...@@ -19,4 +22,5 @@ module QA ...@@ -19,4 +22,5 @@ module QA
expect(page).to have_content('The repository for this project is empty') expect(page).to have_content('The repository for this project is empty')
end end
end end
end
end end
# frozen_string_literal: true
module QA module QA
describe 'user imports a GitHub repo', :orchestrated, :github do context :manage, :orchestrated, :github do
describe 'Project import from GitHub' do
let(:imported_project) do let(:imported_project) do
Factory::Resource::ProjectImportedFromGithub.fabricate! do |project| Factory::Resource::ProjectImportedFromGithub.fabricate! do |project|
project.name = 'imported-project' project.name = 'imported-project'
...@@ -103,4 +106,5 @@ module QA ...@@ -103,4 +106,5 @@ module QA
expect(page).to have_content('Welcome to the test-project wiki!') expect(page).to have_content('Welcome to the test-project wiki!')
end end
end end
end
end end
# frozen_string_literal: true
module QA module QA
describe 'activity page' do context :manage do
it 'push creates an event in the activity page' do describe 'Project activity' do
it 'user creates an event in the activity page upon Git push' do
Runtime::Browser.visit(:gitlab, Page::Main::Login) Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials } Page::Main::Login.act { sign_in_using_credentials }
...@@ -17,4 +20,5 @@ module QA ...@@ -17,4 +20,5 @@ module QA
expect(page).to have_content('pushed new branch master') expect(page).to have_content('pushed new branch master')
end end
end end
end
end end
# frozen_string_literal: true
module QA module QA
describe 'creates issue', :smoke do context :plan, :smoke do
describe 'Issue creation' do
let(:issue_title) { 'issue title' } let(:issue_title) { 'issue title' }
it 'user creates issue' do it 'user creates an issue' do
Runtime::Browser.visit(:gitlab, Page::Main::Login) Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials } Page::Main::Login.act { sign_in_using_credentials }
...@@ -15,4 +18,5 @@ module QA ...@@ -15,4 +18,5 @@ module QA
expect(page).to have_content(issue_title) expect(page).to have_content(issue_title)
end end
end end
end
end end
# frozen_string_literal: true
module QA module QA
describe 'creates a merge request with milestone' do context :create do
describe 'Merge request creation' do
it 'user creates a new merge request' do it 'user creates a new merge request' do
Runtime::Browser.visit(:gitlab, Page::Main::Login) Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials } Page::Main::Login.act { sign_in_using_credentials }
...@@ -29,6 +32,7 @@ module QA ...@@ -29,6 +32,7 @@ module QA
end end
end end
end end
end
describe 'creates a merge request', :smoke do describe 'creates a merge request', :smoke do
it 'user creates a new merge request' do it 'user creates a new merge request' do
......
# frozen_string_literal: true
module QA module QA
describe 'Project fork' do context :create do
it 'can submit merge requests to upstream master' do describe 'Merge request creation from fork' do
it 'user forks a project, submits a merge request and maintainer merges it' do
Runtime::Browser.visit(:gitlab, Page::Main::Login) Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials } Page::Main::Login.act { sign_in_using_credentials }
...@@ -18,4 +21,5 @@ module QA ...@@ -18,4 +21,5 @@ module QA
expect(page).to have_content('The changes were merged') expect(page).to have_content('The changes were merged')
end end
end end
end
end end
# frozen_string_literal: true
module QA module QA
describe 'merge request rebase' do context :create do
it 'rebases source branch of merge request' do describe 'Merge request rebasing' do
it 'user rebases source branch of merge request' do
Runtime::Browser.visit(:gitlab, Page::Main::Login) Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials } Page::Main::Login.act { sign_in_using_credentials }
...@@ -20,6 +23,8 @@ module QA ...@@ -20,6 +23,8 @@ module QA
push.project = project push.project = project
push.file_name = "other.txt" push.file_name = "other.txt"
push.file_content = "New file added!" push.file_content = "New file added!"
push.branch_name = "master"
push.new_branch = false
end end
merge_request.visit! merge_request.visit!
...@@ -36,4 +41,5 @@ module QA ...@@ -36,4 +41,5 @@ module QA
end end
end end
end end
end
end end
# frozen_string_literal: true
module QA module QA
describe 'merge request squash commits' do context :create do
it 'when squash commits is marked before merge' do describe 'Merge request squashing' do
it 'user squashes commits while merging' do
Runtime::Browser.visit(:gitlab, Page::Main::Login) Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials } Page::Main::Login.act { sign_in_using_credentials }
...@@ -47,4 +50,5 @@ module QA ...@@ -47,4 +50,5 @@ module QA
end end
end end
end end
end
end end
# frozen_string_literal: true
module QA module QA
describe 'clone code from the repository' do context :create do
context 'with regular account over http' do describe 'Git clone over HTTP' do
let(:location) do let(:location) do
Page::Project::Show.act do Page::Project::Show.act do
choose_repository_clone_http choose_repository_clone_http
......
# frozen_string_literal: true
module QA module QA
describe 'File Functionality', :core do context :create, :core do
it 'lets a user create, edit and delete a file via WebUI' do describe 'Files management' do
it 'user creates, edits and deletes a file via the Web' do
Runtime::Browser.visit(:gitlab, Page::Main::Login) Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials } Page::Main::Login.act { sign_in_using_credentials }
...@@ -51,4 +54,5 @@ module QA ...@@ -51,4 +54,5 @@ module QA
expect(page).to have_no_content(file_name) expect(page).to have_no_content(file_name)
end end
end end
end
end end
# frozen_string_literal: true
module QA module QA
describe 'push code to repository' do context :create do
context 'with regular account over http' do describe 'Git push over HTTP' do
it 'user pushes code to the repository' do it 'user pushes code to the repository' do
Runtime::Browser.visit(:gitlab, Page::Main::Login) Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials } Page::Main::Login.act { sign_in_using_credentials }
......
# frozen_string_literal: true
module QA module QA
describe 'branch protection support' do context :create do
describe 'Protected branch support' do
let(:branch_name) { 'protected-branch' } let(:branch_name) { 'protected-branch' }
let(:commit_message) { 'Protected push commit message' } let(:commit_message) { 'Protected push commit message' }
let(:project) do let(:project) do
...@@ -63,4 +66,5 @@ module QA ...@@ -63,4 +66,5 @@ module QA
end end
end end
end end
end
end end
# frozen_string_literal: true
module QA module QA
describe 'Wiki Functionality' do context :create do
describe 'Wiki management' do
def login def login
Runtime::Browser.visit(:gitlab, Page::Main::Login) Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials } Page::Main::Login.act { sign_in_using_credentials }
...@@ -14,7 +17,7 @@ module QA ...@@ -14,7 +17,7 @@ module QA
login login
end end
it '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| wiki = Factory::Resource::Wiki.fabricate! do |resource|
resource.title = 'Home' resource.title = 'Home'
resource.content = '# My First Wiki Content' resource.content = '# My First Wiki Content'
...@@ -42,4 +45,5 @@ module QA ...@@ -42,4 +45,5 @@ module QA
expect(page).to have_content('My Third Wiki Content') expect(page).to have_content('My Third Wiki Content')
end end
end end
end
end end
# frozen_string_literal: true
module QA module QA
describe 'CI/CD Pipelines', :orchestrated, :docker do context :verify, :orchestrated, :docker do
describe 'Pipeline creation and processing' do
let(:executor) { "qa-runner-#{Time.now.to_i}" } let(:executor) { "qa-runner-#{Time.now.to_i}" }
after do after do
Service::Runner.new(executor).remove! Service::Runner.new(executor).remove!
end end
it 'user registers a new specific runner' do it 'users creates a pipeline which gets processed' do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials }
Factory::Resource::Runner.fabricate! do |runner|
runner.name = executor
end
Page::Project::Settings::CICD.perform do |settings|
sleep 5 # Runner should register within 5 seconds
settings.refresh
settings.expand_runners_settings do |page|
expect(page).to have_content(executor)
expect(page).to have_online_runner
end
end
end
it 'users creates a new pipeline' do
Runtime::Browser.visit(:gitlab, Page::Main::Login) Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials } Page::Main::Login.act { sign_in_using_credentials }
...@@ -99,4 +83,5 @@ module QA ...@@ -99,4 +83,5 @@ module QA
end end
end end
end end
end
end end
# frozen_string_literal: true
module QA module QA
describe 'secret variables support' do context :verify do
describe 'Secret variable support' do
it 'user adds a secret variable' do it 'user adds a secret variable' do
Runtime::Browser.visit(:gitlab, Page::Main::Login) Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials } Page::Main::Login.act { sign_in_using_credentials }
...@@ -21,4 +24,5 @@ module QA ...@@ -21,4 +24,5 @@ module QA
end end
end end
end end
end
end end
# frozen_string_literal: true
module QA module QA
describe 'deploy keys support' do context :release do
describe 'Deploy key creation' do
it 'user adds a deploy key' do it 'user adds a deploy key' do
Runtime::Browser.visit(:gitlab, Page::Main::Login) Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials } Page::Main::Login.act { sign_in_using_credentials }
...@@ -16,4 +19,5 @@ module QA ...@@ -16,4 +19,5 @@ module QA
expect(deploy_key.fingerprint).to eq(key.fingerprint) expect(deploy_key.fingerprint).to eq(key.fingerprint)
end end
end end
end
end end
# frozen_string_literal: true
require 'digest/sha1' require 'digest/sha1'
module QA module QA
describe 'cloning code using a deploy key', :docker do context :release, :docker do
describe 'Git clone using a deploy key' do
def login def login
Runtime::Browser.visit(:gitlab, Page::Main::Login) Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials } Page::Main::Login.act { sign_in_using_credentials }
...@@ -102,4 +105,5 @@ module QA ...@@ -102,4 +105,5 @@ module QA
end end
end end
end end
end
end end
# frozen_string_literal: true
require 'pathname' require 'pathname'
module QA module QA
describe 'Auto Devops', :orchestrated, :kubernetes do context :configure, :orchestrated, :kubernetes do
describe 'Auto DevOps support' do
after do after do
@cluster&.remove! @cluster&.remove!
end end
...@@ -61,4 +64,5 @@ module QA ...@@ -61,4 +64,5 @@ module QA
end end
end end
end end
end
end end
# frozen_string_literal: true
module QA module QA
describe 'create a new group', :orchestrated, :mattermost do context :configure, :orchestrated, :mattermost do
it 'creating a group with a mattermost team' do describe 'Mattermost support' do
it 'user creates a group with a mattermost team' do
Runtime::Browser.visit(:gitlab, Page::Main::Login) Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials } Page::Main::Login.act { sign_in_using_credentials }
Page::Menu::Main.act { go_to_groups } Page::Menu::Main.act { go_to_groups }
...@@ -14,4 +17,5 @@ module QA ...@@ -14,4 +17,5 @@ module QA
end end
end end
end end
end
end end
module QA
describe 'basic user login', :smoke do
it 'user logs in using basic credentials' do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials }
# TODO, since `Signed in successfully` message was removed
# this is the only way to tell if user is signed in correctly.
#
Page::Menu::Main.perform do |menu|
expect(menu).to have_personal_area
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