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
Introduce capybara accessible selectors for a11y
Christophe Bliard5150b5d32094
diff --git a/Gemfile b/Gemfileindex 63f35c6b2c2..e26ef5a2e97 100644--- a/Gemfile+++ b/Gemfile@@ -256,6 +256,7 @@ group :test dogem 'capybara-screenshot', '~> 1.0.17'gem 'cuprite', '~> 0.15.0'gem 'selenium-webdriver', '~> 4.15.0'+ gem 'capybara_accessible_selectors', git: 'https://github.com/citizensadvice/capybara_accessible_selectors', branch: 'main'gem 'fuubar', '~> 2.5.0'gem 'timecop', '~> 0.9.0'diff --git a/Gemfile.lock b/Gemfile.lockindex a6301e8b7e5..3e29bf5fef6 100644--- a/Gemfile.lock+++ b/Gemfile.lock@@ -1,3 +1,11 @@+GIT+ remote: https://github.com/citizensadvice/capybara_accessible_selectors+ revision: da34e96c4787bd7705c477fe2e70f993bfad8f5c+ branch: main+ specs:+ capybara_accessible_selectors (0.10.0)+ capybara (>= 3.36.0)+GITremote: https://github.com/crohr/turbo_tests.gitrevision: b700cdb344e1ed8e100fd1f56525ec12fa792b45@@ -1065,6 +1073,7 @@ DEPENDENCIESbudgets!capybara (~> 3.39.0)capybara-screenshot (~> 1.0.17)+ capybara_accessible_selectors!carrierwave (~> 1.3.1)carrierwave_direct (~> 2.1.0)climate_controldiff --git a/app/views/account/_register.html.erb b/app/views/account/_register.html.erbindex 610ccdc44b2..fa5fdd197fb 100644--- a/app/views/account/_register.html.erb+++ b/app/views/account/_register.html.erb@@ -33,7 +33,7 @@ See COPYRIGHT and LICENSE files for more details.<%= back_url_hidden_field_tag %><%= error_messages_for :user %>- <div class="spot-modal--header">+ <div id="spotModalTitle" class="spot-modal--header"><%= I18n.t('onboarding.welcome', app_title: Setting.app_title) %></div><div class="spot-divider"></div>diff --git a/app/views/onboarding/_configuration_modal.html.erb b/app/views/onboarding/_configuration_modal.html.erbindex e38fba6222a..16b095f0e05 100644--- a/app/views/onboarding/_configuration_modal.html.erb+++ b/app/views/onboarding/_configuration_modal.html.erb@@ -29,7 +29,7 @@ See COPYRIGHT and LICENSE files for more details.<div class="modal-delivery-element"><%= labelled_tabular_form_for current_user, url: { action: 'user_settings', controller: 'onboarding' }, html: { id: 'user-form' } do |f| %>- <div class="spot-modal--header">+ <div id="spotModalTitle" class="spot-modal--header"><%= I18n.t('onboarding.welcome', app_title: Setting.app_title) %>, <%= current_user.name %></div>diff --git a/app/views/onboarding/_onboarding_video_modal.html.erb b/app/views/onboarding/_onboarding_video_modal.html.erbindex 5dc7cbd56d9..e7f168a8651 100644--- a/app/views/onboarding/_onboarding_video_modal.html.erb+++ b/app/views/onboarding/_onboarding_video_modal.html.erb@@ -30,7 +30,7 @@ See COPYRIGHT and LICENSE files for more details.<div class="modal-delivery-element"><div class="spot-modal--header"><span class="spot-icon spot-icon_user"></span>- <span><%= I18n.t('onboarding.welcome', app_title: Setting.app_title) %></span>+ <span id="spotModalTitle"><%= I18n.t('onboarding.welcome', app_title: Setting.app_title) %></span></div><div class="spot-divider"></div><div class="onboarding--main spot-modal--body spot-container">diff --git a/app/views/projects/_project_export_modal.html.erb b/app/views/projects/_project_export_modal.html.erbindex d15b830c9b6..5595041f925 100644--- a/app/views/projects/_project_export_modal.html.erb+++ b/app/views/projects/_project_export_modal.html.erb@@ -28,7 +28,7 @@ See COPYRIGHT and LICENSE files for more details.++#%><div class="modal-delivery-element">- <div class="spot-modal--header">+ <div id="spotModalTitle" class="spot-modal--header"><%= I18n.t('js.label_export') %></div><div class="spot-divider"></div>diff --git a/app/views/wiki/_wiki_export_modal.html.erb b/app/views/wiki/_wiki_export_modal.html.erbindex c3c7f2f9a24..61b146092d5 100644--- a/app/views/wiki/_wiki_export_modal.html.erb+++ b/app/views/wiki/_wiki_export_modal.html.erb@@ -28,7 +28,7 @@ See COPYRIGHT and LICENSE files for more details.++#%><div class="modal-delivery-element">- <div class="spot-modal--header">+ <div id="spotModalTitle" class="spot-modal--header"><%= I18n.t('js.label_export') %></div><div class="spot-divider"></div>diff --git a/frontend/src/app/features/boards/board/add-list-modal/add-list-modal.html b/frontend/src/app/features/boards/board/add-list-modal/add-list-modal.htmlindex d2ad2cb4fdb..5ffbf4c51a6 100644--- a/frontend/src/app/features/boards/board/add-list-modal/add-list-modal.html+++ b/frontend/src/app/features/boards/board/add-list-modal/add-list-modal.html@@ -2,7 +2,7 @@class="spot-modal spot-modal_autoheight confirm-form-submit--modal loading-indicator--location"data-indicator-name="modal">- <div class="spot-modal--header">{{text.title}}</div>+ <div id="spotModalTitle" class="spot-modal--header">{{text.title}}</div><div class="spot-divider"></div>diff --git a/frontend/src/app/features/boards/board/configuration-modal/board-configuration.modal.html b/frontend/src/app/features/boards/board/configuration-modal/board-configuration.modal.htmlindex 4a5dbf708f7..0a1d23b6280 100644--- a/frontend/src/app/features/boards/board/configuration-modal/board-configuration.modal.html+++ b/frontend/src/app/features/boards/board/configuration-modal/board-configuration.modal.html@@ -2,7 +2,7 @@class="spot-modal loading-indicator--location"data-indicator-name="modal">- <div class="spot-modal--header">{{text.title}}</div>+ <div id="spotModalTitle" class="spot-modal--header">{{text.title}}</div><div class="spot-divider"></div>diff --git a/frontend/src/app/features/enterprise/enterprise-modal/enterprise-trial.modal.html b/frontend/src/app/features/enterprise/enterprise-modal/enterprise-trial.modal.htmlindex e5b9592319b..93a7434c7b3 100644--- a/frontend/src/app/features/enterprise/enterprise-modal/enterprise-trial.modal.html+++ b/frontend/src/app/features/enterprise/enterprise-modal/enterprise-trial.modal.html@@ -1,5 +1,5 @@<div class="spot-modal op-enterprise-modal">- <div class="spot-modal--header" [textContent]="headerText$ | async"></div>+ <div id="spotModalTitle" class="spot-modal--header" [textContent]="headerText$ | async"></div><div class="spot-divider"></div>diff --git a/frontend/src/app/features/invite-user-modal/principal/principal.component.html b/frontend/src/app/features/invite-user-modal/principal/principal.component.htmlindex bb245195437..f34564f63e3 100644--- a/frontend/src/app/features/invite-user-modal/principal/principal.component.html+++ b/frontend/src/app/features/invite-user-modal/principal/principal.component.html@@ -3,7 +3,7 @@[formGroup]="principalForm"(ngSubmit)="onSubmit($event)">- <div class="spot-modal--header">{{text.principal.title()}}</div>+ <div id="spotModalTitle" class="spot-modal--header">{{text.principal.title()}}</div><div class="spot-divider"></div>diff --git a/frontend/src/app/features/invite-user-modal/project-selection/project-selection.component.html b/frontend/src/app/features/invite-user-modal/project-selection/project-selection.component.htmlindex 4f21083b278..7c6392fddd3 100644--- a/frontend/src/app/features/invite-user-modal/project-selection/project-selection.component.html+++ b/frontend/src/app/features/invite-user-modal/project-selection/project-selection.component.html@@ -3,7 +3,7 @@[formGroup]="projectAndTypeForm"(ngSubmit)="onSubmit($event)">- <div class="spot-modal--header">{{text.title}}</div>+ <div id="spotModalTitle" class="spot-modal--header">{{text.title}}</div><div class="spot-divider"></div>diff --git a/frontend/src/app/features/invite-user-modal/success/success.component.html b/frontend/src/app/features/invite-user-modal/success/success.component.htmlindex f9ce47f736a..728c90c3716 100644--- a/frontend/src/app/features/invite-user-modal/success/success.component.html+++ b/frontend/src/app/features/invite-user-modal/success/success.component.html@@ -1,4 +1,5 @@<div+ id="spotModalTitle"class="spot-modal--header"[textContent]="text.title()"></div>diff --git a/frontend/src/app/features/invite-user-modal/summary/summary.component.html b/frontend/src/app/features/invite-user-modal/summary/summary.component.htmlindex bb45bb818a5..f0178d0bcb4 100644--- a/frontend/src/app/features/invite-user-modal/summary/summary.component.html+++ b/frontend/src/app/features/invite-user-modal/summary/summary.component.html@@ -3,7 +3,7 @@(submit)="onSubmit($event)"class="op-ium-summary spot-modal">- <div class="spot-modal--header">{{text.title()}}</div>+ <div id="spotModalTitle" class="spot-modal--header">{{text.title()}}</div><div class="spot-divider"></div>@@ -16,7 +16,7 @@<spot-form-field [label]="text.principalLabel[type]"><p slot="input" class="spot-body-small op-ium-summary--details">{{ principal?.name }}</p></spot-form-field>-+<spot-form-field [label]="text.roleLabel()"><p slot="input" class="spot-body-small op-ium-summary--details">{{ role.name }}</p></spot-form-field>diff --git a/frontend/src/app/features/job-status/job-status-modal/job-status.modal.html b/frontend/src/app/features/job-status/job-status-modal/job-status.modal.htmlindex b2cd60011ce..e05fc3f658e 100644--- a/frontend/src/app/features/job-status/job-status-modal/job-status.modal.html+++ b/frontend/src/app/features/job-status/job-status-modal/job-status.modal.html@@ -2,6 +2,7 @@class="spot-modal job-status--modal"><div+ id="spotModalTitle"class="spot-modal--header"data-test-selector="job-status--header">{{ title }}</div>diff --git a/frontend/src/app/features/work-packages/components/wp-share-modal/wp-share.modal.html b/frontend/src/app/features/work-packages/components/wp-share-modal/wp-share.modal.htmlindex 995cf376bf0..3a2d71ac8d7 100644--- a/frontend/src/app/features/work-packages/components/wp-share-modal/wp-share.modal.html+++ b/frontend/src/app/features/work-packages/components/wp-share-modal/wp-share.modal.html@@ -5,6 +5,7 @@class="spot-modal--header"><div+ id="spotModalTitle"class="spot-modal--header-title"[textContent]="this.text.title"></div>diff --git a/frontend/src/app/features/work-packages/components/wp-table/configuration-modal/wp-table-configuration.modal.html b/frontend/src/app/features/work-packages/components/wp-table/configuration-modal/wp-table-configuration.modal.htmlindex 75812d158ad..1189832d601 100644--- a/frontend/src/app/features/work-packages/components/wp-table/configuration-modal/wp-table-configuration.modal.html+++ b/frontend/src/app/features/work-packages/components/wp-table/configuration-modal/wp-table-configuration.modal.html@@ -2,7 +2,7 @@class="spot-modal spot-modal_wide wp-table--configuration-modal loading-indicator--location"data-indicator-name="modal">- <div class="spot-modal--header">{{text.title}}</div>+ <div id="spotModalTitle" class="spot-modal--header">{{text.title}}</div><div class="spot-divider"></div>diff --git a/frontend/src/app/shared/components/attribute-help-texts/help-text.modal.html b/frontend/src/app/shared/components/attribute-help-texts/help-text.modal.htmlindex c893b1a9210..cbbaf4267ce 100644--- a/frontend/src/app/shared/components/attribute-help-texts/help-text.modal.html+++ b/frontend/src/app/shared/components/attribute-help-texts/help-text.modal.html@@ -7,7 +7,7 @@data-test-selector="attribute-help-text--header"><span class="spot-icon spot-icon_help1"></span>- <span class="attribute-help-text--header-text"+ <span class="attribute-help-text--header-text"[textContent]="helpText.attributeCaption"></span></div>diff --git a/frontend/src/app/shared/components/attribute-help-texts/static-attribute-help-text.modal.html b/frontend/src/app/shared/components/attribute-help-texts/static-attribute-help-text.modal.htmlindex 6229b00a00a..d6b04bb8809 100644--- a/frontend/src/app/shared/components/attribute-help-texts/static-attribute-help-text.modal.html+++ b/frontend/src/app/shared/components/attribute-help-texts/static-attribute-help-text.modal.html@@ -4,6 +4,7 @@data-test-selector="static-attribute-help-text--modal"><div+ id="spotModalTitle"class="spot-modal--header">{{ title }}diff --git a/frontend/src/app/shared/components/grids/widgets/add/add.modal.html b/frontend/src/app/shared/components/grids/widgets/add/add.modal.htmlindex d2dc7ec47f4..cfdc1b30433 100644--- a/frontend/src/app/shared/components/grids/widgets/add/add.modal.html+++ b/frontend/src/app/shared/components/grids/widgets/add/add.modal.html@@ -2,7 +2,7 @@class="spot-modal loading-indicator--location"data-indicator-name="modal">- <div class="spot-modal--header">{{text.title}}</div>+ <div id="spotModalTitle" class="spot-modal--header">{{text.title}}</div><div class="spot-divider"></div>@@ -25,7 +25,7 @@<buttontype="button"class="spot-list--item-action"- (click)="select($event, widget)"+ (click)="select($event, widget)"[id]="widget.identifier"[textContent]="widget.title"></button>diff --git a/frontend/src/app/shared/components/grids/widgets/time-entries/current-user/configuration-modal/configuration.modal.html b/frontend/src/app/shared/components/grids/widgets/time-entries/current-user/configuration-modal/configuration.modal.htmlindex 15cddfadb92..b50793139d2 100644--- a/frontend/src/app/shared/components/grids/widgets/time-entries/current-user/configuration-modal/configuration.modal.html+++ b/frontend/src/app/shared/components/grids/widgets/time-entries/current-user/configuration-modal/configuration.modal.html@@ -2,7 +2,7 @@data-indicator-name="modal"tabindex="0">- <div class="spot-modal--header">{{text.displayedDays}}</div>+ <div id="spotModalTitle" class="spot-modal--header">{{text.displayedDays}}</div><div class="spot-divider"></div>diff --git a/frontend/src/app/shared/components/modal/modal-overlay.component.html b/frontend/src/app/shared/components/modal/modal-overlay.component.htmlindex c3fc04dbd20..9f62fb6a7c9 100644--- a/frontend/src/app/shared/components/modal/modal-overlay.component.html+++ b/frontend/src/app/shared/components/modal/modal-overlay.component.html@@ -8,6 +8,9 @@cdkTrapFocus[cdkTrapFocusAutoCapture]="true"(mousedown)="close($event, false)"+ role="dialog"+ aria-modal="true"+ aria-labelledby="spotModalTitle"><buttontype="button"diff --git a/frontend/src/app/shared/components/modals/confirm-dialog/confirm-dialog.modal.html b/frontend/src/app/shared/components/modals/confirm-dialog/confirm-dialog.modal.htmlindex ff2051f2935..f488a5bab19 100644--- a/frontend/src/app/shared/components/modals/confirm-dialog/confirm-dialog.modal.html+++ b/frontend/src/app/shared/components/modals/confirm-dialog/confirm-dialog.modal.html@@ -6,7 +6,7 @@cdkTrapFocus[cdkTrapFocusAutoCapture]="true">- <div class="spot-modal--header">{{text.title}}</div>+ <div id="spotModalTitle" class="spot-modal--header">{{text.title}}</div><div *ngIf="divideContent" class="spot-divider"></div>@@ -14,7 +14,7 @@<span class="op-confirm-dialog--text spot-body-small"[textContent]="text.text"></span>-+<ng-container *ngIf="showListData; else showData"><span class="op-confirm-dialog--text spot-body-small"[textContent]="listTitle"@@ -25,7 +25,7 @@</li></ul></ng-container>-+<ng-template #showData><span*ngFor="let data of passedData"@@ -39,7 +39,7 @@<span class="op-confirm-dialog--text spot-body-small"[innerHtml]="warningText"></span>-+</div><div class="spot-action-bar">diff --git a/frontend/src/app/shared/components/modals/editor/macro-child-pages-modal/child-pages-macro.modal.html b/frontend/src/app/shared/components/modals/editor/macro-child-pages-modal/child-pages-macro.modal.htmlindex 1a26adc7e9c..38a4998df8d 100644--- a/frontend/src/app/shared/components/modals/editor/macro-child-pages-modal/child-pages-macro.modal.html+++ b/frontend/src/app/shared/components/modals/editor/macro-child-pages-modal/child-pages-macro.modal.html@@ -2,7 +2,7 @@class="spot-modal "(submit)="applyAndClose($event)">- <div class="spot-modal--header">{{text.title}}</div>+ <div id="spotModalTitle" class="spot-modal--header">{{text.title}}</div><div class="spot-divider"></div>diff --git a/frontend/src/app/shared/components/modals/editor/macro-code-block-modal/code-block-macro.modal.html b/frontend/src/app/shared/components/modals/editor/macro-code-block-modal/code-block-macro.modal.htmlindex 998e82294e7..d9358bb3096 100644--- a/frontend/src/app/shared/components/modals/editor/macro-code-block-modal/code-block-macro.modal.html+++ b/frontend/src/app/shared/components/modals/editor/macro-code-block-modal/code-block-macro.modal.html@@ -2,7 +2,7 @@class="spot-modal "(submit)="applyAndClose($event)">- <div class="spot-modal--header">{{text.title}}</div>+ <div id="spotModalTitle" class="spot-modal--header">{{text.title}}</div><div class="spot-divider"></div>diff --git a/frontend/src/app/shared/components/modals/editor/macro-wiki-include-page-modal/wiki-include-page-macro.modal.html b/frontend/src/app/shared/components/modals/editor/macro-wiki-include-page-modal/wiki-include-page-macro.modal.htmlindex 79c46b8f53e..44742ececf1 100644--- a/frontend/src/app/shared/components/modals/editor/macro-wiki-include-page-modal/wiki-include-page-macro.modal.html+++ b/frontend/src/app/shared/components/modals/editor/macro-wiki-include-page-modal/wiki-include-page-macro.modal.html@@ -2,7 +2,7 @@class="spot-modal"(submit)="applyAndClose($event)">- <div class="spot-modal--header">{{text.title}}</div>+ <div id="spotModalTitle" class="spot-modal--header">{{text.title}}</div><div class="spot-divider"></div>diff --git a/frontend/src/app/shared/components/modals/editor/macro-wp-button-modal/wp-button-macro.modal.html b/frontend/src/app/shared/components/modals/editor/macro-wp-button-modal/wp-button-macro.modal.htmlindex 95adc5301c3..b7f70e92599 100644--- a/frontend/src/app/shared/components/modals/editor/macro-wp-button-modal/wp-button-macro.modal.html+++ b/frontend/src/app/shared/components/modals/editor/macro-wp-button-modal/wp-button-macro.modal.html@@ -3,7 +3,7 @@(submit)="applyAndClose($event)"data-indicator-name="modal">- <div class="spot-modal--header">{{text.title}}</div>+ <div id="spotModalTitle" class="spot-modal--header">{{text.title}}</div><div class="spot-divider"></div>diff --git a/frontend/src/app/shared/components/modals/export-modal/wp-table-export.modal.html b/frontend/src/app/shared/components/modals/export-modal/wp-table-export.modal.htmlindex 4a3856e2e3f..799f56caaa7 100644--- a/frontend/src/app/shared/components/modals/export-modal/wp-table-export.modal.html+++ b/frontend/src/app/shared/components/modals/export-modal/wp-table-export.modal.html@@ -4,7 +4,7 @@cdkTrapFocus[cdkTrapFocusAutoCapture]="true">- <div class="spot-modal--header">{{text.title}}</div>+ <div id="spotModalTitle" class="spot-modal--header">{{text.title}}</div><div class="spot-divider"></div>diff --git a/frontend/src/app/shared/components/modals/get-ical-url-modal/query-get-ical-url.modal.html b/frontend/src/app/shared/components/modals/get-ical-url-modal/query-get-ical-url.modal.htmlindex 2cbb629649c..30c62237fe1 100644--- a/frontend/src/app/shared/components/modals/get-ical-url-modal/query-get-ical-url.modal.html+++ b/frontend/src/app/shared/components/modals/get-ical-url-modal/query-get-ical-url.modal.html@@ -1,9 +1,9 @@-<form+<formclass="spot-modal loading-indicator--location op-query-get-ical-url"[formGroup]="tokenNameForm"(submit)="generateAndCopyUrl()">- <div class="spot-modal--header">{{text.label_ical_sharing}}</div>+ <div id="spotModalTitle" class="spot-modal--header">{{text.label_ical_sharing}}</div><div class="spot-divider"></div>@@ -19,12 +19,12 @@<p>{{text.description_ical_sharing}}</p>-+<spot-form-field [label]="text.token_name" [required]="true" showValidationErrorOn="change">- <spot-text-field- formControlName="name"- slot="input"+ <spot-text-field+ formControlName="name"+ slot="input"[placeholder]="text.token_name_placeholder"opAutofocus></spot-text-field>@@ -37,11 +37,11 @@{{nameControl?.errors?.rails}}</div>- <span- slot="description"+ <span+ slot="description"[innerHtml]="text.token_name_description_text"></span>-+</spot-form-field></div>diff --git a/frontend/src/app/shared/components/modals/request-for-confirmation/password-confirmation.modal.html b/frontend/src/app/shared/components/modals/request-for-confirmation/password-confirmation.modal.htmlindex 1d7cc015a8e..1474f55a1e7 100644--- a/frontend/src/app/shared/components/modals/request-for-confirmation/password-confirmation.modal.html+++ b/frontend/src/app/shared/components/modals/request-for-confirmation/password-confirmation.modal.html@@ -3,7 +3,7 @@data-indicator-name="modal"(submit)="confirmAndClose($event)">- <div class="spot-modal--header">{{text.title}}</div>+ <div id="spotModalTitle" class="spot-modal--header">{{text.title}}</div><div class="spot-divider"></div>diff --git a/frontend/src/app/shared/components/modals/save-modal/save-query.modal.html b/frontend/src/app/shared/components/modals/save-modal/save-query.modal.htmlindex a87080362c1..eae1060b0c2 100644--- a/frontend/src/app/shared/components/modals/save-modal/save-query.modal.html+++ b/frontend/src/app/shared/components/modals/save-modal/save-query.modal.html@@ -4,8 +4,8 @@name="modalSaveForm"(submit)="saveQueryAs($event)">- <h1 class="spot-modal--header">{{text.save_as}}</h1>-+ <h1 id="spotModalTitle" class="spot-modal--header">{{text.save_as}}</h1>+<div class="spot-divider"></div><div@@ -29,9 +29,9 @@</div></div><div class="spot-divider"></div>-+<h2 class="spot-subheader-extra-small">{{ text.label_visibility_settings }}</h2>-+<query-sharing-form[isSave]="true"(onChange)="setValues($event)"diff --git a/frontend/src/app/shared/components/modals/share-modal/query-sharing.modal.html b/frontend/src/app/shared/components/modals/share-modal/query-sharing.modal.htmlindex edffc9ecfe6..e42113932fc 100644--- a/frontend/src/app/shared/components/modals/share-modal/query-sharing.modal.html+++ b/frontend/src/app/shared/components/modals/share-modal/query-sharing.modal.html@@ -2,7 +2,7 @@class="spot-modal loading-indicator--location"data-indicator-name="modal">- <div class="spot-modal--header">{{text.label_visibility_settings}}</div>+ <div id="spotModalTitle" class="spot-modal--header">{{text.label_visibility_settings}}</div><div class="spot-divider"></div>diff --git a/frontend/src/app/shared/components/modals/wp-destroy-modal/wp-destroy.modal.html b/frontend/src/app/shared/components/modals/wp-destroy-modal/wp-destroy.modal.htmlindex fb178b62cc6..60f9f8b362c 100644--- a/frontend/src/app/shared/components/modals/wp-destroy-modal/wp-destroy.modal.html+++ b/frontend/src/app/shared/components/modals/wp-destroy-modal/wp-destroy.modal.html@@ -3,7 +3,7 @@data-indicator-name="modal"id="wp_destroy_modal">- <div class="spot-modal--header">{{text.title}}</div>+ <div id="spotModalTitle" class="spot-modal--header">{{text.title}}</div><div class="spot-modal--body spot-container"><ng-container *ngIf="singleWorkPackage">diff --git a/frontend/src/app/shared/components/storages/file-picker-modal/file-picker-modal.component.html b/frontend/src/app/shared/components/storages/file-picker-modal/file-picker-modal.component.htmlindex cee558f6dae..c222cf3a048 100644--- a/frontend/src/app/shared/components/storages/file-picker-modal/file-picker-modal.component.html+++ b/frontend/src/app/shared/components/storages/file-picker-modal/file-picker-modal.component.html@@ -3,7 +3,7 @@data-test-selector="op-files-picker-modal"><div class="spot-modal--header">- <span class="spot-modal--header-title">{{text.header}}</span>+ <span id="spotModalTitle" class="spot-modal--header-title">{{text.header}}</span></div><div class="spot-divider"></div>diff --git a/frontend/src/app/shared/components/storages/location-picker-modal/location-picker-modal.component.html b/frontend/src/app/shared/components/storages/location-picker-modal/location-picker-modal.component.htmlindex e4b6788139b..37a710221d0 100644--- a/frontend/src/app/shared/components/storages/location-picker-modal/location-picker-modal.component.html+++ b/frontend/src/app/shared/components/storages/location-picker-modal/location-picker-modal.component.html@@ -3,7 +3,7 @@data-test-selector="op-files-picker-modal"><div class="spot-modal--header">- <span class="spot-modal--header-title">{{text.header}}</span>+ <span id="spotModalTitle" class="spot-modal--header-title">{{text.header}}</span></div><div class="spot-divider"></div>diff --git a/frontend/src/app/shared/components/storages/upload-conflict-modal/upload-conflict-modal.component.html b/frontend/src/app/shared/components/storages/upload-conflict-modal/upload-conflict-modal.component.htmlindex 277f3157edc..7289c7292a0 100644--- a/frontend/src/app/shared/components/storages/upload-conflict-modal/upload-conflict-modal.component.html+++ b/frontend/src/app/shared/components/storages/upload-conflict-modal/upload-conflict-modal.component.html@@ -5,6 +5,7 @@class="spot-modal--header"><span+ id="spotModalTitle"class="spot-modal--header-title"[textContent]="text.header"></span>diff --git a/frontend/src/app/shared/components/time_entries/shared/modal/base.modal.html b/frontend/src/app/shared/components/time_entries/shared/modal/base.modal.htmlindex 13e80a9bbb1..50b919bbc01 100644--- a/frontend/src/app/shared/components/time_entries/shared/modal/base.modal.html+++ b/frontend/src/app/shared/components/time_entries/shared/modal/base.modal.html@@ -4,7 +4,7 @@><div class="spot-modal--header"><span class="spot-icon spot-icon_time"></span>- <span [textContent]="text.title"></span>+ <span id="spotModalTitle" [textContent]="text.title"></span></div><div class="spot-divider"></div>diff --git a/frontend/src/app/shared/components/time_entries/timer/stop-existing-timer-modal.component.html b/frontend/src/app/shared/components/time_entries/timer/stop-existing-timer-modal.component.htmlindex ba9ec03fc33..3c2c9d41995 100644--- a/frontend/src/app/shared/components/time_entries/timer/stop-existing-timer-modal.component.html+++ b/frontend/src/app/shared/components/time_entries/timer/stop-existing-timer-modal.component.html@@ -3,7 +3,7 @@data-test-selector="op-stop-existing-timer-modal"><div class="spot-modal--header">- <span class="spot-modal--header-title">{{text.title}}</span>+ <span id="spotModalTitle" class="spot-modal--header-title">{{text.title}}</span></div><pdiff --git a/spec/features/work_packages/share_spec.rb b/spec/features/work_packages/share_spec.rbindex 3f715ce4e8f..d9d55800c2c 100644--- a/spec/features/work_packages/share_spec.rb+++ b/spec/features/work_packages/share_spec.rb@@ -97,7 +97,7 @@ RSpec.describe 'Work package sharing',click_button 'Share'aggregate_failures "Initial shares list" do- share_modal.expect_open+ share_modal.expect_title(I18n.t('js.work_packages.sharing.title'))share_modal.expect_shared_with(comment_user, 'Comment', position: 1)share_modal.expect_shared_with(dinesh, 'Edit', position: 2)share_modal.expect_shared_with(edit_user, 'Edit', position: 3)diff --git a/spec/support/capybara/additional_accessible_selectors.rb b/spec/support/capybara/additional_accessible_selectors.rbnew file mode 100644index 00000000000..d05f4ceafb9--- /dev/null+++ b/spec/support/capybara/additional_accessible_selectors.rb@@ -0,0 +1,61 @@+# frozen_string_literal: true++#-- copyright+# OpenProject is an open source project management software.+# Copyright (C) 2012-2023 the OpenProject GmbH+#+# This program is free software; you can redistribute it and/or+# modify it under the terms of the GNU General Public License version 3.+#+# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:+# Copyright (C) 2006-2013 Jean-Philippe Lang+# Copyright (C) 2010-2013 the ChiliProject Team+#+# This program is free software; you can redistribute it and/or+# modify it under the terms of the GNU General Public License+# as published by the Free Software Foundation; either version 2+# of the License, or (at your option) any later version.+#+# This program is distributed in the hope that it will be useful,+# but WITHOUT ANY WARRANTY; without even the implied warranty of+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+# GNU General Public License for more details.+#+# You should have received a copy of the GNU General Public License+# along with this program; if not, write to the Free Software+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.+#+# See COPYRIGHT and LICENSE files for more details.+#++++Capybara.add_selector(:list) do+ xpath { ".//ul | .//ol" }+end++Capybara.add_selector(:list_item) do+ label 'list item'++ xpath { ".//li" }++ expression_filter(:position) do |xpath, position|+ position ? "#{xpath}[#{position}]" : xpath+ end++ describe_expression_filters do |position: nil, **|+ position ? " at position #{position}" : ""+ end+end++module Capybara+ module RSpecMatchers+ %i[list list_item].each do |selector|+ define_method "have_#{selector}" do |locator = nil, **options, &optional_filter_block|+ Matchers::HaveSelector.new(selector, locator, **options, &optional_filter_block)+ end++ define_method "have_no_#{selector}" do |*args, **options, &optional_filter_block|+ Matchers::NegatedMatcher.new(send("have_#{selector}", *args, **options, &optional_filter_block))+ end+ end+ end+enddiff --git a/spec/support/components/common/modal.rb b/spec/support/components/common/modal.rbindex a4fafc26444..2e75352cca6 100644--- a/spec/support/components/common/modal.rb+++ b/spec/support/components/common/modal.rb@@ -34,17 +34,15 @@ module Componentsinclude RSpec::Matchersdef expect_title(text)- within_modal do- expect(page).to have_selector('.spot-modal--header', text:)- end+ expect(page).to have_modal(text)enddef expect_open- expect(page).to have_selector(selector, wait: 40)+ expect(page).to have_modal(wait: 40)enddef expect_closed- expect(page).not_to have_selector(selector)+ expect(page).not_to have_modalenddef expect_text(text)@@ -59,16 +57,12 @@ module Componentsendend- def within_modal(&)- page.within(selector, &)+ def within_modal(name = nil, **options, &)+ super(name, **options, &)enddef modal_element- page.find(selector)- end-- def selector- '.spot-modal'+ find(:modal)endendenddiff --git a/spec/support/components/work_packages/share_modal.rb b/spec/support/components/work_packages/share_modal.rbindex 151701bd16a..03770bb2975 100644--- a/spec/support/components/work_packages/share_modal.rb+++ b/spec/support/components/work_packages/share_modal.rb@@ -32,9 +32,6 @@ require 'support/components/autocompleter/ng_select_autocomplete_helpers'module Componentsmodule WorkPackagesclass ShareModal < Components::Common::Modal- include Capybara::DSL- include Capybara::RSpecMatchers- include RSpec::Matchersinclude Components::Autocompleter::NgSelectAutocompleteHelpersattr_reader :work_package@@ -201,7 +198,7 @@ module Componentsselect_invite_role(role_name)- within modal_element do+ within_modal doclick_button 'Share'endend@@ -250,36 +247,23 @@ module Componentsenddef close- within modal_element do+ within_modal doclick_button 'Close'endenddef expect_shared_with(user, role_name = nil, position: nil, editable: true)- within shares_list do- expect(page)- .to have_text(user.name)- end-- if position- within shares_list do- expect(page)- .to have_selector("li:nth-child(#{position})", text: user.name),- "Expected #{user.name} to be ##{position} on the shares list."- end- end-- if role_name- within user_row(user) do- expect(page)- .to have_button(role_name)- end- end-- unless editable- within user_row(user) do- expect(page)- .not_to have_button+ within_modal do+ expect(page).to have_list_item(text: user.name, position:)+ within(:list_item, text: user.name, position:) do+ if role_name+ expect(page).to have_button(role_name),+ "Expected share with #{user.name.inspect} to have button #{role_name}."+ end+ unless editable+ expect(page).not_to have_button,+ "Expected share with #{user.name.inspect} not to be editable (expected no buttons)."+ endendendend@@ -299,7 +283,7 @@ module Componentsenddef expect_no_invite_option- within modal_element do+ within_modal doexpect(page).to have_text(I18n.t('work_package.sharing.permissions.denied'))end@@ -319,8 +303,9 @@ module Componentsenddef user_row(user)- shares_list- .find("[data-test-selector=\"op-share-wp-active-user-#{user.id}\"]")+ within_modal do+ find(:list_item, text: user.name)+ endenddef active_list@@ -355,7 +340,7 @@ module Componentsenddef expect_upsale_banner- within modal_element do+ within_modal doexpect(page).to have_text(I18n.t(:label_enterprise_addon))end