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
[#44828] fixed spec selectors
Eric Schubert11ddbb53fab9
diff --git a/frontend/src/app/features/work-packages/components/wp-relations/wp-relation-row/wp-relation-row.template.html b/frontend/src/app/features/work-packages/components/wp-relations/wp-relation-row/wp-relation-row.template.htmlindex abf5ff983bf..7cd263a8f7f 100644--- a/frontend/src/app/features/work-packages/components/wp-relations/wp-relation-row/wp-relation-row.template.html+++ b/frontend/src/app/features/work-packages/components/wp-relations/wp-relation-row/wp-relation-row.template.html@@ -10,6 +10,7 @@<buttontype="button"class="relation-row--type"+ data-qa-selector="op-relation--row-type"(click)="activateRelationTypeEdit()"*ngIf="!userInputs.showRelationTypesForm">@@ -47,12 +48,14 @@<aclass="relation-row--grid-id"+ data-qa-selector="op-relation--row-id"uiSref="work-packages.show.tabs"[uiParams]="{ workPackageId: relatedWorkPackage.id, tabIdentifier: 'relations' }">#{{relatedWorkPackage.id}}</a><aclass="relation-row--grid-subject"+ data-qa-selector="op-relation--row-subject"uiSref="work-packages.show.tabs"[uiParams]="{ workPackageId: relatedWorkPackage.id, tabIdentifier: 'relations' }"[textContent]="relatedWorkPackage.subject"diff --git a/spec/features/work_packages/copy_spec.rb b/spec/features/work_packages/copy_spec.rbindex f63b00f6d66..30df41460ee 100644--- a/spec/features/work_packages/copy_spec.rb+++ b/spec/features/work_packages/copy_spec.rb@@ -128,7 +128,7 @@ RSpec.describe 'Work package copy', js: true, selenium: true dowork_package_page.visit_tab! :relationsexpect_angular_frontend_initializedexpect(page).to have_selector('.relation-group--header', text: 'RELATED TO', wait: 20)- expect(page).to have_selector('.wp-relations--subject-field', text: original_work_package.subject)+ expect(page).to have_selector("[data-qa-selector='op-relation--row-subject']", text: original_work_package.subject)enddescribe 'when source work package has an attachment' do@@ -181,6 +181,6 @@ RSpec.describe 'Work package copy', js: true, selenium: true dowork_package_page.visit_tab!('relations')expect_angular_frontend_initializedexpect(page).to have_selector('.relation-group--header', text: 'RELATED TO', wait: 20)- expect(page).to have_selector('.wp-relations--subject-field', text: original_work_package.subject)+ expect(page).to have_selector("[data-qa-selector='op-relation--row-subject']", text: original_work_package.subject)endenddiff --git a/spec/features/work_packages/details/relations/hierarchy_spec.rb b/spec/features/work_packages/details/relations/hierarchy_spec.rbindex f071d4dbdaf..a8301ef0532 100644--- a/spec/features/work_packages/details/relations/hierarchy_spec.rb+++ b/spec/features/work_packages/details/relations/hierarchy_spec.rb@@ -69,14 +69,14 @@ shared_examples 'work package relations tab', js: true, selenium: true do### Add child #1- relations.openChildrenAutocompleter+ relations.open_children_autocompleterrelations.add_existing_child(child)relations.expect_child(child)### Add child #2- relations.openChildrenAutocompleter+ relations.open_children_autocompleterrelations.add_existing_child(child2)relations.expect_child(child2)@@ -240,7 +240,7 @@ shared_examples 'work package relations tab', js: true, selenium: true do### Add child- relations.openChildrenAutocompleter+ relations.open_children_autocompleterrelations.add_existing_child(child)wp_page.expect_and_dismiss_toaster(message: 'Successful update.')diff --git a/spec/features/work_packages/details/relations/relations_spec.rb b/spec/features/work_packages/details/relations/relations_spec.rbindex 588a98da1d0..3ab48316224 100644--- a/spec/features/work_packages/details/relations/relations_spec.rb+++ b/spec/features/work_packages/details/relations/relations_spec.rb@@ -249,7 +249,7 @@ describe 'Work package relations tab', js: true, selenium: true do# Wait for the relations table to be presentsleep 2- expect(page).to have_selector('.wp-relations--subject-field')+ expect(page).to have_selector("[data-qa-selector='op-relation--row-subject']")scroll_to_element find('.detail-panel--relations')diff --git a/spec/support/components/work_packages/relations.rb b/spec/support/components/work_packages/relations.rbindex 23359c83cf2..f9881b4df9b 100644--- a/spec/support/components/work_packages/relations.rb+++ b/spec/support/components/work_packages/relations.rb@@ -48,7 +48,7 @@ module Componentsdef click_relation(relatable)SeleniumHubWaiter.wait- page.find(".relation-row-#{relatable.id} .wp-relations--subject-field").click+ page.find(".relation-row-#{relatable.id} [data-qa-selector='op-relation--row-id']").clickenddef edit_relation_type(relatable, to_type:)@@ -63,7 +63,7 @@ module Componentsdef hover_action(relatable, action)retry_block do# Focus type edit to expose buttons- span = page.find(".relation-row-#{relatable.id} .relation-row--type", wait: 20)+ span = page.find(".relation-row-#{relatable.id} [data-qa-selector='op-relation--row-type']", wait: 20)scroll_to_element(span)page.driver.browser.action.move_to(span.native).perform@@ -96,7 +96,7 @@ module Componentscontainer = find('.wp-relations-create--form', wait: 10)# Labels to expect- relation_label = I18n.t('js.relation_labels.' + type)+ relation_label = I18n.t("js.relation_labels.#{type}")select relation_label, from: 'relation-type--select'@@ -111,9 +111,9 @@ module Componentstext: relation_label.upcase,wait: 10)- expect(page).to have_selector('.relation-row--type', text: to.type.name.upcase)+ expect(page).to have_selector("[data-qa-selector='op-relation--row-type']", text: to.type.name.upcase)- expect(page).to have_selector('.wp-relations--subject-field', text: to.subject)+ expect(page).to have_selector("[data-qa-selector='op-relation--row-subject']", text: to.subject)## Test if relation existwork_package.reload@@ -123,15 +123,15 @@ module Componentsenddef expect_relation(relatable)- expect(relations_group).to have_selector('.wp-relations--subject-field', text: relatable.subject)+ expect(relations_group).to have_selector("[data-qa-selector='op-relation--row-subject']", text: relatable.subject)enddef expect_relation_by_text(text)- expect(relations_group).to have_selector('.wp-relations--subject-field', text:)+ expect(relations_group).to have_selector("[data-qa-selector='op-relation--row-subject']", text:)enddef expect_no_relation(relatable)- expect(page).not_to have_selector('.wp-relations--subject-field', text: relatable.subject)+ expect(page).not_to have_selector("[data-qa-selector='op-relation--row-subject']", text: relatable.subject)enddef add_parent(query, work_package)@@ -172,7 +172,7 @@ module Componentssubject.update subject_textend- def openChildrenAutocompleter+ def open_children_autocompleterretry_block donext if page.has_selector?('.wp-relations--children .ng-input input')