diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5f3480ba4b..d90e5a7f9f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -98,14 +98,6 @@ jobs: additional_spec_opts: "${{ matrix.specs.additional_spec_opts }}" secrets: inherit - cucumber: - uses: ./.github/workflows/testing.yml - with: - name: "all" - test-runner: "cucumber" - want-pdf: true - secrets: inherit - docker-dnsmasq: uses: ./.github/workflows/testing.yml with: diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index b8e7d6fd63..37ac5b638f 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -145,16 +145,6 @@ jobs: retention-days: 7 if-no-files-found: ignore - - name: Run cucumber specs - if: ${{ inputs.test-runner == 'cucumber' }} - env: - CUCUMBER_FORMAT: pretty - DATABASE_URL: postgres://postgres:postgres@localhost:5432/test - RAILS_ENV: test - OTP_SECRET_ENCRYPTION_KEY: testtest - run: | - bundle exec cucumber --color - - name: Expose GitHub Runtime for Docker build uses: crazy-max/ghaction-github-runtime@v3 if: ${{ inputs.test-runner == 'docker' }} diff --git a/Gemfile b/Gemfile index 6af0c5b977..aaa040fc39 100644 --- a/Gemfile +++ b/Gemfile @@ -78,7 +78,6 @@ group :development, :test do gem "bullet" gem "erb_lint", require: false gem "guard", require: false - gem "guard-cucumber", require: false gem "guard-rspec", require: false gem "pry-byebug" gem "rails-controller-testing" @@ -99,7 +98,6 @@ end group :test do gem "capybara" - gem "cucumber-rails", require: false gem "database_cleaner" gem "email_spec" gem "factory_bot_rails" diff --git a/Gemfile.lock b/Gemfile.lock index 05172d5020..dc591c1047 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -221,35 +221,6 @@ GEM rexml crass (1.0.6) csv (3.2.8) - cucumber (9.2.1) - builder (~> 3.2) - cucumber-ci-environment (> 9, < 11) - cucumber-core (> 13, < 14) - cucumber-cucumber-expressions (~> 17.0) - cucumber-gherkin (> 24, < 28) - cucumber-html-formatter (> 20.3, < 22) - cucumber-messages (> 19, < 25) - diff-lcs (~> 1.5) - mini_mime (~> 1.1) - multi_test (~> 1.1) - sys-uname (~> 1.2) - cucumber-ci-environment (10.0.1) - cucumber-core (13.0.3) - cucumber-gherkin (>= 27, < 28) - cucumber-messages (>= 20, < 23) - cucumber-tag-expressions (> 5, < 7) - cucumber-cucumber-expressions (17.1.0) - bigdecimal - cucumber-gherkin (27.0.0) - cucumber-messages (>= 19.1.4, < 23) - cucumber-html-formatter (21.7.0) - cucumber-messages (> 19, < 27) - cucumber-messages (22.0.0) - cucumber-rails (3.1.0) - capybara (>= 3.11, < 4) - cucumber (>= 5, < 10) - railties (>= 5.2, < 9) - cucumber-tag-expressions (6.1.1) daemons (1.4.1) dartsass-rails (0.4.1) railties (>= 6.0.0) @@ -336,9 +307,6 @@ GEM shellany (~> 0.0) thor (>= 0.18.1) guard-compat (1.2.1) - guard-cucumber (3.0.0) - cucumber (>= 3.1) - nenv (>= 0.1) guard-rspec (4.7.3) guard (~> 2.1) guard-compat (~> 1.1) @@ -422,7 +390,6 @@ GEM mini_mime (1.1.5) minitest (5.25.5) msgpack (1.7.2) - multi_test (1.1.0) nenv (0.3.0) net-http (0.4.1) uri @@ -658,8 +625,6 @@ GEM strong_migrations (2.5.0) activerecord (>= 7.1) strong_password (0.0.10) - sys-uname (1.3.1) - ffi (~> 1.1) terminal-table (4.0.0) unicode-display_width (>= 1.1.1, < 4) thor (1.4.0) @@ -727,7 +692,6 @@ DEPENDENCIES capybara commonmarker (~> 0.23.10) csv - cucumber-rails daemons dartsass-rails database_cleaner @@ -743,7 +707,6 @@ DEPENDENCIES foreman grover guard - guard-cucumber guard-rspec holidays i18n (< 1.9) diff --git a/Guardfile b/Guardfile index 2dad3babd2..e01c9471a0 100644 --- a/Guardfile +++ b/Guardfile @@ -70,28 +70,3 @@ guard :rspec, cmd: "bin/rspec --order defined --fail-fast", failed_mode: :focus Dir[File.join("**/#{m[1]}.feature")][0] || "spec/acceptance" end end - -cucumber_options = { - # Below are examples overriding defaults - - # cmd: 'bin/cucumber', - cmd_additional_args: "--publish-quiet --fail-fast", - - all_after_pass: false, - all_on_start: false, - # keep_failed: false, - # feature_sets: ['features/frontend', 'features/experimental'], - - # run_all: { cmd_additional_args: '--profile guard_all' }, - # focus_on: { 'wip' }, # @wip - notification: false -} - -guard "cucumber", cucumber_options do - watch(%r{^features/.+\.feature$}) - watch(%r{^features/support/.+$}) { "features" } - - watch(%r{^features/step_definitions/(.+)_steps\.rb$}) do |m| - Dir[File.join("**/#{m[1]}.feature")][0] || "features" - end -end diff --git a/Makefile b/Makefile index 408adb5186..3500291dac 100644 --- a/Makefile +++ b/Makefile @@ -44,9 +44,6 @@ engine-specs: $(patsubst engines/bops_%/spec,%-specs,$(ENGINES)) rspec: $(DOCKER-RUN) console rspec -cucumber: - $(DOCKER-RUN) console cucumber - guard: $(DOCKER-RUN) console $(BUNDLE-EXEC) guard diff --git a/Rakefile b/Rakefile index bbe7789df9..8e783949f2 100644 --- a/Rakefile +++ b/Rakefile @@ -8,4 +8,4 @@ require_relative "config/application" Rails.application.load_tasks -task(:default).clear.enhance(%i[bundle_audit brakeman rubocop spec cucumber]) +task(:default).clear.enhance(%i[bundle_audit brakeman rubocop spec]) diff --git a/config/cucumber.yml b/config/cucumber.yml deleted file mode 100644 index f99cdd5086..0000000000 --- a/config/cucumber.yml +++ /dev/null @@ -1,9 +0,0 @@ -<% -rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : "" -rerun = rerun.strip.gsub /\s/, ' ' -rerun_opts = rerun.empty? ? "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} features" : "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} #{rerun}" -std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} --strict --tags 'not @wip'" -%> -default: <%= std_opts %> features --publish-quiet -wip: --tags @wip:3 --wip features -rerun: <%= rerun_opts %> --format rerun --publish-quiet --out rerun.txt --strict --tags 'not @wip' diff --git a/features/adding_description_change.feature b/features/adding_description_change.feature deleted file mode 100644 index 69f6eb6cc4..0000000000 --- a/features/adding_description_change.feature +++ /dev/null @@ -1,57 +0,0 @@ -Feature: Creating a description change on the application - Background: - Given I am logged in as an assessor - And a new planning application - And the planning application has a description of "Add a statue of Melissa striking poses" - And I view the planning application - - Scenario: I can add a new description change request - Given I create a description change request with "Add a backyard cinema" - Then the page contains "Description change request successfully sent." - - Scenario: I can cancel a description change request - Given I create a description change request with "Add a backyard cinema" - And I cancel the existing description change request - Then the page contains "Description change request successfully cancelled" - And there is an audit entry containing "Cancelled: validation request" - - Scenario: I can add and view a new description change request after cancelling the previous one - Given I create a description change request with "Its margarita time ole!" - And I press "Check description" - Then the page contains "Previous description" - Then the page contains "Add a statue of Melissa striking poses" - Then the page contains "Proposed description" - Then the page contains "Its margarita time ole!" - - Scenario: When a change request has been rejected I can view it when creating a new one - Given a rejected description change request - And I press "Check and validate" - And I press "Check description" - Then the page contains "Rejected" - - Scenario: I cannot create a second description change request when an open one exists - Given I create a description change request with "A yard full of bananas" - When I visit the new description change request link - And I fill in "Enter an amended description" with "Mambo number 2" - And I choose "Yes, applicant agreement needed" - And I press "Update description" - Then the page contains "An open description change already exists for this planning application." - - Scenario: I can view a notification banner when a request has been auto-closed - Given I create a description change request with "Add a rooftop cinema" - And the description change request has been auto-closed after 5 days - When I view the planning application - Then the page contains "Description change request has been automatically accepted after 5 days." - - Scenario: I can view a notification banner when a request has been responded to - Given I create a description change request with "Add a golden fence" - And the request has been responded to - When I view the planning application - Then the page contains "new response to a validation request" - - Scenario: After a request auto-closed I can see an updated planning application description - Given I create a description change request with "Add a ball pit" - When the description request has been auto-closed - And I view the planning application - Then the page contains "Add a ball pit" - And there is an audit entry containing "Auto-closed: validation request (description#1)" diff --git a/features/adding_note.feature b/features/adding_note.feature deleted file mode 100644 index 386c8ed8e1..0000000000 --- a/features/adding_note.feature +++ /dev/null @@ -1,22 +0,0 @@ -Feature: Adding a note - Background: - Given I am logged in as an assessor - And a new planning application - And I view the planning application - And the time is 14:00 on the 5-11-2021 - -Scenario Outline: As an assessor I can add notes - When I press "Add a note" - Then I see that there are no notes - When I add a note with "This is an epic note" - Then I see the latest note with entry "This is an epic note" at "5 November 2021" - When I press "Add and view all notes" - Then I see that there is one note - And I see that there is a note with entry "This is an epic note" at "5 November 2021 14:00" - When the time is 15:25 on the 5-11-2021 - And I add a note with "This is another epic note" - And I view the planning application notes - Then I see that there are multiple notes - And I see that there is a note with entry "This is another epic note" at "5 November 2021 15:25" - When I view the planning application - Then I see the latest note with entry "This is another epic note" at "5 November 2021" diff --git a/features/auditing.feature b/features/auditing.feature deleted file mode 100644 index f285d4c283..0000000000 --- a/features/auditing.feature +++ /dev/null @@ -1,56 +0,0 @@ -Feature: Auditing a planning application - Background: - Given I am logged in as an assessor - And my name is "Miyazaki" - And a new planning application - And I view the planning application - - Scenario: I can audit when a validation request is created - Given I create a new document validation request for a "Picture of the dog" because "it would be nice" - When I view the planning application audit - Then there is an audit entry containing "Added: validation request (new document#1)" - And there is an audit log entry in the index accordion with "Added: validation request (new document#1)" - - Scenario: I can audit the validation requests are sent when the application is invalid - Given I create an additional document validation request with "Picture of the dog" - And the planning application is invalidated - When I view the planning application audit - Then there is an audit entry containing "invalidation requests have been emailed: Additional document validation request #1, Additional document validation request #2" - And there is an audit entry containing "Application invalidated" - - Scenario: I can audit when a validation request is cancelled after an application is made invalid - Given I create an additional document validation request with "Meme of the dog" - And the planning application is invalidated - When I view the application's validations requests - And I cancel a validation request for a "Meme of the dog" with "Meme of dog is no longer needed" - When I view the planning application audit - Then there is an audit entry containing "Cancelled: validation request (new document#1)" - Then there is an audit entry containing "Reason: Meme of dog is no longer needed" - - Scenario: I can view in the audit log when a planning application has been withdrawn - Given the application is withdrawn by the applicant - Then there is an audit entry containing "Application withdrawn" - And there is an audit entry containing "Applicant is moving to Bermuda, because heck this" - - Scenario: I can view in the audit log when a planning application has been returned - Given the application is returned by the applicant - Then there is an audit entry containing "Application returned" - And there is an audit entry containing "Applicant sent selfies instead of floor plans" - - Scenario: I can view an entry in the audit log showing application updates - And I click "Application information" - When I press "Edit details" - And I fill in "Address 1" with "20 leafy gardens" - And I fill in "Payment reference" with " " - And I press "Save" - Then there is an audit entry containing "Address 1 updated" - And there is an audit entry containing "Miyazaki" - And there is an audit entry containing "Changed to: 20 leafy gardens" - And there is not an audit entry containing "Payment reference updated" - - Scenario: I can view an entry in the audit showing the application being validated - When I press "Check and validate" - And I press "Send validation decision" - And I press "Mark the application as valid" - And I press "Mark the application as valid" - Then there is an audit entry containing "Application validated" diff --git a/features/editing_a_planning_application.feature b/features/editing_a_planning_application.feature deleted file mode 100644 index 4047d84aa6..0000000000 --- a/features/editing_a_planning_application.feature +++ /dev/null @@ -1,61 +0,0 @@ -Feature: Editing an application's details - Background: - Given I am logged in as an assessor - And a new planning application - And I edit the planning application's details - - Scenario: I can edit the application's received date - Given I fill in "Day" with "3" - And I fill in "Month" with "10" - And I fill in "Year" with "1989" - When I press "Save" - And I click "Application" - Then the page contains "Target date: 7 November 1989" - - Scenario: I can edit the applicaiton's site details - Given I fill in "Address 1" with "2 Streatham High Road" - And I fill in "Address 2" with "Streatham" - And I fill in "Town" with "Crystal Palace" - And I fill in "County" with "London" - And I fill in "Postcode" with "SW16 1DB" - And I fill in "UPRN" with "294884040" - When I press "Save" - Then the page contains "2 Streatham High Road, Crystal Palace, SW16 1DB" - And there is an audit entry containing "Address 1 updated" - And there is an audit entry containing "Changed to: 2 Streatham High Road" - - Scenario: I can edit the application's applicant details - Given I am focused on the "Applicant information" fieldset - And I fill in "First name" with "Pearly" - And I fill in "Last name" with "Poorly" - And I fill in "Email address" with "pearly@poorly.com" - And I fill in "UK telephone number" with "0777773949494312" - When I press "Save" - And I click "Application" - Then the page contains "Pearly Poorly" - And the page contains "pearly@poorly.com" - And the page contains "0777773949494312" - - Scenario: I can edit the agent's details - Given I am focused on the "Agent information" fieldset - And I fill in "First name" with "Pearly" - And I fill in "Last name" with "Poorly" - And I fill in "Email address" with "pearly@poorly.com" - And I fill in "UK telephone number" with "0777773949494312" - When I press "Save" - And I click "Application" - Then the page contains "Pearly Poorly" - And the page contains "pearly@poorly.com" - And the page contains "0777773949494312" - - Scenario: I can edit the payment's reference - Given I fill in "Payment reference" with "293844848" - When I press "Save" - Then the page contains "293844848" - - Scenario: I cannot edit a planning application if it has an assessment in progress - Given a draft assessment on the planning application - When I edit the planning application's details - And I fill in "Address 2" with "Happy Buns" - And I press "Save" - Then the page contains "Please save and mark as complete the draft recommendation before updating application fields." diff --git a/features/editing_an_application_constraints.feature b/features/editing_an_application_constraints.feature deleted file mode 100644 index a057f77a16..0000000000 --- a/features/editing_an_application_constraints.feature +++ /dev/null @@ -1,12 +0,0 @@ -Feature: Editing an application's constraints - Background: - Given I am logged in as an assessor - And a validated planning application - And the planning application has the "Conservation area" constraint - And I view the planning application - - Scenario: As an assessor I cannot add constraints past determination - Given a recommendation is submitted for the planning application - When I press "Check and assess" - And I click "Constraints" - Then the page does not contain "Update constraints" diff --git a/features/editing_documents.feature b/features/editing_documents.feature deleted file mode 100644 index 4ae996e462..0000000000 --- a/features/editing_documents.feature +++ /dev/null @@ -1,37 +0,0 @@ -Feature: Editing documents for an application - Background: - Given I am logged in as an assessor - And a validated planning application - And the planning application has a document with reference "FOOBAR" - And I view the planning application - And I view the document with reference "FOOBAR" - - Scenario: I can replace the document - Given I attach a replacement file with path "spec/fixtures/files/images/proposed-roofplan.pdf" - And I fill in "Drawing number" with "DOC0001" - And I click "Edit tags" - And I check "Floor plan - existing" - And I check "Roof plan - existing" - And I choose "Yes" for "Do you want to list this document on the decision notice?" - And I choose "Yes" for "Should this document be made publicly available?" - When I press "Save" - Then the page contains "Document has been updated" - And the page contains "DOC0001" - And the page contains "Included in decision notice: Yes" - And the page contains "Public: Yes" - - Scenario: I can edit the document's received at date - Given I set the date inputs to "19/11/2021" - When I press "Save" - Then the page contains "Date received: 19 November 2021" - And there is an audit entry containing "received at date was modified" - - Scenario: I can edit and audit simultaneous updates to the document - Given I set the date inputs to "19/11/2021" - And I press "Save" - And I view the document with reference "FOOBAR" - And I set the date inputs to "22/11/2021" - When I press "Save" - Then there is an audit entry containing "received at date was modified" - And there is an audit entry containing "from: 19 November 2021" - And there is an audit entry containing "to: 22 November 2021" diff --git a/features/editing_validation_requests.feature b/features/editing_validation_requests.feature deleted file mode 100644 index c52de33fb6..0000000000 --- a/features/editing_validation_requests.feature +++ /dev/null @@ -1,36 +0,0 @@ -Feature: Editing validation requests - Background: - Given I am logged in as an assessor - And a new planning application - And I view the planning application - When I press "Check and validate" - And I press "Send validation decision" - And I create a new document validation request for a "Picture of the dog" because "it would be nice" - And I create a other change validation request with "Time for some changes up in here" - And I create a red line boundary change validation request with "We shall update some boundaries" - -Scenario: I can edit a document validation request before its been sent - When I view the application's validations requests - And I click link "View and update" in table row for "Picture of the dog" - And I press "Edit request" - And I fill in "Please specify the new document type:" with "cats instead" - And I fill in "Please specify the reason you have requested this document?" with "I love me some cats" - When I press "Update" - And I view the application's validations requests - Then the page contains "cats instead" - -Scenario: I can edit an other type of validation request before its been sent - When I view the application's validations requests - And I click link "View and update" in table row for "Time for some changes" - And I press "Edit request" - And I fill in "Tell the applicant another reason why the application is invalid" with "change those manners" - When I press "Update" - And I view the application's validations requests - Then the page contains "change those manners" - -Scenario: I cannot edit a validation request after its been sent - When the planning application is invalidated - And I view the application's validations requests - And I click link "View and update" in table row for "Picture of the dog" - Then the page does not contain "Edit request" - And the page contains "Cancel request" diff --git a/features/invalidating_an_application.feature b/features/invalidating_an_application.feature deleted file mode 100644 index 8bbbc8ddff..0000000000 --- a/features/invalidating_an_application.feature +++ /dev/null @@ -1,17 +0,0 @@ -Feature: Invalidating application - Background: - Given I am logged in as an assessor - And a new planning application - And I view the planning application - - Scenario: As an assessor I can invalidate new applications - Then the page has a "Check and validate" link - - Scenario: As an assessor I can invalidate an application with validation requests - When I press "Check and validate" - And I press "Send validation decision" - And I create a new document validation request for a "Picture of the dog" because "it would be nice" - And I press "Back" - And I press "Send validation decision" - When I press "Mark the application as invalid" - Then the page contains "Application has been invalidated" diff --git a/features/managing_validation_requests.feature b/features/managing_validation_requests.feature deleted file mode 100644 index 5e491ea7d1..0000000000 --- a/features/managing_validation_requests.feature +++ /dev/null @@ -1,63 +0,0 @@ -Feature: Managing validation requests - Background: - Given I am logged in as an assessor - And a new planning application - And I view the planning application - When I press "Check and validate" - And I press "Send validation decision" - And I create a new document validation request for a "Picture of the dog" because "it would be nice" - And I create a new document validation request for a "Picture of the cat" because "it would also be nice" - - Scenario Outline: As an assessor I can create different validation requests - When I create a validation request with "" - Then there is a validation request for a "" that shows "Not sent" - Examples: - | type | comment | - | additional document | John | - | other change | George | - | red line boundary change | View request red line boundary | - - Scenario: As an assessor all my validation requests are initially not sent - When I view the application's validations requests - Then there is a validation request for a "Picture of the dog" that shows "Not sent" - Then there is a validation request for a "Picture of the cat" that shows "Not sent" - - Scenario: As an assessor I can see the time left on each request of an invalidated application - When I press "Back" - And I press "Send validation decision" - And I press "Mark the application as invalid" - And I view the application's validations requests - Then there is a validation request for a "Picture of the dog" that shows "sent" - Then there is a validation request for a "Picture of the cat" that shows "sent" - - Scenario: As an assessor any request past invalidation is sent immediately - Given the planning application is invalidated - When I create a new document validation request for an "Extra request" because "love requests" - Then there is a validation request for an "Extra request" that shows "sent" - - Scenario: As an assessor I can delete a validation request before invalidating the planning application - When I view the application's validations requests - And I click link "View and update" in table row for "Picture of the dog" - When I click link "Delete request" in table row for "Picture of the dog" - And I view the application's validations requests - Then there is no validation request for a "Picture of the dog" - - Scenario: As an assessor I can cancel a validation request only after invalidating the planning application - Given the date is 21-10-2021 - And the planning application is invalidated - When I view the application's validations requests - And I cancel a validation request for a "Picture of the dog" with "Dog pic is no longer needed" - And I view the application's validations requests - Then there is a cancelled validation request for a "Dog pic is no longer needed" that shows "21 October 2021" - And there is no validation request for a "Picture of the dog" - - Scenario Outline: As an assessor I can cancel different validation requests - Given the date is 21-10-2021 - And the planning application is invalidated - When I cancel a validation request with "" - Then there is a cancelled validation request for a "" that shows "21 October 2021" - Examples: - | type | reason | - | additional document | document no longer needed | - | other change | my mistake | - | red line boundary change | original boundary was correct | diff --git a/features/step_definitions/.gitkeep b/features/step_definitions/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/features/step_definitions/auditing_steps.rb b/features/step_definitions/auditing_steps.rb deleted file mode 100644 index bc745c2064..0000000000 --- a/features/step_definitions/auditing_steps.rb +++ /dev/null @@ -1,41 +0,0 @@ -# frozen_string_literal: true - -Then("there is an audit entry containing {string}") do |content| - step "I visit the audit log" - - within_table("Audit log") do - expect(page).to have_content(content, normalize_ws: true) - end -end - -Then("there is not an audit entry containing {string}") do |content| - step "I visit the audit log" - - within_table("Audit log") do - expect(page).not_to have_content(content, normalize_ws: true) - end -end - -Then("there is an audit entry with") do |content| - step "I visit the audit log" - - within_table("Audit log") do - page.should have_content(content) - end -end - -Then("there is an audit log entry in the index accordion with {string}") do |content| - steps %( - When I view the planning application - And I click "Audit log" - Then the page contains "#{content}" - ) -end - -When("I visit the audit log") do - steps %( - When I view the planning application - Then I click "Audit log" - Then I press "View all audits" - ) -end diff --git a/features/step_definitions/constraints_steps.rb b/features/step_definitions/constraints_steps.rb deleted file mode 100644 index 5bdc2c18ee..0000000000 --- a/features/step_definitions/constraints_steps.rb +++ /dev/null @@ -1,14 +0,0 @@ -# frozen_string_literal: true - -Given("the planning application has the {string} constraint") do |constraint| - @planning_application.planning_application_constraints.select { |k, v| k.type_code == constraint } -end - -Given("I visit the application's constraints form") do - steps %( - Given I view the planning application - And I press "Check and assess" - And I press "Constraints" - And I press "Update constraints" - ) -end diff --git a/features/step_definitions/datetime_steps.rb b/features/step_definitions/datetime_steps.rb deleted file mode 100644 index 3939f68eca..0000000000 --- a/features/step_definitions/datetime_steps.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true - -Given("the date is {int}-{int}-{int}") do |day, month, year| - travel_to Time.zone.local(year, month, day) -end - -Given("the date is {int}-{int}-{int} and the planning application is validated") do |day, month, year| - travel_to Time.zone.local(year, month, day) - - steps("Given the planning application is validated") - - visit "/" -end - -Given("the time is {int}:{int} on the {int}-{int}-{int}") do |hour, minutes, day, month, year| - travel_to Time.zone.local(year, month, day, hour, minutes) -end - -Given("the time is {int}:{int}") do |hour, minutes| - now = Time.zone.now - destination = Time.zone.local(now.year, now.month, now.day, hour, minutes) - - # Travelling forward in time will force the Devise session to expire - destination = destination.advance(days: -1) if destination.after?(now) - - travel_to destination -end - -Given("the time is {int}:{int} and the planning application is validated") do |hour, minutes| - steps("Given the time is #{hour}:#{minutes}") - steps("Given the planning application is validated") - - visit "/" -end diff --git a/features/step_definitions/description_change_steps.rb b/features/step_definitions/description_change_steps.rb deleted file mode 100644 index 7dd8a91473..0000000000 --- a/features/step_definitions/description_change_steps.rb +++ /dev/null @@ -1,55 +0,0 @@ -# frozen_string_literal: true - -require "faker" - -Given("a rejected description change request") do - FactoryBot.create( - :description_change_validation_request, - planning_application: @planning_application, - state: "closed", - approved: false, - rejection_reason: "Spelling mistakes" - ) -end - -Given("I create a description change request with {string}") do |details| - steps %( - When I view the planning application - And I press "Check and validate" - And I press "Check description" - And I choose "No" - And I press "Save and mark as complete" - And I fill in "Enter an amended description" with "#{details}" - And I choose "Yes, applicant agreement needed" - And I press "Update description" - ) -end - -When("I visit the new description change request link") do - visit "/planning_applications/#{@planning_application.reference}/validation/validation_requests/new?type=description_change" -end - -When("I cancel the existing description change request") do - steps %( - When I view the planning application - And I press "Check and validate" - And I press "Check description" - When I press "Cancel request" - ) -end - -When("the description change request has been auto-closed after 5 days") do - request = @planning_application.description_change_validation_requests.last - request.update!(created_at: 6.business_days.ago) - request.auto_close_request! -end - -When("the request has been responded to") do - @planning_application.description_change_validation_requests.last.update!(state: "closed", approved: true) -end - -When("the description request has been auto-closed") do - @planning_application.description_change_validation_requests.last.update!(created_at: 6.business_days.ago) - - CloseDescriptionChangeJob.perform_now -end diff --git a/features/step_definitions/document_steps.rb b/features/step_definitions/document_steps.rb deleted file mode 100644 index cd6a8c1cf9..0000000000 --- a/features/step_definitions/document_steps.rb +++ /dev/null @@ -1,40 +0,0 @@ -# frozen_string_literal: true - -Given("I manage the application's documents") do - steps %( - Given I view the planning application - And I press "Manage documents" - ) -end - -Given("the planning application has a document with reference {string}") do |reference| - steps %( - When I manage the application's documents - And I press "Upload document" - And I upload "spec/fixtures/files/images/proposed-floorplan.png" for the "file" input - And I fill in "Drawing number" with "#{reference}" - And I press "Save" - ) -end - -Given("I view the document with reference {string}") do |reference| - step "I manage the application's documents" - - document = @planning_application.documents.find_by(numbers: reference) - - visit "/planning_applications/#{@planning_application.reference}/documents/#{document.id}/edit" -end - -Given("I attach a replacement file with path {string}") do |path| - step %(I upload "#{path}" for the "file" input) -end - -Given("I set the date inputs to {string}") do |date| - day, month, year = date.split("/") - - steps %( - Given I fill in "Day" with "#{day}" - And I fill in "Month" with "#{month}" - And I fill in "Year" with "#{year}" - ) -end diff --git a/features/step_definitions/note_steps.rb b/features/step_definitions/note_steps.rb deleted file mode 100644 index 69faf9f441..0000000000 --- a/features/step_definitions/note_steps.rb +++ /dev/null @@ -1,69 +0,0 @@ -# frozen_string_literal: true - -When("I view the planning application notes") do - visit "/planning_applications/#{@planning_application.reference}/notes" -end - -When("I see the note form actions") do - within(".govuk-button-group") do - steps %( - Then the page has button "Add new note" - And the page has a "Back" link with href "#{planning_application_path(@planning_application)}" - ) - end -end - -Then("I see that there are no notes") do - steps %( - And the page contains "There are no notes yet." - And the page does not contain "Latest note" - And the page does not contain "Previous notes" - ) -end - -Then("I see that there is one note") do - steps %( - And the page does not contain "There are no notes yet." - And the page contains "Latest note" - And the page does not contain "Previous notes" - ) -end - -Then("I see that there is a note with entry {string} at {string}") do |entry, day_month_year_time| - note = @planning_application.notes.find_by(entry:) - - within("#notes") do - within("#note_#{note.id}") do - steps %( - And the page contains "#{note.user.name}" - And the page contains "#{day_month_year_time}" - And the page contains "#{entry}" - ) - end - end -end - -Then("I see that there are multiple notes") do - within("#notes") do - steps %( - And the page contains "Latest note" - And the page contains "Previous notes" - ) - end -end - -Given("I add a note with {string}") do |entry| - steps %( - Given I fill in "Add a note to this application." with "#{entry}" - And I see the note form actions - And I press "Add new note" - Then the page contains "Note was successfully created." - ) -end - -When("I see the latest note with entry {string} at {string}") do |entry, day_month_year| - steps %( - Then the page contains "#{entry}" - And the page contains "#{day_month_year}" - ) -end diff --git a/features/step_definitions/planning_application_steps.rb b/features/step_definitions/planning_application_steps.rb deleted file mode 100644 index 7e9177d98f..0000000000 --- a/features/step_definitions/planning_application_steps.rb +++ /dev/null @@ -1,193 +0,0 @@ -# frozen_string_literal: true - -require "faker" - -Given("I am logged out") do - visit "/" - - click_on "Log out" if page.has_button? "Log out" -end - -Given("I am logged in as a(n) {}") do |role| - southwark = LocalAuthority.find_by(subdomain: "southwark") - @officer = FactoryBot.create(:user, role.to_sym, local_authority: southwark, mobile_number: "07788446542") - @api_user = FactoryBot.create(:api_user, :planx) - - step("I am logged out") - visit "/users/sign_in" - - fill_in "Email", with: @officer.email - fill_in "Password", with: @officer.password - - step("I enter 2FA") -end - -Given("I enter 2FA") do - click_button "Log in" - - fill_in "Security code", with: @officer.current_otp - click_button "Enter code" -end - -Given("my name is {string}") do |name| - @officer.update!(name:) -end - -Given("a new planning application") do - @planning_application = FactoryBot.create( - :planning_application, - :not_started, - :with_boundary_geojson, - :with_constraints, - user: @officer, - local_authority: @officer.local_authority, - api_user: @api_user - ) -end - -Given("a validated planning application") do - @planning_application = FactoryBot.create( - :planning_application, - :in_assessment, - :with_constraints, - local_authority: @officer.local_authority, - api_user: @api_user - ) -end - -Given("a new application of type prior approval") do - @planning_application = FactoryBot.create(:planning_application, - :prior_approval, - local_authority: @officer.local_authority) -end - -Given("the planning application is invalidated") do - steps %( - Given I create a new document validation request for a "validation request" because "I have to" - And I press "Back" - And I press "Send validation decision" - And I press "Mark the application as invalid" - ) -end - -Given("the planning application is validated") do - steps %( - When I view the planning application - And I press "Check and validate" - And I press "Send validation decision" - And I press "Mark the application as valid" - And I press "Mark the application as valid" - ) -end - -Given("the planning application is assessed") do - steps %( - Given I view the planning application - And I press "Check and assess" - And I press "Make draft recommendation" - And I choose "Granted" from a fieldset "What is your recommendation?" - And I fill in "State the reasons for your recommendation." with "a valid reason" - And I fill in "Provide supporting information for your manager." with "looks legit" - And I press "Save and mark as complete" - ) -end - -Given("a recommendation is submitted for the planning application") do - steps %( - Given the planning application is assessed - And I press "Review and submit recommendation" - And I press "Submit recommendation" - ) -end - -When("I choose {string} from a fieldset {string}") do |option, fieldset| - within_fieldset(fieldset) do - choose option - end -end - -When("I view the planning application") do - visit "/planning_applications/#{@planning_application.reference}" -end - -When("I view the planning application audit") do - visit "/planning_applications/#{@planning_application.reference}/audits" -end - -And("the planning application has a description of {string}") do |description| - @planning_application.update!(description:) -end - -When("I view all {string} planning applications") do |status| - visit "/planning_applications" - - click_on(status) -end - -Given("the application expires in {int} days") do |n| - @planning_application.update_column(:expiry_date, n.business_days.from_now(Date.current)) # rubocop:disable Rails/SkipsModelValidations -end - -Given("the application expired {int} days ago") do |n| - @planning_application.update_column(:expiry_date, n.business_days.ago(Date.current)) # rubocop:disable Rails/SkipsModelValidations -end - -Then("the page contains a {string} tag containing {string}") do |colour, text| - expect(page).to have_selector(".govuk-tag--#{colour}", text:) -end - -Then("there is a relevant proposal detail for {string} with a response of {string}") do |question, response| - within(".result_information ol") do - expect(page).to have_selector("li", text: [question, response].join("\n")) - end -end - -Given("I edit the planning application's details") do - steps %( - Given I view the planning application - And I click "Application information" - And I press "Edit details" - ) -end - -Given "the application is withdrawn by the applicant" do - steps %( - Given I press "Withdraw or cancel application" - And I choose "Withdrawn by applicant" - And I fill in "Provide a reason" with "Applicant is moving to Bermuda, because heck this" - And I press "Withdraw or cancel application" - ) -end - -Given "the application is returned by the applicant" do - steps %( - Given I press "Withdraw or cancel application" - When I choose "Returned as invalid" - And I fill in "Provide a reason" with "Applicant sent selfies instead of floor plans" - And I press "Withdraw or cancel application" - ) -end - -Then("the assess proposal accordion displays a {string} tag") do |tag| - within(:xpath, '//*[@id="assess-section"]') do - expect(page).to have_content tag - end -end - -Then("the complete assessment accordion displays a {string} tag") do |tag| - within(:xpath, '//*[@id="complete-assessment-tasks"]') do - expect(page).to have_content tag - end -end - -Given "a draft assessment on the planning application" do - steps %( - Given the planning application is validated - And I view the planning application - And I press "Check and assess" - And I press "Make draft recommendation" - When I fill in "State the reasons for your recommendation." with "Lawful as can be" - And I fill in "Provide supporting information for your manager." with "I'm hoping you feel supported" - And I press "Save and come back later" - ) -end diff --git a/features/step_definitions/policy_assessment_steps.rb b/features/step_definitions/policy_assessment_steps.rb deleted file mode 100644 index a86e3eab10..0000000000 --- a/features/step_definitions/policy_assessment_steps.rb +++ /dev/null @@ -1,39 +0,0 @@ -# frozen_string_literal: true - -ParameterType( - name: "list", - regexp: /"(.*)"/, - transformer: ->(s) { s.split(/,\s+/) } -) - -Given("I add the policy class(es) {list} to the application") do |classes| - classes_step = classes.map { |name| "And I check \"Class #{name}\"" }.join("\n") - - steps %( - Given I view the planning application - And I press "Check and assess" - And I press "Add assessment area" - Then the page has a "Open the Town and Country" link with href "https://www.legislation.gov.uk/uksi/2015/596/schedule/2" - And I choose "Part 1" - And I press "Continue" - #{classes_step} - And I press "Add classes" - ) -end - -Given("I remove the policy class(es) {list} from the application") do |classes| - classes.each do |policy_class| - steps %( - Given I view the planning application - And I press "Check and assess" - And I press "Part 1, Class #{policy_class}" - And I press "Remove class from assessment" - ) - end -end - -Then("there is a row for the {string} policy with a(n) {string} status") do |name, status| - within("ul#assess-policy-section") do - expect(page.find("li", text: name)).to have_text status - end -end diff --git a/features/step_definitions/validation_requests_steps.rb b/features/step_definitions/validation_requests_steps.rb deleted file mode 100644 index 156a3e239a..0000000000 --- a/features/step_definitions/validation_requests_steps.rb +++ /dev/null @@ -1,175 +0,0 @@ -# frozen_string_literal: true - -When("I view the application's validations requests") do - visit "/planning_applications/#{@planning_application.reference}/validation/validation_requests" -end - -When("I start the validation wizard") do - visit "/planning_applications/#{@planning_application.reference}/validation/tasks" -end - -When("I create a new document validation request for a(n) {string} because {string}") do |type, reason| - steps %( - Given I start the validation wizard - And I press "Check and request documents" - And I press "Add a request for a missing document" - And I fill in "Please specify the new document type:" with "#{type}" - And I fill in "the reason" with "#{reason}" - And I save or send the request - And I press "Validation tasks" - And I click link "Review validation requests" - ) -end - -Then("there is a validation request for a(n) {string} that shows {string}") do |request_details, status| - table = page.find(".validation-requests-table") - - expect(table).to have_selector(:table_row, "Detail" => request_details, "Status" => status) -end - -Then("there is a validation request for a(n) {string} that has a link {string}") do |request_details, link| - table = page.find(:table, "Validation requests") - - expect(table).to have_selector(:table_row, "Detail" => request_details, "Actions" => link) -end - -Then("there is a validation request for a(n) {string} that does not have a link {string}") do |request_details, link| - table = page.find(:table, "Validation requests") - - expect(table).to_not have_selector(:table_row, "Detail" => request_details, "Actions" => link) -end - -Then("there is a cancelled validation request for a(n) {string} that shows {string}") do |reason, date| - table = page.find(:table, "Cancelled requests") - - expect(table).to have_selector(:table_row, "Reason for cancellation" => reason, "Date cancelled" => date) -end - -Then("there is no validation request for a {string}") do |request_details| - table = page.find(".validation-requests-table") - - expect(table).to_not have_selector(:table_row, "Detail" => request_details) -end - -Given("I add a new validation request") do - steps %( - Given I view the application's validations requests - And I press "Add new request" - ) -end - -Given("I create a(n) additional document validation request with {string}") do |details| - steps %( - Given I start the validation wizard - And I press "Check and request documents" - And I press "Add a request for a missing document" - And I fill in "Please specify the new document type:" with "#{details}" - And I fill in "the reason" with "a valid reason" - And I save or send the request - And I press "Validation tasks" - And I click link "Review validation requests" - ) -end - -Given("I create a(n) other change validation request with {string}") do |details| - steps %( - Given I start the validation wizard - And I press "Add another validation request" - And I fill in "Tell the applicant" with "#{details}" - And I fill in "Explain to the applicant" with "Please make the change" - And I save or send the request - And I click link "Review validation requests" - ) -end - -Given("I create a red line boundary change validation request with {string}") do |details| - # we can't simulate drawing a new map, not now anyway - FactoryBot.create( - :red_line_boundary_change_validation_request, - state: "pending", - planning_application: @planning_application, - reason: details - ) - - # force a refresh as we've gone under the hood here - visit current_path -end - -When("I save or send the request") do - if @planning_application.reload.invalidated? - steps %( - And I press "Send request" - ) - else - steps %( - And I press "Save request" - ) - end -end - -# Cancel validation requests - -When("I see the cancel confirmation form actions") do - within(".govuk-button-group") do - steps %( - Then the page has button "Confirm cancellation" - And the page has a "Back" link - ) - end -end - -Given("I cancel a validation request for a {string} with {string}") do |details, reason| - steps %( - Given I click link "View and update" in table row for "#{details}" - And I click link "Cancel request" in table row for "#{details}" - Then I fill in "Explain to the applicant why this request is being cancelled" with "#{reason}" - And I press "Confirm cancellation" - Then an email is sent to the applicant confirming the validation request cancellation - ) -end - -Given("I cancel a(n) additional document validation request with {string}") do |details| - steps %( - Given I create an additional document validation request with "Picture of funny meme" - And I click link "View and update" in table row for "Picture of funny meme" - And I click link "Cancel request" in table row for "Picture of funny meme" - Then I fill in "Explain to the applicant why this request is being cancelled" with "#{details}" - And I see the cancel confirmation form actions - And I press "Confirm cancellation" - Then an email is sent to the applicant confirming the validation request cancellation - ) -end - -Given("I cancel a(n) other change validation request with {string}") do |details| - steps %( - Given I create an other change validation request with "More info needed" - And I click link "View and update" in table row for "Other" - And I press "Cancel request" - Then I fill in "Explain to the applicant why this request is being cancelled" with "#{details}" - And I see the cancel confirmation form actions - And I press "Confirm cancellation" - Then an email is sent to the applicant confirming the validation request cancellation - ) -end - -Given("I cancel a red line boundary change validation request with {string}") do |details| - steps %( - Given I create a red line boundary change validation request with "boundary change required" - And I view the application's validations requests - And I click link "View and update" in table row for "Red line boundary changes" - And I press "Cancel request" - Then I fill in "Explain to the applicant why this request is being cancelled" with "#{details}" - And I see the cancel confirmation form actions - And I press "Confirm cancellation" - Then an email is sent to the applicant confirming the validation request cancellation - ) -end - -Then("an email is sent to the applicant confirming the validation request cancellation") do - body = ActionMailer::Base.deliveries.last.body.to_s - expect(body).to include(@planning_application.secure_change_url) - - expect(body).to include( - "We no longer need you to make a change to your application." - ) -end diff --git a/features/step_definitions/web_steps.rb b/features/step_definitions/web_steps.rb deleted file mode 100644 index 2edb1c071d..0000000000 --- a/features/step_definitions/web_steps.rb +++ /dev/null @@ -1,146 +0,0 @@ -# frozen_string_literal: true - -Then("the page contains {string}") do |content| - expect(page).to have_content(content) -end - -Then("the page does not contain {string}") do |content| - expect(page).not_to have_content(content) -end - -Then("the page has a {string} link") do |label| - expect(page).to have_link(label) -end - -Then("the page has a {string} link with href {string}") do |label, href| - expect(page).to have_link(label, href:) -end - -Then("the page does not have a {string} link") do |label| - expect(page).not_to have_link(label) -end - -Then("the page has button {string}") do |label| - expect(page).to have_button(label) -end - -Then("the page does not have button {string}") do |label| - expect(page).not_to have_button(label) -end - -Then("the next page is {string}") do |header| - expect(page.find("h1")).to have_content(header) -end - -Then("the page contains an error about {string}") do |msg| - within(:css, "div.govuk-error-summary") do - expect(page).to have_content msg - end -end - -Then("the page contains a custom flash about {string}") do |msg| - within(:css, ".flash") do - expect(page).to have_content msg - end -end - -Then("the {string} option is checked") do |option| - expect(page.find_field(option)).to be_checked -end - -Then("I should see the following within {string}") do |caption, table| - expect(page).to have_table(caption, with_rows: table.rows) -end - -Then("I should not see the following within {string}") do |caption, table| - expect(page).not_to have_table(caption, with_rows: table.rows) -end - -Then("I can't press the {string} button") do |string| - expect(page).to have_button(string, disabled: true) -end - -Then("print the page") do - log page.html -end - -Then("debugger") do - # rubocop:disable Lint/Debugger - require "pry" - binding.pry - # rubocop:enable Lint/Debugger -end - -When("I press {string}") do |label| - click_on label -end - -When("I click {string}") do |label| - first("*", text: label).click -end - -When("I fill in {string} with {string}") do |label, value| - if @fieldset.present? - within_fieldset(@fieldset) do - fill_in label, with: value - end - else - fill_in label, with: value - end -end - -When("I choose {string}") do |option| - choose option -end - -When("I choose {string} for {string}") do |option, legend| - within_fieldset(legend) do - choose option - end -end - -When("I check {string}") do |option| - check option -end - -When("I check {string} for {string}") do |option, legend| - within_fieldset(legend) do - check option - end -end - -Given("I uncheck {string}") do |option| - uncheck option -end - -Then("the input for {string} contains {string}") do |label, value| - expect(page.find_field(label).value).to eq value -end - -Then "I click link {string}" do |link| - click_link(link) -end - -Then "I click link {string} in table row for {string}" do |link, value| - within(:xpath, "//tr[contains(.,'#{value}')]") do - click_link(link) - end -end - -Then "the page does not contain {string} in table row for {string}" do |link, value| - within(:xpath, "//tr[contains(.,'#{value}')]") do - expect(page).not_to have_content(link) - end -end - -When("I upload {string} for the {string} input") do |path, name| - attach_file(name, path) -end - -Then "the option {string} is checked" do |option| - expect(page).to have_checked_field(option) -end - -Given("I am focused on the {string} fieldset") do |fieldset| - @fieldset = fieldset -end diff --git a/features/support/capybara.rb b/features/support/capybara.rb deleted file mode 100644 index 97e07e70d1..0000000000 --- a/features/support/capybara.rb +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -Capybara.server = :puma, {Silent: true} - -Capybara.register_driver :chrome_headless do |app| - Capybara::Selenium::Driver.load_selenium - browser_options = Selenium::WebDriver::Chrome::Options.new - browser_options.args << "--headless=new" - browser_options.args << "--no-sandbox" - browser_options.args << "--allow-insecure-localhost" - browser_options.args << "--window-size=1280,2800" - browser_options.args << "--disable-gpu" if Gem.win_platform? - browser_options.args << "--disable-dev-shm-usage" - browser_options.args << "--host-rules=MAP * 127.0.0.1" - - if Gem::Platform.local.os != "darwin" - # Probably Docker/GHA - %w[/usr/local/bin /usr/bin].each do |path| - driver_path = "#{path}/chromedriver" - if File.exist? driver_path - Selenium::WebDriver::Chrome::Service.driver_path = driver_path - break - end - end - end - - Capybara::Selenium::Driver.new(app, browser: :chrome, options: browser_options) -end - -Capybara.app_host = "http://southwark.bops.services" -Capybara.javascript_driver = ENV.fetch("JS_DRIVER", "chrome_headless").to_sym -Capybara.automatic_label_click = true diff --git a/features/support/env.rb b/features/support/env.rb deleted file mode 100644 index 6cc38eb15b..0000000000 --- a/features/support/env.rb +++ /dev/null @@ -1,63 +0,0 @@ -# frozen_string_literal: true - -# IMPORTANT: This file is generated by cucumber-rails - edit at your own peril. -# It is recommended to regenerate this file in the future when you upgrade to a -# newer version of cucumber-rails. Consider adding your own code to a new file -# instead of editing this one. Cucumber will automatically load all features/**/*.rb -# files. - -require "cucumber/rails" -require "sidekiq/testing" - -# frozen_string_literal: true - -# Capybara defaults to CSS3 selectors rather than XPath. -# If you'd prefer to use XPath, just uncomment this line and adjust any -# selectors in your step definitions to use the XPath syntax. -# Capybara.default_selector = :xpath - -# By default, any exception happening in your Rails application will bubble up -# to Cucumber so that your scenario will fail. This is a different from how -# your application behaves in the production environment, where an error page will -# be rendered instead. -# -# Sometimes we want to override this default behaviour and allow Rails to rescue -# exceptions and display an error page (just like when the app is running in production). -# Typical scenarios where you want to do this is when you test your error pages. -# There are two ways to allow Rails to rescue exceptions: -# -# 1) Tag your scenario (or feature) with @allow-rescue -# -# 2) Set the value below to true. Beware that doing this globally is not -# recommended as it will mask a lot of errors for you! -# -ActionController::Base.allow_rescue = false - -# Remove/comment out the lines below if your app doesn't have a database. -# For some databases (like MongoDB and CouchDB) you may need to use :truncation instead. -begin - DatabaseCleaner.strategy = :transaction - DatabaseCleaner.allow_remote_database_url = true -rescue NameError - raise "You need to add database_cleaner to your Gemfile (in the :test group) if you wish to use it." -end - -# You may also want to configure DatabaseCleaner to use different strategies for certain features and scenarios. -# See the DatabaseCleaner documentation for details. Example: -# -# Before('@no-txn,@selenium,@culerity,@celerity,@javascript') do -# # { except: [:widgets] } may not do what you expect here -# # as Cucumber::Rails::Database.javascript_strategy overrides -# # this setting. -# DatabaseCleaner.strategy = :truncation -# end -# -# Before('not @no-txn', 'not @selenium', 'not @culerity', 'not @celerity', 'not @javascript') do -# DatabaseCleaner.strategy = :transaction -# end -# - -# Possible values are :truncation and :transaction -# The :transaction strategy is faster, but might give you threading problems. -# See https://github.com/cucumber/cucumber-rails/blob/master/features/choose_javascript_database_strategy.feature -Cucumber::Rails::Database.javascript_strategy = :transaction diff --git a/features/support/hooks.rb b/features/support/hooks.rb deleted file mode 100644 index e1c3601c84..0000000000 --- a/features/support/hooks.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -Before do - Rails.application.load_seed -end - -Before("@javascript") do - next unless page.driver.respond_to?(:invalid_element_errors) - - unless page.driver.invalid_element_errors.include?(Selenium::WebDriver::Error::UnknownError) - page.driver.invalid_element_errors << Selenium::WebDriver::Error::UnknownError - end -end diff --git a/features/support/stub_requests.rb b/features/support/stub_requests.rb deleted file mode 100644 index bfd2838eae..0000000000 --- a/features/support/stub_requests.rb +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -require Rails.root.join "spec/support/api/mapit_helpers" -require Rails.root.join "spec/support/api/paapi_helpers" -require Rails.root.join "spec/support/api/planning_data_helpers" -require Rails.root.join "spec/support/api/plan_x_helpers" -require Rails.root.join "spec/support/notify_helpers" - -World(MapitHelper) -World(NotifyHelper) -World(PaapiHelper) -World(PlanningDataHelper) -World(PlanXHelper) - -Before do - stub_any_mapit_api_request.to_return(mapit_api_response(:ok)) - stub_paapi_api_request_for("100081043511").to_return(paapi_api_response(:ok)) - - stub_planning_data_api_request_for("BUC").to_return(planning_data_api_response(:ok, "BUC")) - stub_planning_data_api_request_for("LBH").to_return(planning_data_api_response(:ok, "LBH")) - stub_planning_data_api_request_for("SWK").to_return(planning_data_api_response(:ok, "SWK")) - stub_planning_data_api_request_for("TEST").to_return(planning_data_api_response(:ok, "TEST")) - stub_any_planning_data_entity_geojson_request - - stub_any_post_sms_notification.to_return(sms_notification_api_response(:ok)) - - stub_planx_api_response_for( - "POLYGON ((-0.054597 51.537331, -0.054588 51.537287, -0.054453 51.537313, -0.054597 51.537331))" - ).to_return( - status: 200, body: "{}" - ) -end diff --git a/features/support/time.rb b/features/support/time.rb deleted file mode 100644 index 9cbfd4cf75..0000000000 --- a/features/support/time.rb +++ /dev/null @@ -1,6 +0,0 @@ -# frozen_string_literal: true - -# always step out of the time machine -After do - travel_back -end diff --git a/features/support/webmock.rb b/features/support/webmock.rb deleted file mode 100644 index d5b75dcd99..0000000000 --- a/features/support/webmock.rb +++ /dev/null @@ -1,6 +0,0 @@ -# frozen_string_literal: true - -require "webmock/cucumber" - -allowed_hosts = ["chromedriver.storage.googleapis.com"] -WebMock.disable_net_connect! allow_localhost: true, allow: allowed_hosts diff --git a/features/uploading_documents.feature b/features/uploading_documents.feature deleted file mode 100644 index 517e9bec22..0000000000 --- a/features/uploading_documents.feature +++ /dev/null @@ -1,25 +0,0 @@ -Feature: Uploading documents for an application - Background: - Given I am logged in as an assessor - And my name is "Morisuke" - And a new planning application - When I manage the application's documents - - Scenario: I can upload a new document with a reference, received date and tags - Given I press "Upload document" - And I upload "spec/fixtures/files/images/proposed-floorplan.png" for the "file" input - And I set the date inputs to "5/7/2021" - And I click "Edit tags" - And I check "Floor plan - existing" - And I check "Roof plan - existing" - And I check "Utility bill" - And I fill in "Drawing number" with "Floorplan" - And I press "Save" - Then the page contains "proposed-floorplan.png has been uploaded." - And the page contains "Date received: 5 July 2021" - When I view the document with reference "Floorplan" - Then the page contains "This document was manually uploaded by Morisuke" - And I click "Edit tags" - And the option "Floor plan - existing" is checked - And the option "Roof plan - existing" is checked - And the option "Utility bill" is checked diff --git a/lib/tasks/cucumber.rake b/lib/tasks/cucumber.rake deleted file mode 100644 index bb450e0b07..0000000000 --- a/lib/tasks/cucumber.rake +++ /dev/null @@ -1,8 +0,0 @@ -# frozen_string_literal: true - -desc "Run cucumber" -task cucumber: :environment do - cmd = "cucumber" - cmd << " --color" if ENV["CI"].present? - exit 1 unless cmd -end