Skip to content

Commit

Permalink
Remove smoke tests (#2434)
Browse files Browse the repository at this point in the history
  • Loading branch information
vertism authored Aug 5, 2024
1 parent 3f8827d commit becc9c4
Show file tree
Hide file tree
Showing 9 changed files with 2 additions and 238 deletions.
2 changes: 0 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ CHROME_CONTAINER_IMAGE=seleniarm/standalone-chromium

# Google Analytics
GA_TRACKING_ID=
SETTINGS__SMOKE_TESTS__USERNAME=
SETTINGS__SMOKE_TESTS__PASSWORD=
SETTINGS__GOVUK_NOTIFY_API_KEY=your-local-testing-api-key-generated-from-www.notifications.service.gov.uk

# Devise OmniAuth - Azure Active Directory
Expand Down
25 changes: 2 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,10 @@ $ bin/yarn install
```

#### Seeds
Seeds can be loaded into the database using the command. Some environment variables need to be set for this to work.
Seeds can be loaded into the database via a rake task. The user accounts password is set with the `DEV_PASSWORD` env var.

```
$ export [email protected]
$ export SETTINGS__SMOKE_TESTS__PASSWORD=correspondence
$ export DEV_PASSWORD=correspondence
$ bin/rake db:seed:dev
$ DEV_PASSWORD=correspondence bin/rake db:seed:dev
```

#### Running locally:
Expand Down Expand Up @@ -278,24 +275,6 @@ Whenever any changes to the letter templates are required DO NOT EDIT THE DATABA

This is required whenever any new template is added; should someone have edited the versions in the database directly, those changes will be overwritten the next time the seeder is run.

### Smoke Tests

The smoke test runs through the process of signing into the service using a dedicated user account setup as Disclosure BMT team member.
It checks that sign in was successful and then randomly views one case in the case list view.

To run the smoke test, set the following environment variables:

```
SETTINGS__SMOKE_TESTS__USERNAME # the email address to use for smoke tests
SETTINGS__SMOKE_TESTS__PASSWORD # The password for the smoketest email account
```

and then run

```
bundle exec rails smoke
```

### Site prism page manifest file

The tests use the Site Prism gem to manage page objects which behave as an abstract description of the pages in the application; they're used in feature tests for finding elements, describing the URL path for a given page and for defining useful methods e.g. for completing particular form fields on the page in question.
Expand Down
3 changes: 0 additions & 3 deletions bin/codename.sh

This file was deleted.

3 changes: 0 additions & 3 deletions config/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,6 @@ global_navigation:
search_cases:
teams:

smoke_tests:
site_url: 'http://localhost:3000'

enabled_features:
# A tempory feature flag to hide editing functionality on overturneds until the feature is built
edit_overturned:
Expand Down
27 changes: 0 additions & 27 deletions db/seeders/dev_user_seeder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,12 @@ def seed!
Rails.logger.debug "***** Dev users will not be seeded in production environment *****"
Rails.logger.debug "=================================================================="
Rails.logger.debug ""
return
else
foi = CorrespondenceType.foi
@users.each do |user_name, user_info_list|
user_info_list.each do |user_info|
team_abbr = user_info[:team]
team = @teams[team_abbr]
# team_name = @teams.find { |t| t.second == team_abbr } .first
email = email_from_name(user_name)
role = user_info[:role]

Expand Down Expand Up @@ -97,31 +95,6 @@ def seed!
end
end
end

# # add Dave Allen into Disclosure and Comms & Information teams as well
# my_user = User.find_by_full_name! 'Dave Allen'
# team = BusinessUnit.find_by_name! 'Disclosure'
# TeamsUsersRole.find_or_create_by!(user: my_user, team: team, role: 'approver')
# team = BusinessUnit.find_by_name 'Communications and Information'
# TeamsUsersRole.find_or_create_by!(user: my_user, team: team, role: 'responder')

# # add Dasha Diss into BMT and Comms and information teams as well
# my_user = User.find_by_full_name! 'Dasha Diss'
# team = BusinessUnit.find_by_name! 'Disclosure BMT'
# TeamsUsersRole.find_or_create_by!(user: my_user, team: team, role: 'manager')
# team = BusinessUnit.find_by_name 'Communications and Information'
# TeamsUsersRole.find_or_create_by!(user: my_user, team: team, role: 'responder')

smoketest_user = User.find_or_create_by!(email: Settings.smoke_tests.username) do |user|
user.full_name = "Smokey Test(DO NOT EDIT)"
user.password = Settings.smoke_tests.password
user.password_confirmation = Settings.smoke_tests.password
Rails.logger.debug "Created Smoke Test user"
end

TeamsUsersRole.find_or_create_by!(team: BusinessUnit.dacu_bmt, user: smoketest_user, role: "manager") do
Rails.logger.debug "Created Team/Role link to user"
end
end

private
Expand Down
143 changes: 0 additions & 143 deletions lib/smoketest.rb

This file was deleted.

24 changes: 0 additions & 24 deletions lib/tasks/semaphore.rake

This file was deleted.

8 changes: 0 additions & 8 deletions lib/tasks/smoke.rake

This file was deleted.

5 changes: 0 additions & 5 deletions run-smoketests.sh

This file was deleted.

0 comments on commit becc9c4

Please sign in to comment.