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
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Switch `admin/attribute_help_texts_spec` to cuprite
Aaron Contrerasa3c62135ed5d
diff --git a/spec/features/admin/attribute_help_texts_spec.rb b/spec/features/admin/attribute_help_texts_spec.rbindex caf024ceb0b..adf1732e50c 100644--- a/spec/features/admin/attribute_help_texts_spec.rb+++ b/spec/features/admin/attribute_help_texts_spec.rb@@ -28,7 +28,9 @@require 'spec_helper'-RSpec.describe 'Attribute help texts', js: true do+RSpec.describe 'Attribute help texts',+ js: true,+ with_cuprite: true doshared_let(:admin) { create(:admin) }let(:instance) { AttributeHelpText.last }@@ -43,13 +45,14 @@ RSpec.describe 'Attribute help texts', js: true dovisit attribute_help_texts_pathend- context 'with direct uploads (Regression #34285)', with_direct_uploads: true do+ # TODO: Migrate to cuprite when the `better_cuprite_billy` driver is added+ context 'with direct uploads (Regression #34285)', with_cuprite: false, with_direct_uploads: true dobefore doallow_any_instance_of(Attachment).to receive(:diskfile).and_return image_fixtureendit 'can upload an image' do- page.find('.attribute-help-texts--create-button').click+ find('.attribute-help-texts--create-button').clickselect 'Status', from: 'attribute_help_text_attribute_name'editor.set_markdown('My attribute help text')@@ -69,7 +72,7 @@ RSpec.describe 'Attribute help texts', js: true do# Create help text# -> new- page.find('.attribute-help-texts--create-button').click+ find('.attribute-help-texts--create-button').click# Set attributes# -> create@@ -103,7 +106,7 @@ RSpec.describe 'Attribute help texts', js: true do# -> editSeleniumHubWaiter.wait- page.find('.attribute-help-text--entry td a', text: 'Status').click+ find('.attribute-help-text--entry td a', text: 'Status').clickSeleniumHubWaiter.waitexpect(page).to have_selector('#attribute_help_text_attribute_name[disabled]')editor.set_markdown(' ')@@ -135,14 +138,15 @@ RSpec.describe 'Attribute help texts', js: true dovisit attribute_help_texts_path# Create new, status is now blocked- page.find('.attribute-help-texts--create-button').click+ find('.attribute-help-texts--create-button').clickexpect(page).to have_selector('#attribute_help_text_attribute_name option', text: 'Assignee')expect(page).not_to have_selector('#attribute_help_text_attribute_name option', text: 'Status')visit attribute_help_texts_path# Destroy- page.find('.attribute-help-text--entry .icon-delete').click- page.driver.browser.switch_to.alert.accept+ accept_alert do+ find('.attribute-help-text--entry .icon-delete').click+ endexpect(page).to have_selector('.generic-table--no-results-container')expect(AttributeHelpText.count).to be_zerodiff --git a/spec/features/support/components/attribute_help_text_modal.rb b/spec/features/support/components/attribute_help_text_modal.rbindex 2142d121d4c..bfccb14e7f5 100644--- a/spec/features/support/components/attribute_help_text_modal.rb+++ b/spec/features/support/components/attribute_help_text_modal.rb@@ -60,7 +60,14 @@ module Componentsdef close!# make backdrop click an the pixel x:10,y:10page.find('.spot-modal-overlay').tap do |element|- element.click(x: -((element.native.size.width / 2) - 10), y: -((element.native.size.height / 2) - 10))+ if RSpec.current_example.metadata[:with_cuprite]+ width = element.style('width')["width"].to_i+ height = element.style('height')["height"].to_i+ else+ width = element.native.size.width+ height = element.native.size.height+ end+ element.click(x: -((width / 2) - 10), y: -((height / 2) - 10))endexpect(page).not_to have_selector('[data-qa-selector="attribute-help-text--header"]', text: help_text.attribute_caption)enddiff --git a/spec/support/shared/with_direct_uploads.rb b/spec/support/shared/with_direct_uploads.rbindex 9eefbcacc7d..0b2bfbfb591 100644--- a/spec/support/shared/with_direct_uploads.rb+++ b/spec/support/shared/with_direct_uploads.rb@@ -61,7 +61,7 @@ class WithDirectUploadsenddef around(example)- example.metadata[:driver] = :chrome_billy+ example.metadata[:javascript_driver] = example.metadata[:driver] = :chrome_billycsp_config = SecureHeaders::Configuration.instance_variable_get("@default_config").csp