From 5de737dfb55222eba16b3602ff2a8bd6e6e2116e Mon Sep 17 00:00:00 2001 From: Peter Hamilton Date: Tue, 23 Jul 2024 13:33:55 +0100 Subject: [PATCH] Retire old and unused site prism specs and related overhead (#1281) * Remove unused browser checks * Update README * Update Dockerfile and Gemfile --- .github/workflows/azure-deploy-dev.yml | 1 - .github/workflows/azure-deploy-review.yml | 1 - .github/workflows/ci.yml | 1 - .github/workflows/qa.yml | 74 --- .gitignore | 4 +- Dockerfile | 27 - Gemfile | 11 - Gemfile.lock | 18 +- README.md | 37 +- bin/docker-build | 2 +- bin/docker-certs | 12 - bin/docker-prod | 17 - bin/docker-prod-reset | 10 - bin/docker-qa | 26 - bin/qa | 15 - docker-compose.qa.yml | 74 --- ui/drivers/capybara_drivers.rb | 34 - ui/drivers/chrome.rb | 64 -- ui/drivers/firefox.rb | 64 -- ui/e2e_spec.rb | 28 - ui/home_page_spec.rb | 23 - ui/pages/base.rb | 12 - ui/pages/edit_name.rb | 11 - ui/pages/home.rb | 7 - ui/pages/my_account.rb | 11 - ui/pages/privacy_policy.rb | 9 - ui/pages/sign_in.rb | 26 - ui/pages/terms_and_conditions.rb | 9 - ui/privacy_policy.spec.rb | 17 - ui/profile_management_spec.rb | 21 - ui/sections/footer.rb | 7 - ui/sections/header.rb | 13 - ui/spec_helper.rb | 35 - .../ast/child-development-and-the-eyfs.yml | 606 ------------------ ui/support/env.rb | 15 - ui/support/shared/with_guest.rb | 3 - ui/support/shared/with_user.rb | 16 - ui/terms_and_conditions_spec.rb | 17 - ui/ui.rb | 44 -- 39 files changed, 6 insertions(+), 1416 deletions(-) delete mode 100644 .github/workflows/qa.yml delete mode 100755 bin/docker-certs delete mode 100755 bin/docker-prod delete mode 100755 bin/docker-prod-reset delete mode 100755 bin/docker-qa delete mode 100755 bin/qa delete mode 100644 docker-compose.qa.yml delete mode 100644 ui/drivers/capybara_drivers.rb delete mode 100644 ui/drivers/chrome.rb delete mode 100644 ui/drivers/firefox.rb delete mode 100644 ui/e2e_spec.rb delete mode 100644 ui/home_page_spec.rb delete mode 100644 ui/pages/base.rb delete mode 100644 ui/pages/edit_name.rb delete mode 100644 ui/pages/home.rb delete mode 100644 ui/pages/my_account.rb delete mode 100644 ui/pages/privacy_policy.rb delete mode 100644 ui/pages/sign_in.rb delete mode 100644 ui/pages/terms_and_conditions.rb delete mode 100644 ui/privacy_policy.spec.rb delete mode 100644 ui/profile_management_spec.rb delete mode 100644 ui/sections/footer.rb delete mode 100644 ui/sections/header.rb delete mode 100644 ui/spec_helper.rb delete mode 100644 ui/support/ast/child-development-and-the-eyfs.yml delete mode 100644 ui/support/env.rb delete mode 100644 ui/support/shared/with_guest.rb delete mode 100644 ui/support/shared/with_user.rb delete mode 100644 ui/terms_and_conditions_spec.rb delete mode 100644 ui/ui.rb diff --git a/.github/workflows/azure-deploy-dev.yml b/.github/workflows/azure-deploy-dev.yml index 7b604aeea..c9477fc72 100644 --- a/.github/workflows/azure-deploy-dev.yml +++ b/.github/workflows/azure-deploy-dev.yml @@ -16,7 +16,6 @@ on: - .yardopts - bin/* - docker-compose.* - - terraform/** - terraform-azure/** - uml/* diff --git a/.github/workflows/azure-deploy-review.yml b/.github/workflows/azure-deploy-review.yml index 0e56ca69d..30c0d9d95 100644 --- a/.github/workflows/azure-deploy-review.yml +++ b/.github/workflows/azure-deploy-review.yml @@ -16,7 +16,6 @@ on: - bin/* - docker-compose.* - Dockerfile - - terraform - terraform-azure - uml/* diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0ae78fc52..3dee6a751 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,6 @@ on: - bin/* - docker-compose.* - Dockerfile - - terraform - terraform-azure jobs: diff --git a/.github/workflows/qa.yml b/.github/workflows/qa.yml deleted file mode 100644 index 24b9a1688..000000000 --- a/.github/workflows/qa.yml +++ /dev/null @@ -1,74 +0,0 @@ -# -# Run UI integration specs after accessibility tests -# ---- -name: QA Framework -on: - workflow_dispatch: - inputs: - workspace: - description: Deployment workspace to test against (dev, review-pr-xxx) - type: string - default: dev - - # pull_request: - # merge_group: - # deployment_status: - - workflow_run: - workflows: - - Check WCAG Standards - branches: - - main - types: - - completed - -env: - BASE_URL: https://eyrecovery-${{ inputs.workspace || 'dev' }}.azurewebsites.net - USER_PASSWORD: ${{ secrets.USER_PASSWORD }} - -jobs: - test: - name: QA checks - runs-on: ubuntu-latest - - # https://docs.github.com/en/actions/using-containerized-services/about-service-containers - services: - chrome: - image: selenium/standalone-chrome:latest - ports: - - 4441:4444 - volumes: - - /dev/shm:/dev/shm - firefox: - image: selenium/standalone-firefox:latest - ports: - - 4442:4444 - volumes: - - /dev/shm:/dev/shm - - steps: - - - name: Checkout deployed code - uses: actions/checkout@v4 - # with: - # ref: ${{ github.event.workflow_run.head_branch }} - - - name: Setup Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: 3.3.4 - bundler-cache: true - - - name: Install Rubygems - run: bundle install --jobs 20 --retry 3 - - - name: Use Chrome - env: - BROWSER: standalone_chrome - run: bundle exec rspec --default-path ui - - - name: Use Firefox - env: - BROWSER: standalone_firefox - run: bundle exec rspec --default-path ui diff --git a/.gitignore b/.gitignore index 8ca8af16b..fc394c34a 100644 --- a/.gitignore +++ b/.gitignore @@ -53,9 +53,7 @@ doc coverage # Self-signed certificates -localhost.crt -localhost.key -nscacert.pem +*.pem # Yarn files .yarn/* diff --git a/Dockerfile b/Dockerfile index e75673d34..8de08c68c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -117,33 +117,6 @@ COPY .rubocop_todo.yml ${APP_HOME}/.rubocop_todo.yml CMD ["bundle", "exec", "rspec"] -# ------------------------------------------------------------------------------ -# Test UI Stage (additional non-Ruby dependencies, containerised version of local dev experience) -# ------------------------------------------------------------------------------ -FROM app as ui - -RUN bundle config unset without -RUN bundle config set without development -RUN bundle install --no-binstubs --retry=10 --jobs=4 - -COPY ui ${APP_HOME}/ui - -CMD ["bundle", "exec", "rspec", "--default-path", "ui"] - -# ------------------------------------------------------------------------------ -# QA Stage - ./bin/docker-qa -# ------------------------------------------------------------------------------ -FROM base as qa - -RUN gem install pry-byebug rspec capybara site_prism selenium-webdriver faker dry-inflector - -WORKDIR /srv - -COPY ui /srv/spec -COPY .rspec /srv/.rspec - -CMD ["rspec"] - # ------------------------------------------------------------------------------ # Pa11y CI - ./bin/docker-pa11y # ------------------------------------------------------------------------------ diff --git a/Gemfile b/Gemfile index 8525a3c4c..2ba5f60a2 100644 --- a/Gemfile +++ b/Gemfile @@ -106,14 +106,3 @@ group :test do gem 'show_me_the_cookies' gem 'simplecov' end - -# NB: -# This gem group is being installed into an as yet unused Docker target 'ui' that -# adds additional test dependencies for /ui tests alongside application code. -# However, this is also available in an isolated container, target 'qa'. -# -group :ui do - gem 'dry-inflector' - gem 'selenium-webdriver' - gem 'site_prism' -end diff --git a/Gemfile.lock b/Gemfile.lock index 9ddd81b3b..e8f2ff935 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -471,7 +471,7 @@ GEM actionpack (>= 5.2) railties (>= 5.2) retriable (3.1.2) - rexml (3.3.2) + rexml (3.3.1) strscan rouge (4.2.0) rspec-core (3.13.0) @@ -535,14 +535,7 @@ GEM rexml ruby-progressbar (1.13.0) ruby-rc4 (0.1.5) - rubyzip (2.3.2) safely_block (0.4.0) - selenium-webdriver (4.23.0) - base64 (~> 0.2) - logger (~> 1.4) - rexml (~> 3.2, >= 3.2.5) - rubyzip (>= 1.2.2, < 3.0) - websocket (~> 1.0) sentry-rails (5.18.1) railties (>= 5.0) sentry-ruby (~> 5.18.1) @@ -562,11 +555,6 @@ GEM simplecov_json_formatter (~> 0.1) simplecov-html (0.12.3) simplecov_json_formatter (0.1.4) - site_prism (5.0.3) - addressable (~> 2.8, >= 2.8.4) - capybara (~> 3.32) - site_prism-all_there (> 2, < 5) - site_prism-all_there (3.0.5) sitemap_generator (6.3.0) builder (~> 3.0) slim (5.2.1) @@ -625,7 +613,6 @@ GEM faraday (~> 2.0) faraday-follow_redirects webrick (1.8.1) - websocket (1.2.11) websocket-driver (0.7.6) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) @@ -665,7 +652,6 @@ DEPENDENCIES dibber dotenv-rails dry-core - dry-inflector dry-initializer dry-struct dry-types @@ -697,12 +683,10 @@ DEPENDENCIES rspec-rails rubocop-govuk rubocop-performance - selenium-webdriver sentry-rails sentry-ruby show_me_the_cookies simplecov - site_prism sitemap_generator slim-rails sprockets-rails diff --git a/README.md b/README.md index bdf2295ec..2cb0b28bb 100644 --- a/README.md +++ b/README.md @@ -127,19 +127,8 @@ The commands run common tasks inside containers: equivalent of `bin/rspec` - `bin/docker-doc` runs a YARD documentation server - `bin/docker-uml` exports UML diagrams as default PNGs -- `bin/docker-prod` starts rails in production under `https` -- `bin/docker-qa` runs the browser tests against a running production application, - a containerised equivalent of `bin/qa` - `bin/docker-pa11y` runs WCAG checks against a generated `sitemap.xml` -These commands can be used to debug problems: - -- `docker ps` lists all active **Docker** processes -- `docker system prune` tidies up your system -- `docker-compose -f docker-compose.yml -f docker-compose..yml --project-name recovery run --rm app` - can help identify why the application is not running in either the `dev`, `test`, or `qa` contexts -- `BASE_URL=https://app:3000 docker-compose -f docker-compose.yml -f docker-compose.qa.yml --project-name recovery up app` debug the UAT tests - ## Using Rake Custom tasks are namespaced under `eyfs`, list them using `rake --tasks eyfs`. @@ -147,10 +136,6 @@ Custom tasks are namespaced under `eyfs`, list them using `rake --tasks eyfs`. ```sh # Generate secure bot user $ rake eyfs:bot -# Que job to insert page view events for injected module items -$ rake eyfs:jobs:plug_content -# Recalculate module completion time -$ rake eyfs:user_progress # Enable the post login 'What's new' page $ rake eyfs:whats_new ``` @@ -196,19 +181,6 @@ Production console access | 6274651 | eyf-recovery | early-years-foundation-reform | eyf-recovery | +---------+--------------+-------------------------------+--------------+ -## Quality Assurance - -The UI/UA test suite can be run against any site. -A production-like application is available as a composed Docker service for local development. -To run a self-signed certificate must first be generated. - -1. `./bin/docker-certs` (Mac users can trust the certificate in [Keychain Access](https://support.apple.com/en-gb/guide/keychain-access)) -2. `./bin/docker-qa` (this will build and bring up the application with a clean database) -3. `./bin/docker-prod-reset` (clean and reseed the prerequisite user accounts) -4. `./bin/docker-qa` (retest) -4. `BASE_URL=https://deployment ./bin/docker-qa` (alternative test against another server) - - ## Accessibility Standards An automated accessibility audit can be run against a development server running @@ -277,7 +249,7 @@ Using this authentication method also requires basic HTTP auth credentials. For status updates see -### Questions +### Support Questions can be directed to the `#govuk-one-login` slack channel @@ -302,14 +274,14 @@ User [service accounts](https://cloud.google.com/iam/docs/service-accounts) can - [Staging Dashboard](https://lookerstudio.google.com/reporting/8f550461-c4e7-4c9f-b597-6f27669ff14c) - [Staging Bucket](https://console.cloud.google.com/storage/browser/eyfs-data-dashboard-staging) - [Production Dashboard](https://lookerstudio.google.com/reporting/095cfc94-d1d2-4a32-a2ba-d5899c3ecea5) -- [Production Bucket](https://console.cloud.google.com/storage/browser/eyfs-data-dashboard-live) +- [Production Bucket](https://console.cloud.google.com/storage/browser/eyfs-recovery-production) **Downloading exported data** - `gcloud auth login` - `gcloud config set project eyfsdashboard` - `gsutil ls` (list buckets) -- `gsutil -m cp -r "gs://eyfs-data-dashboard-live/eventsdata" "gs://eyfs-data-dashboard-live/useranswers" .` (export folders recursively) +- `gsutil -m cp -r "gs://eyfs-recovery-production/events" "gs://eyfs-recovery-production/training" .` (export folders recursively) --- @@ -357,7 +329,6 @@ File.open(file, 'w') { |file| file.write(data.to_yaml) } [prototype-app]: https://eye-recovery.herokuapp.com -[interim-prototype-app]: https://child-development-training-prototype.london.cloudapps.digital [production]: https://child-development-training.education.gov.uk [staging]: https://staging.child-development-training.education.gov.uk [development]: https://eyrecovery-dev.azurewebsites.net @@ -370,11 +341,9 @@ File.open(file, 'w') { |file| file.write(data.to_yaml) } [ci-workflow]: https://github.com/DFE-Digital/early-years-foundation-recovery/actions/workflows/ci.yml [production-workflow]: https://github.com/DFE-Digital/early-years-foundation-recovery/actions/workflows/production.yml [staging-workflow]: https://github.com/DFE-Digital/early-years-foundation-recovery/actions/workflows/staging.yml -[qa-workflow]: https://github.com/DFE-Digital/early-years-foundation-recovery/actions/workflows/qa.yml [brakeman-badge]: https://github.com/DFE-Digital/early-years-foundation-recovery/actions/workflows/brakeman.yml/badge.svg [pa11y-badge]: https://github.com/DFE-Digital/early-years-foundation-recovery/actions/workflows/pa11y.yml/badge.svg [ci-badge]: https://github.com/DFE-Digital/early-years-foundation-recovery/actions/workflows/ci.yml/badge.svg -[qa-badge]: https://github.com/DFE-Digital/early-years-foundation-recovery/actions/workflows/qa.yml/badge.svg diff --git a/bin/docker-build b/bin/docker-build index 8dbab7de3..28bb102d7 100755 --- a/bin/docker-build +++ b/bin/docker-build @@ -5,7 +5,7 @@ # ------------------------------------------------------------------------------ set -e -for env in dev test qa; do +for env in dev test; do docker-compose \ -f docker-compose.yml \ -f docker-compose.$env.yml \ diff --git a/bin/docker-certs b/bin/docker-certs deleted file mode 100755 index 680642f40..000000000 --- a/bin/docker-certs +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bash -# -# https://support.apple.com/en-gb/guide/keychain-access -# ------------------------------------------------------------------------------ -set -e - -openssl req \ - -nodes -x509 -sha256 \ - -newkey rsa:2048 \ - -keyout localhost.key \ - -out localhost.crt \ - -subj "/C=GB/ST=London/L=London/O=DfE/OU=EYFS/CN=example.com" diff --git a/bin/docker-prod b/bin/docker-prod deleted file mode 100755 index 8488cc5b5..000000000 --- a/bin/docker-prod +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -# -# Generate self-signed certificates before running using: -# $ ./bin/docker-certs -# -# ------------------------------------------------------------------------------ -set -e - -docker-compose \ - -f docker-compose.yml \ - -f docker-compose.qa.yml \ - --project-name recovery \ - up --detach app - -./bin/docker-prod-reset - -docker attach recovery_prod diff --git a/bin/docker-prod-reset b/bin/docker-prod-reset deleted file mode 100755 index dd53e9f4b..000000000 --- a/bin/docker-prod-reset +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash -# -# ------------------------------------------------------------------------------ -set -e - -docker exec \ - -it \ - -e DISABLE_DATABASE_ENVIRONMENT_CHECK=1 \ - recovery_prod \ - rails db:seed:replant \ No newline at end of file diff --git a/bin/docker-qa b/bin/docker-qa deleted file mode 100755 index a6b0e80a4..000000000 --- a/bin/docker-qa +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env bash -# -# @see https://github.com/SeleniumHQ/docker-selenium -# -# @example -# $ ./bin/docker-prod -# $ TYPE=firefox ./bin/docker-qa -# $ BASE_URL=https://eyrecovery-review-pr-123.azurewebsites.net USER_PASSWORD=secret ./bin/docker-qa -# -# ------------------------------------------------------------------------------ -set -e - -TYPE=${TYPE-"chrome"} - -BASE_URL=${BASE_URL-"https://app:3000"} \ -BROWSER=${BROWSER-"standalone_$TYPE"} \ -DRIVER=${DRIVER-"$TYPE:4444"} \ - docker-compose \ - -f docker-compose.yml \ - -f docker-compose.qa.yml \ - --project-name recovery \ - run \ - --volume="$PWD/ui:/srv/ui" \ - --name recovery_qa \ - --rm qa \ - rspec --default-path ui "$@" diff --git a/bin/qa b/bin/qa deleted file mode 100755 index 61528cc8c..000000000 --- a/bin/qa +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env bash -# -# Run the QA framework against a given URL: -# The QA framework is expected to run against a production environment -# defaults to using 'chrome' and using 'https' -# -# @example -# $ ./bin/docker-prod -# $ BROWSER=firefox ./bin/qa -# -# ------------------------------------------------------------------------------ -set -e - -BASE_URL=${BASE_URL-'https://localhost:3000'} \ - bundle exec rspec --default-path ui "$@" diff --git a/docker-compose.qa.yml b/docker-compose.qa.yml deleted file mode 100644 index 31b15b465..000000000 --- a/docker-compose.qa.yml +++ /dev/null @@ -1,74 +0,0 @@ -# ------------------------------------------------------------------------------ -# Seed the production database: -# -# $ docker exec -it recovery_prod rails db:create db:prepare db:seed -# ---- -services: - app: - command: rails server -b 'ssl://0.0.0.0:3000?key=localhost.key&cert=localhost.crt' - healthcheck: - test: curl --fail --insecure https://localhost:3000/health || exit 1 - environment: - - DATABASE_URL=postgres://postgres:password@db:5432/early_years_foundation_recovery_production - - DOMAIN=localhost:3000 - - PROXY_CERT=/srv/localhost.crt - # overrides - - WORKSPACE - - USER_PASSWORD - - CONTENTFUL_ENVIRONMENT - - CONTENTFUL_PREVIEW - volumes: - # NB: or ensure RAILS_MASTER_KEY= is in .env - - ./config/credentials/production.key:/srv/config/credentials/production.key - # NB: run ./bin/docker-certs to generate a self-signed certificate - - ./localhost.key:/srv/localhost.key - - ./localhost.crt:/srv/localhost.crt - - qa: - container_name: recovery_qa - build: - context: . - target: qa - image: recovery:qa - environment: - - BASE_URL - - BROWSER - - DRIVER - - USER_PASSWORD - - E2E - depends_on: - app: - condition: service_healthy - chrome: - condition: service_healthy - firefox: - condition: service_healthy - networks: - - recovery - tty: true - stdin_open: true - - chrome: - container_name: recovery_chrome - image: selenium/standalone-chrome:latest - volumes: - - /dev/shm:/dev/shm - ports: - - 4441:4444 - healthcheck: - test: curl --fail http://localhost:4444 || exit 1 - networks: - - recovery - - firefox: - container_name: recovery_firefox - image: selenium/standalone-firefox:latest - volumes: - - /dev/shm:/dev/shm - ports: - - 4442:4444 - healthcheck: - test: curl --fail http://localhost:4444 || exit 1 - networks: - - recovery diff --git a/ui/drivers/capybara_drivers.rb b/ui/drivers/capybara_drivers.rb deleted file mode 100644 index 45592de5f..000000000 --- a/ui/drivers/capybara_drivers.rb +++ /dev/null @@ -1,34 +0,0 @@ -# Namespace for Driver related functionality -module Drivers - # Capybara registration for all drivers - class CapybaraDrivers - # Invoke the #all_drivers methods on each of the driver classes within the drivers directory. - # @return [Array] Driver classes - def self.register_all - inflector = Dry::Inflector.new - klasses = Drivers.constants.select { |klass| Drivers.const_get(klass).is_a?(Class) } - klasses.delete_if { |score| score.match?(/CapybaraDrivers/) } - klasses.each { |klass| inflector.constantize("Drivers::#{klass}").send(:all_drivers) } - end - - # Get the current browser - # @return [Symbol] the current browser - def self.chosen_driver - browser - end - - # String to symbol mapping based on value of environment variable BROWSER - # @return [Symbol] the chosen browser - def self.browser - case ENV['BROWSER'] - when 'firefox' then :firefox - when 'chrome' then :chrome - when 'headless_chrome' then :headless_chrome - when 'headless_firefox' then :headless_firefox - when 'standalone_chrome' then :standalone_chrome - when 'standalone_firefox' then :standalone_firefox - else abort 'BROWSER variable needs to be set to something valid, or left alone' - end - end - end -end diff --git a/ui/drivers/chrome.rb b/ui/drivers/chrome.rb deleted file mode 100644 index 424a9888e..000000000 --- a/ui/drivers/chrome.rb +++ /dev/null @@ -1,64 +0,0 @@ -module Drivers - class Chrome - # @return [Capybara] - def self.all_drivers - register - register_remote - register_headless - end - - # @return [Selenium::WebDriver::Chrome::Options] - def self.driver_options(headless: false) - options = if headless - %w[ - headless - disable-extensions - disable-gpu - no-sandbox - window-size=1280,800 - ] - else - [] - end - - Selenium::WebDriver::Options.chrome( - accept_insecure_certs: true, - 'goog:chromeOptions': options, - ) - end - - # @return [Capybara] - def self.register - Capybara.register_driver :chrome do |app| - Capybara::Selenium::Driver.new( - app, - browser: :chrome, - options: driver_options, - ) - end - end - - # @return [Capybara] - def self.register_headless - Capybara.register_driver :headless_chrome do |app| - Capybara::Selenium::Driver.new( - app, - browser: :chrome, - options: driver_options(headless: true), - ) - end - end - - # @return [Capybara] - def self.register_remote - Capybara.register_driver :standalone_chrome do |app| - Capybara::Selenium::Driver.new( - app, - browser: :remote, - url: "http://#{ENV.fetch('DRIVER', 'localhost:4441')}/wd/hub", - options: driver_options, - ) - end - end - end -end diff --git a/ui/drivers/firefox.rb b/ui/drivers/firefox.rb deleted file mode 100644 index 35e84104f..000000000 --- a/ui/drivers/firefox.rb +++ /dev/null @@ -1,64 +0,0 @@ -module Drivers - class Firefox - # @return [Capybara] - def self.all_drivers - register - register_remote - register_headless - end - - # @return [Selenium::WebDriver::Firefox::Options] - def self.driver_options(headless: false) - options = if headless - %w[ - -headless - disable-extensions - disable-gpu - no-sandbox - window-size=1280,80 - ] - else - [] - end - - Selenium::WebDriver::Options.firefox( - accept_insecure_certs: true, - 'moz:firefoxOptions': options, - ) - end - - # @return [Capybara] - def self.register - Capybara.register_driver :firefox do |app| - Capybara::Selenium::Driver.new( - app, - browser: :firefox, - options: driver_options, - ) - end - end - - # @return [Capybara] - def self.register_headless - Capybara.register_driver :headless_firefox do |app| - Capybara::Selenium::Driver.new( - app, - browser: :firefox, - options: driver_options(headless: true), - ) - end - end - - # @return [Capybara] - def self.register_remote - Capybara.register_driver :standalone_firefox do |app| - Capybara::Selenium::Driver.new( - app, - browser: :remote, - url: "http://#{ENV.fetch('DRIVER', 'localhost:4442')}/wd/hub", - options: driver_options, - ) - end - end - end -end diff --git a/ui/e2e_spec.rb b/ui/e2e_spec.rb deleted file mode 100644 index 59350b0d2..000000000 --- a/ui/e2e_spec.rb +++ /dev/null @@ -1,28 +0,0 @@ -RSpec.describe 'E2E' do - include_context 'with user' - - include Capybara::DSL - - let(:ast) do - YAML.load_file('ui/support/ast/child-development-and-the-eyfs.yml') - end - - def input_text(field, input) - fill_in field, with: input - end - - before do - skip 'WIP' unless ENV['E2E'] - - click_on 'Module 1: Understanding child development and the EYFS' - click_on 'Start module' - end - - it 'completes the module' do - ast.each do |content| - expect(page).to have_current_path content[:path] - expect(page).to have_content content[:text] - content[:inputs].each { |args| send(*args) } - end - end -end diff --git a/ui/home_page_spec.rb b/ui/home_page_spec.rb deleted file mode 100644 index e0a5fb9c1..000000000 --- a/ui/home_page_spec.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true - -describe 'home page' do - context 'when unauthenticated' do - include_context 'as guest' - - before do - ui.home.load - end - - it 'is displayed when the user clicks the header logo' do - ui.home.header.logo.click - expect(ui.home).to be_displayed - end - - describe 'footer' do - it 'links to Terms and conditions' do - ui.home.footer.terms_and_conditions.click - expect(ui.terms_and_conditions).to be_displayed - end - end - end -end diff --git a/ui/pages/base.rb b/ui/pages/base.rb deleted file mode 100644 index ba7e04299..000000000 --- a/ui/pages/base.rb +++ /dev/null @@ -1,12 +0,0 @@ -# frozen_string_literal: true - -module Pages - class Base < SitePrism::Page - def self.set_url(path) - super(ENV['BASE_URL'] + path) - end - - section :header, Sections::Header, 'header' - section :footer, Sections::Footer, 'footer' - end -end diff --git a/ui/pages/edit_name.rb b/ui/pages/edit_name.rb deleted file mode 100644 index 56228756f..000000000 --- a/ui/pages/edit_name.rb +++ /dev/null @@ -1,11 +0,0 @@ -# frozen_string_literal: true - -module Pages - class EditName < Base - set_url '/registration/name/edit' - - element :first_name_field, '#user-first-name-field' - element :last_name_field, '#user-last-name-field' - element :button, 'button.govuk-button', text: 'Continue' - end -end diff --git a/ui/pages/home.rb b/ui/pages/home.rb deleted file mode 100644 index d057956db..000000000 --- a/ui/pages/home.rb +++ /dev/null @@ -1,7 +0,0 @@ -# frozen_string_literal: true - -module Pages - class Home < Base - set_url '/' - end -end diff --git a/ui/pages/my_account.rb b/ui/pages/my_account.rb deleted file mode 100644 index f134a29f0..000000000 --- a/ui/pages/my_account.rb +++ /dev/null @@ -1,11 +0,0 @@ -# frozen_string_literal: true - -module Pages - class MyAccount < Base - set_url '/my-account' - - element :name, '.govuk-summary-list__value', match: :first - - element :edit_name, '#edit_name_registration', text: 'Change' - end -end diff --git a/ui/pages/privacy_policy.rb b/ui/pages/privacy_policy.rb deleted file mode 100644 index c4f6b515a..000000000 --- a/ui/pages/privacy_policy.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -module Pages - class PrivacyPolicy < Base - set_url '/privacy-policy' - - element :heading, 'h1', text: 'Privacy policy' - end -end diff --git a/ui/pages/sign_in.rb b/ui/pages/sign_in.rb deleted file mode 100644 index dd7b46a0c..000000000 --- a/ui/pages/sign_in.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -module Pages - class SignIn < Base - set_url '/users/sign-in' - - element :email_field, '#user-email-field' - element :password_field, '#user-password-field' - element :sign_in_button, 'button.govuk-button', text: 'Sign in' - - # Authenticate using email and password - # - # @param email [String] login email address (default: completed@example.com) - # @param password [String] login password (default: Str0ngPa$$w0rd12) - def with_email_and_password(email = nil, password = nil) - wait_until_header_visible - - email ||= 'completed@example.com' - password ||= ENV.fetch('USER_PASSWORD', 'Str0ngPa$$w0rd12') - - email_field.set(email) - password_field.set(password) - sign_in_button.click - end - end -end diff --git a/ui/pages/terms_and_conditions.rb b/ui/pages/terms_and_conditions.rb deleted file mode 100644 index d40b245f2..000000000 --- a/ui/pages/terms_and_conditions.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -module Pages - class TermsAndConditions < Base - set_url '/terms-and-conditions' - - element :heading, 'h1', text: 'Terms and conditions' - end -end diff --git a/ui/privacy_policy.spec.rb b/ui/privacy_policy.spec.rb deleted file mode 100644 index b36d1d9ac..000000000 --- a/ui/privacy_policy.spec.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -describe 'Privacy Page' do - include_context 'as guest' - - before do - ui.privacy_policy.load - end - - it 'then the page is displayed' do - expect(ui.privacy_policy).to be_displayed - end - - it 'then the page has a heading' do - expect(ui.privacy_policy).to have_heading - end -end diff --git a/ui/profile_management_spec.rb b/ui/profile_management_spec.rb deleted file mode 100644 index 2a892b77d..000000000 --- a/ui/profile_management_spec.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -describe 'Profile management' do - include_context 'with user' - - before do - ui.my_account.load - end - - describe 'Your details' do - it 'edit first name' do - expect(ui.my_account).to be_displayed - ui.my_account.edit_name.click - expect(ui.edit_name).to be_displayed - ui.edit_name.first_name_field.set 'Peter' - ui.edit_name.button.click - expect(ui.my_account).to be_displayed - expect(ui.my_account.name).to have_text 'Peter' - end - end -end diff --git a/ui/sections/footer.rb b/ui/sections/footer.rb deleted file mode 100644 index 2b8231a78..000000000 --- a/ui/sections/footer.rb +++ /dev/null @@ -1,7 +0,0 @@ -# frozen_string_literal: true - -module Sections - class Footer < SitePrism::Section - element :terms_and_conditions, "a[href='/terms-and-conditions']", text: 'Terms and conditions' - end -end diff --git a/ui/sections/header.rb b/ui/sections/header.rb deleted file mode 100644 index 2a919d043..000000000 --- a/ui/sections/header.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -module Sections - class Header < SitePrism::Section - element :title_link, '.dfe-header__link dfe-header__link--service-name', text: 'GOV.UK Early years child development training' - element :logo, '.dfe-header__link--service', text: 'Early years child development training' - element :home, "a[href='/']", text: 'Home' - element :training_module, "a[href='/modules']", text: 'Training Modules' - element :sign_in, "a[href='/users/sign-in']", text: 'Sign in' - element :sign_out, "a[href='/users/sign-out']", text: 'Sign out' - element :my_account, "a[href='/my-account']", text: 'My account' - end -end diff --git a/ui/spec_helper.rb b/ui/spec_helper.rb deleted file mode 100644 index 927d15299..000000000 --- a/ui/spec_helper.rb +++ /dev/null @@ -1,35 +0,0 @@ -require 'pry-byebug' - -RSpec.configure do |config| - config.expect_with :rspec do |expectations| - expectations.include_chain_clauses_in_custom_matcher_descriptions = true - end - - config.mock_with :rspec do |mocks| - mocks.verify_partial_doubles = true - end - - config.shared_context_metadata_behavior = :apply_to_host_groups -end - -require_relative './support/env' -require_relative './support/shared/with_user' -require_relative './support/shared/with_guest' - -# Site Prism URL defaults to SSL in production -ENV['BASE_URL'] ||= 'http://localhost:3000' - -# If no browser is chosen, then default to the following browser -ENV['BROWSER'] ||= 'chrome' - -%w[drivers sections pages].each do |component| - Dir[Pathname(__dir__).realpath.join("#{component}/*")].each(&method(:require)) -end - -require_relative './ui' - -Drivers::CapybaraDrivers.register_all - -Capybara.configure do |config| - config.default_driver = Drivers::CapybaraDrivers.chosen_driver -end diff --git a/ui/support/ast/child-development-and-the-eyfs.yml b/ui/support/ast/child-development-and-the-eyfs.yml deleted file mode 100644 index 6470f10f9..000000000 --- a/ui/support/ast/child-development-and-the-eyfs.yml +++ /dev/null @@ -1,606 +0,0 @@ -# -# @see ContentTestSchema -# ---- -- - :path: /modules/child-development-and-the-eyfs/content-pages/what-to-expect - :text: What to expect during the training - :inputs: - - - :click_on - - Next -- - :path: /modules/child-development-and-the-eyfs/content-pages/1-1 - :text: An informed approach to care and education - :inputs: - - - :click_on - - Start section -- - :path: /modules/child-development-and-the-eyfs/content-pages/1-1-1 - :text: The importance of understanding child development - :inputs: - - - :click_on - - Next -- - :path: /modules/child-development-and-the-eyfs/content-pages/1-1-1-1 - :text: How understanding child development benefits the child - :inputs: - - - :input_text - - note-body-field - - hello world - - - :click_on - - Save and continue -- - :path: /modules/child-development-and-the-eyfs/questionnaires/1-1-1-1b - :text: Self-efficacy is a measure of which of the following? - :inputs: - - - :choose - - user-answer-answers-3-field - - - :click_on - - Next - - - :click_on - - Next -- - :path: /modules/child-development-and-the-eyfs/content-pages/1-1-1-2 - :text: How understanding child development benefits the practitioner - :inputs: - - - :input_text - - note-body-field - - hello world - - - :click_on - - Save and continue -- - :path: /modules/child-development-and-the-eyfs/questionnaires/1-1-1-2b - :text: When planning your curriculum, what is implementation? - :inputs: - - - :choose - - user-answer-answers-1-field - - - :click_on - - Next - - - :click_on - - Next -- - :path: /modules/child-development-and-the-eyfs/content-pages/1-1-1-3 - :text: How understanding child development benefits the wider support network - :inputs: - - - :input_text - - note-body-field - - hello world - - - :click_on - - Save and continue -- - :path: /modules/child-development-and-the-eyfs/content-pages/1-1-1-4 - :text: The potential impact of limited child development knowledge - :inputs: - - - :input_text - - note-body-field - - hello world - - - :click_on - - Save and continue -- - :path: /modules/child-development-and-the-eyfs/questionnaires/1-1-1-4b - :text: When the learning environment and activities are too challenging, a child may become frustrated and disengaged. - :inputs: - - - :choose - - user-answer-answers-1-field - - - :click_on - - Next - - - :click_on - - Next -- - :path: /modules/child-development-and-the-eyfs/content-pages/1-1-1-5 - :text: How improved child development knowledge supports practice - scaffolding learning - :inputs: - - - :input_text - - note-body-field - - hello world - - - :click_on - - Save and continue -- - :path: /modules/child-development-and-the-eyfs/content-pages/1-1-1-6 - :text: How improved child development knowledge supports practice - understanding behaviour - :inputs: - - - :click_on - - Next -- - :path: /modules/child-development-and-the-eyfs/questionnaires/1-1-1-6b - :text: Which of the following aspects of the learning environment can trigger behaviour that practitioners may find challenging? - :inputs: - - - :check - - user-answer-answers-2-field - - - :check - - user-answer-answers-3-field - - - :check - - user-answer-answers-4-field - - - :click_on - - Next - - - :click_on - - Next -- - :path: /modules/child-development-and-the-eyfs/content-pages/1-1-1-7 - :text: How improved child development knowledge supports practice - effective holistic support - :inputs: - - - :input_text - - note-body-field - - hello world - - - :click_on - - Save and continue -- - :path: /modules/child-development-and-the-eyfs/questionnaires/1-1-1-7b - :text: What should Fatima’s childminder do? - :inputs: - - - :choose - - user-answer-answers-4-field - - - :click_on - - Next - - - :click_on - - Next -- - :path: /modules/child-development-and-the-eyfs/content-pages/1-1-2 - :text: Factors affecting children’s development - :inputs: - - - :click_on - - Next -- - :path: /modules/child-development-and-the-eyfs/content-pages/1-1-2-1 - :text: Nature versus nurture - :inputs: - - - :click_on - - Next -- - :path: /modules/child-development-and-the-eyfs/content-pages/1-1-2-2 - :text: The impact of the COVID-19 pandemic - :inputs: - - - :click_on - - Next -- - :path: /modules/child-development-and-the-eyfs/content-pages/1-1-2-3 - :text: The impact of the COVID-19 pandemic on communication, language and literacy - :inputs: - - - :click_on - - Next -- - :path: /modules/child-development-and-the-eyfs/questionnaires/1-1-2-3b - :text: During the pandemic, some children may have had a smaller variety of social interactions. - :inputs: - - - :choose - - user-answer-answers-2-field - - - :click_on - - Next - - - :click_on - - Next -- - :path: /modules/child-development-and-the-eyfs/content-pages/1-1-2-4 - :text: The impact of the COVID-19 pandemic on personal, social and emotional development - :inputs: - - - :click_on - - Next -- - :path: /modules/child-development-and-the-eyfs/questionnaires/1-1-2-4b - :text: Some children may have become more emotionally mature as a result of the pandemic. - :inputs: - - - :choose - - user-answer-answers-1-field - - - :click_on - - Next - - - :click_on - - Next -- - :path: /modules/child-development-and-the-eyfs/content-pages/1-1-2-5 - :text: The impact of the COVID-19 pandemic on mathematics - :inputs: - - - :click_on - - Next -- - :path: /modules/child-development-and-the-eyfs/content-pages/1-1-2-6 - :text: The impact of the COVID-19 pandemic on physical development - :inputs: - - - :click_on - - Next -- - :path: /modules/child-development-and-the-eyfs/questionnaires/1-1-2-6b - :text: Doing which of the following could have had a positive impact on children’s physical development during the pandemic? - :inputs: - - - :check - - user-answer-answers-2-field - - - :check - - user-answer-answers-4-field - - - :click_on - - Next - - - :click_on - - Next -- - :path: /modules/child-development-and-the-eyfs/content-pages/1-1-2-7 - :text: The impact of the COVID-19 pandemic on knowledge and understanding of the world - :inputs: - - - :click_on - - Next -- - :path: /modules/child-development-and-the-eyfs/content-pages/1-1-2-8 - :text: The impact of the COVID-19 pandemic on expressive arts - :inputs: - - - :click_on - - Next -- - :path: /modules/child-development-and-the-eyfs/content-pages/1-1-2-9 - :text: The importance of language skills - :inputs: - - - :input_text - - note-body-field - - hello world - - - :click_on - - Save and continue -- - :path: /modules/child-development-and-the-eyfs/questionnaires/1-1-2-9b - :text: Having effective communication skills can help children to do which of the following? - :inputs: - - - :check - - user-answer-answers-2-field - - - :check - - user-answer-answers-3-field - - - :check - - user-answer-answers-4-field - - - :click_on - - Next - - - :click_on - - Next -- - :path: /modules/child-development-and-the-eyfs/content-pages/1-1-2-10 - :text: Being a role model for communication - :inputs: - - - :click_on - - Next -- - :path: /modules/child-development-and-the-eyfs/questionnaires/1-1-2-10b - :text: If a child observes a positive interaction between you and their parent or carer, they may mimic the interaction they have observed. - :inputs: - - - :choose - - user-answer-answers-1-field - - - :click_on - - Next - - - :click_on - - Next -- - :path: /modules/child-development-and-the-eyfs/content-pages/1-2 - :text: A positive approach to care and education - :inputs: - - - :click_on - - Start section -- - :path: /modules/child-development-and-the-eyfs/content-pages/1-2-1 - :text: Doing the best for each child in your care - :inputs: - - - :click_on - - Next -- - :path: /modules/child-development-and-the-eyfs/content-pages/1-2-1-1 - :text: Acknowledging children’s individual strengths - :inputs: - - - :input_text - - note-body-field - - hello world - - - :click_on - - Save and continue -- - :path: /modules/child-development-and-the-eyfs/content-pages/1-2-1-2 - :text: Empowering children - :inputs: - - - :click_on - - Next -- - :path: /modules/child-development-and-the-eyfs/questionnaires/1-2-1-2b - :text: Giving children responsibility will help to increase their resilience. - :inputs: - - - :choose - - user-answer-answers-1-field - - - :click_on - - Next - - - :click_on - - Next -- - :path: /modules/child-development-and-the-eyfs/content-pages/1-2-1-3 - :text: Supporting individual potential - :inputs: - - - :input_text - - note-body-field - - hello world - - - :click_on - - Save and continue -- - :path: /modules/child-development-and-the-eyfs/content-pages/1-2-1-4 - :text: Successful enabling environments - :inputs: - - - :input_text - - note-body-field - - hello world - - - :click_on - - Save and continue -- - :path: /modules/child-development-and-the-eyfs/questionnaires/1-2-1-4b - :text: Which of the following can help children to develop their gross motor skills? - :inputs: - - - :choose - - user-answer-answers-1-field - - - :click_on - - Next - - - :click_on - - Next -- - :path: /modules/child-development-and-the-eyfs/questionnaires/1-2-1-4c - :text: Regularly changing the routine in your setting will help children to feel more confident in their learning. - :inputs: - - - :choose - - user-answer-answers-2-field - - - :click_on - - Next - - - :click_on - - Next -- - :path: /modules/child-development-and-the-eyfs/content-pages/1-2-1-5 - :text: 'A balanced approach to learning: child led play' - :inputs: - - - :input_text - - note-body-field - - hello world - - - :click_on - - Save and continue -- - :path: /modules/child-development-and-the-eyfs/questionnaires/1-2-1-5b - :text: Which of the following are benefits of child led play? - :inputs: - - - :check - - user-answer-answers-1-field - - - :check - - user-answer-answers-3-field - - - :check - - user-answer-answers-4-field - - - :click_on - - Next - - - :click_on - - Next -- - :path: /modules/child-development-and-the-eyfs/content-pages/1-2-1-6 - :text: 'A balanced approach to learning: adult led activities' - :inputs: - - - :click_on - - Next -- - :path: /modules/child-development-and-the-eyfs/content-pages/1-2-1-6video - :text: Balancing adult and child led activities - :inputs: - - - :click_on - - Next -- - :path: /modules/child-development-and-the-eyfs/questionnaires/1-2-1-6b - :text: Children will not be enthusiastic about adult led activities as they do not incorporate their interests and preferences. - :inputs: - - - :choose - - user-answer-answers-2-field - - - :click_on - - Next - - - :click_on - - Next -- - :path: /modules/child-development-and-the-eyfs/content-pages/1-2-2 - :text: Effective implementation of the EYFS - :inputs: - - - :click_on - - Next -- - :path: /modules/child-development-and-the-eyfs/content-pages/1-2-2-1 - :text: An effective EYFS - :inputs: - - - :input_text - - note-body-field - - hello world - - - :click_on - - Save and continue -- - :path: /modules/child-development-and-the-eyfs/questionnaires/1-2-2-1b - :text: Which of the following are benefits of successfully implementing the EYFS? - :inputs: - - - :check - - user-answer-answers-2-field - - - :check - - user-answer-answers-3-field - - - :check - - user-answer-answers-4-field - - - :click_on - - Next - - - :click_on - - Next -- - :path: /modules/child-development-and-the-eyfs/content-pages/1-2-2-2 - :text: Effective assessment - :inputs: - - - :click_on - - Next -- - :path: /modules/child-development-and-the-eyfs/questionnaires/1-2-2-2b - :text: The 2 year old progress check is an example of which type of assessment? - :inputs: - - - :choose - - user-answer-answers-4-field - - - :click_on - - Next - - - :click_on - - Next -- - :path: /modules/child-development-and-the-eyfs/content-pages/1-3 - :text: Summary and next steps - :inputs: - - - :click_on - - Start section -- - :path: /modules/child-development-and-the-eyfs/content-pages/1-3-1 - :text: Recap and further reading - :inputs: - - - :click_on - - Next -- - :path: /modules/child-development-and-the-eyfs/content-pages/1-3-4 - :text: End of module test - :inputs: - - - :click_on - - Start test -- - :path: /modules/child-development-and-the-eyfs/questionnaires/1-3-4-1 - :text: Which of the following are benefits of increasing your understanding of child development? - :inputs: - - - :check - - user-answer-answers-1-field - - - :check - - user-answer-answers-2-field - - - :check - - user-answer-answers-3-field - - - :click_on - - Save and continue -- - :path: /modules/child-development-and-the-eyfs/questionnaires/1-3-4-2 - :text: If a child in your care is struggling with their learning, you should not tell their parents or carers, so as to avoid worrying them. - :inputs: - - - :choose - - user-answer-answers-2-field - - - :click_on - - Save and continue -- - :path: /modules/child-development-and-the-eyfs/questionnaires/1-3-4-3 - :text: Which of the following is the process practitioners can use to give children temporary levels of successive support? - :inputs: - - - :choose - - user-answer-answers-1-field - - - :click_on - - Save and continue -- - :path: /modules/child-development-and-the-eyfs/questionnaires/1-3-4-4 - :text: Which of the following are benefits of taking a holistic approach to learning and development? - :inputs: - - - :check - - user-answer-answers-1-field - - - :check - - user-answer-answers-2-field - - - :check - - user-answer-answers-3-field - - - :click_on - - Save and continue -- - :path: /modules/child-development-and-the-eyfs/questionnaires/1-3-4-5 - :text: Which of the following activities may have helped children to develop their mathematics skills during the pandemic? - :inputs: - - - :check - - user-answer-answers-2-field - - - :check - - user-answer-answers-3-field - - - :click_on - - Save and continue -- - :path: /modules/child-development-and-the-eyfs/questionnaires/1-3-4-6 - :text: During the pandemic some children may have had limited access to creative materials, role play items or musical activity. - :inputs: - - - :choose - - user-answer-answers-3-field - - - :click_on - - Save and continue -- - :path: /modules/child-development-and-the-eyfs/questionnaires/1-3-4-7 - :text: Acknowledging small achievements can encourage children to try more challenging tasks. - :inputs: - - - :choose - - user-answer-answers-1-field - - - :click_on - - Save and continue -- - :path: /modules/child-development-and-the-eyfs/questionnaires/1-3-4-8 - :text: Which of the following should you consider when planning the curriculum for your setting? - :inputs: - - - :check - - user-answer-answers-1-field - - - :check - - user-answer-answers-2-field - - - :check - - user-answer-answers-3-field - - - :check - - user-answer-answers-4-field - - - :click_on - - Save and continue -- - :path: /modules/child-development-and-the-eyfs/questionnaires/1-3-4-9 - :text: How do child led activities benefit children? - :inputs: - - - :check - - user-answer-answers-2-field - - - :check - - user-answer-answers-3-field - - - :check - - user-answer-answers-4-field - - - :click_on - - Save and continue -- - :path: /modules/child-development-and-the-eyfs/questionnaires/1-3-4-10 - :text: Due to the planning needed, effective assessment will require practitioners to be away from children for prolonged periods. - :inputs: - - - :choose - - user-answer-answers-2-field - - - :click_on - - Finish test -- - :path: /modules/child-development-and-the-eyfs/assessment-result/1-3-4-11 - :text: Assessment results - :inputs: - - - :click_on - - Next -- - :path: /modules/child-development-and-the-eyfs/content-pages/1-3-2 - :text: Reflect on your learning - :inputs: - - - :click_on - - Next -- - :path: /modules/child-development-and-the-eyfs/questionnaires/1-3-2-1 - :text: This training has improved my understanding of the importance of child development knowledge. - :inputs: - - - :choose - - user-answer-answers-5-field - - - :click_on - - Next -- - :path: /modules/child-development-and-the-eyfs/questionnaires/1-3-2-2 - :text: This training has improved my understanding of the different factors that can affect children’s development. - :inputs: - - - :choose - - user-answer-answers-5-field - - - :click_on - - Next -- - :path: /modules/child-development-and-the-eyfs/questionnaires/1-3-2-3 - :text: This training has improved my understanding of how the coronavirus (COVID-19) pandemic has impacted on children’s development. - :inputs: - - - :choose - - user-answer-answers-5-field - - - :click_on - - Next -- - :path: /modules/child-development-and-the-eyfs/questionnaires/1-3-2-4 - :text: This training has improved my confidence in doing my best to support each child in my care. - :inputs: - - - :choose - - user-answer-answers-5-field - - - :click_on - - Next -- - :path: /modules/child-development-and-the-eyfs/questionnaires/1-3-2-5 - :text: This training has improved my confidence in delivering the EYFS framework in an effective way. - :inputs: - - - :choose - - user-answer-answers-5-field - - - :click_on - - Next -- - :path: /modules/child-development-and-the-eyfs/content-pages/1-3-2-6 - :text: Thank you - :inputs: - - - :click_on - - Finish -- - :path: /modules/child-development-and-the-eyfs/content-pages/1-3-3 - :text: Congratulations! - :inputs: [] diff --git a/ui/support/env.rb b/ui/support/env.rb deleted file mode 100644 index ac2204b63..000000000 --- a/ui/support/env.rb +++ /dev/null @@ -1,15 +0,0 @@ -require 'capybara' -require 'capybara/rspec' -require 'selenium-webdriver' -require 'site_prism' -require 'site_prism/all_there' -require 'faker' -require 'dry/inflector' - -Capybara.configure do |config| - config.server_host = 'app' - config.automatic_label_click = true - config.default_max_wait_time = 10 -end - -Faker::Config.locale = 'en-GB' diff --git a/ui/support/shared/with_guest.rb b/ui/support/shared/with_guest.rb deleted file mode 100644 index 7c29e8115..000000000 --- a/ui/support/shared/with_guest.rb +++ /dev/null @@ -1,3 +0,0 @@ -RSpec.shared_context 'as guest' do - let(:ui) { Ui.new } -end diff --git a/ui/support/shared/with_user.rb b/ui/support/shared/with_user.rb deleted file mode 100644 index 691928aef..000000000 --- a/ui/support/shared/with_user.rb +++ /dev/null @@ -1,16 +0,0 @@ -RSpec.shared_context 'with user' do - let(:ui) { Ui.new } - - let(:browser) { Capybara.current_session.driver.browser } - - before do - ui.home.load - ui.home.header.sign_in.click - ui.sign_in.with_email_and_password - end - - # Capybara.current_session.driver.quit - after do - browser.manage.delete_all_cookies - end -end diff --git a/ui/terms_and_conditions_spec.rb b/ui/terms_and_conditions_spec.rb deleted file mode 100644 index 98bba115c..000000000 --- a/ui/terms_and_conditions_spec.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -describe 'Terms and conditions' do - include_context 'as guest' - - before do - ui.terms_and_conditions.load - end - - it 'then the page is displayed' do - expect(ui.terms_and_conditions).to be_displayed - end - - it 'then the page has a heading' do - expect(ui.terms_and_conditions).to have_heading - end -end diff --git a/ui/ui.rb b/ui/ui.rb deleted file mode 100644 index 940d0b133..000000000 --- a/ui/ui.rb +++ /dev/null @@ -1,44 +0,0 @@ -class Ui - attr_reader :inflector - - # include Pages::Base - - # Set class defaults - def initialize - @inflector = Dry::Inflector.new - end - - # Dynamic method naming - # - # @param [String] method_name name - # @return [Pages] A page instance - def method_missing(method_name) - pages[method_name] ||= get_constantized_instance_name(method_name).new - end - - # Required respond to missing method when using method_missing - # - # @param [String] method_name string arg. - def respond_to_missing?(method_name, include_private = false) - get_constantized_instance_name(method_name) - rescue NameError => _e - super - end - -private - - # convenience method to setup dynamic method body - # - # @param [String] method_name text input - def get_constantized_instance_name(method_name) - camelized_method = @inflector.camelize("Pages/#{method_name}") - @inflector.constantize(camelized_method) - end - - # Sets pages type if unset - # - # @return pages instance - def pages - @pages ||= {} - end -end