Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Switch `global_roles/global_create_project_spec` to cuprite

Aaron Contreras71109c5f1f7a
diff --git a/spec/features/global_roles/global_create_project_spec.rb b/spec/features/global_roles/global_create_project_spec.rb
index de2f5fcdd39..44659fd3ad8 100644
--- a/spec/features/global_roles/global_create_project_spec.rb
+++ b/spec/features/global_roles/global_create_project_spec.rb
@@ -28,12 +28,14 @@
require 'spec_helper'
-RSpec.describe 'Global role: Global Create project', js: true do
+RSpec.describe 'Global role: Global Create project',
+ js: true,
+ with_cuprite: true do
let(:user) { create(:admin) }
let(:project) { create(:project) }
before do
- login_as(user)
+ login_as user
end
describe 'Create Project is not a member permission' do
@@ -86,7 +88,7 @@ RSpec.describe 'Global role: Global Create project', js: true do
name_field.set_value 'New project name'
- page.find('button:not([disabled])', text: 'Save').click
+ find('button:not([disabled])', text: 'Save').click
expect(page).to have_current_path '/projects/new-project-name/'
end
diff --git a/spec/support/form_fields/input_form_field.rb b/spec/support/form_fields/input_form_field.rb
index de2d25a4974..7f851866924 100644
--- a/spec/support/form_fields/input_form_field.rb
+++ b/spec/support/form_fields/input_form_field.rb
@@ -20,7 +20,14 @@ module FormFields
# A normal fill_in would cause the focus loss on the input for empty strings.
# Thus the form would be submitted.
# https://github.com/erikras/redux-form/issues/686
- input_element.fill_in with: content, fill_options: { clear: :backspace }
+ if Capybara.javascript_driver == :better_cuprite_en
+ input_element.value.length.times do
+ input_element.send_keys(:backspace)
+ end
+ input_element.fill_in with: content
+ else
+ input_element.fill_in with: content, fill_options: { clear: :backspace }
+ end
end
def send_keys(*args)