gitlab-org--gitlab-foss/spec/features/projects/tree/create_file_spec.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

63 lines
1.4 KiB
Ruby
Raw Permalink Normal View History

# frozen_string_literal: true
require 'spec_helper'
RSpec.describe 'Multi-file editor new file', :js do
let(:user) { create(:user) }
let(:project) { create(:project, :repository) }
before do
stub_feature_flags(vscode_web_ide: false)
project.add_maintainer(user)
sign_in(user)
visit project_path(project)
wait_for_requests
click_link('Web IDE')
wait_for_requests
end
after do
set_cookie('new_repo', 'false')
end
it 'creates file in current directory' do
2018-08-07 11:15:56 -04:00
first('.ide-tree-actions button').click
page.within('.modal') do
find('.form-control').set('file name')
click_button('Create file')
end
wait_for_requests
2018-04-17 11:27:46 -04:00
find('.js-ide-commit-mode').click
# Compact mode depends on the size of window. If it is shorter than MAX_WINDOW_HEIGHT_COMPACT,
# (as it is with WEBDRIVER_HEADLESS=0), this initial commit button will exist. Otherwise, if it is
# taller (as it is by default with chrome headless) then the button will not exist.
if page.has_css?('[data-testid="begin-commit-button"]')
find('[data-testid="begin-commit-button"]').click
end
fill_in('commit-message', with: 'commit message ide')
find(:css, ".js-ide-commit-new-mr input").set(false)
2019-07-15 09:16:55 -04:00
page.within '.multi-file-commit-form' do
click_button('Commit')
wait_for_requests
2019-07-15 09:16:55 -04:00
end
find('.js-ide-edit-mode').click
expect(page).to have_content('file name')
end
end