Commit 405e447b authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Merge branch '299405-fixed-flaky-tests' into 'master'

Fixed the flaky tests

See merge request gitlab-org/gitlab!52396
parents 036539ce b9a57722
......@@ -2,14 +2,16 @@
require 'spec_helper'
RSpec.describe 'Projects > Files > User wants to add a Dockerfile file', quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/299405' do
RSpec.describe 'Projects > Files > User wants to add a Dockerfile file', :js do
include Spec::Support::Helpers::Features::EditorLiteSpecHelpers
before do
project = create(:project, :repository)
sign_in project.owner
visit project_new_blob_path(project, 'master', file_name: 'Dockerfile')
end
it 'user can pick a Dockerfile file from the dropdown', :js do
it 'user can pick a Dockerfile file from the dropdown' do
expect(page).to have_css('.dockerfile-selector')
find('.js-dockerfile-selector').click
......@@ -24,6 +26,6 @@ RSpec.describe 'Projects > Files > User wants to add a Dockerfile file', quarant
wait_for_requests
expect(page).to have_css('.dockerfile-selector .dropdown-toggle-text', text: 'Apply a template')
expect(page).to have_content('COPY ./ /usr/local/apache2/htdocs/')
expect(editor_get_value).to have_content('COPY ./ /usr/local/apache2/htdocs/')
end
end
......@@ -2,14 +2,16 @@
require 'spec_helper'
RSpec.describe 'Projects > Files > User wants to add a .gitignore file', quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/299405' do
RSpec.describe 'Projects > Files > User wants to add a .gitignore file', :js do
include Spec::Support::Helpers::Features::EditorLiteSpecHelpers
before do
project = create(:project, :repository)
sign_in project.owner
visit project_new_blob_path(project, 'master', file_name: '.gitignore')
end
it 'user can pick a .gitignore file from the dropdown', :js do
it 'user can pick a .gitignore file from the dropdown' do
expect(page).to have_css('.gitignore-selector')
find('.js-gitignore-selector').click
......@@ -24,7 +26,7 @@ RSpec.describe 'Projects > Files > User wants to add a .gitignore file', quarant
wait_for_requests
expect(page).to have_css('.gitignore-selector .dropdown-toggle-text', text: 'Apply a template')
expect(page).to have_content('/.bundle')
expect(page).to have_content('config/initializers/secret_token.rb')
expect(editor_get_value).to have_content('/.bundle')
expect(editor_get_value).to have_content('config/initializers/secret_token.rb')
end
end
......@@ -3,6 +3,8 @@
require 'spec_helper'
RSpec.describe 'Projects > Files > User wants to add a .gitlab-ci.yml file' do
include Spec::Support::Helpers::Features::EditorLiteSpecHelpers
before do
project = create(:project, :repository)
sign_in project.owner
......@@ -34,8 +36,7 @@ RSpec.describe 'Projects > Files > User wants to add a .gitlab-ci.yml file' do
let(:experiment_active) { true }
let(:in_experiment_group) { true }
it 'allows the user to pick a "Learn CI/CD syntax" template from the dropdown', :js,
{ quarantine: { issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/297347' } } do
it 'allows the user to pick a "Learn CI/CD syntax" template from the dropdown', :js do
expect(page).to have_css('.gitlab-ci-syntax-yml-selector')
find('.js-gitlab-ci-syntax-yml-selector').click
......@@ -50,7 +51,7 @@ RSpec.describe 'Projects > Files > User wants to add a .gitlab-ci.yml file' do
wait_for_requests
expect(page).to have_css('.gitlab-ci-syntax-yml-selector .dropdown-toggle-text', text: 'Learn CI/CD syntax')
expect(page).to have_content('You can use artifacts to pass data to jobs in later stages.')
expect(editor_get_value).to have_content('You can use artifacts to pass data to jobs in later stages.')
end
end
end
......@@ -2,14 +2,16 @@
require 'spec_helper'
RSpec.describe 'Projects > Files > User wants to add a .gitlab-ci.yml file', quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/299405' do
RSpec.describe 'Projects > Files > User wants to add a .gitlab-ci.yml file', :js do
include Spec::Support::Helpers::Features::EditorLiteSpecHelpers
before do
project = create(:project, :repository)
sign_in project.owner
visit project_new_blob_path(project, 'master', file_name: '.gitlab-ci.yml')
end
it 'user can pick a template from the dropdown', :js do
it 'user can pick a template from the dropdown' do
expect(page).to have_css('.gitlab-ci-yml-selector')
find('.js-gitlab-ci-yml-selector').click
......@@ -24,7 +26,7 @@ RSpec.describe 'Projects > Files > User wants to add a .gitlab-ci.yml file', qua
wait_for_requests
expect(page).to have_css('.gitlab-ci-yml-selector .dropdown-toggle-text', text: 'Apply a template')
expect(page).to have_content('This file is a template, and might need editing before it works on your project')
expect(page).to have_content('jekyll build -d test')
expect(editor_get_value).to have_content('This file is a template, and might need editing before it works on your project')
expect(editor_get_value).to have_content('jekyll build -d test')
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