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
Fix cukes in backlogs due to js cucumber
Oliver Günther2258309baa1b
diff --git a/features/support/env.rb b/features/support/env.rbindex 09c358f64d5..9638ea5257a 100644--- a/features/support/env.rb+++ b/features/support/env.rb@@ -135,7 +135,7 @@ Cucumber::Rails::Database.javascript_strategy = :truncation# Remove any modal dialog remaining from the scenarios which finish in an unclean stateBefore do |_scenario|- page.driver.browser.switch_to.alert.accept rescue Selenium::WebDriver::Error::NoAlertOpenError+ page.driver.browser.switch_to.alert.accept rescue Selenium::WebDriver::Error::NoSuchAlertErrorendBefore dodiff --git a/features/support/selenium_with_firebug.rb b/features/support/selenium_with_firebug.rbdeleted file mode 100644index 44826f8ea8e..00000000000--- a/features/support/selenium_with_firebug.rb+++ /dev/null@@ -1,56 +0,0 @@-#-- encoding: UTF-8-#-- copyright-# OpenProject is an open source project management software.-# Copyright (C) 2012-2020 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-2017 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 docs/COPYRIGHT.rdoc for more details.-#++--Capybara.register_driver :selenium_with_firebug do |app|- Capybara::Selenium::Driver- profile = Selenium::WebDriver::Firefox::Profile.new- profile.add_extension(File.expand_path('../firebug-1.11.4.xpi', __FILE__))- profile.add_extension(File.expand_path('../firepath-0.9.7-fx.xpi', __FILE__))-- # Prevent "Welcome!" tab- profile['extensions.firebug.currentVersion'] = '999'-- # Enable for all sites.- profile['extensions.firebug.allPagesActivation'] = 'on'-- # Enable all features.- ['console', 'net', 'script'].each do |feature|- profile["extensions.firebug.#{feature}.enableSites"] = true- end-- profile['intl.accept_languages'] = 'en,en-us'-- Capybara::Selenium::Driver.new(app,- browser: :firefox,- profile: profile)-end--Before '@firebug' do- Capybara.current_driver = :selenium_with_firebug-enddiff --git a/frontend/src/app/modules/backlogs/openproject-backlogs.routes.ts b/frontend/src/app/modules/backlogs/openproject-backlogs.routes.tsindex e730021740c..f2b1dd9e42a 100644--- a/frontend/src/app/modules/backlogs/openproject-backlogs.routes.ts+++ b/frontend/src/app/modules/backlogs/openproject-backlogs.routes.ts@@ -36,4 +36,10 @@ export const BACKLOGS_ROUTES:Ng2StateDeclaration[] = [url: '/backlogs',component: BacklogsPageComponent},+ {+ name: 'backlogs_sprint',+ parent: 'root',+ url: '/sprints/{sprintId:int}/taskboard',+ component: BacklogsPageComponent+ },];diff --git a/frontend/src/app/modules/router/openproject.routes.ts b/frontend/src/app/modules/router/openproject.routes.tsindex ef42f0b59f4..ce951b3d851 100644--- a/frontend/src/app/modules/router/openproject.routes.ts+++ b/frontend/src/app/modules/router/openproject.routes.ts@@ -69,6 +69,12 @@ export const OPENPROJECT_ROUTES:Ng2StateDeclaration[] = [url: '/backlogs',loadChildren: () => import('../backlogs/openproject-backlogs.module').then(m => m.OpenprojectBacklogsModule)},+ {+ name: 'backlogs_sprint.**',+ parent: 'root',+ url: '/sprints',+ loadChildren: () => import('../backlogs/openproject-backlogs.module').then(m => m.OpenprojectBacklogsModule)+ },{name: 'reporting.**',parent: 'root',@@ -156,8 +162,8 @@ export function initializeUiRouterListeners(injector:Injector) {let wpBase = document.querySelector(appBaseSelector);// Uncomment to trace route changes- // const uiRouter = injector.get(UIRouter);- // uiRouter.trace.enable();+ const uiRouter = injector.get(UIRouter);+ uiRouter.trace.enable();// Apply classes from bodyClasses in each state definition// This was defined as onEnter, onExit functions in each state beforediff --git a/modules/backlogs/features/common.feature b/modules/backlogs/features/common.featureindex fecfa1e94d5..2a494feae40 100644--- a/modules/backlogs/features/common.feature+++ b/modules/backlogs/features/common.feature@@ -57,16 +57,19 @@ Feature: CommonAnd the user "paul" is a "team member"And I am already logged in as "paul"+ @javascriptScenario: View the master backlogGiven I am on the overview page of the projectAnd I follow "Backlogs"Then I should be on the master backlog+ @javascriptScenario: View the product backlogWhen I go to the master backlog- Then the request should complete successfully+ Then I should see "Backlogs" within "#content"+ @javascriptScenario: View the product backlog without any storiesGiven there are no stories in the projectWhen I go to the master backlog- Then the request should complete successfully+ Then I should see "Backlogs" within "#content"diff --git a/modules/backlogs/features/product_owner.feature b/modules/backlogs/features/product_owner.featureindex 70044ac5a9d..1d48a665226 100644--- a/modules/backlogs/features/product_owner.feature+++ b/modules/backlogs/features/product_owner.feature@@ -91,6 +91,7 @@ Feature: Product Owner| Story B | Sprint 001 |And I am already logged in as "mathias"+ @javascriptScenario: View the product backlogWhen I go to the master backlogThen I should see the product backlog@@ -98,6 +99,7 @@ Feature: Product OwnerAnd I should see 4 sprint backlogsAnd I should see 2 product owner backlogs+ @javascriptScenario: Create a new storyWhen I go to the master backlogAnd I want to create a story@@ -107,6 +109,7 @@ Feature: Product OwnerThen the 1st story in the "Product Backlog" should be "A Whole New Story"And all positions should be unique for each version+ @javascriptScenario: Update a storyGiven I am on the master backlogAnd I want to edit the story with subject Story 3@@ -117,6 +120,7 @@ Feature: Product OwnerAnd the story should have a type of EpicAnd the story should be at position 3+ @javascriptScenario: Close a storyGiven I am on the master backlogAnd I want to edit the story with subject Story 4@@ -124,16 +128,19 @@ Feature: Product OwnerWhen I update the storyThen the status of the story should be set as closed+ @javascriptScenario: Move a story to the topGiven I am on the master backlogWhen I move the 3rd story to the 1st positionThen the 1st story in the "Product Backlog" should be "Story 3"+ @javascriptScenario: Move a story to the bottomGiven I am on the master backlogWhen I move the 2nd story to the last positionThen the 4th story in the "Product Backlog" should be "Story 2"+ @javascriptScenario: Move a story downGiven I am on the master backlogWhen I move the 2nd story to the 3rd position@@ -141,6 +148,7 @@ Feature: Product OwnerAnd the 3rd story in the "Product Backlog" should be "Story 2"And the 4th story in the "Product Backlog" should be "Story 4"+ @javascriptScenario: Move a story upGiven I am on the master backlogWhen I move the 4th story to the 2nd positiondiff --git a/modules/backlogs/features/scrum_master.feature b/modules/backlogs/features/scrum_master.featureindex 70869df00d3..e74859cdd83 100644--- a/modules/backlogs/features/scrum_master.feature+++ b/modules/backlogs/features/scrum_master.feature@@ -120,6 +120,7 @@ Feature: Scrum Master| Subsubtask | Sprint 005 | Subfeature | Task |And I am already logged in as "markus"+ @javascriptScenario: View stories that have a parent ticketGiven I am on the master backlogThen I should see 2 stories in "Sprint 005"@@ -218,6 +219,7 @@ Feature: Scrum MasterAnd the impediment "Bad Company" should signal unsuccessful savingAnd the error alert should show "IDs of blocked work packages must contain the ID of at least one ticket"+ @javascriptScenario: Update sprint detailsGiven I am on the master backlogAnd I want to edit the sprint named Sprint 001@@ -228,6 +230,7 @@ Feature: Scrum MasterThen the request should complete successfullyAnd the sprint should be updated accordingly+ @javascriptScenario: Update sprint with no nameGiven I am on the master backlogAnd I want to edit the sprint named Sprint 001@@ -235,6 +238,7 @@ Feature: Scrum MasterWhen I update the sprintThen the server should return an update error+ @javascriptScenario: Move a story from product backlog to sprint backlogGiven I am on the master backlogWhen I move the story named Story 1 up to the 1st position of the sprint named Sprint 001@@ -246,6 +250,7 @@ Feature: Scrum MasterAnd Story 1 should be in the 2nd position of the sprint named Sprint 001And Story 2 should be in the 1st position of the sprint named Sprint 002+ @javascriptScenario: Move a story down in a sprintGiven I am on the master backlogWhen I move the story named Story A below Story B@@ -253,6 +258,7 @@ Feature: Scrum MasterAnd Story A should be in the 2nd position of the sprint named Sprint 001And Story B should be the higher item of Story A+ @javascriptScenario: View tasks that have subtasksGiven I am on the taskboard for "Sprint 005"Then I should see "Task 10" within "#tasks"@@ -264,6 +270,7 @@ Feature: Scrum MasterAnd I should not see "Subfeature"And I should not see "Subsubtask"+ @javascriptScenario: Move stories around in the backlog that have a parent ticketGiven I am on the master backlogWhen I move the story named Story D below Story E@@ -285,6 +292,7 @@ Feature: Scrum MasterAnd I should see "Subfeature" within ".work-package-table--container table"And I should see "Subsubtask" within ".work-package-table--container table"+ @javascriptScenario: Move a task with subtasks around in the taskboardGiven I am on the taskboard for "Sprint 005"When I move the task named Task 10 below Task 11diff --git a/modules/backlogs/features/shared_versions.feature b/modules/backlogs/features/shared_versions.featureindex 9e782de0b72..6654b9b3364 100644--- a/modules/backlogs/features/shared_versions.feature+++ b/modules/backlogs/features/shared_versions.feature@@ -72,10 +72,12 @@ Feature: Shared Versions| ChildSprint | 2010-03-01 | 2010-03-31 |And I am already logged in as "padme"+ @javascriptScenario: Inherited Sprints are displayedGiven I am on the master backlogThen I should see "ParentSprint" within "#sprint_backlogs_container .backlog:first-child .sprint .name"+ @javascriptScenario: Only stories of current project are displayedGiven the project "parent" has the following stories in the following sprints:| subject | backlog |diff --git a/modules/backlogs/features/step_definitions/_then_steps.rb b/modules/backlogs/features/step_definitions/_then_steps.rbindex 87b607b7b5c..4fbfe3c1fab 100644--- a/modules/backlogs/features/step_definitions/_then_steps.rb+++ b/modules/backlogs/features/step_definitions/_then_steps.rb@@ -108,11 +108,11 @@ Then /^(.+) should be the higher (story|item|task) of (.+)$/ do |higher_subject,endThen /^the request should complete successfully$/ do- page.driver.response.status.should == 200+ RequestStore[:response].status.should == 200endThen /^the request should fail$/ do- page.driver.response.status.should == 401+ RequestStore[:response].status.should == 401endThen /^the (\d+)(?:st|nd|rd|th) story in (?:the )?"(.+?)" should be "(.+)"$/ do |position, version_name, subject|@@ -148,7 +148,7 @@ Then /^the (\d+)(?:st|nd|rd|th) task for (.+) should be (.+)$/ do |position, stoendThen /^the server should return an update error$/ do- page.driver.response.status.should == 400+ RequestStore[:response].status.should == 400endThen /^the server should return (\d+) updated (.+)$/ do |count, object_type|diff --git a/modules/backlogs/features/step_definitions/_when_steps.rb b/modules/backlogs/features/step_definitions/_when_steps.rbindex 6382a76d845..ca891e577c0 100644--- a/modules/backlogs/features/step_definitions/_when_steps.rb+++ b/modules/backlogs/features/step_definitions/_when_steps.rb@@ -26,20 +26,36 @@# See docs/COPYRIGHT.rdoc for more details.#+++def perform_post(url, params = {})+ session = page.get_rack_session+ driver = Capybara.current_driver+ begin+ Capybara.current_driver = :rack_test+ page.set_rack_session(session)+ RequestStore[:response] = page.driver.post(url, params)+ rescue StandardError => e+ warn "Failed to perform rack request: #{e}"+ raise e+ ensure+ Capybara.current_driver = driver+ page.set_rack_session(session)+ end+end+When /^I create the impediment$/ do- page.driver.post backlogs_project_sprint_impediments_url(+ perform_post backlogs_project_sprint_impediments_url(*@impediment_params.values_at('project_id', 'version_id')), @impediment_params.except('author_id', 'author')endWhen /^I create the story$/ do- page.driver.post backlogs_project_sprint_stories_url(+ perform_post backlogs_project_sprint_stories_url(*@story_params.values_at('project_id', 'version_id')), @story_params.except('author_id', 'author')endWhen /^I create the task$/ do- page.driver.post backlogs_project_sprint_tasks_url(+ perform_post backlogs_project_sprint_tasks_url(*@task_params.values_at('project_id', 'version_id')), @task_params.except('author_id', 'author')end@@ -62,7 +78,7 @@ When /^I move the (story|item|task) named (.+) below (.+)$/ do |type, story_subjproject = Project.find(attributes['project_id'])sprint = prev.version- page.driver.post polymorphic_url(+ perform_post polymorphic_url([:backlogs, project, sprint.becomes(Sprint), story]), attributes.merge('_method' => 'put')end@@ -82,7 +98,7 @@ When /^I move the story named (.+) (up|down) to the (\d+)(?:st|nd|rd|th) positiostories[position - (direction == 'up' ? 2 : 1)].idend- page.driver.post backlogs_project_sprint_story_url(+ perform_post backlogs_project_sprint_story_url(*attributes.values_at('project_id', 'version_id', 'id')), attributes.merge('_method' => 'put')end@@ -105,7 +121,7 @@ When /^I move the (\d+)(?:st|nd|rd|th) story to the (\d+|last)(?:st|nd|rd|th)? p@story = Story.find(story.text.to_i)- page.driver.post backlogs_project_sprint_story_url(+ perform_post backlogs_project_sprint_story_url(@project.id,@story.version_id,@story.id@@ -113,25 +129,25 @@ When /^I move the (\d+)(?:st|nd|rd|th) story to the (\d+|last)(?:st|nd|rd|th)? pendWhen /^I update the impediment$/ do- page.driver.post backlogs_project_sprint_impediment_url(+ perform_post backlogs_project_sprint_impediment_url(*@impediment_params.values_at('project_id', 'version_id', 'id')), @impediment_params.merge('_method' => 'put')endWhen /^I update the sprint$/ do- page.driver.post backlogs_project_sprint_url(+ perform_post backlogs_project_sprint_url(*@sprint_params.values_at('project_id', 'id')), @sprint_params.merge('_method' => 'put')endWhen /^I update the story$/ do- page.driver.post backlogs_project_sprint_story_url(+ perform_post backlogs_project_sprint_story_url(*@story_params.values_at('project_id', 'version_id', 'id')), @story_params.merge('_method' => 'put')endWhen /^I update the task$/ do- page.driver.post backlogs_project_sprint_task_url(+ perform_post backlogs_project_sprint_task_url(*@task_params.values_at('project_id', 'version_id', 'id')), @task_params.merge('_method' => 'put')enddiff --git a/modules/backlogs/features/team_member.feature b/modules/backlogs/features/team_member.featureindex c1ffa84a2fb..501e771abeb 100644--- a/modules/backlogs/features/team_member.feature+++ b/modules/backlogs/features/team_member.feature@@ -81,6 +81,7 @@ Feature: Team Member| Impediment 2 | Sprint 001 | Story 2 |And I am already logged in as "paul"+ @javascriptScenario: Create a task for a storyGiven I am on the taskboard for "Sprint 001"And I want to create a task for Story 1@@ -89,6 +90,7 @@ Feature: Team MemberThen the request should complete successfullyAnd the 1st task for Story 1 should be A Whole New Task+ @javascriptScenario: Update a task for a storyGiven I am on the taskboard for "Sprint 001"And I want to edit the task named Task 1@@ -97,6 +99,7 @@ Feature: Team MemberThen the request should complete successfullyAnd the story named Story 1 should have 1 task named Whoa there, Sparky+ @javascriptScenario: View a taskboardGiven I am on the taskboard for "Sprint 001"Then I should see the taskboard@@ -128,6 +131,7 @@ Feature: Team MemberWhen I press "Filter"Then I should see "Version" within "#filters"+ @javascriptScenario: Copy estimate to remainingGiven I am on the taskboard for "Sprint 001"And I want to create a task for Story 1@@ -137,6 +141,7 @@ Feature: Team MemberThen the request should complete successfullyAnd task A Whole New Task should have remaining_hours set to 3+ @javascriptScenario: Copy remaining to estimateGiven I am on the taskboard for "Sprint 001"And I want to create a task for Story 1@@ -146,6 +151,7 @@ Feature: Team MemberThen the request should complete successfullyAnd task A Whole New Task should have estimated_hours set to 3+ @javascriptScenario: Set both estimate and remainingGiven I am on the taskboard for "Sprint 001"And I want to create a task for Story 1diff --git a/modules/backlogs/features/user_settings.feature b/modules/backlogs/features/user_settings.featureindex 3595348bb02..1b0e97bfbfa 100644--- a/modules/backlogs/features/user_settings.feature+++ b/modules/backlogs/features/user_settings.feature@@ -28,6 +28,7 @@Feature: User settings+ @javascriptScenario: A user can change its task colorGiven there is 1 user with the following:| login | bob |diff --git a/modules/backlogs/features/version_settings.feature b/modules/backlogs/features/version_settings.featureindex d7a671e7a46..8ac9ec56547 100644--- a/modules/backlogs/features/version_settings.feature+++ b/modules/backlogs/features/version_settings.feature@@ -55,6 +55,7 @@ Feature: Version Settings| Sprint 004 | 2010-03-01 | 2010-03-31 |And I am already logged in as "padme"+ @javascriptScenario: Creating a new versionWhen I go to the versions/new page of the project called "ecookbook"And I fill in "version_name" with "Sprint X"@@ -63,6 +64,7 @@ Feature: Version SettingsAnd I should see "Successful creation." within "div.notice"And I should see "Sprint X"+ @javascriptScenario: One can select whether versions are displayed left or right (left is default) in the backlogs pageWhen I go to the edit page of the version called "Sprint 001"@@ -74,6 +76,7 @@ Feature: Version SettingsThen I should be on the settings/versions page of the project called "ecookbook"+ @javascriptScenario: Inherited versions can also be configured to be displayed left, right or not at allGiven there is 1 project with:| name | parent |@@ -98,6 +101,7 @@ Feature: Version SettingsThen I should be on the settings/versions page of the project called "ecookbook"+ @javascriptScenario: Setting "Column in backlog" to the different settingsWhen I go to the edit page of the version called "Sprint 001"And I select "right" from "Column in backlog"@@ -130,11 +134,13 @@ Feature: Version SettingsAnd I should not see "Sprint 003" within "#owner_backlogs_container"And I should not see "Sprint 003" within "#sprint_backlogs_container"+ @javascriptScenario: There should be a version start date fieldWhen I go to the edit page of the version called "Sprint 001"Then the editable attributes of the version should be the following:| Start date | 2010-01-01 |+ @javascriptScenario: former sprint_start_date and start_date are the sameWhen I go to the edit page of the version called "Sprint 001"And I fill in "2010-01-20" for "version_start_date"diff --git a/spec/features/versions/project_settings_index_spec.rb b/spec/features/versions/project_settings_index_spec.rbindex 2442e5705ac..7670b24539c 100644--- a/spec/features/versions/project_settings_index_spec.rb+++ b/spec/features/versions/project_settings_index_spec.rb@@ -46,6 +46,7 @@ feature 'project settings index', type: :feature dologin_as(user)end+ @javascriptscenario 'see versions listed in semver order' dovisit settings_versions_project_path(project)