From 8ead5d1e3419816a0464b3aad29f4a5fe0ce187e Mon Sep 17 00:00:00 2001 From: "vishal.s.patel" Date: Fri, 5 Jan 2024 11:04:06 +1300 Subject: [PATCH 01/13] Updated tests from UI to Api checks --- spec/features/api_helper.rb | 21 +++++++++++++++++ spec/features/backups_spec.rb | 44 ++++++++++++++--------------------- spec/gitlab_test_helper.rb | 7 ++++++ spec/spec_helper.rb | 1 + 4 files changed, 47 insertions(+), 26 deletions(-) create mode 100644 spec/features/api_helper.rb diff --git a/spec/features/api_helper.rb b/spec/features/api_helper.rb new file mode 100644 index 0000000000..830544d46a --- /dev/null +++ b/spec/features/api_helper.rb @@ -0,0 +1,21 @@ +require 'rest-client' +require 'json' + +module ApiHelper + BASE_URL = "https://gitlab-#{ENV['CI_ENVIRONMENT_SLUG']}.#{ENV['KUBE_INGRESS_BASE_DOMAIN']}/api/v4/".freeze + # BASE_URL = "https://gitlab-gke122-review-tes-oetv01.cloud-native-v122.helm-charts.win/api/v4/" + def self.invoke_get_request(uri) + default_args = { + method: :get, + url: "#{BASE_URL}#{uri}", + verify_ssl: true, + headers: { + # "Authorization" => "Bearer gplat-XXXX" + "Authorization" => "Bearer #{ENV['GITLAB_ADMIN_TOKEN']}" + } + } + response = RestClient::Request.execute(default_args) + puts response.to_s + JSON.parse(response.body) + end +end diff --git a/spec/features/backups_spec.rb b/spec/features/backups_spec.rb index 92e3bf1c75..3a31ed6799 100644 --- a/spec/features/backups_spec.rb +++ b/spec/features/backups_spec.rb @@ -52,38 +52,30 @@ describe "Restoring a backup" do describe 'Restored gitlab instance' do before { sign_in } - it 'Home page should show projects' do - visit '/' - expect(page).to have_content 'Projects' - expect(page).to have_content 'Administrator / testproject1' + it 'testproject1 project should exist' do + uri = "search?scope=projects&search=testproject1" + response = ApiHelper.invoke_get_request(uri) + expect(response.collect { |item| item["name_with_namespace"] }).to have_content 'Administrator / testproject1' end - it 'Navigating to testproject1 repo should work' do - visit '/root/testproject1' - expect(find('[data-testid="file-tree-table"]')) - .to have_content('Dockerfile') + it 'Issue under testproject1 should exist' do + uri = "search?scope=issues&search=test" + response = ApiHelper.invoke_get_request(uri) + expect(response.collect { |item| item["title"] }).to have_content 'This is a test issue with attachment' end - it 'Should have runner registered' do - visit '/admin/runners' - expect(page).to have_css('#content-body [data-testid^="runner-row-"],[data-qa-selector^="runner-row-"]', minimum: 1) + it 'Test repo should have Dockerfile' do + uri = "projects/1/repository/tree" + response = ApiHelper.invoke_get_request(uri) + expect(response.collect { |item| item["name"] }) + .to have_content('Dockerfile') end - it 'Issue attachments should load correctly' do - visit '/root/testproject1/-/issues/1' - - image_selector = 'div.md > p > a > img.js-lazy-loaded' - - # Image has additional classes added by JS async - wait(reload: false) do - has_selector?(image_selector) - end - - expect(page).to have_selector(image_selector) - image_src = page.all(image_selector)[0][:src] - URI.open(image_src) do |f| - expect(f.status[0]).to eq '200' - end + it 'Should have atleast 1 runner registered' do + uri = "runners/all" + response = ApiHelper.invoke_get_request(uri) + expect(response.collect { |item| item["status"] }).to have_content('online', minimum: 1) + expect(response.collect { |item| item["online"] }).to have_content('true', minimum: 1) end it 'Could pull image from registry' do diff --git a/spec/gitlab_test_helper.rb b/spec/gitlab_test_helper.rb index a778fb07dc..458afae9db 100644 --- a/spec/gitlab_test_helper.rb +++ b/spec/gitlab_test_helper.rb @@ -99,6 +99,13 @@ module Gitlab return [stdout, status] end + def set_admin_token + cmd = full_command("gitlab-rails runner \"unless PersonalAccessToken.find_by_token('#{ENV['GITLAB_ADMIN_TOKEN']}'); user = User.find_by_username('root'); token = user.personal_access_tokens.create(scopes: ['api'], name: 'vishaltest token', expires_at: 365.days.from_now); \\ + token.set_token('#{ENV['GITLAB_ADMIN_TOKEN']}'); token.save! end;\"") + stdout, status = Open3.capture2e(cmd) + return [stdout, status] + end + def gitlab_url protocol = ENV['PROTOCOL'] || 'https' instance_url = ENV['GITLAB_URL'] || "gitlab.#{ENV['GITLAB_ROOT_DOMAIN']}" diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 83a30fb4f1..0502bee21b 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -5,6 +5,7 @@ require 'capybara/rspec' require 'capybara-screenshot/rspec' require 'selenium-webdriver' require 'rspec/retry' +require 'api_helper' require 'gitlab_test_helper' require 'rspec-parameterized' require 'pry' -- GitLab From 0e1be05f27291fc8d77ba9b95602b81af26ce0e8 Mon Sep 17 00:00:00 2001 From: "vishal.s.patel" Date: Fri, 5 Jan 2024 11:30:54 +1300 Subject: [PATCH 02/13] Moved api_helper under spec --- spec/features/api_helper.rb | 21 --------------------- 1 file changed, 21 deletions(-) delete mode 100644 spec/features/api_helper.rb diff --git a/spec/features/api_helper.rb b/spec/features/api_helper.rb deleted file mode 100644 index 830544d46a..0000000000 --- a/spec/features/api_helper.rb +++ /dev/null @@ -1,21 +0,0 @@ -require 'rest-client' -require 'json' - -module ApiHelper - BASE_URL = "https://gitlab-#{ENV['CI_ENVIRONMENT_SLUG']}.#{ENV['KUBE_INGRESS_BASE_DOMAIN']}/api/v4/".freeze - # BASE_URL = "https://gitlab-gke122-review-tes-oetv01.cloud-native-v122.helm-charts.win/api/v4/" - def self.invoke_get_request(uri) - default_args = { - method: :get, - url: "#{BASE_URL}#{uri}", - verify_ssl: true, - headers: { - # "Authorization" => "Bearer gplat-XXXX" - "Authorization" => "Bearer #{ENV['GITLAB_ADMIN_TOKEN']}" - } - } - response = RestClient::Request.execute(default_args) - puts response.to_s - JSON.parse(response.body) - end -end -- GitLab From 80cde59affc7d6485dc0ee3bb83e0737275366f5 Mon Sep 17 00:00:00 2001 From: "vishal.s.patel" Date: Fri, 5 Jan 2024 11:33:30 +1300 Subject: [PATCH 03/13] Moved api_helper under spec --- spec/api_helper.rb | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 spec/api_helper.rb diff --git a/spec/api_helper.rb b/spec/api_helper.rb new file mode 100644 index 0000000000..830544d46a --- /dev/null +++ b/spec/api_helper.rb @@ -0,0 +1,21 @@ +require 'rest-client' +require 'json' + +module ApiHelper + BASE_URL = "https://gitlab-#{ENV['CI_ENVIRONMENT_SLUG']}.#{ENV['KUBE_INGRESS_BASE_DOMAIN']}/api/v4/".freeze + # BASE_URL = "https://gitlab-gke122-review-tes-oetv01.cloud-native-v122.helm-charts.win/api/v4/" + def self.invoke_get_request(uri) + default_args = { + method: :get, + url: "#{BASE_URL}#{uri}", + verify_ssl: true, + headers: { + # "Authorization" => "Bearer gplat-XXXX" + "Authorization" => "Bearer #{ENV['GITLAB_ADMIN_TOKEN']}" + } + } + response = RestClient::Request.execute(default_args) + puts response.to_s + JSON.parse(response.body) + end +end -- GitLab From 4769db22ba7f4e5c1a9da7fa72c6e5527dea2b67 Mon Sep 17 00:00:00 2001 From: "vishal.s.patel" Date: Fri, 5 Jan 2024 11:47:36 +1300 Subject: [PATCH 04/13] Added rest-client to Gemfile --- Gemfile | 1 + Gemfile.lock | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/Gemfile b/Gemfile index 03834ce616..6f14c94672 100644 --- a/Gemfile +++ b/Gemfile @@ -14,6 +14,7 @@ group :test do gem 'knapsack' gem 'tomlrb' gem 'fugit' + gem 'rest-client' end group :rubocop do diff --git a/Gemfile.lock b/Gemfile.lock index f71af222b8..def6098796 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -84,6 +84,7 @@ GEM docker-api (1.34.2) excon (>= 0.47.0) multi_json + domain_name (0.6.20231109) e2mmap (0.1.0) equalizer (0.0.11) et-orbi (1.2.7) @@ -115,6 +116,9 @@ GEM rubocop-rails (~> 2.15) rubocop-rspec (~> 2.12) hash-deep-merge (0.1.1) + http-accept (1.7.0) + http-cookie (1.0.5) + domain_name (~> 0.5) httparty (0.21.0) mini_mime (>= 1.0.0) multi_xml (>= 0.5.2) @@ -136,6 +140,9 @@ GEM memoizable (0.4.2) thread_safe (~> 0.3, >= 0.3.1) method_source (1.0.0) + mime-types (3.5.2) + mime-types-data (~> 3.2015) + mime-types-data (3.2023.1205) mini_mime (1.0.2) mini_portile2 (2.8.0) minitest (5.16.3) @@ -149,6 +156,7 @@ GEM multi_json (1.13.1) multi_xml (0.6.0) nap (1.1.0) + netrc (0.11.0) no_proxy_fix (0.1.2) nokogiri (1.13.8) mini_portile2 (~> 2.8.0) @@ -178,6 +186,11 @@ GEM rake (13.0.1) rchardet (1.8.0) regexp_parser (1.8.2) + rest-client (2.1.0) + http-accept (>= 1.7.0, < 2.0) + http-cookie (>= 1.0.2, < 2.0) + mime-types (>= 1.16, < 4.0) + netrc (~> 0.8) reverse_markdown (2.1.1) nokogiri rexml (3.2.5) @@ -295,6 +308,7 @@ DEPENDENCIES knapsack pry rake + rest-client rspec rspec-parameterized rspec-retry -- GitLab From 1aa63124b1d097a012d958921454904608c50727 Mon Sep 17 00:00:00 2001 From: "vishal.s.patel" Date: Fri, 5 Jan 2024 12:15:43 +1300 Subject: [PATCH 05/13] Generating token before tests --- spec/features/backups_spec.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spec/features/backups_spec.rb b/spec/features/backups_spec.rb index 3a31ed6799..ad15754a00 100644 --- a/spec/features/backups_spec.rb +++ b/spec/features/backups_spec.rb @@ -37,6 +37,9 @@ describe "Restoring a backup" do stdout, status = enforce_root_password(ENV['GITLAB_PASSWORD']) if ENV['GITLAB_PASSWORD'] fail stdout unless status.success? + stdout, status = set_admin_token + fail stdout unless status.success? + # scale the Rails code deployments up scale_rails_up # wait for rollout to complete (change in replicas) -- GitLab From 2cb086232e7d78544c5991b76937902bb585d26d Mon Sep 17 00:00:00 2001 From: "vishal.s.patel" Date: Fri, 5 Jan 2024 15:48:47 +1300 Subject: [PATCH 06/13] Removed unwanted comments --- spec/api_helper.rb | 3 --- 1 file changed, 3 deletions(-) diff --git a/spec/api_helper.rb b/spec/api_helper.rb index 830544d46a..4094737d9a 100644 --- a/spec/api_helper.rb +++ b/spec/api_helper.rb @@ -3,19 +3,16 @@ require 'json' module ApiHelper BASE_URL = "https://gitlab-#{ENV['CI_ENVIRONMENT_SLUG']}.#{ENV['KUBE_INGRESS_BASE_DOMAIN']}/api/v4/".freeze - # BASE_URL = "https://gitlab-gke122-review-tes-oetv01.cloud-native-v122.helm-charts.win/api/v4/" def self.invoke_get_request(uri) default_args = { method: :get, url: "#{BASE_URL}#{uri}", verify_ssl: true, headers: { - # "Authorization" => "Bearer gplat-XXXX" "Authorization" => "Bearer #{ENV['GITLAB_ADMIN_TOKEN']}" } } response = RestClient::Request.execute(default_args) - puts response.to_s JSON.parse(response.body) end end -- GitLab From 5d73b73496be44d2549dfb7424692b9a3508f59f Mon Sep 17 00:00:00 2001 From: "vishal.s.patel" Date: Tue, 9 Jan 2024 09:13:49 +1300 Subject: [PATCH 07/13] Added suggestion and missing test --- spec/api_helper.rb | 2 +- spec/features/backups_spec.rb | 8 +++++- spec/gitlab_test_helper.rb | 50 +++++++++++++++++------------------ 3 files changed, 33 insertions(+), 27 deletions(-) diff --git a/spec/api_helper.rb b/spec/api_helper.rb index 4094737d9a..f0af71b6e6 100644 --- a/spec/api_helper.rb +++ b/spec/api_helper.rb @@ -2,7 +2,7 @@ require 'rest-client' require 'json' module ApiHelper - BASE_URL = "https://gitlab-#{ENV['CI_ENVIRONMENT_SLUG']}.#{ENV['KUBE_INGRESS_BASE_DOMAIN']}/api/v4/".freeze + BASE_URL = "#{ENV['GITLAB_URL']}/api/v4/".freeze def self.invoke_get_request(uri) default_args = { method: :get, diff --git a/spec/features/backups_spec.rb b/spec/features/backups_spec.rb index ad15754a00..59b48605f4 100644 --- a/spec/features/backups_spec.rb +++ b/spec/features/backups_spec.rb @@ -53,7 +53,7 @@ describe "Restoring a backup" do end describe 'Restored gitlab instance' do - before { sign_in } + # before { sign_in } it 'testproject1 project should exist' do uri = "search?scope=projects&search=testproject1" @@ -81,6 +81,12 @@ describe "Restoring a backup" do expect(response.collect { |item| item["online"] }).to have_content('true', minimum: 1) end + it 'Issue contains attachment in the description' do + uri = "issues" + response = ApiHelper.invoke_get_request(uri) + expect(response.collect { |item| item["description"] }).to have_content '![Screen_Shot_2018-05-01_at_2.53.34_PM](/uploads/90701344e9ebb53fa9ebac83d43afdcc/Screen_Shot_2018-05-01_at_2.53.34_PM.png)' + end + it 'Could pull image from registry' do stdout, status = Open3.capture2e("docker login #{registry_url} --username root --password #{ENV['GITLAB_PASSWORD']}") expect(status.success?).to be(true), "Login failed: #{stdout}" diff --git a/spec/gitlab_test_helper.rb b/spec/gitlab_test_helper.rb index 458afae9db..34dd9d997e 100644 --- a/spec/gitlab_test_helper.rb +++ b/spec/gitlab_test_helper.rb @@ -61,36 +61,36 @@ module Gitlab false end - def sign_in - # DRY CSS selector for finding the user avatar - qa_avatar_selector = 'img[data-testid="user-avatar-content"]' + # def sign_in + # # DRY CSS selector for finding the user avatar + # qa_avatar_selector = 'img[data-testid="user-avatar-content"]' - visit '/users/sign_in' + # visit '/users/sign_in' - # Give time for the app to fully load - wait(max: 600, time: 3) do - has_css?('.login-page') || has_css?(qa_avatar_selector) - end + # # Give time for the app to fully load + # wait(max: 600, time: 3) do + # has_css?('.login-page') || has_css?(qa_avatar_selector) + # end - # Return if already signed in - return if has_selector?(qa_avatar_selector) - raise 'GITLAB_PASSWORD environment variable not set' if ENV['GITLAB_PASSWORD'].blank? + # # Return if already signed in + # return if has_selector?(qa_avatar_selector) + # raise 'GITLAB_PASSWORD environment variable not set' if ENV['GITLAB_PASSWORD'].blank? - # Operate specifically within the user login form, avoiding registation form - within('div#login-pane') do - fill_in 'Username or primary email', with: 'root' - fill_in 'Password', with: ENV['GITLAB_PASSWORD'] - end - click_button 'Sign in' + # # Operate specifically within the user login form, avoiding registation form + # within('div#login-pane') do + # fill_in 'Username or primary email', with: 'root' + # fill_in 'Password', with: ENV['GITLAB_PASSWORD'] + # end + # click_button 'Sign in' - # Check the login was a success - wait(reload: false) do - has_current_path?('/', ignore_query: true) && has_css?(qa_avatar_selector) - end + # # Check the login was a success + # wait(reload: false) do + # has_current_path?('/', ignore_query: true) && has_css?(qa_avatar_selector) + # end - expect(page).to have_current_path('/', ignore_query: true) - expect(page).to have_selector(qa_avatar_selector) - end + # expect(page).to have_current_path('/', ignore_query: true) + # expect(page).to have_selector(qa_avatar_selector) + # end def enforce_root_password(password) cmd = full_command("gitlab-rails runner \"user = User.find(1); user.user_type = :human ; user.password='#{password}'; user.password_confirmation='#{password}'; user.save!\"") @@ -100,7 +100,7 @@ module Gitlab end def set_admin_token - cmd = full_command("gitlab-rails runner \"unless PersonalAccessToken.find_by_token('#{ENV['GITLAB_ADMIN_TOKEN']}'); user = User.find_by_username('root'); token = user.personal_access_tokens.create(scopes: ['api'], name: 'vishaltest token', expires_at: 365.days.from_now); \\ + cmd = full_command("gitlab-rails runner \"unless PersonalAccessToken.find_by_token('#{ENV['GITLAB_ADMIN_TOKEN']}'); user = User.find_by_username('root'); token = user.personal_access_tokens.create(scopes: ['api'], name: 'Token for running specs', expires_at: 365.days.from_now); \\ token.set_token('#{ENV['GITLAB_ADMIN_TOKEN']}'); token.save! end;\"") stdout, status = Open3.capture2e(cmd) return [stdout, status] -- GitLab From 14a58643506f08642954a0e3d73e49806b4a9de5 Mon Sep 17 00:00:00 2001 From: "vishal.s.patel" Date: Tue, 9 Jan 2024 10:24:10 +1300 Subject: [PATCH 08/13] Added debugging --- spec/api_helper.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spec/api_helper.rb b/spec/api_helper.rb index f0af71b6e6..5367363074 100644 --- a/spec/api_helper.rb +++ b/spec/api_helper.rb @@ -2,7 +2,9 @@ require 'rest-client' require 'json' module ApiHelper - BASE_URL = "#{ENV['GITLAB_URL']}/api/v4/".freeze + BASE_URL = "https://gitlab-#{ENV['CI_ENVIRONMENT_SLUG']}.#{ENV['KUBE_INGRESS_BASE_DOMAIN']}/api/v4/".freeze + puts "##################" + puts ENV['GITLAB_URL'] def self.invoke_get_request(uri) default_args = { method: :get, -- GitLab From efd21608fe60bab5ccb5671d08d02cfb055d3710 Mon Sep 17 00:00:00 2001 From: "vishal.s.patel" Date: Tue, 9 Jan 2024 10:43:23 +1300 Subject: [PATCH 09/13] Updated the Base URL --- spec/api_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/api_helper.rb b/spec/api_helper.rb index 5367363074..4f0548d5b0 100644 --- a/spec/api_helper.rb +++ b/spec/api_helper.rb @@ -2,7 +2,7 @@ require 'rest-client' require 'json' module ApiHelper - BASE_URL = "https://gitlab-#{ENV['CI_ENVIRONMENT_SLUG']}.#{ENV['KUBE_INGRESS_BASE_DOMAIN']}/api/v4/".freeze + BASE_URL = "https://#{ENV['GITLAB_URL']}/api/v4/".freeze puts "##################" puts ENV['GITLAB_URL'] def self.invoke_get_request(uri) -- GitLab From 30c35291f6e99984d691f7e8dbbf1b110588c1a6 Mon Sep 17 00:00:00 2001 From: "vishal.s.patel" Date: Tue, 9 Jan 2024 10:45:11 +1300 Subject: [PATCH 10/13] Added debugging --- spec/api_helper.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/api_helper.rb b/spec/api_helper.rb index 4f0548d5b0..905f0c0c29 100644 --- a/spec/api_helper.rb +++ b/spec/api_helper.rb @@ -3,8 +3,8 @@ require 'json' module ApiHelper BASE_URL = "https://#{ENV['GITLAB_URL']}/api/v4/".freeze - puts "##################" - puts ENV['GITLAB_URL'] + puts "#########" + puts BASE_URL def self.invoke_get_request(uri) default_args = { method: :get, -- GitLab From 61ad5819178937426848a17c6eb65108b7d586a9 Mon Sep 17 00:00:00 2001 From: "vishal.s.patel" Date: Tue, 9 Jan 2024 12:02:20 +1300 Subject: [PATCH 11/13] Removed debugging --- spec/api_helper.rb | 3 +-- spec/gitlab_test_helper.rb | 31 ------------------------------- 2 files changed, 1 insertion(+), 33 deletions(-) diff --git a/spec/api_helper.rb b/spec/api_helper.rb index 905f0c0c29..241999f6b6 100644 --- a/spec/api_helper.rb +++ b/spec/api_helper.rb @@ -3,8 +3,7 @@ require 'json' module ApiHelper BASE_URL = "https://#{ENV['GITLAB_URL']}/api/v4/".freeze - puts "#########" - puts BASE_URL + def self.invoke_get_request(uri) default_args = { method: :get, diff --git a/spec/gitlab_test_helper.rb b/spec/gitlab_test_helper.rb index 34dd9d997e..dbda3af66a 100644 --- a/spec/gitlab_test_helper.rb +++ b/spec/gitlab_test_helper.rb @@ -61,37 +61,6 @@ module Gitlab false end - # def sign_in - # # DRY CSS selector for finding the user avatar - # qa_avatar_selector = 'img[data-testid="user-avatar-content"]' - - # visit '/users/sign_in' - - # # Give time for the app to fully load - # wait(max: 600, time: 3) do - # has_css?('.login-page') || has_css?(qa_avatar_selector) - # end - - # # Return if already signed in - # return if has_selector?(qa_avatar_selector) - # raise 'GITLAB_PASSWORD environment variable not set' if ENV['GITLAB_PASSWORD'].blank? - - # # Operate specifically within the user login form, avoiding registation form - # within('div#login-pane') do - # fill_in 'Username or primary email', with: 'root' - # fill_in 'Password', with: ENV['GITLAB_PASSWORD'] - # end - # click_button 'Sign in' - - # # Check the login was a success - # wait(reload: false) do - # has_current_path?('/', ignore_query: true) && has_css?(qa_avatar_selector) - # end - - # expect(page).to have_current_path('/', ignore_query: true) - # expect(page).to have_selector(qa_avatar_selector) - # end - def enforce_root_password(password) cmd = full_command("gitlab-rails runner \"user = User.find(1); user.user_type = :human ; user.password='#{password}'; user.password_confirmation='#{password}'; user.save!\"") -- GitLab From 8f78c1190901be41bfbf27a72ff47b154c306b19 Mon Sep 17 00:00:00 2001 From: "vishal.s.patel" Date: Wed, 10 Jan 2024 10:19:32 +1300 Subject: [PATCH 12/13] Removing commented out code --- spec/features/backups_spec.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/spec/features/backups_spec.rb b/spec/features/backups_spec.rb index 59b48605f4..e7ff249c62 100644 --- a/spec/features/backups_spec.rb +++ b/spec/features/backups_spec.rb @@ -53,7 +53,6 @@ describe "Restoring a backup" do end describe 'Restored gitlab instance' do - # before { sign_in } it 'testproject1 project should exist' do uri = "search?scope=projects&search=testproject1" -- GitLab From 2f441bd6a5135a4ba06e83a14bf83258deb58e8f Mon Sep 17 00:00:00 2001 From: Nailia Iskhakova Date: Mon, 15 Jan 2024 20:45:07 +0000 Subject: [PATCH 13/13] Updating spec names --- spec/features/backups_spec.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/features/backups_spec.rb b/spec/features/backups_spec.rb index e7ff249c62..4dca093731 100644 --- a/spec/features/backups_spec.rb +++ b/spec/features/backups_spec.rb @@ -54,7 +54,7 @@ describe "Restoring a backup" do describe 'Restored gitlab instance' do - it 'testproject1 project should exist' do + it 'Project testproject1 should exist' do uri = "search?scope=projects&search=testproject1" response = ApiHelper.invoke_get_request(uri) expect(response.collect { |item| item["name_with_namespace"] }).to have_content 'Administrator / testproject1' @@ -66,14 +66,14 @@ describe "Restoring a backup" do expect(response.collect { |item| item["title"] }).to have_content 'This is a test issue with attachment' end - it 'Test repo should have Dockerfile' do + it 'Test project repository should have Dockerfile' do uri = "projects/1/repository/tree" response = ApiHelper.invoke_get_request(uri) expect(response.collect { |item| item["name"] }) .to have_content('Dockerfile') end - it 'Should have atleast 1 runner registered' do + it 'Should have at least 1 runner registered' do uri = "runners/all" response = ApiHelper.invoke_get_request(uri) expect(response.collect { |item| item["status"] }).to have_content('online', minimum: 1) -- GitLab