Commit 360122d5 authored by Denys Mishunov's avatar Denys Mishunov

Fixed the flaky tests

All of these are related to the way we have
to fetch content of an editor in the feature
specs
parent 1894a85f
......@@ -2,7 +2,9 @@
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
......@@ -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,7 +2,9 @@
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
......@@ -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
......@@ -2,7 +2,9 @@
require 'spec_helper'
RSpec.describe 'Projects > Files > User wants to add a .gitlab-ci.yml file' 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
......@@ -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,7 +2,9 @@
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
......@@ -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