diff --git a/.circleci/config.yml b/.circleci/config.yml index ff32cf8d3..babdf11a9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,9 +1,9 @@ -version: 2.0 +version: 2.1 jobs: build: docker: - - image: cypress/base:10 + - image: cypress/base:12.0.0 environment: TERM: xterm CIRCLE_TEST_REPORTS: test-results @@ -13,14 +13,14 @@ jobs: - checkout - restore_cache: keys: - - v2-deps-{{ checksum "yarn.lock" }} - - v2-deps-{{ .Branch }} - - v2-deps + - v3-deps-{{ checksum "yarn.lock" }} + - v3-deps-{{ .Branch }} + - v3-deps - run: name: Install Dependencies command: yarn install --frozen-lockfile - save_cache: - key: v2-deps-{{ checksum "yarn.lock" }} + key: v3-deps-{{ checksum "yarn.lock" }} paths: - node_modules - packages/ripple-nuxt-tide/node_modules @@ -40,7 +40,7 @@ jobs: warm-up: docker: - - image: cypress/base:10 + - image: cypress/base:12.0.0 steps: - run: name: wake up dev backend @@ -48,7 +48,7 @@ jobs: test: docker: - - image: cypress/base:10 + - image: cypress/base:12.0.0 environment: TERM: xterm CIRCLE_TEST_REPORTS: test-results @@ -60,9 +60,9 @@ jobs: at: ~/app - restore_cache: keys: - - v2-deps-{{ checksum "yarn.lock" }} - - v2-deps-{{ .Branch }} - - v2-deps + - v3-deps-{{ checksum "yarn.lock" }} + - v3-deps-{{ .Branch }} + - v3-deps - run: name: Lint code. command: yarn lint --format ./node_modules/eslint-junit/index.js @@ -94,7 +94,7 @@ jobs: e2e-vic-gov: # This runs the full suite of e2e tests docker: - - image: cypress/base:10 + - image: cypress/browsers:node12.0.0-chrome73 environment: TERM: xterm TZ: "Australia/Melbourne" @@ -106,9 +106,43 @@ jobs: at: ~/app - restore_cache: keys: - - v2-deps-{{ checksum "yarn.lock" }} - - v2-deps-{{ .Branch }} - - v2-deps + - v3-deps-{{ checksum "yarn.lock" }} + - v3-deps-{{ .Branch }} + - v3-deps + - run: + name: run full e2e test + command: yarn test:e2e-vic + - run: + name: prepare cucumber test report + command: yarn test:report + when: always + - store_artifacts: + path: test-results + - store_test_results: + path: test-results + - store_artifacts: + path: examples/vic-gov-au/test/e2e/videos + - store_artifacts: + path: examples/vic-gov-au/test/e2e/screenshots + + e2e-vic-gov-develop: + # Tests against the actual website using FQDN + docker: + - image: cypress/browsers:node12.0.0-chrome73 + environment: + TERM: xterm + TZ: "Australia/Melbourne" + CYPRESS_BASE_URL: "https://www.develop.www.vic.gov.au" + working_directory: ~/app + parallelism: 1 + steps: + - attach_workspace: + at: ~/app + - restore_cache: + keys: + - v3-deps-{{ checksum "yarn.lock" }} + - v3-deps-{{ .Branch }} + - v3-deps - run: name: run full e2e test command: yarn test:e2e-vic @@ -128,7 +162,7 @@ jobs: e2e-example: # This runs the full suite of e2e tests docker: - - image: cypress/base:10 + - image: cypress/browsers:node12.0.0-chrome73 environment: TERM: xterm working_directory: ~/app @@ -137,9 +171,9 @@ jobs: at: ~/app - restore_cache: keys: - - v2-deps-{{ checksum "yarn.lock" }} - - v2-deps-{{ .Branch }} - - v2-deps + - v3-deps-{{ checksum "yarn.lock" }} + - v3-deps-{{ .Branch }} + - v3-deps - run: name: build example nuxt app command: cd examples/basic-examples && yarn build:default @@ -160,7 +194,7 @@ jobs: e2e-vue-example-app: docker: - - image: cypress/base:10 + - image: cypress/browsers:node12.0.0-chrome73 environment: TERM: xterm working_directory: ~/app @@ -169,9 +203,9 @@ jobs: at: ~/app - restore_cache: keys: - - v2-deps-{{ checksum "yarn.lock" }} - - v2-deps-{{ .Branch }} - - v2-deps + - v3-deps-{{ checksum "yarn.lock" }} + - v3-deps-{{ .Branch }} + - v3-deps - run: name: run smoke test command: cd examples/vue-example-app && yarn test:smoke @@ -199,9 +233,9 @@ jobs: at: ~/app - restore_cache: keys: - - v2-deps-{{ checksum "yarn.lock" }} - - v2-deps-{{ .Branch }} - - v2-deps + - v3-deps-{{ checksum "yarn.lock" }} + - v3-deps-{{ .Branch }} + - v3-deps - run: name: Set NPM_TOKEN command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc @@ -228,6 +262,7 @@ workflows: branches: only: - /^release\/.*/ + - feature/update-e2e-tests - e2e-example: requires: - build @@ -271,7 +306,7 @@ workflows: context: Ripple requires: - build - - e2e-vic-gov: + - e2e-vic-gov-develop: context: Ripple requires: - build diff --git a/.npmrc b/.npmrc index e69de29bb..a21347f1b 100644 --- a/.npmrc +++ b/.npmrc @@ -0,0 +1 @@ +scripts-prepend-node-path=true \ No newline at end of file diff --git a/examples/basic-examples/package.json b/examples/basic-examples/package.json index f248703a7..7dcbda6d5 100644 --- a/examples/basic-examples/package.json +++ b/examples/basic-examples/package.json @@ -42,9 +42,6 @@ "babel-preset-vue": "^2.0.2", "core-js": "^2.6.5", "cross-env": "^5.2.0", - "cypress": "^3.1.5", - "cypress-axe": "^0.4.0", - "cypress-cucumber-preprocessor": "^1.11.0", "eslint": "^4.15.0", "eslint-config-standard": "^10.2.1", "eslint-friendly-formatter": "^3.0.0", diff --git a/examples/basic-examples/test/e2e/integration/custom/error-page.feature b/examples/basic-examples/test/e2e/integration/custom/error-page.feature index 69ed4d0d4..e8277409a 100644 --- a/examples/basic-examples/test/e2e/integration/custom/error-page.feature +++ b/examples/basic-examples/test/e2e/integration/custom/error-page.feature @@ -3,9 +3,9 @@ Feature: Custom error page Custom error page content should work Scenario: Example for adding custom 404 messages - Given I attempt to visit the page "/404" + When I attempt to visit the page "/404" Then the example 404 error content is added Scenario: Example for adding custom 500 messages - Given I attempt to visit the page "/500" + When I attempt to visit the page "/500" Then the example 500 error content is added diff --git a/examples/vic-gov-au/cypress.json b/examples/vic-gov-au/cypress.json index 5c86ac0ef..20bed2ff2 100644 --- a/examples/vic-gov-au/cypress.json +++ b/examples/vic-gov-au/cypress.json @@ -6,7 +6,12 @@ "screenshotsFolder": "test/e2e/screenshots", "supportFile": "test/e2e/support/index.js", "videosFolder": "test/e2e/videos", - "ignoreTestFiles": "*.js", + "ignoreTestFiles": [ + "*.js", + "*.md" + ], + "snapshotFileName": "test/e2e/snapshots.js", + "projectId": "wtymar", "chromeWebSecurity": false, - "projectId": "wtymar" + "$schema": "https://on.cypress.io/cypress.schema.json" } diff --git a/examples/vic-gov-au/package.json b/examples/vic-gov-au/package.json index f905abe6d..0c29eca91 100644 --- a/examples/vic-gov-au/package.json +++ b/examples/vic-gov-au/package.json @@ -9,8 +9,8 @@ "build:default": "if [ \"$NUXT_HOT_RELOADING\" != \"1\" ] ; then nuxt build; fi", "build:win32": "IF \"%NUXT_HOT_RELOADING%\" NEQ \"1\" ( nuxt build )", "cy:open": "cypress open", - "cy:run": "cypress run -e TAGS='not @skip or @smoke'", - "cy:run-record": "cypress run -e TAGS='not @skip or @smoke' --record --parallel --group $CIRCLE_JOB", + "cy:run": "cypress run -b chrome -e TAGS='not @skip or @smoke'", + "cy:run-record": "cypress run -b chrome -e TAGS='not @skip or @smoke' --record --parallel --group $CIRCLE_JOB", "cy:run-smoke": "cypress run -e TAGS='@smoke' --spec 'test/e2e/integration/smoke/*'", "test:dev": "cross-env NODE_ENV=test start-server-and-test dev http://localhost:3000 cy:open", "test:smoke": "cross-env TEST=1 start-server-and-test start http://localhost:3000 cy:run-smoke", @@ -34,9 +34,6 @@ "babel-eslint": "^10.0.1", "babel-plugin-lodash": "^3.3.2", "cross-env": "^5.2.0", - "cypress": "^3.1.5", - "cypress-axe": "^0.4.0", - "cypress-cucumber-preprocessor": "^1.11.0", "eslint": "^4.15.0", "eslint-config-standard": "^10.2.1", "eslint-friendly-formatter": "^3.0.0", @@ -57,6 +54,7 @@ }, "cypress-cucumber-preprocessor": { "nonGlobalStepDefinitions": true, + "step_definitions": "test/e2e/integration/", "cucumberJson": { "generate": true, "outputFolder": "./../../test-results/cucumber", diff --git a/examples/vic-gov-au/test/e2e/fixtures/alert/1-BE-Alert-1.yml b/examples/vic-gov-au/test/e2e/fixtures/alert/1-BE-Alert-1.yml index 8dd986c1c..e50dbd5da 100644 --- a/examples/vic-gov-au/test/e2e/fixtures/alert/1-BE-Alert-1.yml +++ b/examples/vic-gov-au/test/e2e/fixtures/alert/1-BE-Alert-1.yml @@ -1,8 +1,13 @@ - entity: node type: alert title: 1-BE-Alert-1 Demo Alert - uid: 1 status: 1 + path: + - pathauto: 0 + alias: '/1-BE-Alert-1' + uid: 1 + uuid: 0566c8c7-1deb-41a7-a6e3-86ac81341a93 + nid: 81019 moderation_state: - '#process': callback: reference @@ -11,7 +16,7 @@ - workflow: editorial moderation_state: published field_call_to_action: - - uri: https://vic.gov.au + - uri: https://www.google.com title: More details # Alert type. field_alert_type: @@ -23,18 +28,6 @@ name: 'Demo Alert Type' # Sites. field_node_site: - - '#process': - callback: reference - args: - - taxonomy_term - - vid: sites - name: 'Demo Site' - - '#process': - callback: reference - args: - - taxonomy_term - - vid: sites - name: 'Demo Section 1' - '#process': callback: reference args: diff --git a/examples/vic-gov-au/test/e2e/fixtures/alert/1-BE-Alert-2.yml b/examples/vic-gov-au/test/e2e/fixtures/alert/1-BE-Alert-2.yml index baffa9180..52906dc53 100644 --- a/examples/vic-gov-au/test/e2e/fixtures/alert/1-BE-Alert-2.yml +++ b/examples/vic-gov-au/test/e2e/fixtures/alert/1-BE-Alert-2.yml @@ -1,8 +1,13 @@ - entity: node type: alert title: 1-BE-Alert-2 Demo Alert - uid: 1 status: 1 + path: + - pathauto: 0 + alias: '/1-BE-Alert-2' + uid: 1 + uuid: 56f0477e-a819-4b2c-83b3-0afd7057d5fb + nid: 81020 moderation_state: - '#process': callback: reference @@ -11,7 +16,7 @@ - workflow: editorial moderation_state: published field_call_to_action: - - uri: https://vic.gov.au + - uri: https://www.google.com title: More details # Alert type. field_alert_type: diff --git a/examples/vic-gov-au/test/e2e/fixtures/authenticatedContent/1-FE-auth-content-4.yml b/examples/vic-gov-au/test/e2e/fixtures/authenticatedContent/1-FE-auth-content-4.yml index 9168c6d12..219402f19 100644 --- a/examples/vic-gov-au/test/e2e/fixtures/authenticatedContent/1-FE-auth-content-4.yml +++ b/examples/vic-gov-au/test/e2e/fixtures/authenticatedContent/1-FE-auth-content-4.yml @@ -3,6 +3,12 @@ title: 1-FE-auth-content-4 uid: 1 status: 1 + path: + - pathauto: 0 + alias: '/1-FE-auth-content-4' + uid: 1 + uuid: b66ab2d5-256f-44e0-a5af-b7fc4a38ef77 + nid: 90774 moderation_state: - '#process': callback: reference @@ -48,11 +54,11 @@ - entity: paragraph type: hero_banner_with_cta field_paragraph_cta: - - uri: https://www.vic.gov.au + - uri: https://www.google.com title: Phasellus congue field_paragraph_freetext: Nulla ultricies dignissim leo, posuere vestibulum erat cursus vitae field_paragraph_link_text: - - uri: https://vic.gov.au + - uri: https://www.google.com title: Nullam laoreet field_paragraph_background_image: - '#process': @@ -106,7 +112,7 @@ args: - taxonomy_term - vid: authenticated_content - name: 'test' + name: test field_tags: - '#process': callback: reference diff --git a/examples/vic-gov-au/test/e2e/fixtures/authenticatedContent/taxonomy.yml b/examples/vic-gov-au/test/e2e/fixtures/authenticatedContent/taxonomy.yml index 97f3351d9..9d2a9796a 100644 --- a/examples/vic-gov-au/test/e2e/fixtures/authenticatedContent/taxonomy.yml +++ b/examples/vic-gov-au/test/e2e/fixtures/authenticatedContent/taxonomy.yml @@ -1,3 +1,3 @@ - entity: "taxonomy_term" vid: "authenticated_content" - name: "test" + name: "test" \ No newline at end of file diff --git a/examples/vic-gov-au/test/e2e/fixtures/content-preview/1-fe-content-preview-1.yml b/examples/vic-gov-au/test/e2e/fixtures/content-preview/1-fe-content-preview-1.yml new file mode 100644 index 000000000..8fb92c0b3 --- /dev/null +++ b/examples/vic-gov-au/test/e2e/fixtures/content-preview/1-fe-content-preview-1.yml @@ -0,0 +1,128 @@ +- entity: node + type: landing_page + title: 1-FE-content-preview-1 + uid: 11222 + uuid: e9db742d-3a43-40fa-81e2-f81b4f0f7a27 + nid: 80903 + path: + - pathauto: 0 + alias: '/1-FE-content-preview-1' + status: 0 + moderation_state: + - '#process': + callback: reference + args: + - content_moderation_state + - workflow: editorial + moderation_state: draft + # Page header. + field_featured_image: + - '#process': + callback: reference + args: + - media + - bundle: image + name: 'Demo: Melbourne tram' + field_landing_page_hero_image: + - '#process': + callback: reference + args: + - media + - bundle: image + name: 'Demo: Melbourne skyline at dusk' + field_graphical_image: + - '#process': + callback: reference + args: + - media + - bundle: image + name: 'Demo: Parliament of Victoria' + field_landing_page_intro_text: Nulla ultricies dignissim leo, posuere vestibulum erat cursus vitae + field_landing_page_summary: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam tincidunt sit amet ligula sit amet lacinia. In a leo nec tortor aliquet faucibus. + field_landing_page_hero_theme: light + field_landing_page_bg_colour: white + # Hero banner. + field_landing_page_hero_banner: + - entity: paragraph + type: hero_banner_with_cta + field_paragraph_cta: + - uri: https://www.google.com + title: Phasellus congue + field_paragraph_freetext: Nulla ultricies dignissim leo, posuere vestibulum erat cursus vitae + field_paragraph_link_text: + - uri: https://www.google.com + title: Nullam laoreet + field_paragraph_background_image: + - '#process': + callback: reference + args: + - media + - bundle: image + name: 'Demo: Staff at Treasury' + field_paragraph_theme: light + # Content Components. + # field_show_table_of_content: 1 + field_landing_page_component: + # Basic Text. + - entity: paragraph + type: basic_text + field_paragraph_body: + - format: rich_text + value: | +

Nulla ultricies dignissim leo, posuere vestibulum erat cursus vitae

+

Phasellus congue aliquam vehicula

+

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam tincidunt sit amet ligula sit amet lacinia. In a leo nec tortor aliquet faucibus. Quisque nec congue ligula, vitae condimentum tellus. Nulla nec urna augue. Curabitur commodo nisi est, eu pulvinar tortor cursus vel. Morbi dictum ex est, et semper diam finibus eu. Cras rutrum, nunc a fringilla convallis, massa est vulputate velit, in blandit augue dui vitae elit. Donec hendrerit commodo augue, in maximus orci tempor congue. Mauris ultricies euismod orci, nec vehicula quam vehicula ac. Nunc dictum tortor dolor, nec eleifend orci luctus sed.

+

Donec scelerisque cursus ex varius efficitur

+

Morbi cursus placerat mi

+
Nullam laoreet ante placerat
+

Integer interdum nisl ut neque dictum, et sagittis metus feugiat. Sed in mattis neque. Duis at risus non ipsum semper dapibus. Sed enim sapien, molestie sed commodo vel, lacinia vitae risus. Proin sagittis diam nisi, sed rhoncus diam varius id. Sed malesuada felis tortor, scelerisque pretium elit tempor non. Pellentesque ultrices volutpat tincidunt. Fusce quis viverra urna, quis finibus nulla.

+
+

Mauris tincidunt tincidunt felis vel tempus. Vestibulum rhoncus blandit justo quis finibus. Phasellus lacus lectus, sollicitudin sed posuere non, ultricies ut quam.

+ +
+
Mauris tincidunt tincidunt felis vel tempus
+ +

Phasellus in varius leo. Suspendisse potenti. Donec scelerisque cursus ex varius efficitur. Vivamus pretium nisi sed libero accumsan mattis. Duis convallis, velit eget varius tempus, orci erat aliquam sem, eget porta mauris nisl at mauris.

+ + # Topic and Tags. + field_topic: + - '#process': + callback: reference + args: + - taxonomy_term + - vid: topic + name: 'Demo Topic' + # Add authenticated content + field_authenticated_content: + - '#process': + callback: reference + args: + - taxonomy_term + - vid: authenticated_content + name: 'test1' + field_tags: + - '#process': + callback: reference + args: + - taxonomy_term + - vid: tags + name: 'Demo Tag' + field_node_site: + - '#process': + callback: reference + args: + - taxonomy_term + - vid: sites + name: 'vic.gov.au' + field_node_primary_site: + - '#process': + callback: reference + args: + - taxonomy_term + - vid: sites + name: 'vic.gov.au' diff --git a/examples/vic-gov-au/test/e2e/fixtures/grant/1-fe-grant-content-1.yml b/examples/vic-gov-au/test/e2e/fixtures/data-driven-component/1-data-driven-component.yml similarity index 100% rename from examples/vic-gov-au/test/e2e/fixtures/grant/1-fe-grant-content-1.yml rename to examples/vic-gov-au/test/e2e/fixtures/data-driven-component/1-data-driven-component.yml diff --git a/examples/vic-gov-au/test/e2e/fixtures/event/2-BE-event-1.yml b/examples/vic-gov-au/test/e2e/fixtures/event/2-BE-event-1.yml index d4a52f83f..61aa5c81b 100644 --- a/examples/vic-gov-au/test/e2e/fixtures/event/2-BE-event-1.yml +++ b/examples/vic-gov-au/test/e2e/fixtures/event/2-BE-event-1.yml @@ -61,7 +61,7 @@ - uri: http://www.weatherzone.com.au/vic/central/healesville # Event author. field_node_author: Full Name - field_node_email: jeremy.mcmillan@dpc.vic.gov.au + field_node_email: test.user@dpc.vic.gov.au field_node_phone: '12345678' # Related links field_show_related_content: 1 @@ -69,12 +69,12 @@ - entity: paragraph type: related_links field_paragraph_link: - - uri: https://www.vic.gov.au + - uri: https://www.google.com title: State Government of Victoria - entity: paragraph type: related_links field_paragraph_link: - - uri: https://www.vic.gov.au/department-premier-and-cabinet + - uri: https://www.google.com title: Department of Premier and Cabinet # Contact. field_landing_page_show_contact: 1 diff --git a/examples/vic-gov-au/test/e2e/fixtures/grant/tc-9a-grant.yml b/examples/vic-gov-au/test/e2e/fixtures/grant/tc-9a-grant.yml new file mode 100644 index 000000000..4c6fdeb77 --- /dev/null +++ b/examples/vic-gov-au/test/e2e/fixtures/grant/tc-9a-grant.yml @@ -0,0 +1,169 @@ +- entity: node + type: grant + title: TC-9a Grant Simple Test - Date Range + path: + - pathauto: 0 + alias: '/tc-9a-grant' + uid: 1 + uuid: 27430be1-39cd-45e8-9e1e-bca46b1e50f9 + nid: 70919 + status: 1 + moderation_state: + - '#process': + callback: reference + args: + - content_moderation_state + - workflow: editorial + moderation_state: published + # Page header. + field_featured_image: + - '#process': + callback: reference + args: + - media + - bundle: image + name: 'Demo: Melbourne tram' + field_landing_page_intro_text: 'Blah blah' + field_overview_title: 'Overview title' + field_audience: + - '#process': + callback: reference + args: + - taxonomy_term + - vid: audience + name: 'Business' + field_call_to_action: + - uri: https://www.google.com + title: More details + field_node_phone: '12345678' + field_node_department: + - '#process': + callback: reference + args: + - taxonomy_term + - vid: department + name: 'Demo Department' + field_news_intro_text: 'news intro test' + field_description: 'Description' + field_node_author: 'bob' + field_node_email: 'test@testr.com' + field_node_funding_level: + - from: '11326' + to: '26494' + field_node_dates: + - value: '2019-04-08T08:00:00' + end_value: '2019-05-08T10:00:00' + field_node_guidelines: + - entity: paragraph + type: accordion + field_paragraph_title: Guidelines + field_paragraph_accordion_style: basic + field_paragraph_accordion: + - entity: paragraph + type: accordion_content + field_paragraph_accordion_name: 'Eligibility' + field_paragraph_accordion_body: 'Lorem ipsum' + - entity: paragraph + type: accordion_content + field_paragraph_accordion_name: 'Assessment criteria' + field_paragraph_accordion_body: 'Lorem ipsum' + - entity: paragraph + type: accordion_content + field_paragraph_accordion_name: 'Assessment process' + field_paragraph_accordion_body: 'Lorem ipsum' + - entity: paragraph + type: accordion_content + field_paragraph_accordion_name: 'How to apply' + field_paragraph_accordion_body: 'Lorem ipsum' + field_node_on_going: false + field_node_documents: + - '#process': + callback: reference + args: + - media + - bundle: document + name: 'Demo Sample Document' + field_node_timeline: + - entity: paragraph + type: timelines + field_paragraph_title: Demo Timeline + field_timeline: + - entity: paragraph + type: timeline + field_paragraph_title: Demo Timeline Item + field_paragraph_date_range: + - value: '2020-01-01T08:00:00' + end_value: '2020-01-01T10:00:00' + field_paragraph_link: https://www.google.com + field_paragraph_media: + - '#process': + callback: reference + args: + - media + - bundle: image + name: 'Demo: Melbourne tram' + field_paragraph_summary: Mauris tincidunt tincidunt felis vel tempus. Vestibulum rhoncus blandit justo quis finibus. + - entity: paragraph + type: timeline + field_paragraph_title: Demo Timeline Item 2 + field_paragraph_cta_text: Alternative + field_paragraph_link: https://www.google.com + field_paragraph_media: + - '#process': + callback: reference + args: + - media + - bundle: image + name: 'Demo: Melbourne tram' + field_paragraph_summary: Anim excepteur magna eu aliqua quis velit voluptate sit culpa. + # Other. + field_show_social_sharing: 1 + field_show_content_rating: 1 + field_show_table_of_content: 1 + field_topic: + - '#process': + callback: reference + args: + - taxonomy_term + - vid: topic + name: 'Demo Topic' + field_tags: + - '#process': + callback: reference + args: + - taxonomy_term + - vid: tags + name: 'Demo Tag' + - '#process': + callback: reference + args: + - taxonomy_term + - vid: tags + name: 'Another Demo Tag' + # Sites. + field_node_site: + - '#process': + callback: reference + args: + - taxonomy_term + - vid: sites + name: 'Demo Site' + - '#process': + callback: reference + args: + - taxonomy_term + - vid: sites + name: 'Demo Section 1' + - '#process': + callback: reference + args: + - taxonomy_term + - vid: sites + name: 'Another Demo Site' + field_node_primary_site: + - '#process': + callback: reference + args: + - taxonomy_term + - vid: sites + name: 'Demo Site' \ No newline at end of file diff --git a/examples/vic-gov-au/test/e2e/fixtures/grant/tc-9b-grant.yml b/examples/vic-gov-au/test/e2e/fixtures/grant/tc-9b-grant.yml new file mode 100644 index 000000000..fc77948ee --- /dev/null +++ b/examples/vic-gov-au/test/e2e/fixtures/grant/tc-9b-grant.yml @@ -0,0 +1,169 @@ +- entity: node + type: grant + title: TC-9b Grant page - Closed + path: + - pathauto: 0 + alias: '/tc-9b-grant' + uid: 1 + uuid: 11f8f83c-4d9f-41e6-8480-0dd4d9287bd3 + nid: 70921 + status: 1 + moderation_state: + - '#process': + callback: reference + args: + - content_moderation_state + - workflow: editorial + moderation_state: published + # Page header. + field_featured_image: + - '#process': + callback: reference + args: + - media + - bundle: image + name: 'Demo: Melbourne tram' + field_landing_page_intro_text: 'Blah blah' + field_overview_title: 'Overview title' + field_audience: + - '#process': + callback: reference + args: + - taxonomy_term + - vid: audience + name: 'Business' + field_call_to_action: + - uri: https://www.google.com + title: More details + field_node_phone: '12345678' + field_node_department: + - '#process': + callback: reference + args: + - taxonomy_term + - vid: department + name: 'Demo Department' + field_news_intro_text: 'news intro test' + field_description: 'Description' + field_node_author: 'bob' + field_node_email: 'test@testr.com' + field_node_funding_level: + - from: '11326' + to: '26494' + field_node_dates: + - value: '2019-03-09T08:00:00' + end_value: '2019-04-09T10:00:00' + field_node_guidelines: + - entity: paragraph + type: accordion + field_paragraph_title: Guidelines + field_paragraph_accordion_style: basic + field_paragraph_accordion: + - entity: paragraph + type: accordion_content + field_paragraph_accordion_name: 'Eligibility' + field_paragraph_accordion_body: 'Lorem ipsum' + - entity: paragraph + type: accordion_content + field_paragraph_accordion_name: 'Assessment criteria' + field_paragraph_accordion_body: 'Lorem ipsum' + - entity: paragraph + type: accordion_content + field_paragraph_accordion_name: 'Assessment process' + field_paragraph_accordion_body: 'Lorem ipsum' + - entity: paragraph + type: accordion_content + field_paragraph_accordion_name: 'How to apply' + field_paragraph_accordion_body: 'Lorem ipsum' + field_node_on_going: false + field_node_documents: + - '#process': + callback: reference + args: + - media + - bundle: document + name: 'Demo Sample Document' + field_node_timeline: + - entity: paragraph + type: timelines + field_paragraph_title: Demo Timeline + field_timeline: + - entity: paragraph + type: timeline + field_paragraph_title: Demo Timeline Item + field_paragraph_date_range: + - value: '2020-01-01T08:00:00' + end_value: '2020-01-01T10:00:00' + field_paragraph_link: https://www.google.com + field_paragraph_media: + - '#process': + callback: reference + args: + - media + - bundle: image + name: 'Demo: Melbourne tram' + field_paragraph_summary: Mauris tincidunt tincidunt felis vel tempus. Vestibulum rhoncus blandit justo quis finibus. + - entity: paragraph + type: timeline + field_paragraph_title: Demo Timeline Item 2 + field_paragraph_cta_text: Alternative + field_paragraph_link: https://www.google.com + field_paragraph_media: + - '#process': + callback: reference + args: + - media + - bundle: image + name: 'Demo: Melbourne tram' + field_paragraph_summary: Anim excepteur magna eu aliqua quis velit voluptate sit culpa. + # Other. + field_show_social_sharing: 1 + field_show_content_rating: 1 + field_show_table_of_content: 1 + field_topic: + - '#process': + callback: reference + args: + - taxonomy_term + - vid: topic + name: 'Demo Topic' + field_tags: + - '#process': + callback: reference + args: + - taxonomy_term + - vid: tags + name: 'Demo Tag' + - '#process': + callback: reference + args: + - taxonomy_term + - vid: tags + name: 'Another Demo Tag' + # Sites. + field_node_site: + - '#process': + callback: reference + args: + - taxonomy_term + - vid: sites + name: 'Demo Site' + - '#process': + callback: reference + args: + - taxonomy_term + - vid: sites + name: 'Demo Section 1' + - '#process': + callback: reference + args: + - taxonomy_term + - vid: sites + name: 'Another Demo Site' + field_node_primary_site: + - '#process': + callback: reference + args: + - taxonomy_term + - vid: sites + name: 'Demo Site' \ No newline at end of file diff --git a/examples/vic-gov-au/test/e2e/fixtures/landingPage/5-be-land-3-landing-page-complete-test.yml b/examples/vic-gov-au/test/e2e/fixtures/landingPage/5-be-land-3-landing-page-complete-test.yml index ec91b4421..adc3b0ed1 100644 --- a/examples/vic-gov-au/test/e2e/fixtures/landingPage/5-be-land-3-landing-page-complete-test.yml +++ b/examples/vic-gov-au/test/e2e/fixtures/landingPage/5-be-land-3-landing-page-complete-test.yml @@ -40,11 +40,11 @@ - entity: paragraph type: hero_banner_with_cta field_paragraph_cta: - - uri: https://www.vic.gov.au + - uri: https://www.google.com title: Phasellus congue field_paragraph_freetext: Nulla ultricies dignissim leo, posuere vestibulum erat cursus vitae field_paragraph_link_text: - - uri: https://vic.gov.au + - uri: https://www.google.com title: Nullam laoreet field_paragraph_background_image: - '#process': @@ -60,12 +60,12 @@ type: key_journeys field_paragraph_title: 'Want to know more about...' field_paragraph_links: - - uri: 'https://vic.gov.au' + - uri: 'https://www.google.com' title: Nullam laoreet - - uri: 'https://vic.gov.au' + - uri: 'https://www.google.com' title: Morbi cursus placerat mi field_paragraph_cta: - - uri: https://vic.gov.au + - uri: https://www.google.com title: Nullam laoreet # Header components. field_landing_page_header: @@ -74,9 +74,9 @@ field_paragraph_title: Nulla ultricies dignissim leo, posuere vestibulum erat cursus vitae field_paragraph_summary: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam tincidunt sit amet ligula sit amet lacinia. In a leo nec tortor aliquet faucibus. field_paragraph_links: - - uri: 'https://vic.gov.au' + - uri: 'https://www.google.com' title: Nullam laoreet - - uri: 'https://vic.gov.au' + - uri: 'https://www.google.com' title: Morbi cursus placerat mi # Campaigns. field_landing_page_c_primary: @@ -144,7 +144,7 @@ name: 'Demo: Melbourne tram' field_paragraph_body: 'Mauris tincidunt tincidunt felis vel tempus. Vestibulum rhoncus blandit justo quis finibus. Phasellus lacus lectus, sollicitudin sed posuere non, ultricies ut quam.' field_paragraph_cta: - - uri: https://vic.gov.au + - uri: https://www.google.com title: Victorian Government field_paragraph_cta_style: banner # Card carousel. @@ -189,7 +189,7 @@ address_line1: 35 Collins St field_paragraph_summary: Mauris tincidunt tincidunt felis vel tempus. Vestibulum rhoncus blandit justo quis finibus. field_paragraph_cta: - - uri: https://www.vic.gov.au + - uri: https://www.google.com title: Read more - entity: paragraph type: card_event @@ -219,7 +219,7 @@ address_line1: 35 Collins St field_paragraph_summary: Mauris tincidunt tincidunt felis vel tempus. Vestibulum rhoncus blandit justo quis finibus. field_paragraph_cta: - - uri: https://www.vic.gov.au + - uri: https://www.google.com title: Read more # Card Event. - entity: paragraph @@ -262,7 +262,7 @@ name: 'Demo: Melbourne tram' field_paragraph_summary: Mauris tincidunt tincidunt felis vel tempus. Vestibulum rhoncus blandit justo quis finibus. field_paragraph_link: - - uri: https://www.vic.gov.au + - uri: https://www.google.com title: Vestibulum rhoncus field_paragraph_topic: - '#process': @@ -277,7 +277,7 @@ field_paragraph_title: 'Card Promotion' field_paragraph_summary: Mauris tincidunt tincidunt felis vel tempus. Vestibulum rhoncus blandit justo quis finibus. field_paragraph_link: - - uri: https://www.vic.gov.au + - uri: https://www.google.com title: Vestibulum rhoncus # Card navigation featured. - entity: paragraph @@ -285,7 +285,7 @@ field_paragraph_title: 'Card Promotion' field_paragraph_summary: Mauris tincidunt tincidunt felis vel tempus. Vestibulum rhoncus blandit justo quis finibus. field_paragraph_link: - - uri: https://www.vic.gov.au + - uri: https://www.google.com title: Vestibulum rhoncus field_paragraph_media: - '#process': @@ -304,7 +304,7 @@ field_paragraph_title: 'Demo Key Date' field_paragraph_summary: 'First key date summary.' field_paragraph_link: - - uri: https://www.vic.gov.au + - uri: https://www.google.com title: First key date link - entity: paragraph type: keydates @@ -312,10 +312,10 @@ field_paragraph_title: 'Demo Key Date 2' field_paragraph_summary: 'Second key date summary.' field_paragraph_link: - - uri: https://www.vic.gov.au + - uri: https://www.google.com title: Second key date link field_paragraph_cta: - - uri: https://www.vic.gov.au + - uri: https://www.google.com title: Read more # Card promotion auto. - entity: paragraph @@ -408,7 +408,7 @@ - bundle: image name: 'Demo: Melbourne tram' field_paragraph_cta: - - uri: https://www.vic.gov.au + - uri: https://www.google.com title: See more # Timelines - entity: paragraph @@ -421,7 +421,7 @@ field_paragraph_date_range: - value: '2020-01-01T08:00:00' end_value: '2020-01-01T10:00:00' - field_paragraph_link: https://www.vic.gov.au + field_paragraph_link: https://www.google.com field_paragraph_media: - '#process': callback: reference @@ -434,7 +434,7 @@ type: timeline field_paragraph_title: Demo Timeline Item 2 field_paragraph_cta_text: Alternative - field_paragraph_link: https://www.vic.gov.au + field_paragraph_link: https://www.google.com field_paragraph_media: - '#process': callback: reference @@ -449,12 +449,12 @@ - entity: paragraph type: links field_paragraph_link: - - uri: https://www.vic.gov.au + - uri: https://www.google.com title: State Government of Victoria - entity: paragraph type: links field_paragraph_link: - - uri: https://www.vic.gov.au/department-premier-and-cabinet + - uri: https://www.google.com title: Department of Premier and Cabinet # Related links field_show_related_content: 1 @@ -462,12 +462,12 @@ - entity: paragraph type: related_links field_paragraph_link: - - uri: https://www.vic.gov.au + - uri: https://www.google.com title: State Government of Victoria - entity: paragraph type: related_links field_paragraph_link: - - uri: https://www.vic.gov.au/department-premier-and-cabinet + - uri: https://www.google.com title: Department of Premier and Cabinet # Contact. field_landing_page_show_contact: 1 diff --git a/examples/vic-gov-au/test/e2e/fixtures/media/embedded-video-no-transcript.yml b/examples/vic-gov-au/test/e2e/fixtures/media/embedded-video-no-transcript.yml index 47a812656..b047d0d4e 100644 --- a/examples/vic-gov-au/test/e2e/fixtures/media/embedded-video-no-transcript.yml +++ b/examples/vic-gov-au/test/e2e/fixtures/media/embedded-video-no-transcript.yml @@ -2,6 +2,11 @@ bundle: embedded_video name: 'Embedded video test - no transcript' uid: 1 + uuid: 90db91cb-eb81-41ee-b87f-6cee6ef67b86 + mid: 17009 + path: + - pathauto: 0 + alias: '/test-embedded-video-no-transcript' status: 1 field_media_video_embed_field: 'https://www.youtube.com/watch?v=pZRrtGYx7EM' field_media_link: 'View transcript' diff --git a/examples/vic-gov-au/test/e2e/fixtures/media/embedded-video-test.yml b/examples/vic-gov-au/test/e2e/fixtures/media/embedded-video-test.yml index d210e9c39..1f61cafdc 100644 --- a/examples/vic-gov-au/test/e2e/fixtures/media/embedded-video-test.yml +++ b/examples/vic-gov-au/test/e2e/fixtures/media/embedded-video-test.yml @@ -24,9 +24,9 @@ - format: rich_text value: |

Victorian women say thank you

- +

In September 2019, recipients of the 2019 Queen’s Birthday Honours were presented with their Order of Australia medals, by the Governor at official ceremonies at Government House, Melbourne.

- +

In April 2019, recipients of the 2019 Australian Day Honours were presented with their Order of Australia medals, by the Governor at official ceremonies at Government House, Melbourne.

# Other. diff --git a/examples/vic-gov-au/test/e2e/fixtures/media/embedded-video.yml b/examples/vic-gov-au/test/e2e/fixtures/media/embedded-video.yml index 20155a72a..769ef266d 100644 --- a/examples/vic-gov-au/test/e2e/fixtures/media/embedded-video.yml +++ b/examples/vic-gov-au/test/e2e/fixtures/media/embedded-video.yml @@ -3,6 +3,11 @@ name: 'Demo: Wodonga Local Aboriginal Network - Bringing People Together' uid: 1 status: 1 + uuid: fa4aba0b-a58a-40c2-9a8d-2234ed555577 + mid: 17008 + path: + - pathauto: 0 + alias: '/test-embedded-video' field_media_video_embed_field: 'https://www.youtube.com/watch?v=pZRrtGYx7EM' field_media_link: 'View transcript' field_media_transcript: 'this is the transcript' diff --git a/examples/vic-gov-au/test/e2e/fixtures/news/news.yml b/examples/vic-gov-au/test/e2e/fixtures/news/news-1.yml similarity index 86% rename from examples/vic-gov-au/test/e2e/fixtures/news/news.yml rename to examples/vic-gov-au/test/e2e/fixtures/news/news-1.yml index 1a4360b2b..1bb003471 100644 --- a/examples/vic-gov-au/test/e2e/fixtures/news/news.yml +++ b/examples/vic-gov-au/test/e2e/fixtures/news/news-1.yml @@ -1,7 +1,6 @@ - entity: node type: news - uuid: 11dede11-10c0-111e1-1100-000000000320 - title: Demo News + title: Test news page 1 uid: 1 status: 1 moderation_state: @@ -59,12 +58,12 @@ - entity: paragraph type: related_links field_paragraph_link: - - uri: https://www.vic.gov.au + - uri: https://www.google.com title: State Government of Victoria - entity: paragraph type: related_links field_paragraph_link: - - uri: https://www.vic.gov.au/department-premier-and-cabinet + - uri: https://www.google.com title: Department of Premier and Cabinet # Other. field_show_social_sharing: 1 @@ -85,36 +84,18 @@ - taxonomy_term - vid: tags name: 'Demo Tag' - - '#process': - callback: reference - args: - - taxonomy_term - - vid: tags - name: 'Another Demo Tag' - # Sites. + # Sites. field_node_site: - '#process': callback: reference args: - taxonomy_term - vid: sites - name: 'Demo Site' - - '#process': - callback: reference - args: - - taxonomy_term - - vid: sites - name: 'Demo Section 1' - - '#process': - callback: reference - args: - - taxonomy_term - - vid: sites - name: 'Another Demo Site' + name: 'vic.gov.au' field_node_primary_site: - '#process': callback: reference args: - taxonomy_term - vid: sites - name: 'Demo Site' \ No newline at end of file + name: 'vic.gov.au' \ No newline at end of file diff --git a/examples/vic-gov-au/test/e2e/fixtures/news/news-2.yml b/examples/vic-gov-au/test/e2e/fixtures/news/news-2.yml new file mode 100644 index 000000000..67eb4ad3e --- /dev/null +++ b/examples/vic-gov-au/test/e2e/fixtures/news/news-2.yml @@ -0,0 +1,101 @@ +- entity: node + type: news + title: Test news page 2 + uid: 1 + status: 1 + moderation_state: + - '#process': + callback: reference + args: + - content_moderation_state + - workflow: editorial + moderation_state: published + # Page Header. + field_news_date: + - value: '2019-07-01T23:00:00' + field_featured_image: + - '#process': + callback: reference + args: + - media + - bundle: image + name: 'Demo: Melbourne tram' + field_news_intro_text: Nulla ultricies dignissim leo, posuere vestibulum erat cursus vitae + field_node_department: + - '#process': + callback: reference + args: + - taxonomy_term + - vid: department + name: 'Demo Department' + field_location: + - '#process': + callback: reference + args: + - taxonomy_term + - vid: location + name: 'Western metropolitan Melbourne' + # Body content. + body: + - format: rich_text + value: | +

Nulla ultricies dignissim leo, posuere vestibulum erat cursus vitae

+

Phasellus congue aliquam vehicula

+

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam tincidunt sit amet ligula sit amet lacinia. In a leo nec tortor aliquet faucibus. Quisque nec congue ligula, vitae condimentum tellus. Nulla nec urna augue. Curabitur commodo nisi est, eu pulvinar tortor cursus vel. Morbi dictum ex est, et semper diam finibus eu. Cras rutrum, nunc a fringilla convallis, massa est vulputate velit, in blandit augue dui vitae elit. Donec hendrerit commodo augue, in maximus orci tempor congue. Mauris ultricies euismod orci, nec vehicula quam vehicula ac. Nunc dictum tortor dolor, nec eleifend orci luctus sed.

+

Donec scelerisque cursus ex varius efficitur

+

Morbi cursus placerat mi

+
Nullam laoreet ante placerat
+

Integer interdum nisl ut neque dictum, et sagittis metus feugiat. Sed in mattis neque. Duis at risus non ipsum semper dapibus. Sed enim sapien, molestie sed commodo vel, lacinia vitae risus. Proin sagittis diam nisi, sed rhoncus diam varius id. Sed malesuada felis tortor, scelerisque pretium elit tempor non. Pellentesque ultrices volutpat tincidunt. Fusce quis viverra urna, quis finibus nulla.

+
+

Mauris tincidunt tincidunt felis vel tempus. Vestibulum rhoncus blandit justo quis finibus. Phasellus lacus lectus, sollicitudin sed posuere non, ultricies ut quam.

+ +
+
Mauris tincidunt tincidunt felis vel tempus
+ +

Phasellus in varius leo. Suspendisse potenti. Donec scelerisque cursus ex varius efficitur. Vivamus pretium nisi sed libero accumsan mattis. Duis convallis, velit eget varius tempus, orci erat aliquam sem, eget porta mauris nisl at mauris.

+ + # Related links + field_show_related_content: 1 + field_related_links: + - entity: paragraph + type: related_links + field_paragraph_link: + - uri: https://www.google.com + title: State Government of Victoria + - entity: paragraph + type: related_links + field_paragraph_link: + - uri: https://www.google.com + title: Department of Premier and Cabinet + # Other. + field_show_social_sharing: 1 + field_show_content_rating: 1 + field_show_table_of_content: 1 + # Topic and Tags. + field_topic: + - '#process': + callback: reference + args: + - taxonomy_term + - vid: topic + name: 'Demo Topic' + # Sites. + field_node_site: + - '#process': + callback: reference + args: + - taxonomy_term + - vid: sites + name: 'vic.gov.au' + field_node_primary_site: + - '#process': + callback: reference + args: + - taxonomy_term + - vid: sites + name: 'vic.gov.au' \ No newline at end of file diff --git a/examples/vic-gov-au/test/e2e/fixtures/page/8-BE-page-1-basic-page.yml b/examples/vic-gov-au/test/e2e/fixtures/page/8-BE-page-1-basic-page.yml index 98245f565..25a89776f 100644 --- a/examples/vic-gov-au/test/e2e/fixtures/page/8-BE-page-1-basic-page.yml +++ b/examples/vic-gov-au/test/e2e/fixtures/page/8-BE-page-1-basic-page.yml @@ -54,12 +54,12 @@ - entity: paragraph type: links field_paragraph_link: - - uri: https://www.vic.gov.au + - uri: https://www.google.com title: State Government of Victoria - entity: paragraph type: links field_paragraph_link: - - uri: https://www.vic.gov.au/department-premier-and-cabinet + - uri: https://www.google.com title: Department of Premier and Cabinet # Related links field_show_related_content: 1 @@ -67,12 +67,12 @@ - entity: paragraph type: related_links field_paragraph_link: - - uri: https://emergency.vic.gov.au/respond/# + - uri: https://www.google.com title: Related Link external text - entity: paragraph type: related_links field_paragraph_link: - - uri: https://www.vic.gov.au/department-premier-and-cabinet + - uri: https://www.google.com title: Department of Premier and Cabinet # Other. field_show_social_sharing: 1 diff --git a/examples/vic-gov-au/test/e2e/fixtures/users/user-1.yml b/examples/vic-gov-au/test/e2e/fixtures/users/user-1.yml new file mode 100644 index 000000000..1185a829e --- /dev/null +++ b/examples/vic-gov-au/test/e2e/fixtures/users/user-1.yml @@ -0,0 +1,18 @@ +- entity: user + status: 1 + uid: 11221 + name: 'e2e-test-1@example.com' + mail: 'e2e-test-1@example.com' + roles: + - '#process': + callback: 'reference' + args: + - 'user_role' + - id: 'test_role' + field_user_site: + - '#process': + callback: reference + args: + - taxonomy_term + - vid: sites + name: 'vic.gov.au' diff --git a/examples/vic-gov-au/test/e2e/fixtures/users/user-2.yml b/examples/vic-gov-au/test/e2e/fixtures/users/user-2.yml new file mode 100644 index 000000000..91ae45f0d --- /dev/null +++ b/examples/vic-gov-au/test/e2e/fixtures/users/user-2.yml @@ -0,0 +1,19 @@ +- entity: user + status: 1 + uid: 11222 + name: 'e2e-test-2@example.com' + mail: 'e2e-test-2@example.com' + roles: + - '#process': + callback: 'reference' + args: + - 'user_role' + - id: 'editor' + # Sites. + field_user_site: + - '#process': + callback: reference + args: + - taxonomy_term + - vid: sites + name: 'vic.gov.au' diff --git a/examples/vic-gov-au/test/e2e/fixtures/webforms/contact-us-form-failure.json b/examples/vic-gov-au/test/e2e/fixtures/webforms/contact-us-form-failure.json new file mode 100644 index 000000000..077404aaa --- /dev/null +++ b/examples/vic-gov-au/test/e2e/fixtures/webforms/contact-us-form-failure.json @@ -0,0 +1,3 @@ +{ + +} \ No newline at end of file diff --git a/examples/vic-gov-au/test/e2e/fixtures/webforms/contact-us-form-success.json b/examples/vic-gov-au/test/e2e/fixtures/webforms/contact-us-form-success.json new file mode 100644 index 000000000..cba008af4 --- /dev/null +++ b/examples/vic-gov-au/test/e2e/fixtures/webforms/contact-us-form-success.json @@ -0,0 +1,67 @@ +{ + "jsonapi": { + "version": "1.0", + "meta": { + "links": { "self": { "href": "http://jsonapi.org/format/1.0/" } } + } + }, + "data": { + "type": "webform_submission--connect_with_us", + "id": "a8499930-69e4-4058-b202-9e2846c4b4c4", + "attributes": { + "serial": 1853, + "drupal_internal__sid": 12699, + "token": "qiV7LMDxGbY7lzHyWWhXoeKIoKVamzZe5JxRGc0gabY", + "uri": "/api/v1/webform_submission/connect_with_us", + "created": "2020-03-10T01:24:27+00:00", + "completed": "2020-03-10T01:24:27+00:00", + "changed": "2020-03-10T01:24:27+00:00", + "in_draft": false, + "current_page": null, + "remote_addr": "203.219.192.17", + "langcode": "en", + "entity_type": null, + "entity_id": null, + "locked": false, + "sticky": false, + "notes": null, + "metatag": null, + "metatag_normalized": [], + "data": null + }, + "relationships": { + "uid": { + "data": null, + "links": { + "self": { + "href": "https://develop.content.vic.gov.au/api/v1/webform_submission/connect_with_us/a8499930-69e4-4058-b202-9e2846c4b4c4/relationships/uid" + } + } + }, + "webform_id": { + "data": { + "type": "webform--webform", + "id": "fa8cae13-d8b0-4157-b3a6-fe53397e4ef1" + }, + "links": { + "self": { + "href": "https://develop.content.vic.gov.au/api/v1/webform_submission/connect_with_us/a8499930-69e4-4058-b202-9e2846c4b4c4/relationships/webform_id" + }, + "related": { + "href": "https://develop.content.vic.gov.au/api/v1/webform_submission/connect_with_us/a8499930-69e4-4058-b202-9e2846c4b4c4/webform_id" + } + } + } + }, + "links": { + "self": { + "href": "https://develop.content.vic.gov.au/api/v1/webform_submission/connect_with_us/a8499930-69e4-4058-b202-9e2846c4b4c4" + } + } + }, + "links": { + "self": { + "href": "https://develop.content.vic.gov.au/api/v1/webform_submission/connect_with_us" + } + } +} diff --git a/examples/vic-gov-au/test/e2e/fixtures/webforms/content-rating-form-failure.json b/examples/vic-gov-au/test/e2e/fixtures/webforms/content-rating-form-failure.json new file mode 100644 index 000000000..9e26dfeeb --- /dev/null +++ b/examples/vic-gov-au/test/e2e/fixtures/webforms/content-rating-form-failure.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/examples/vic-gov-au/test/e2e/fixtures/webforms/content-rating-form-success.json b/examples/vic-gov-au/test/e2e/fixtures/webforms/content-rating-form-success.json new file mode 100644 index 000000000..be32fb51d --- /dev/null +++ b/examples/vic-gov-au/test/e2e/fixtures/webforms/content-rating-form-success.json @@ -0,0 +1,67 @@ +{ + "jsonapi": { + "version": "1.0", + "meta": { + "links": { "self": { "href": "http://jsonapi.org/format/1.0/" } } + } + }, + "data": { + "type": "webform_submission--tide_webform_content_rating", + "id": "4ea029d1-d8a7-40ac-b178-4b266e327c08", + "attributes": { + "serial": 6695, + "drupal_internal__sid": 12690, + "token": "EXdZni3tkM236vdxa5MDRymMvKpziusPr2oSAXn-C34", + "uri": "/api/v1/webform_submission/tide_webform_content_rating", + "created": "2020-03-09T23:31:33+00:00", + "completed": "2020-03-09T23:31:33+00:00", + "changed": "2020-03-09T23:31:33+00:00", + "in_draft": false, + "current_page": null, + "remote_addr": "203.219.192.17", + "langcode": "en", + "entity_type": null, + "entity_id": null, + "locked": false, + "sticky": false, + "notes": null, + "metatag": null, + "metatag_normalized": [], + "data": null + }, + "relationships": { + "uid": { + "data": null, + "links": { + "self": { + "href": "https://develop.content.vic.gov.au/api/v1/webform_submission/tide_webform_content_rating/4ea029d1-d8a7-40ac-b178-4b266e327c08/relationships/uid" + } + } + }, + "webform_id": { + "data": { + "type": "webform--webform", + "id": "d39d6519-6c87-4725-8ac3-65125391bd8a" + }, + "links": { + "self": { + "href": "https://develop.content.vic.gov.au/api/v1/webform_submission/tide_webform_content_rating/4ea029d1-d8a7-40ac-b178-4b266e327c08/relationships/webform_id" + }, + "related": { + "href": "https://develop.content.vic.gov.au/api/v1/webform_submission/tide_webform_content_rating/4ea029d1-d8a7-40ac-b178-4b266e327c08/webform_id" + } + } + } + }, + "links": { + "self": { + "href": "https://develop.content.vic.gov.au/api/v1/webform_submission/tide_webform_content_rating/4ea029d1-d8a7-40ac-b178-4b266e327c08" + } + } + }, + "links": { + "self": { + "href": "https://develop.content.vic.gov.au/api/v1/webform_submission/tide_webform_content_rating" + } + } +} diff --git a/examples/vic-gov-au/test/e2e/fixtures/alert/1-BE-Alert-3.yml b/examples/vic-gov-au/test/e2e/fixtures/webforms/test-form-page.yml similarity index 51% rename from examples/vic-gov-au/test/e2e/fixtures/alert/1-BE-Alert-3.yml rename to examples/vic-gov-au/test/e2e/fixtures/webforms/test-form-page.yml index 0f75307d0..58d04cc42 100644 --- a/examples/vic-gov-au/test/e2e/fixtures/alert/1-BE-Alert-3.yml +++ b/examples/vic-gov-au/test/e2e/fixtures/webforms/test-form-page.yml @@ -1,7 +1,6 @@ - entity: node - type: alert - title: 1-BE-Alert-3 Demo Alert - uid: 1 + type: landing_page + title: Test form status: 1 moderation_state: - '#process': @@ -10,17 +9,23 @@ - content_moderation_state - workflow: editorial moderation_state: published - field_call_to_action: - - uri: https://vic.gov.au - title: More details - # Alert type. - field_alert_type: + + # Content Components. + field_landing_page_component: + - entity: paragraph + type: embedded_webform + field_paragraph_title: test form + field_paragraph_webform: + - target_id: test_form_1 + + # Topic and Tags. + field_topic: - '#process': callback: reference args: - taxonomy_term - - vid: alert_type - name: 'Flood' + - vid: topic + name: 'Equality' # Sites. field_node_site: - '#process': @@ -28,11 +33,18 @@ args: - taxonomy_term - vid: sites - name: 'Demo Section 1' + name: 'vic.gov.au' + - '#process': + callback: reference + args: + - taxonomy_term + - vid: sites + name: 'demo.vic.gov.au' field_node_primary_site: - '#process': callback: reference args: - taxonomy_term - vid: sites - name: 'vic.gov.au' \ No newline at end of file + name: 'vic.gov.au' + diff --git a/examples/vic-gov-au/test/e2e/fixtures/webforms/test_form.yml b/examples/vic-gov-au/test/e2e/fixtures/webforms/test_form.yml new file mode 100644 index 000000000..7a75d21cc --- /dev/null +++ b/examples/vic-gov-au/test/e2e/fixtures/webforms/test_form.yml @@ -0,0 +1,254 @@ +- entity: webform + langcode: en + status: open + dependencies: { } + open: null + close: null + weight: 0 + uid: 7155 + template: false + archive: false + id: test_form_1 + title: 'test form ' + description: 'TEST form for automated end to end testing' + category: '' + elements: | + text_field: + '#type': textfield + '#title': 'Text field' + textarea: + '#type': textarea + '#title': Textarea + email: + '#type': email + '#title': Email + '#required': true + '#required_error': 'Email address is a required field' + telephone: + '#type': tel + '#title': Telephone + '#required': true + number: + '#type': number + '#title': Number + '#required': true + '#required_error': 'Number is a required field' + '#min': '1' + '#max': '30' + '#step': '1' + address: + '#type': webform_address + '#title': Address + markup: + '#type': processed_text + '#text': | +

This is markup

+ +

https://www.google.com.au

+ + + + '#format': rich_text + select: + '#type': select + '#title': Select + '#options': + 'Option 1': 'Option 1' + 'Option 2': 'Option 2' + 'Option 3': 'Option 3' + date: + '#type': date + '#title': Date + '#datepicker': true + checkboxes: + '#type': checkbox + '#title': Checkboxes + '#options': + 'Option 1': 'Option 1' + 'Option 2': 'Option 2' + 'Option 3': 'Option 3' + radios: + '#type': radios + '#title': Radios + '#options': + 'Option 1': 'Option 1' + 'Option 2': 'Option 2' + 'Option 3': 'Option 3' + privacy_statement: + '#type': webform_privacy_statement + '#required': true + '#privacy_statement_heading': '' + '#privacy_statement_content': | +

The Department of Premier and Cabinet (the Department) collects the information that you provide with this complaint form. The information that you provide is used to respond to your enquiry. You can request access to, and corrections of, any personal information provided in this form. Requests for access or correction should be sent to contact@dpc.vic.gov.au.

+

The Department is using the services of Drupal 8 to administer this form. The information that you provide is stored in our Drupal 8 content management system and Amazon Web Services servers.

+

For more information on the Department’s handling of any personal information, please refer to the Department’s Privacy Statement.

+

If you do not provide all or part of the information requested, the Department may not be able to contact you regarding your enquiry. Please contact the Department of Premier and Cabinet if you wish to use an alternative mechanism to the online form.

+ + '#title': 'I have read and understand how Department of Premier and Cabinet stores information.' + actions: + '#type': webform_actions + '#title': Submit + '#submit__label': Submit + css: '' + javascript: '' + settings: + ajax: false + ajax_scroll_top: form + ajax_progress_type: '' + ajax_effect: '' + ajax_speed: null + page: true + page_submit_path: '' + page_confirm_path: '' + page_admin_theme: false + form_title: both + form_submit_once: false + form_exception_message: '' + form_open_message: '' + form_close_message: '' + form_previous_submissions: true + form_confidential: false + form_confidential_message: '' + form_remote_addr: true + form_convert_anonymous: false + form_prepopulate: false + form_prepopulate_source_entity: false + form_prepopulate_source_entity_required: false + form_prepopulate_source_entity_type: '' + form_reset: false + form_disable_autocomplete: false + form_novalidate: false + form_disable_inline_errors: false + form_required: false + form_unsaved: false + form_disable_back: false + form_submit_back: false + form_autofocus: false + form_details_toggle: false + form_access_denied: default + form_access_denied_title: '' + form_access_denied_message: '' + form_access_denied_attributes: { } + form_file_limit: '' + submission_label: '' + submission_log: false + submission_views: { } + submission_views_replace: { } + submission_user_columns: { } + submission_user_duplicate: false + submission_access_denied: default + submission_access_denied_title: '' + submission_access_denied_message: '' + submission_access_denied_attributes: { } + submission_exception_message: '' + submission_locked_message: '' + submission_excluded_elements: { } + submission_exclude_empty: false + submission_exclude_empty_checkbox: false + previous_submission_message: '' + previous_submissions_message: '' + autofill: false + autofill_message: '' + autofill_excluded_elements: { } + wizard_progress_bar: true + wizard_progress_pages: false + wizard_progress_percentage: false + wizard_progress_link: false + wizard_start_label: '' + wizard_preview_link: false + wizard_confirmation: true + wizard_confirmation_label: '' + wizard_track: '' + preview: 0 + preview_label: '' + preview_title: '' + preview_message: '' + preview_attributes: { } + preview_excluded_elements: { } + preview_exclude_empty: true + preview_exclude_empty_checkbox: false + draft: none + draft_multiple: false + draft_auto_save: false + draft_saved_message: '' + draft_loaded_message: '' + draft_pending_single_message: '' + draft_pending_multiple_message: '' + confirmation_type: page + confirmation_title: '' + confirmation_message: '' + confirmation_url: '' + confirmation_attributes: { } + confirmation_back: true + confirmation_back_label: '' + confirmation_back_attributes: { } + confirmation_exclude_query: false + confirmation_exclude_token: false + confirmation_update: false + limit_total: null + limit_total_interval: null + limit_total_message: '' + limit_total_unique: false + limit_user: null + limit_user_interval: null + limit_user_message: '' + limit_user_unique: false + entity_limit_total: null + entity_limit_total_interval: null + entity_limit_user: null + entity_limit_user_interval: null + purge: none + purge_days: null + results_disabled: false + results_disabled_ignore: false + token_update: false + access: + create: + roles: + - anonymous + - authenticated + users: { } + permissions: { } + view_any: + roles: { } + users: { } + permissions: { } + update_any: + roles: { } + users: { } + permissions: { } + delete_any: + roles: { } + users: { } + permissions: { } + purge_any: + roles: { } + users: { } + permissions: { } + view_own: + roles: { } + users: { } + permissions: { } + update_own: + roles: { } + users: { } + permissions: { } + delete_own: + roles: { } + users: { } + permissions: { } + administer: + roles: { } + users: { } + permissions: { } + test: + roles: { } + users: { } + permissions: { } + configuration: + roles: + - anonymous + - authenticated + users: { } + permissions: { } + handlers: { } \ No newline at end of file diff --git a/examples/vic-gov-au/test/e2e/integration/common/index.js b/examples/vic-gov-au/test/e2e/integration/common/index.js index f27a75182..b75ee5fb4 100644 --- a/examples/vic-gov-au/test/e2e/integration/common/index.js +++ b/examples/vic-gov-au/test/e2e/integration/common/index.js @@ -1,2 +1,2 @@ // Import shared step_definitions from ripple-test-tools package -require('@dpc-sdp/ripple-test-tools/step_definitions/common') +require('@dpc-sdp/ripple-test-tools/step_definitions') diff --git a/examples/vic-gov-au/test/e2e/integration/core-modules/alert/alert.feature b/examples/vic-gov-au/test/e2e/integration/core-modules/alert/alert.feature index c40f2a316..226616736 100644 --- a/examples/vic-gov-au/test/e2e/integration/core-modules/alert/alert.feature +++ b/examples/vic-gov-au/test/e2e/integration/core-modules/alert/alert.feature @@ -1,13 +1,29 @@ Feature: Global Notifications (Alert) As a citizen I need to be alerted to important site wide notifications. - - Background: Cleanup alerts - # Given there are no alerts in the system - Scenario: 1-FE-Alert-1 Displays global alert - Given I have created a node with the YAML fixture "alert/1-BE-Alert-1" + Scenario: BE - Add alerts + Given I have logged into the backend + And in the backend there are no "alert" nodes + And in the backend there is a node at "/1-BE-Alert-1" with "alert/1-BE-Alert-1" data + And in the backend there is a node at "/1-BE-Alert-2" with "alert/1-BE-Alert-2" data + + Scenario: Warm the cache + When I visit the page "/" + + Scenario: FE - 1-FE-Alert-1 Displays global alert When I visit the page "/" Then there should be the following global notifications: - | title | type | link | linkText | - | 1-BE-Alert-1 Demo Alert | Demo Alert Type | https://vic.gov.au | More details | + | title | type | link | linkText | + | 1-BE-Alert-1 Demo Alert | Demo Alert Type | https://www.google.com | More details | + + Scenario: FE- 1-FE-Alert-2 Displays alert for site section + When I visit the page "/housing-and-property" + Then there should be the following global notifications: + | title | type | link | linkText | + | 1-BE-Alert-1 Demo Alert | Demo Alert Type | https://www.google.com | More details | + | 1-BE-Alert-2 Demo Alert | Heat wave | https://www.google.com | More details | + When I visit the page "/housing-and-property" + Then there should be the following global notifications: + | title | type | link | linkText | + | 1-BE-Alert-1 Demo Alert | Demo Alert Type | https://www.google.com | More details | \ No newline at end of file diff --git a/examples/vic-gov-au/test/e2e/integration/core-modules/authenticatedContent/authenticated-content.feature b/examples/vic-gov-au/test/e2e/integration/core-modules/authenticatedContent/authenticated-content.feature index d83a89a4e..6abf46f59 100644 --- a/examples/vic-gov-au/test/e2e/integration/core-modules/authenticatedContent/authenticated-content.feature +++ b/examples/vic-gov-au/test/e2e/integration/core-modules/authenticatedContent/authenticated-content.feature @@ -2,13 +2,14 @@ Feature: Protected content As authorized I want to be able to login to the site so I can view pages which are not for the general public - @skip - # Scenario: Setup role - # Given the role "testrole" exists in the backend - # And the authenticated content module is configured with: - # | role | term | - # | testrole | testterm | - + Scenario: BE - Setup environment + Given I have logged into the backend + And in the backend there is a role "test-role" + And in the backend there is a user "users/user-1" + And in the backend there is a node at "/authenticatedcontent/test-auth-term" with "authenticatedContent/taxonomy" data + # And the authenticated content term "test" has the role "test_role" + And in the backend there is a node at "/1-fe-auth-content-4" with "authenticatedContent/1-FE-auth-content-4" data + Scenario: 1-FE-auth-content-1 - Login form renders correctly Given I visit the page "/login" Then there should be a login form with the title "Login" @@ -18,18 +19,6 @@ Feature: Protected content And there should be a login form button with the text "Register" And there should be a login form button with the text "Forgot password" - Scenario: 1-FE-auth-content-2 - Login success - Given there is a user in the system with the following credentials: - | login | password | active | email | - | testuser1 | Password-111 | true | testuser1@mailinator.com | - And I visit the page "/login" - When I enter the the following login credentials: - | login | password | - | testuser1 | Password-111 | - And I submit the login form - Then the login status colour should should be "green" - And the login status message should be "Login Successful." - Scenario: 1-FE-auth-content-3 - Login failure Given I visit the page "/login" When I enter the the following login credentials: @@ -39,47 +28,27 @@ Feature: Protected content Then the login status colour should should be "red" And the login status message should be "Login Failed. Please try again" - @skip Scenario: 1-FE-auth-content-4 - Should not be able to access a protected content page when unauthenticated - Given the "/1-fe-auth-content-4" page exists with fixture "authenticatedContent/1-FE-auth-content-4" data When I attempt to visit the page "/1-fe-auth-content-4" Then I should see a 404 page - @skip - Scenario: Accessing a protected content page when authenticated - Given the "/1-fe-auth-content-4" page exists with fixture "authenticatedContent/1-FE-auth-content-4" data - And there is a user in the system with the following credentials: - | login | password | active | email | role | - | testuser2 | Password-222 | true | testuser2@mailinator.com | testrole | + Scenario: 1-FE-auth-content-2 - Login success And I visit the page "/login" When I enter the the following login credentials: - | login | password | - | testuser2 | Password-222 | + | login | password | + | e2e-test-1@example.com | ******** | And I submit the login form - Then I should be redirected to the page "/" - Given I visit the page "/1-fe-auth-content-4" - Then the page title should be "1-FE-auth-content-4" - And the h1 should be "1-FE-auth-content-4" + Then the login status colour should should be "green" + And the login status message should be "Login Successful." - @skip - Scenario: Can still navigate after session is expired - Given the "/1-fe-auth-content-4" page exists with fixture "authenticatedContent/1-FE-auth-content-4" data - And there is a user in the system with the following credentials: - | login | password | active | email | role | - | testuser3 | Password-333 | true | testuser3@mailinator.com | testrole | - And I visit the page "/login" + Scenario: Accessing a protected content page when authenticated + When I visit the page "/login" When I enter the the following login credentials: - | login | password | - | testuser3 | Password-333 | + | login | password | + | administrator1.test@example.com | ******** | And I submit the login form - Then I should be redirected to the page "/" - When I visit the page "/1-fe-auth-content-4" + Then the current page url should be "/" + When I wait for 3 seconds + Given I visit the page "/1-fe-auth-content-4" Then the page title should be "1-FE-auth-content-4" And the h1 should be "1-FE-auth-content-4" - When I wait for 60 seconds - And I attempt to visit the page "/1-fe-auth-content-4" - Then I should see a 404 page - When I visit the page "/" - Then the menu should have 2 top level items - And the logout button should not be visible - diff --git a/examples/vic-gov-au/test/e2e/integration/core-modules/authenticatedContent/authenticated-content/hooks.js b/examples/vic-gov-au/test/e2e/integration/core-modules/authenticatedContent/authenticated-content/hooks.js deleted file mode 100644 index 3d67d77ac..000000000 --- a/examples/vic-gov-au/test/e2e/integration/core-modules/authenticatedContent/authenticated-content/hooks.js +++ /dev/null @@ -1,20 +0,0 @@ -/* global before, after, cy */ - -before(function () { - cy.task('configureProtectedContent', { - sessionExpiry: '1' - }) -}) - -afterEach(function () { - if (this.userId) { - cy.task('deleteUser', this.userId) - this.userId = null - } -}) - -after(function () { - cy.task('configureProtectedContent', { - sessionExpiry: '10' - }) -}) diff --git a/examples/vic-gov-au/test/e2e/integration/core-modules/dataDrivenComponent/data-driven-component.feature b/examples/vic-gov-au/test/e2e/integration/core-modules/dataDrivenComponent/data-driven-component.feature index 47fad1136..c05d2c2e9 100644 --- a/examples/vic-gov-au/test/e2e/integration/core-modules/dataDrivenComponent/data-driven-component.feature +++ b/examples/vic-gov-au/test/e2e/integration/core-modules/dataDrivenComponent/data-driven-component.feature @@ -1,6 +1,9 @@ Feature: Data driven component - This test is not ready yet + As a citizen I need to be able to view maps on the site - @skip - Scenario: Test \ No newline at end of file + # Not ready yet - ddc doesnt seem to be working + @skip + Scenario: BE - Create landingpage with data driven component + Given I have logged into the backend + And in the backend there is a node at "/2-data-driven-component" with "data-driven-component/1-data-driven-component" data diff --git a/examples/vic-gov-au/test/e2e/integration/core-modules/event/event.feature b/examples/vic-gov-au/test/e2e/integration/core-modules/event/event.feature index 824ac8b29..19fc4e706 100644 --- a/examples/vic-gov-au/test/e2e/integration/core-modules/event/event.feature +++ b/examples/vic-gov-au/test/e2e/integration/core-modules/event/event.feature @@ -1,9 +1,11 @@ Feature: Event page As a citizen I can view information for all available content on an event page - Prerequisite: Events Simple Test 1-BE-event-1 + + Scenario: BE - add event + Given I have logged into the backend + And in the backend there is a node at "/2-be-event-1" with "event/2-BE-event-1" data Scenario: Event Page loads correctly - Given the "/2-be-event-1" page exists with fixture "event/2-BE-event-1" data When I visit the page "/2-be-event-1" Then the page title should be "2-BE-event-1" And the event page Description should be "So now all who escaped death in battle or by shipwreck had got safely home except Ulysses, and he, though he was longing to return to his wife and country, was detained by the goddess Calypso, who had got him into a large cave and wanted to marry him. But as years went by, there came a time when the gods settled that he should go back to Ithaca; even then, however, when he was among his own people, his troubles were not yet over; nevertheless all the gods had now begun to pity him except Neptune, who still persecuted him without ceasing and would not let him get home." @@ -19,9 +21,9 @@ Feature: Event page And the related links component should exist And the related links title should be "Related links" And the related links should contain the following links: - | title | url | - | State Government of Victoria | https://www.vic.gov.au | - | Department of Premier and Cabinet | https://www.vic.gov.au/department-premier-and-cabinet | + | title | url | + | State Government of Victoria | https://www.google.com | + | Department of Premier and Cabinet | https://www.google.com | # Social Sharing And the share this component should exist diff --git a/examples/vic-gov-au/test/e2e/integration/core-modules/grant/grant.feature b/examples/vic-gov-au/test/e2e/integration/core-modules/grant/grant.feature index 005a52d9c..2ac7d4b8d 100644 --- a/examples/vic-gov-au/test/e2e/integration/core-modules/grant/grant.feature +++ b/examples/vic-gov-au/test/e2e/integration/core-modules/grant/grant.feature @@ -2,61 +2,40 @@ Feature: Grant page As a citizen I can view information about a specific grant, including grant amount, audience, etc. https://digital-engagement.atlassian.net/browse/SDPA-175 + + Background: Reset date to today before each test + Given the current date is today - # TODO: Create grant YAML content + Scenario: BE - Create TC-9a Grant + Given I have logged into the backend + And in the backend there is a node at "/tc-9a-grant" with "grant/TC-9a-grant" data + And in the backend there is a node at "/tc-9b-grant" with "grant/TC-9b-grant" data - @skip - Scenario: TC-9a Grant - Simple Test - Date Range - Given the "/1-fe-grant-content-1" page exists with fixture "grant/1-fe-grant-content-1" data - Then the page title should be "TC- 9a Grant- Simple Test - Date Range" - And the grant overview title should match test data + Scenario: FE - TC-9a Grant - Simple Test - Date Range + Given that the current date is "April 10, 2019 00:00:00" + And I visit the page "/tc-9a-grant" + Then the page title should be "TC-9a Grant Simple Test - Date Range" And the grant overview price should be "$11,326 - $26,494" - And the grant overview audience should be "Individuals" - And the grant overview open status is "Ongoing" - And the grant overview description should match test data + And the grant overview audience should be "Businesses" + And the grant overview open status is "Open, closing in 28 days" And the timeline component should exist - And the timeline section title should match test data - And the timeline item title should match test data - And the timeline item date should be "08 April to 08 May 0019" + And the timeline title should be "Demo Timeline" + And there should be the following timeline items: + | title | link | image | subtitle | description | + | Demo Timeline Item | https://www.google.com | Melbourne-tram.jpg | 01 January | Mauris tincidunt tincidunt felis vel tempus. Vestibulum rhoncus blandit justo quis finibus. | And the grant guideline section title should be "Guidelines" And the grant guideline should have the following accordions | "Eligibility" | | "Assessment criteria" | | "Assessment process" | | "How to apply" | - - @skip - Scenario: TC-9b Grant page - Closed - Given I have created a grant page with the fixture "Pages/Grant/tc9b" - And that the current date is "April 10, 2019 03:24:00" - Then the page title should be "TC- 9b Grant- Simple Test - Closed" - And the grant overview title should match test data - And the grant overview price should be "$12,345 - $23,456" - And the grant overview audience should be "Individuals" - And the grant overview open status is "Closed" - And the grant overview description should match test data - And the timeline component should exist - And the timeline section title should match test data - And the timeline item title should match test data - And the timeline item date should be "07 to 08 April" - And the grant guideline section title should be "Guidelines" - @skip - Scenario: TC-10a Grant page - Complete - Given I have created a grant page with the fixture "Pages/Grant/tc10a" - And that the current date is "April 10, 2019 03:24:00" - Then the page title should be "TC-10a Grant page - Complete" - And the grant overview title should match test data - And the grant overview price should be "$12,345 - $23,456" - And the grant overview audience should be "Individuals, government" + And the page should have the following documents: + | title | size | type | + | Demo Sample Document | 7.53 KB | docx | + And the content rating component should exist + + Scenario: FE - TC-9b Grant page - Closed + Given that the current date is "April 10, 2019 00:00:00" + And I visit the page "/tc-9b-grant" + Then the page title should be "TC-9b Grant page - Closed" And the grant overview open status is "Closed" - And the grant overview description should match test data - And the timeline component should exist - And the timeline section title should match test data - And the timeline item title should match test data - And the timeline item date should be "08 April to 08 May 2019" - And the grant guideline section title should be "Guidelines" - And the grant guideline should have the following accordions - | "test1" | - | "test2" | - | "test3" | - | "test4" | \ No newline at end of file diff --git a/examples/vic-gov-au/test/e2e/integration/core-modules/grant/submit-a-grant/step_definition.js b/examples/vic-gov-au/test/e2e/integration/core-modules/grant/submit-a-grant/step_definition.js deleted file mode 100644 index 494c90694..000000000 --- a/examples/vic-gov-au/test/e2e/integration/core-modules/grant/submit-a-grant/step_definition.js +++ /dev/null @@ -1,83 +0,0 @@ -/* global cy */ - -import { Given, Then, When } from 'cypress-cucumber-preprocessor/steps' - -Then(`the form title should be {string}`, (title) => { - cy.get('.rpl-form__title').should('contain', title) -}) - -Given(`I have entered the form correctly`, () => { - cy.csvFixture('Forms/Grant/tc9c').as('sampleFormSubmission') - cy.get('@sampleFormSubmission').then(sampleFormSubmission => { - cy.log(sampleFormSubmission) - cy.get(':nth-child(5) > .rpl-fieldset__inner > .form-group > .field-wrap > .rpl-checkbox > .rpl-checkbox__box').click() - cy.get('#name-of-grant-or-program').type(sampleFormSubmission.name) - cy.get('#describe-the-grant-or-program').type(sampleFormSubmission.description) - cy.get('[for="open-date"] + div input').type(sampleFormSubmission.openDate) - cy.get('#describe-the-grant-or-program').click() - cy.get('[for="close-date"] + div input').type(sampleFormSubmission.closeDate) - cy.get('#describe-the-grant-or-program').click() - - cy.get('[for="topic"] + div .rpl-select__trigger').click() - cy.get('[for="topic"] + div .rpl-select__listbox').type('{downarrow}') - cy.get('[for="topic"] + div .rpl-select__trigger').click() - - cy.get('[for="who-is-the-grant-or-program-for"] + div .rpl-select__trigger').click() - cy.get('[for="who-is-the-grant-or-program-for"] + div .rpl-select__listbox').type('{downarrow}') - cy.get('[for="who-is-the-grant-or-program-for"] + div .rpl-select__trigger').click() - - cy.get('#funding-amount-from').type(sampleFormSubmission.amountFrom) - cy.get('#funding-amount-to').type(sampleFormSubmission.amountTo) - - cy.get('#website-url-to-apply-for-grant-or-program').type(sampleFormSubmission.applyUrl) - // cy.get('[id^="this-grant-program-is-ongoing-and-does-have-an-open-close-dates-"]').check({force: true}) - cy.get('#website-url-for-grant-or-program-information').type(sampleFormSubmission.infoUrl) - cy.get('#contact-person').type(sampleFormSubmission.contactName) - cy.get('[for="department-agency-or-provider-organisation"] + div .rpl-select__trigger').click() - cy.get('[for="department-agency-or-provider-organisation"] + div .rpl-select__listbox').type('{downarrow}') - cy.get('[for="department-agency-or-provider-organisation"] + div .rpl-select__trigger').click() - - cy.get('#contact-email-address').type(sampleFormSubmission.contactEmail) - cy.get('#contact-telephone-number').type(sampleFormSubmission.contactPhone) - - if (sampleFormSubmission.acknowledge === 'TRUE') { - cy.get('[id^="agree-privacy-statement-"]').check({ force: true }) - } - }) -}) - -When('I submit the form', () => { - cy.fixture('/Forms/Grant/tc9c_submission.json').as('formSubmissionResponse') - cy.server() // enable response stubbing - cy.route('POST', '/api/v1/webform_submission/tide_grant_submission', '@formSubmissionResponse').as('formSubmissionRequest') - cy.get('form.rpl-form').first().submit() - cy.get('@formSubmissionRequest').then(submissionData => { - cy.log(submissionData) - }) -}) - -Then('I should see the form success message', () => { - cy.get('.rpl-form-alert', { timeout: 10000 }).should('have.class', 'rpl-form-alert--success') -}) -Then('I should see the failure message', () => { - cy.get('.rpl-form-alert', { timeout: 10000 }).should('have.class', 'rpl-form-alert--error') -}) - -Then('I should see {int} validation errors', (errors) => { - cy.get('.form-group.error').should('have.length', errors) -}) - -Given(`I have navigated to the created test page`, function () { - cy.visit(`/node/${this.nodeId}`, { failOnStatusCode: false }) -}) - -Given(`I dont fill out any fields`, () => { - // doesn't do nothing to nobody -}) - -Then(`the form submission should be saved`, () => { - cy.wait('@formSubmissionRequest') - cy.get('@formSubmissionRequest').then(submissionData => { - cy.wrap(submissionData.request.body.data.attributes.data).should('equal', `{"name_of_grant_or_program":"Extra special grant","describe_the_grant_or_program":"this is the description","open_date":null,"close_date":null,"this_grant_program_is_ongoing_and_does_have_an_open_close_dates_":true,"topic":"2","who_is_the_grant_or_program_for_":["82"],"funding_level_from":123123,"funding_level_to":234234,"website_url_to_apply_for_grant_or_program":"http://www.google.com","website_url_for_grant_or_program_information":"http://www.google.com","horizontal_rule_1":null,"required_contact_details":null,"contact_person":"Stan Grant","department_agency_or_provider_organisation":"99","contact_email_address":"stan@mailinator.com","contact_telephone_number":"03 91222222","horizontal_rule_2":null,"privacy_statement_disclaimer":null,"agree_privacy_statement":true,"actions":null}`) - }) -}) diff --git a/examples/vic-gov-au/test/e2e/integration/core-modules/gtm/googletagmanager.feature b/examples/vic-gov-au/test/e2e/integration/core-modules/gtm/googletagmanager.feature index fd03852a0..c5e3dbaf2 100644 --- a/examples/vic-gov-au/test/e2e/integration/core-modules/gtm/googletagmanager.feature +++ b/examples/vic-gov-au/test/e2e/integration/core-modules/gtm/googletagmanager.feature @@ -1,6 +1,12 @@ -Feature: Quick exit +Feature: GTM - This test is not ready yet + As a site admin I need to ensure that Google Tag Manager is installed on the site and Google Anlytics is capturing page views - @skip - Scenario: Test \ No newline at end of file + Scenario: GTM is installed on page + Given I visit the page "/" + Then the GTM script should be installed with id "GTM-T5283GW" + + # @stubga + # Scenario: Google analytics page view fires + # Given I click the link "Contact us" + # Then the google analytics tracking request should be made \ No newline at end of file diff --git a/examples/vic-gov-au/test/e2e/integration/core-modules/landingPage/AnchorLink.feature b/examples/vic-gov-au/test/e2e/integration/core-modules/landingPage/AnchorLink.feature index 0867f99f2..b29f689d6 100644 --- a/examples/vic-gov-au/test/e2e/integration/core-modules/landingPage/AnchorLink.feature +++ b/examples/vic-gov-au/test/e2e/integration/core-modules/landingPage/AnchorLink.feature @@ -2,14 +2,19 @@ Feature: Anchor link As a citizen I need to be able to scroll to a section in the page content when clicking an anchor link - Scenario: Visit a url with anchor link via link - Given the "/anchorlink-test" page exists with fixture "page/anchorlinktest" data + Scenario: BE - Create landingpage + Given I have logged into the backend + And in the backend there is a node at "/anchorlink-test" with "page/anchorlinktest" data + + Scenario: FE - Visit a url with anchor link via link When I visit the page "/anchorlink-test" And I click the link "/demo-landing-page#accordion-header-basic" - And I wait for 10 seconds + When I wait for 4 seconds + Then the current page url should be "/demo-landing-page#accordion-header-basic" Then the page should scroll to "#accordion-header-basic" - Scenario: Visit a url with anchor link + Scenario: FE - Visit a url with anchor link Given I visit the page "/demo-landing-page#accordion-header-basic" + When I wait for 8 seconds And the page should scroll to "#accordion-header-basic" diff --git a/examples/vic-gov-au/test/e2e/integration/core-modules/landingPage/AnchorLink/step_definition.js b/examples/vic-gov-au/test/e2e/integration/core-modules/landingPage/AnchorLink/step_definition.js deleted file mode 100644 index d0852a29d..000000000 --- a/examples/vic-gov-au/test/e2e/integration/core-modules/landingPage/AnchorLink/step_definition.js +++ /dev/null @@ -1,7 +0,0 @@ -/* global cy */ - -import { Then } from 'cypress-cucumber-preprocessor/steps' - -Then(`the page should scroll to {string}`, (selector) => { - cy.get(selector).then($el => $el[0].getBoundingClientRect()).its('y').should('lessThan', 1) -}) diff --git a/examples/vic-gov-au/test/e2e/integration/core-modules/landingPage/LandingPage.feature b/examples/vic-gov-au/test/e2e/integration/core-modules/landingPage/LandingPage.feature index f95e0f377..75866a234 100644 --- a/examples/vic-gov-au/test/e2e/integration/core-modules/landingPage/LandingPage.feature +++ b/examples/vic-gov-au/test/e2e/integration/core-modules/landingPage/LandingPage.feature @@ -2,8 +2,11 @@ Feature: Landing page As a citizen I can view information for all available content on any given landing page - Scenario: 5-FE-land-6 Landing Page - Complete Test - Given the "/5-be-land-3-landing-page-complete-test" page exists with fixture "landingPage/5-be-land-3-landing-page-complete-test" data + Scenario: BE - Create landing page + Given I have logged into the backend + And in the backend there is a node at "/5-be-land-3-landing-page-complete-test" with "landingPage/5-be-land-3-landing-page-complete-test" data + + Scenario: FE - 5-FE-land-6 Landing Page - Complete Test When I visit the page "/5-be-land-3-landing-page-complete-test" # Page Header @@ -64,19 +67,19 @@ Feature: Landing page And there should be a navigation featured card with the title "Card Promotion" And the navigation card featured titled "Card Promotion" should contain the following: | title | image | summary | link | - | Card Promotion | Melbourne%20tram.jpg | Mauris tincidunt tincidunt felis vel tempus. Vestibulum rhoncus blandit justo quis finibus. | https://www.vic.gov.au | + | Card Promotion | Melbourne-tram.jpg | Mauris tincidunt tincidunt felis vel tempus. Vestibulum rhoncus blandit justo quis finibus. | https://www.vic.gov.au | # Navigation Featured Automated And there should be a navigation featured automated card with the title "Demo News" And the navigation featured automated card titled "Demo News" should contain the following: | title | image | link | - | Demo News | Melbourne%20tram.jpg | /demo-news | + | Demo News | Melbourne-tram.jpg | /demo-news | # Navigation And there should be a navigation card with the title "Card Promotion" And the navigation card titled "Card Promotion" should contain the following: | title | summary | link | linktext | - | Card Promotion | Mauris tincidunt tincidunt felis vel tempus. Vestibulum rhoncus blandit justo quis finibus. | https://www.vic.gov.au | Vestibulum rhoncus | + | Card Promotion | Mauris tincidunt tincidunt felis vel tempus. Vestibulum rhoncus blandit justo quis finibus. | https://www.google.com | Vestibulum rhoncus | # Navigation Automated And there should be a navigation card with the title "Demo Page" @@ -100,17 +103,19 @@ Feature: Landing page | 02 July | Demo Topic | Demo News | /demo-news | # News Listing - And the news listing component should have the following items: - | date | tag | title | link | - | 02 July 2019 | Demo Topic | Demo News | /demo-news | + And the news listing component should exist + # And there should be the following news listing components: + # | date | tag | title | link | + # | 02 July 2019 | Demo Topic | Test news page 1 | /test-news-page-1-5 | + # | 02 July 2019 | Demo Topic | Demo News | /demo-news | # Image Gallery And the image gallery component should have the following items: | image | title | - | 2018-19%20State%20Budget.jpg | 1 / 4 - Demo: 2018-19 State Budget | - | Aerial%20shot%20of%20new%20housing%20development.jpg | 2 / 4 - Demo: Aerial shot of new housing development | - | Bendigo%20Hospital.jpg | 3 / 4 - Demo: Bendigo Hospital | - | Melbourne%20tram.jpg | 4 / 4 - Demo: Melbourne tram | + | 2018-19-State-Budget.jpg | 1 / 4 - Demo: 2018-19 State Budget | + | Aerial-shot-of-new-housing-development.jpg | 2 / 4 - Demo: Aerial shot of new housing development | + | Bendigo-Hospital.jpg | 3 / 4 - Demo: Bendigo Hospital | + | Melbourne-tram.jpg | 4 / 4 - Demo: Melbourne tram | # Card Event Automated And there should be an event card with the title "Demo Event" @@ -122,10 +127,10 @@ Feature: Landing page And there should be a card carousel titled "Card Carousel for Card Event" And the card carousel titled "Card Carousel for Card Event" should have 2 items And the card carousel titled "Card Carousel for Card Event" should have the following items: - | date | title | image | summary | address | link | linktext | - | 01 January to 12 December 2020 | Carousel Card Event | Melbourne%20tram.jpg | Mauris tincidunt tincidunt felis vel tempus. Vestibulum rhoncus blandit justo quis finibus. | Melbourne | https://www.vic.gov.au | Read more | - | 01 January | Carousel Card Event 2 | Melbourne%20tram.jpg | Mauris tincidunt tincidunt felis vel tempus. Vestibulum rhoncus blandit justo quis finibus. | Melbourne | https://www.vic.gov.au | Read more | - + | date | title | image | summary | address | link | linktext | + | 01 January to 12 December 2020 | Carousel Card Event | Melbourne-tram.jpg | Mauris tincidunt tincidunt felis vel tempus. Vestibulum rhoncus blandit justo quis finibus. | Melbourne | https://www.vic.gov.au | Read more | + | 01 January | Carousel Card Event 2 | Melbourne-tram.jpg | Mauris tincidunt tincidunt felis vel tempus. Vestibulum rhoncus blandit justo quis finibus. | Melbourne | https://www.vic.gov.au | Read more | + # Latest Events And there should be a latest events titled "Demo latest events" And the latest events titled "Demo latest events" should have 6 items @@ -135,21 +140,21 @@ Feature: Landing page # | 02 to 07 July | Demo Event | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam tincidunt sit amet ligula sit amet lacinia. In a leo nec tortor aliquet faucibus. | Department of Premier and Cabinet, GPO Box 4509, Melbourne, VIC 3001 | /demo-event | See event details | And the latest events titled "Demo latest events" should have a call to action card with the following: | title | body | image | linktext | link | - | Latest Event 1 | Mauris tincidunt tincidunt felis vel tempus. | Melbourne%20tram.jpg | See more | https://www.vic.gov.au | + | Latest Event 1 | Mauris tincidunt tincidunt felis vel tempus. | Melbourne-tram.jpg | See more | https://www.vic.gov.au | # Timelines And the timeline component titled "Demo Timeline" should exist And the timeline component titled "Demo Timeline" should have the following items: | title | date | summary | image | link | - | Demo Timeline Item | 01 January | Mauris tincidunt tincidunt felis vel tempus. Vestibulum rhoncus blandit justo quis finibus. | Melbourne%20tram.jpg | https://www.vic.gov.au | - | Demo Timeline Item 2 | Alternative | Anim excepteur magna eu aliqua quis velit voluptate sit culpa. | Melbourne%20tram.jpg | https://www.vic.gov.au | + | Demo Timeline Item | 01 January | Mauris tincidunt tincidunt felis vel tempus. Vestibulum rhoncus blandit justo quis finibus. | Melbourne-tram.jpg | https://www.vic.gov.au | + | Demo Timeline Item 2 | Alternative | Anim excepteur magna eu aliqua quis velit voluptate sit culpa. | Melbourne-tram.jpg | https://www.vic.gov.au | # Key Journeys And the key journey component should exist And the key journey component should have the following items: | linktext | link | - | Nullam laoreet | https://vic.gov.au | - | Nullam laoreet | https://vic.gov.au | + | Nullam laoreet | https://vic.gov.au| + | Nullam laoreet | https://vic.gov.au| # Contact Us And the contact component title should be "Victorian Government" @@ -166,7 +171,7 @@ Feature: Landing page And there should be a call to action component with the title "Phasellus in varius leo" And the call to action component titled "Phasellus in varius leo" should contain the following: | title | image | summary | link | linktext | - | Phasellus in varius leo | Melbourne%20tram.jpg | Mauris tincidunt tincidunt felis vel tempus. Vestibulum rhoncus blandit justo quis finibus. Phasellus lacus lectus, sollicitudin sed posuere non, ultricies ut quam. | https://vic.gov.au | Victorian Government | + | Phasellus in varius leo | Melbourne-tram.jpg | Mauris tincidunt tincidunt felis vel tempus. Vestibulum rhoncus blandit justo quis finibus. Phasellus lacus lectus, sollicitudin sed posuere non, ultricies ut quam. | https://vic.gov.au | Victorian Government | # Related Links And the related links component should exist diff --git a/examples/vic-gov-au/test/e2e/integration/core-modules/media/media.feature b/examples/vic-gov-au/test/e2e/integration/core-modules/media/media.feature index 8eb428326..f3fe0badf 100644 --- a/examples/vic-gov-au/test/e2e/integration/core-modules/media/media.feature +++ b/examples/vic-gov-au/test/e2e/integration/core-modules/media/media.feature @@ -2,15 +2,19 @@ Feature: Embedded Media As a citizen I am able to view videos published to the website + Scenario: BE - Create media + Given I have logged into the backend + And in the backend there is a node at "/embedded-video-test" with "media/embedded-video-test" data + And in the backend there is a node at "/test-embedded-video" with "media/embedded-video" data + And in the backend there is a node at "/test-embedded-video-no-transcript" with "media/embedded-video-no-transcript" data + Scenario: Landing page with Embedded media video - Given the "/embedded-video-test" page exists with fixture "media/embedded-video-test" data When I visit the page "/embedded-video-test" Then there should be 2 embedded videos - And there should be a embedded video transcript link "/media/7008" + And there should be a embedded video transcript link "/test-embedded-video" Scenario: Media page for video with transcript - Given I have created a node with the YAML fixture "media/embedded-video" - When I navigate to the first created node + When I attempt to visit the page "/test-embedded-video" Then the current page should not be an error page And the page title should be "Demo: Wodonga Local Aboriginal Network - Bringing People Together" And the hero banner title should be "Demo: Wodonga Local Aboriginal Network - Bringing People Together" @@ -19,8 +23,7 @@ Feature: Embedded Media And the embedded video transcript should contain the text "this is the transcript" Scenario: Media page for video without transcript - Given I have created a node with the YAML fixture "media/embedded-video-no-transcript" - When I navigate to the first created node + When I attempt to visit the page "/test-embedded-video-no-transcript" Then the current page should not be an error page And the page title should be "Embedded video test - no transcript" And the hero banner title should be "Embedded video test - no transcript" diff --git a/examples/vic-gov-au/test/e2e/integration/core-modules/news/news.feature b/examples/vic-gov-au/test/e2e/integration/core-modules/news/news.feature index 3a75dc16b..e476d3cfd 100644 --- a/examples/vic-gov-au/test/e2e/integration/core-modules/news/news.feature +++ b/examples/vic-gov-au/test/e2e/integration/core-modules/news/news.feature @@ -1,6 +1,22 @@ Feature: News page - This test is not ready yet + As a citizen I need to be able to read view news articles - @skip - Scenario: Test \ No newline at end of file + Scenario: BE - Creating a news page + Given I have logged into the backend + And in the backend there is a node at "/test-news-page" with "news/news-1" data + And in the backend there is a node at "/test-news-page-2" with "news/news-2" data + + Scenario: FE - News page + Given I visit the page "/test-news-page-1" + Then the page title should be "Test news page" + And the h1 should be "Test news page" + And there should be 2 breadcrumb items + And the hero banner title should be "Test news page" + And the hero banner desciption should be "Nulla ultricies dignissim leo, posuere vestibulum erat cursus vitae" + And the publish date and author component should exist + And the publish date and location should read "02/07/19 9.00am" + And the publish author should be "Published by Demo Department" + And the content rating component should exist + And the related links component should exist + And the content rating component should exist diff --git a/examples/vic-gov-au/test/e2e/integration/core-modules/page/page.feature b/examples/vic-gov-au/test/e2e/integration/core-modules/page/page.feature index 87b2cc1c7..5077607c0 100644 --- a/examples/vic-gov-au/test/e2e/integration/core-modules/page/page.feature +++ b/examples/vic-gov-au/test/e2e/integration/core-modules/page/page.feature @@ -2,8 +2,11 @@ Feature: Basic Page As a citizen I want to view a Basic page within the site + Scenario: BE - create basic page + Given I have logged into the backend + And in the backend there is a node at "/8-be-page-1-create-basic-page" with "page/8-BE-page-1-basic-page" data + Scenario: 8-FE-page-2 View Basic Page - Given the "/8-be-page-1-create-basic-page" page exists with fixture "page/8-BE-page-1-basic-page" data When I visit the page "/8-be-page-1-create-basic-page" # Page Header Then the page title should be "8-BE-page-1 Create Basic page" @@ -16,16 +19,16 @@ Feature: Basic Page And the related links component should exist And the related links title should be "Related links" And the related links should contain the following links: - | title | url | - | Related Link external text | https://emergency.vic.gov.au/respond/# | - | Department of Premier and Cabinet | https://www.vic.gov.au/department-premier-and-cabinet | + | title | url | + | Related Link external text | https://www.google.com | + | Department of Premier and Cabinet | https://www.google.com | # Whats Next And the whats next component should exist And the whats next title should be "What's next?" And the whats next links should be: - | title | url | - | State Government of Victoria | https://www.vic.gov.au | - | Department of Premier and Cabinet | https://www.vic.gov.au/department-premier-and-cabinet | + | title | url | + | State Government of Victoria | https://www.google.com | + | Department of Premier and Cabinet | https://www.google.com | # Share this And the share this component should exist And the share this component should have the title "Share this" diff --git a/examples/vic-gov-au/test/e2e/integration/core-modules/profile/profile.feature b/examples/vic-gov-au/test/e2e/integration/core-modules/profile/profile.feature index 93e616b32..0060393ed 100644 --- a/examples/vic-gov-au/test/e2e/integration/core-modules/profile/profile.feature +++ b/examples/vic-gov-au/test/e2e/integration/core-modules/profile/profile.feature @@ -2,8 +2,11 @@ Feature: Profile page As a citizen I want to be able to see information about inductees in the honour roll. - Scenario: Profile page - Given the "/profile-4-be-profile-1" page exists with fixture "profile/4-BE-Profile-1" data + Scenario: BE - Create profile page + Given I have logged into the backend + And in the backend there is a node at "/profile-4-be-profile-1" with "profile/4-BE-Profile-1" data + + Scenario: FE - Profile page When I visit the page "/profile-4-be-profile-1" Then the page title should be "Profile-4-BE-profile-1" And the h1 should be "Profile-4-BE-profile-1" diff --git a/examples/vic-gov-au/test/e2e/integration/core-modules/publication/publication.feature b/examples/vic-gov-au/test/e2e/integration/core-modules/publication/publication.feature index 20c1c863d..7bcdfdc27 100644 --- a/examples/vic-gov-au/test/e2e/integration/core-modules/publication/publication.feature +++ b/examples/vic-gov-au/test/e2e/integration/core-modules/publication/publication.feature @@ -4,10 +4,18 @@ Feature: Publication Scenario: Publication page Given I visit the page "/demo-publication" + And the author information component should exist Then there should be a description list with the following items: | term | value | | Author | Demo Department | | Date | July 2019 | + And the anchor links component should exist + And the contact component should exist + And the accordion component should exist + And there should be a navigation card with the title "Demo Publication - Chapter 1" + And there should be a navigation card with the title "Demo Publication - Chapter 2" + And there should be a navigation card with the title "Demo Publication - Chapter 3" + And the content rating component should exist Scenario: Print all publication pages Given the "/demo-publication" route exists @@ -16,7 +24,7 @@ Feature: Publication Given the "/demo-publication/demo-publication-chapter-1/demo-publication-chapter-1-page-1" route exists When I visit the page "/demo-publication/print-all" Then the page title should be "Demo Publication" - And the following section ids should exist: + And the following section title ids should exist: | section | | demo-publication-chapter-1 | | demo-publication-chapter-1-page-1 | @@ -24,9 +32,9 @@ Feature: Publication | demo-publication-chapter-2-page-1 | And the author information component should exist And there should be a description list with the following items: - | term | value | - | Author | Lorem ipsum dolor sit amet, Nulla ultricies dignissim, Integer interdum nisl | - | Date | July 2019 | + | term | value | + | Author | Demo Department | + | Date | July 2019 | And the anchor links component should exist And the anchor link title should be "On this page:" And there should be the following anchor links: diff --git a/examples/vic-gov-au/test/e2e/integration/core-modules/site/sitemap.feature b/examples/vic-gov-au/test/e2e/integration/core-modules/site/sitemap.feature index ddbffb133..a9830f638 100644 --- a/examples/vic-gov-au/test/e2e/integration/core-modules/site/sitemap.feature +++ b/examples/vic-gov-au/test/e2e/integration/core-modules/site/sitemap.feature @@ -10,7 +10,6 @@ Feature: Sitemap And there should be 2 breadcrumb items And the sitemap component should exist - @skip Scenario: Sitemap xml Given a request is made to "/sitemap.xml" Then the response code should be 200 \ No newline at end of file diff --git a/examples/vic-gov-au/test/e2e/integration/core-modules/webform/contact-form.feature b/examples/vic-gov-au/test/e2e/integration/core-modules/webform/contact-form.feature new file mode 100644 index 000000000..992ec7047 --- /dev/null +++ b/examples/vic-gov-au/test/e2e/integration/core-modules/webform/contact-form.feature @@ -0,0 +1,42 @@ +Feature: Contact form + + As a public user I can submit a question to the site authors + + Scenario: Submit a contact form - success + Given I stubbed the form "connect_with_us" response with "webforms/contact-us-form-success" fixture + And I visit the page "/contact-us" + And i enter the following information into the form "form-connect_with_us": + | label | value | type | + | What type of enquiry do you have? | General enquiry | rpl-select | + | What best describes your enquiry? | test | textarea | + | Full name | Dylan kelly | text | + | Email address | test-dpc@mailinator.com | text | + | Contact number | 03 9999 9999 | tel | + | I have read and understand how Department of Premier and Cabinet stores information. | true | checkbox | + + And I click the form submit button "Submit" + When I wait for 5 seconds + Then I should see the form success message + + Scenario: Submit a contact form - submission failure + Given I stubbed the form "connect_with_us" response with "webforms/contact-us-form-failure" fixture + And I visit the page "/contact-us" + And i enter the following information into the form "form-connect_with_us": + | label | value | type | + | What type of enquiry do you have? | General enquiry | rpl-select | + | What best describes your enquiry? | test | textarea | + | Full name | Dylan kelly | text | + | Email address | test-dpc@mailinator.com | text | + | Contact number | 03 9999 9999 | tel | + | I have read and understand how Department of Premier and Cabinet stores information. | true | checkbox | + + And I click the form submit button "Submit" + When I wait for 5 seconds + Then I should see the form failure message + + Scenario: Submit a contact form - validation + Given I stubbed the form "tide_webform_contact_us" response with "webforms/contact-us-form-failure" fixture + And I visit the page "/contact-us" + When I click the form submit button "Submit" + And I should see 4 form validation errors + diff --git a/examples/vic-gov-au/test/e2e/integration/core-modules/webform/content-rating.feature b/examples/vic-gov-au/test/e2e/integration/core-modules/webform/content-rating.feature new file mode 100644 index 000000000..747a0df94 --- /dev/null +++ b/examples/vic-gov-au/test/e2e/integration/core-modules/webform/content-rating.feature @@ -0,0 +1,24 @@ +Feature: Content rating form + + As a public user I can submit feedback about a page + + Scenario: Submit a content rating form - success + Given I stubbed the form "tide_webform_content_rating" response with "webforms/content-rating-form-success" fixture + And I visit the page "/" + And I enter the following into the content rating form: + | helpful | comment | + | Yes | this is a test comment | + And I click the form submit button "Submit" + When I wait for 5 seconds + Then I should see the form success message + + Scenario: Submit a content rating form - failure + Given I stubbed the form "tide_webform_content_rating" response with "webforms/content-rating-form-failure" fixture + And I visit the page "/" + And I enter the following into the content rating form: + | helpful | comment | + | Yes | this is a test comment | + And I click the form submit button "Submit" + When I wait for 5 seconds + Then I should see the form failure message + diff --git a/examples/vic-gov-au/test/e2e/integration/core-modules/webform/webform.feature b/examples/vic-gov-au/test/e2e/integration/core-modules/webform/webform.feature new file mode 100644 index 000000000..c75f3ce05 --- /dev/null +++ b/examples/vic-gov-au/test/e2e/integration/core-modules/webform/webform.feature @@ -0,0 +1,54 @@ +Feature: Webform + + As a site admin I can create a webform and receive submissions + + Scenario: BE - Create a custom webform + Given I have logged into the backend + Given in the backend there there is a form named "test-form" with the fixture "webforms/test_form" + And in the backend there is a node at "/test-form" with "webforms/test-form-page" data + + Scenario: FE - test form submission + When I visit the page "/test-form" + Given I stubbed the form "test_form_1" response with "webforms/contact-us-form-success" fixture + And i enter the following information into the form "form-test_form_1": + | label | value | type | + | Text field | General enquiry | text | + | Textarea | test | textarea | + | Email | tester@mailinator.com | email | + | Telephone | 03 999 0000 | tel | + | Number | 12345678910 | number | + | Select | Option 1 | rpl-select | + | Date | 18/03/2020 | date | + | Radios | Option 2 | radios | + | Checkboxes | true | checkbox | + | I have read and understand how Department of Premier and Cabinet stores information. | true | checkbox | + + And I click the form submit button "Submit" + When I wait for 5 seconds + Then I should see the form success message + + Scenario: FE - test form submission failure + When I visit the page "/test-form" + Given I stubbed the form "test_form_1" response with "webforms/contact-us-form-failure" fixture + And i enter the following information into the form "form-test_form_1": + | label | value | type | + | Text field | General enquiry | text | + | Textarea | test | textarea | + | Email | tester@mailinator.com | email | + | Telephone | 03 999 0000 | tel | + | Number | 12345678910 | number | + | Select | Option 1 | rpl-select | + | Date | 18/03/2020 | date | + | Radios | Option 2 | radios | + | Checkboxes | true | checkbox | + | I have read and understand how Department of Premier and Cabinet stores information. | true | checkbox | + + And I click the form submit button "Submit" + When I wait for 5 seconds + Then I should see the form failure message + + Scenario: FE - test form validation + When I visit the page "/test-form" + When I click the form submit button "Submit" + And I should see 4 form validation errors + diff --git a/examples/vic-gov-au/test/e2e/integration/core-modules/webform/webforms.feature b/examples/vic-gov-au/test/e2e/integration/core-modules/webform/webforms.feature deleted file mode 100644 index a57b1b76e..000000000 --- a/examples/vic-gov-au/test/e2e/integration/core-modules/webform/webforms.feature +++ /dev/null @@ -1,6 +0,0 @@ -Feature: Webforms - - This test is not ready yet - - @skip - Scenario: Test \ No newline at end of file diff --git a/examples/vic-gov-au/test/e2e/integration/core/content-preview/preview-content.feature b/examples/vic-gov-au/test/e2e/integration/core/content-preview/preview-content.feature index e0b1f9db8..6e542ceac 100644 --- a/examples/vic-gov-au/test/e2e/integration/core/content-preview/preview-content.feature +++ b/examples/vic-gov-au/test/e2e/integration/core/content-preview/preview-content.feature @@ -1,33 +1,29 @@ Feature: Preview content As an authorized user I want to be able to view previews which are not visible to the general public. - @skip + + Scenario: BE - Create draft page + Given I have logged into the backend + And in the backend there is a user "users/user-2" + And in the backend there is a node at "/1-fe-content-preview-1" with "content-preview/1-fe-content-preview-1" data + Scenario: No access to a draft page when unauthenticated - Given the "/1-fe-content-preview-1" page exists with fixture "core/content-preview/1-fe-content-preview-1" data - When I visit the page "/1-fe-content-preview-1" + When I attempt to visit the page "/1-fe-content-preview-1" Then I should see a 404 page - @skip - Scenario: Accessing a preview when unauthorized redirects to login - Given I have created a landing page with the json fixture "Pages/LandingPage/draft" - And I have navigated to the created preview page - Then there should be a redirect to "/login" - And there should be a preview destination query string - @skip + Scenario: Accessing a preview when unauthorized redirects to login + When I attempt to visit the page "/preview/landing_page/e9db742d-3a43-40fa-81e2-f81b4f0f7a27/latest?section=4" + Then the current page url should be "/login" + Scenario: Accessing a preview when authenticated shows page - Given there is a user in the system with the following credentials: - | login | password | active | email | role | - | testuser1 | Password-111 | true | testuser1@mailinator.com | Previewer | - And I have created a landing page with the json fixture "Pages/LandingPage/draft" - And I have navigated to the created preview page - When I enter the the following login credentials: - | login | password | - | testuser1 | Password-111 | + When I visit the page "/preview/landing_page/e9db742d-3a43-40fa-81e2-f81b4f0f7a27/latest?section=4" + And I enter the the following login credentials: + | login | password | + | e2e-test-2@example.com | ******** | And I submit the login form - And I wait for 6 seconds - Then I should be redirected to the preview page - And there should be a draft banner + And I wait for 8 seconds + Then the current page url should be "/preview/landing_page/e9db742d-3a43-40fa-81e2-f81b4f0f7a27/latest" + Then the current page should not be an error page + And there should be a draft banner And there should be a header logout button - And the h1 should be "Test landing page basic" - And the created page should be removed - And the created user should be removed + And the h1 should be "1-FE-content-preview-1" diff --git a/examples/vic-gov-au/test/e2e/integration/core/content-preview/preview-content/step_definition.js b/examples/vic-gov-au/test/e2e/integration/core/content-preview/preview-content/step_definition.js deleted file mode 100644 index eee830597..000000000 --- a/examples/vic-gov-au/test/e2e/integration/core/content-preview/preview-content/step_definition.js +++ /dev/null @@ -1,63 +0,0 @@ -/* global cy */ - -import { Then, When, Given } from 'cypress-cucumber-preprocessor/steps' - -Given(`I have navigated to the created preview page`, () => { - cy.get('@previewLink').then(previewLink => { - cy.visit(previewLink, { failOnStatusCode: false }) - }) -}) - -Then(`there should be a redirect to {string}`, (url) => { - cy.window().its('location.pathname').should('equal', url) -}) - -Then(`there should be a preview destination query string`, () => { - cy.get('@previewLink').then(previewLink => { - cy.window().its('location.search').should('equal', `?destination=${encodeURIComponent(previewLink)}`) - }) -}) - -Then(`I should be redirected to the preview page`, () => { - cy.get('@previewLink').then(previewLink => { - cy.window().its('location.href').should('contain', previewLink) - }) -}) - -Given(`there is a user in the system with the following credentials:`, (dataTable) => { - const user = dataTable.hashes()[0] - const active = Boolean(dataTable.hashes()[0].active === 'true') - - cy.task('createUser', { ...user, active }).as('userId') -}) - -When(`I enter the the following login credentials:`, (dataTable) => { - const login = dataTable.hashes()[0].login - const password = dataTable.hashes()[0].password - cy.get('#username').type(login) - cy.get('#password').type(password) -}) - -When(`I submit the login form`, () => { - cy.get('.field-wrap > input[value="Submit"]').click() -}) - -When(`I wait for {int} seconds`, seconds => { - cy.wait(seconds * 1000) -}) - -Then(`there should be a draft banner`, () => { - cy.get('.rpl-alert-base.app-preview').should('exist') -}) - -Then(`there should be a header logout button`, () => { - cy.get('.rpl-site-header__btn--logout').should('exist') -}) - -Then(`the created user should be removed`, () => { - cy.get('@userId').then(userId => { - if (userId) { - cy.task('deleteUser', userId) - } - }) -}) diff --git a/examples/vic-gov-au/test/e2e/integration/core/global/quickexit.feature b/examples/vic-gov-au/test/e2e/integration/core/global/quickexit.feature index fd03852a0..30c4d9bee 100644 --- a/examples/vic-gov-au/test/e2e/integration/core/global/quickexit.feature +++ b/examples/vic-gov-au/test/e2e/integration/core/global/quickexit.feature @@ -1,6 +1,15 @@ Feature: Quick exit - This test is not ready yet + As a citizen in a potentially dangerous situation I need to be able to + quickly remove the content on my screen if another person walks into the room. - @skip - Scenario: Test \ No newline at end of file + Scenario: BE - Enable quick exit + Given I have logged into the backend + And in the BE I go to the current site taxonomy page + And in the BE I check the "Show Exit Site?" checkbox + And in the BE I click the "Save" button + + Scenario: FE - Check quick exit exists on page + When I attempt to visit the page "/" + Then the quick exit button should be present + And the quick exit url should be "www.google.com" \ No newline at end of file diff --git a/examples/vic-gov-au/test/e2e/integration/smoke/Headers.feature b/examples/vic-gov-au/test/e2e/integration/smoke/Headers.feature index ec3f590e5..2fbadfa33 100644 --- a/examples/vic-gov-au/test/e2e/integration/smoke/Headers.feature +++ b/examples/vic-gov-au/test/e2e/integration/smoke/Headers.feature @@ -7,7 +7,8 @@ Feature: App headers Given a request is made to "/" And the response header "x-sdp-app-type" should has value "ripple" And the response has header "section-cache-tags" - + + @smoke Scenario: There are expected Tide API response headers Given a request is made to "/api/v1/route?site=4&path=/" And the response header "x-sdp-app-type" should has value "tide" diff --git a/examples/vic-gov-au/test/e2e/plugins/index.js b/examples/vic-gov-au/test/e2e/plugins/index.js index 76396b450..bda829d55 100644 --- a/examples/vic-gov-au/test/e2e/plugins/index.js +++ b/examples/vic-gov-au/test/e2e/plugins/index.js @@ -1,15 +1,13 @@ const cucumber = require('cypress-cucumber-preprocessor').default -const tideAdmin = require('@dpc-sdp/ripple-test-tools') - +const rippleTasks = require('@dpc-sdp/ripple-test-tools/tasks') // Environment variables that need exposing to cypress go here - use the example site .env file require('dotenv').config() module.exports = (on, config) => { on('file:preprocessor', cucumber()) - tideAdmin(on, config) - config.env = { + SITE_ID: '4', ADMIN_USERNAME: process.env.CYPRESS_ADMIN_USERNAME, ADMIN_PASSWORD: process.env.CYPRESS_ADMIN_PASSWORD, CONTENT_API_AUTH_USER: process.env.CONTENT_API_AUTH_USER, @@ -20,5 +18,7 @@ module.exports = (on, config) => { SEARCH_ENDPOINT: `https://${process.env.SEARCH_HASH}.${process.env.SEARCH_URL}/${process.env.SEARCH_INDEX}/_search` } + on('task', rippleTasks) + return config } diff --git a/examples/vic-gov-au/test/e2e/support/commands.js b/examples/vic-gov-au/test/e2e/support/commands.js deleted file mode 100644 index f5ec914f7..000000000 --- a/examples/vic-gov-au/test/e2e/support/commands.js +++ /dev/null @@ -1,10 +0,0 @@ -// *********************************************** -// For more comprehensive examples of custom -// commands please read more here: -// https://on.cypress.io/custom-commands -// *********************************************** -// -// -import rippleCommands from '@dpc-sdp/ripple-test-tools/commands.js' - -rippleCommands() diff --git a/examples/vic-gov-au/test/e2e/support/index.js b/examples/vic-gov-au/test/e2e/support/index.js index bf43148c2..1c99ad90c 100644 --- a/examples/vic-gov-au/test/e2e/support/index.js +++ b/examples/vic-gov-au/test/e2e/support/index.js @@ -13,5 +13,4 @@ // https://on.cypress.io/configuration // *********************************************************** -import 'cypress-axe' -import './commands' +require('@dpc-sdp/ripple-test-tools/commands') diff --git a/examples/vue-example-app/package.json b/examples/vue-example-app/package.json index a51f1bd34..991b327da 100644 --- a/examples/vue-example-app/package.json +++ b/examples/vue-example-app/package.json @@ -24,9 +24,6 @@ "@vue/cli-service": "^3.8.0", "babel-eslint": "^10.0.1", "cross-env": "^5.2.0", - "cypress": "^3.1.5", - "cypress-axe": "^0.4.0", - "cypress-cucumber-preprocessor": "^1.11.0", "eslint": "^5.16.0", "eslint-plugin-vue": "^5.0.0", "node-sass": "^4.12.0", diff --git a/package.json b/package.json index da9ec09dd..47f719494 100644 --- a/package.json +++ b/package.json @@ -85,9 +85,6 @@ "vue-jest": "^3.0.4", "vuex-mock-store": "^0.0.7" }, - "cypress-cucumber-preprocessor": { - "nonGlobalStepDefinitions": true - }, "browserslist": [ "> 1%", "IE 11", diff --git a/packages/create-ripple-app/__tests__/__mocks__/v18/package.json b/packages/create-ripple-app/__tests__/__mocks__/v18/package.json index f58dc1f8e..8ee4a4ed3 100644 --- a/packages/create-ripple-app/__tests__/__mocks__/v18/package.json +++ b/packages/create-ripple-app/__tests__/__mocks__/v18/package.json @@ -32,9 +32,6 @@ "axe-core": "^3.3.2", "babel-eslint": "^10.0.1", "cross-env": "^5.2.0", - "cypress": "^3.4.1", - "cypress-axe": "^0.4.0", - "cypress-cucumber-preprocessor": "^1.16.0", "eslint": "^4.15.0", "eslint-config-standard": "^10.2.1", "eslint-friendly-formatter": "^3.0.0", diff --git a/packages/create-ripple-app/generators/updates/22.0.0/saofile.js b/packages/create-ripple-app/generators/updates/22.0.0/saofile.js new file mode 100644 index 000000000..46ae80d27 --- /dev/null +++ b/packages/create-ripple-app/generators/updates/22.0.0/saofile.js @@ -0,0 +1,84 @@ +const fs = require('fs') +const path = require('path') +const common = require('./../../common') +const templateDir = './../../../template' + +module.exports = { + ...common, + templateDir, + actions () { + const results = { + ...this.answers, + ...this.sao.opts.config + } + const actions = [ + { + type: 'modify', + files: 'package.json', + handler (data, filepath) { + data.version = '22.0.0' + data.dependencies['@dpc-sdp/ripple-nuxt-tide'] = `1.7.0` + data.devDependencies['@dpc-sdp/ripple-test-tools'] = `1.7.0` + data.scripts['cy:run'] = `cypress run -b chrome -e TAGS='not @skip or @smoke'` + data.scripts['cy:record'] = `cypress run -b chrome -e TAGS='not @skip or @smoke' --record --parallel --group $CIRCLE_JOB` + if (data['cypress-cucumber-preprocessor']) { + data['cypress-cucumber-preprocessor'].step_definitions = 'test/e2e/integration/' + } + return data + } + }, + { + type: 'add', + files: ['_cypress.json'], + transform: true + }, + { + type: 'move', + patterns: { + '_cypress.json': 'cypress.json' + } + } + ] + + if (results.smoke || results.e2e) { + actions.push( + { + type: 'add', + files: ['**'], + transform: true, + templateDir: `${templateDir}/_tests/_common` + } + ) + } + + if (results.smoke) { + actions.push({ + type: 'add', + files: ['**'], + transform: true, + templateDir: `${templateDir}/_tests/_smoke` + }) + } + if (results.e2e) { + // only add tests for enabled modules + results.modules.forEach(tideModule => { + const hasTests = fs.existsSync(path.resolve(__dirname, `${templateDir}/_tests/_modules/test/e2e/integration/core-modules/${tideModule}`)) + if (hasTests) { + actions.push( + { + type: 'add', + files: [`./test/e2e/integration/core-modules/${tideModule}/**`, `./test/e2e/fixtures/${tideModule}/**`], + transform: true, + templateDir: `${templateDir}/_tests/_modules` + } + ) + } + }) + } + + return actions + }, + async completed () { + console.log('Update to 22.0.0 complete!') + } +} diff --git a/packages/create-ripple-app/options.js b/packages/create-ripple-app/options.js index 6d864204a..efdf28ce4 100644 --- a/packages/create-ripple-app/options.js +++ b/packages/create-ripple-app/options.js @@ -133,5 +133,19 @@ module.exports = { message: 'Elasticsearch password', default: '', store: true + }, + adminuser: { + name: 'adminuser', + type: 'string', + message: 'Drupal user name for E2E automation', + default: '', + store: true + }, + adminpass: { + name: 'adminpass', + type: 'string', + message: 'Drupal user pass for E2E automation', + default: '', + store: true } } diff --git a/packages/create-ripple-app/template/_cypress.json b/packages/create-ripple-app/template/_cypress.json new file mode 100644 index 000000000..d56dc6084 --- /dev/null +++ b/packages/create-ripple-app/template/_cypress.json @@ -0,0 +1,16 @@ +{ + "baseUrl": "http://localhost:3000", + "fixturesFolder": "test/e2e/fixtures", + "integrationFolder": "test/e2e/integration", + "pluginsFile": "test/e2e/plugins/index.js", + "screenshotsFolder": "test/e2e/screenshots", + "supportFile": "test/e2e/support/index.js", + "videosFolder": "test/e2e/videos", + "ignoreTestFiles": [ + "*.js", + "*.md" + ], + "snapshotFileName": "test/e2e/snapshots.js", + "chromeWebSecurity": false, + "$schema": "https://on.cypress.io/cypress.schema.json" +} diff --git a/packages/create-ripple-app/template/_package.json b/packages/create-ripple-app/template/_package.json index 2806194d6..76b7dcf26 100644 --- a/packages/create-ripple-app/template/_package.json +++ b/packages/create-ripple-app/template/_package.json @@ -11,9 +11,9 @@ "build:win32": "IF \"%NUXT_HOT_RELOADING%\" NEQ \"1\" ( nuxt build )", <%_ if ((e2e === true) || (smoke === true)) { _%> "cy:open": "cypress open", - "cy:run-smoke": "cypress run -e TAGS='@smoke' --spec 'test/e2e/integration/smoke/*'", + "cy:run-smoke": "cypress run -b chrome -e TAGS='@smoke' --spec 'test/e2e/integration/smoke/*' --record --parallel --group $CIRCLE_JOB", <%_ if (e2e === true) { _%> - "cy:run": "cypress run -e TAGS='not @skip or @smoke'", + "cy:run": "cypress run -b chrome -e TAGS='not @skip or @smoke'", "test:e2e": "cross-env TEST=1 BASIC_AUTH=0 start-server-and-test start:build http://localhost:3000 cy:run", <%_ } _%> "test:dev": "cross-env NODE_ENV=dev start-server-and-test dev http://localhost:3000 cy:open", @@ -39,7 +39,6 @@ "devDependencies": { <%_ if ((e2e === true) || (smoke === true)) { _%> "@dpc-sdp/ripple-test-tools": "^<%= version %>", - "axe-core": "^3.3.2", <%_ } _%> "babel-eslint": "^10.0.1", "babel-plugin-lodash": "^3.3.2", @@ -78,7 +77,13 @@ }, <%_ if ((e2e === true) || (smoke === true)) { _%> "cypress-cucumber-preprocessor": { - "nonGlobalStepDefinitions": true + "nonGlobalStepDefinitions": true, + "step_definitions": "test/e2e/integration/", + "cucumberJson": { + "generate": true, + "outputFolder": "./../../test-results/cucumber", + "filePrefix": "<%= domain %>" + } }, <%_ } _%> "browserslist": [ diff --git a/packages/create-ripple-app/template/_tests/_common/test/e2e/README.md b/packages/create-ripple-app/template/_tests/_common/test/e2e/README.md deleted file mode 100644 index a3300e134..000000000 --- a/packages/create-ripple-app/template/_tests/_common/test/e2e/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# End to end tests - -End to end tests are run with the Cypress test framework, Please see cypress.io/docs for usage - -Please add custom tests in /tests/e2e/integration/custom/ folder diff --git a/packages/create-ripple-app/template/_tests/_common/test/e2e/integration/common/index.js b/packages/create-ripple-app/template/_tests/_common/test/e2e/integration/common/index.js index f27a75182..b75ee5fb4 100644 --- a/packages/create-ripple-app/template/_tests/_common/test/e2e/integration/common/index.js +++ b/packages/create-ripple-app/template/_tests/_common/test/e2e/integration/common/index.js @@ -1,2 +1,2 @@ // Import shared step_definitions from ripple-test-tools package -require('@dpc-sdp/ripple-test-tools/step_definitions/common') +require('@dpc-sdp/ripple-test-tools/step_definitions') diff --git a/packages/create-ripple-app/template/_tests/_common/test/e2e/integration/core/content-preview/preview-content.feature b/packages/create-ripple-app/template/_tests/_common/test/e2e/integration/core/content-preview/preview-content.feature new file mode 100644 index 000000000..6e542ceac --- /dev/null +++ b/packages/create-ripple-app/template/_tests/_common/test/e2e/integration/core/content-preview/preview-content.feature @@ -0,0 +1,29 @@ +Feature: Preview content + + As an authorized user I want to be able to view previews which are not visible to the general public. + + Scenario: BE - Create draft page + Given I have logged into the backend + And in the backend there is a user "users/user-2" + And in the backend there is a node at "/1-fe-content-preview-1" with "content-preview/1-fe-content-preview-1" data + + Scenario: No access to a draft page when unauthenticated + When I attempt to visit the page "/1-fe-content-preview-1" + Then I should see a 404 page + + Scenario: Accessing a preview when unauthorized redirects to login + When I attempt to visit the page "/preview/landing_page/e9db742d-3a43-40fa-81e2-f81b4f0f7a27/latest?section=4" + Then the current page url should be "/login" + + Scenario: Accessing a preview when authenticated shows page + When I visit the page "/preview/landing_page/e9db742d-3a43-40fa-81e2-f81b4f0f7a27/latest?section=4" + And I enter the the following login credentials: + | login | password | + | e2e-test-2@example.com | ******** | + And I submit the login form + And I wait for 8 seconds + Then the current page url should be "/preview/landing_page/e9db742d-3a43-40fa-81e2-f81b4f0f7a27/latest" + Then the current page should not be an error page + And there should be a draft banner + And there should be a header logout button + And the h1 should be "1-FE-content-preview-1" diff --git a/packages/create-ripple-app/template/_tests/_common/test/e2e/integration/core/global/quickexit.feature b/packages/create-ripple-app/template/_tests/_common/test/e2e/integration/core/global/quickexit.feature new file mode 100644 index 000000000..30c4d9bee --- /dev/null +++ b/packages/create-ripple-app/template/_tests/_common/test/e2e/integration/core/global/quickexit.feature @@ -0,0 +1,15 @@ +Feature: Quick exit + + As a citizen in a potentially dangerous situation I need to be able to + quickly remove the content on my screen if another person walks into the room. + + Scenario: BE - Enable quick exit + Given I have logged into the backend + And in the BE I go to the current site taxonomy page + And in the BE I check the "Show Exit Site?" checkbox + And in the BE I click the "Save" button + + Scenario: FE - Check quick exit exists on page + When I attempt to visit the page "/" + Then the quick exit button should be present + And the quick exit url should be "www.google.com" \ No newline at end of file diff --git a/packages/create-ripple-app/template/_tests/_common/test/e2e/integration/custom/README.md b/packages/create-ripple-app/template/_tests/_common/test/e2e/integration/custom/README.md deleted file mode 100644 index 3e6eea7f9..000000000 --- a/packages/create-ripple-app/template/_tests/_common/test/e2e/integration/custom/README.md +++ /dev/null @@ -1 +0,0 @@ -**Please put any tests for custom functionality here. This folder will not be overridden by automated updates, whereas the other folders may be modified or deleted.** \ No newline at end of file diff --git a/packages/create-ripple-app/template/_tests/_common/test/e2e/integration/smoke/DemoLandingPage.feature b/packages/create-ripple-app/template/_tests/_common/test/e2e/integration/smoke/DemoLandingPage.feature new file mode 100644 index 000000000..3fded018d --- /dev/null +++ b/packages/create-ripple-app/template/_tests/_common/test/e2e/integration/smoke/DemoLandingPage.feature @@ -0,0 +1,42 @@ +Feature: Demo Page + + Demo landing page with all components + + Background: + Given I visit the page "/demo-landing-page" + + @smoke + Scenario: Demo landing page loads correctly + Then the current page should not be an error page + And the page title should be "Demo Landing Page" + And the h1 should be "Demo Landing Page" + And the breadcrumbs should exist + And there should be 2 breadcrumb items + And the site header is visible + And the site footer is visible + # All components load correctly + And the anchor links component should exist + And the content rating component should exist + And the hero banner component should exist + And the intro banner component should exist + And the campaign primary banner component should exist + And the body markup component should exist + And the featured news list component should exist + And the featured card navigation component should exist + And the card event component should exist + And the card CTA component should exist + # And the card keydates component should exist + And the card promotion component should exist + And the card carousel component should exist + And the accordion component should exist + And the news listing component should exist + # And the timeline component should exist + And the image gallery component should exist + And the related links component should exist + And the contact component should exist + And the whats next component should exist + And the share this component should exist + +# Need to fix existing errors or work out ruleset to skip + # Scenario: There are no accessibility errors + # Then it has no detectable a11y violations on load \ No newline at end of file diff --git a/packages/create-ripple-app/template/_tests/_common/test/e2e/integration/smoke/Headers.feature b/packages/create-ripple-app/template/_tests/_common/test/e2e/integration/smoke/Headers.feature new file mode 100644 index 000000000..2fbadfa33 --- /dev/null +++ b/packages/create-ripple-app/template/_tests/_common/test/e2e/integration/smoke/Headers.feature @@ -0,0 +1,14 @@ +Feature: App headers + + As a DevOps Engineer I can rely on headers in the App to distinguish between routes that should go to the Backend API vs the FE App so that I can optimise the CDN. + + @smoke + Scenario: There are expected Ripple app response headers + Given a request is made to "/" + And the response header "x-sdp-app-type" should has value "ripple" + And the response has header "section-cache-tags" + + @smoke + Scenario: There are expected Tide API response headers + Given a request is made to "/api/v1/route?site=4&path=/" + And the response header "x-sdp-app-type" should has value "tide" diff --git a/packages/create-ripple-app/template/_tests/_common/test/e2e/integration/smoke/elasticsearch.feature b/packages/create-ripple-app/template/_tests/_common/test/e2e/integration/smoke/elasticsearch.feature new file mode 100644 index 000000000..c0386bcdf --- /dev/null +++ b/packages/create-ripple-app/template/_tests/_common/test/e2e/integration/smoke/elasticsearch.feature @@ -0,0 +1,17 @@ +Feature: Elasticsearch API + + Integration test to make sure that Elasticsearch is returning the correct API response + + @smoke + Scenario: Search endpoint is up + Given a request is made to the search endpoint with the following: + | query | page | + | victoria | 1 | + Then the response code should be 200 + And the search request should have a valid response + + # @smoke + # Scenario: Search index contains items + # Given a valid test request is made to the search endpoint + # Then the response code should be 200 + # And the search response should return some hits \ No newline at end of file diff --git a/packages/create-ripple-app/template/_tests/_common/test/e2e/integration/smoke/tide-is-up.feature b/packages/create-ripple-app/template/_tests/_common/test/e2e/integration/smoke/tide-is-up.feature index 21079d49f..b8077e7bd 100644 --- a/packages/create-ripple-app/template/_tests/_common/test/e2e/integration/smoke/tide-is-up.feature +++ b/packages/create-ripple-app/template/_tests/_common/test/e2e/integration/smoke/tide-is-up.feature @@ -4,10 +4,10 @@ Feature: Test Tide backend is up @smoke Scenario: Route endpoint returns a correct response - Given a request is made to "/api/v1/route?site=<%= siteid %>&path=/" + Given a request is made to "/api/v1/route?site=4&path=/" Then the response code should be 200 @smoke Scenario: Sites endpoint returns a correct response - Given a request is made to "/api/v1/taxonomy_term/sites?site=<%= siteid %>" - Then the response code should be 200 + Given a request is made to "/api/v1/taxonomy_term/sites?site=4" + Then the response code should be 200 \ No newline at end of file diff --git a/packages/create-ripple-app/template/_tests/_common/test/e2e/plugins/index.js b/packages/create-ripple-app/template/_tests/_common/test/e2e/plugins/index.js index 500e1de3f..882e958d8 100644 --- a/packages/create-ripple-app/template/_tests/_common/test/e2e/plugins/index.js +++ b/packages/create-ripple-app/template/_tests/_common/test/e2e/plugins/index.js @@ -1,21 +1,24 @@ const cucumber = require('cypress-cucumber-preprocessor').default -const tideAdmin = require('@dpc-sdp/ripple-test-tools') - +const rippleTasks = require('@dpc-sdp/ripple-test-tools/tasks') // Environment variables that need exposing to cypress go here - use the example site .env file require('dotenv').config() module.exports = (on, config) => { on('file:preprocessor', cucumber()) - tideAdmin(on, config) - config.env = { + SITE_ID: '<%= siteid %>', ADMIN_USERNAME: process.env.CYPRESS_ADMIN_USERNAME, ADMIN_PASSWORD: process.env.CYPRESS_ADMIN_PASSWORD, CONTENT_API_AUTH_USER: process.env.CONTENT_API_AUTH_USER, CONTENT_API_AUTH_PASS: process.env.CONTENT_API_AUTH_PASS, - CONTENT_API_SERVER: process.env.CONTENT_API_SERVER + CONTENT_API_SERVER: process.env.CONTENT_API_SERVER, + SEARCH_AUTH_USERNAME: process.env.SEARCH_AUTH_USERNAME, + SEARCH_AUTH_PASSWORD: process.env.SEARCH_AUTH_PASSWORD, + SEARCH_ENDPOINT: `https://${process.env.SEARCH_HASH}.${process.env.SEARCH_URL}/${process.env.SEARCH_INDEX}/_search` } + on('task', rippleTasks) + return config } diff --git a/packages/create-ripple-app/template/_tests/_common/test/e2e/support/commands.js b/packages/create-ripple-app/template/_tests/_common/test/e2e/support/commands.js deleted file mode 100644 index f5ec914f7..000000000 --- a/packages/create-ripple-app/template/_tests/_common/test/e2e/support/commands.js +++ /dev/null @@ -1,10 +0,0 @@ -// *********************************************** -// For more comprehensive examples of custom -// commands please read more here: -// https://on.cypress.io/custom-commands -// *********************************************** -// -// -import rippleCommands from '@dpc-sdp/ripple-test-tools/commands.js' - -rippleCommands() diff --git a/packages/create-ripple-app/template/_tests/_common/test/e2e/support/index.js b/packages/create-ripple-app/template/_tests/_common/test/e2e/support/index.js index bf43148c2..1c99ad90c 100644 --- a/packages/create-ripple-app/template/_tests/_common/test/e2e/support/index.js +++ b/packages/create-ripple-app/template/_tests/_common/test/e2e/support/index.js @@ -13,5 +13,4 @@ // https://on.cypress.io/configuration // *********************************************************** -import 'cypress-axe' -import './commands' +require('@dpc-sdp/ripple-test-tools/commands') diff --git a/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/alert/1-BE-Alert-1.yml b/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/alert/1-BE-Alert-1.yml index b15088403..d0c489834 100644 --- a/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/alert/1-BE-Alert-1.yml +++ b/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/alert/1-BE-Alert-1.yml @@ -1,8 +1,13 @@ - entity: node type: alert title: 1-BE-Alert-1 Demo Alert - uid: 1 status: 1 + path: + - pathauto: 0 + alias: '/1-BE-Alert-1' + uid: 1 + uuid: 0566c8c7-1deb-41a7-a6e3-86ac81341a93 + nid: 81019 moderation_state: - '#process': callback: reference @@ -11,7 +16,7 @@ - workflow: editorial moderation_state: published field_call_to_action: - - uri: https://<%= domain %> + - uri: https://www.google.com title: More details # Alert type. field_alert_type: @@ -23,18 +28,6 @@ name: 'Demo Alert Type' # Sites. field_node_site: - - '#process': - callback: reference - args: - - taxonomy_term - - vid: sites - name: 'Demo Site' - - '#process': - callback: reference - args: - - taxonomy_term - - vid: sites - name: 'Demo Section 1' - '#process': callback: reference args: @@ -47,4 +40,4 @@ args: - taxonomy_term - vid: sites - name: '<%= domain %>' \ No newline at end of file + name: '<%= domain %>' diff --git a/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/alert/1-BE-Alert-2.yml b/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/alert/1-BE-Alert-2.yml index d2b155988..db90ab28c 100644 --- a/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/alert/1-BE-Alert-2.yml +++ b/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/alert/1-BE-Alert-2.yml @@ -1,8 +1,13 @@ - entity: node type: alert title: 1-BE-Alert-2 Demo Alert - uid: 1 status: 1 + path: + - pathauto: 0 + alias: '/1-BE-Alert-2' + uid: 1 + uuid: 56f0477e-a819-4b2c-83b3-0afd7057d5fb + nid: 81020 moderation_state: - '#process': callback: reference @@ -11,7 +16,7 @@ - workflow: editorial moderation_state: published field_call_to_action: - - uri: https://<%= domain %> + - uri: https://www.google.com title: More details # Alert type. field_alert_type: @@ -35,4 +40,4 @@ args: - taxonomy_term - vid: sites - name: '<%= domain %>' \ No newline at end of file + name: '<%= domain %>' diff --git a/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/authenticatedContent/1-FE-auth-content-4.yml b/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/authenticatedContent/1-FE-auth-content-4.yml new file mode 100644 index 000000000..241e51e59 --- /dev/null +++ b/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/authenticatedContent/1-FE-auth-content-4.yml @@ -0,0 +1,136 @@ +- entity: node + type: landing_page + title: 1-FE-auth-content-4 + uid: 1 + status: 1 + path: + - pathauto: 0 + alias: '/1-FE-auth-content-4' + uid: 1 + uuid: b66ab2d5-256f-44e0-a5af-b7fc4a38ef77 + nid: 90774 + moderation_state: + - '#process': + callback: reference + args: + - content_moderation_state + - workflow: editorial + moderation_state: published + # Page header. + field_featured_image: + - '#process': + callback: reference + args: + - media + - bundle: image + name: 'Demo: Melbourne tram' + field_landing_page_hero_image: + - '#process': + callback: reference + args: + - media + - bundle: image + name: 'Demo: Melbourne skyline at dusk' + field_graphical_image: + - '#process': + callback: reference + args: + - media + - bundle: image + name: 'Demo: Parliament of Victoria' + field_landing_page_intro_text: Nulla ultricies dignissim leo, posuere vestibulum erat cursus vitae + field_landing_page_summary: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam tincidunt sit amet ligula sit amet lacinia. In a leo nec tortor aliquet faucibus. + field_landing_page_hero_theme: light + field_landing_page_bg_colour: white + field_authenticated_content: + - '#process': + callback: reference + args: + - taxonomy_term + - vid: authenticated_content + name: 'test' + # Hero banner. + field_landing_page_hero_banner: + - entity: paragraph + type: hero_banner_with_cta + field_paragraph_cta: + - uri: https://www.google.com + title: Phasellus congue + field_paragraph_freetext: Nulla ultricies dignissim leo, posuere vestibulum erat cursus vitae + field_paragraph_link_text: + - uri: https://www.google.com + title: Nullam laoreet + field_paragraph_background_image: + - '#process': + callback: reference + args: + - media + - bundle: image + name: 'Demo: Staff at Treasury' + field_paragraph_theme: light + # Content Components. + # field_show_table_of_content: 1 + field_landing_page_component: + # Basic Text. + - entity: paragraph + type: basic_text + field_paragraph_body: + - format: rich_text + value: | +

Nulla ultricies dignissim leo, posuere vestibulum erat cursus vitae

+

Phasellus congue aliquam vehicula

+

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam tincidunt sit amet ligula sit amet lacinia. In a leo nec tortor aliquet faucibus. Quisque nec congue ligula, vitae condimentum tellus. Nulla nec urna augue. Curabitur commodo nisi est, eu pulvinar tortor cursus vel. Morbi dictum ex est, et semper diam finibus eu. Cras rutrum, nunc a fringilla convallis, massa est vulputate velit, in blandit augue dui vitae elit. Donec hendrerit commodo augue, in maximus orci tempor congue. Mauris ultricies euismod orci, nec vehicula quam vehicula ac. Nunc dictum tortor dolor, nec eleifend orci luctus sed.

+

Donec scelerisque cursus ex varius efficitur

+

Morbi cursus placerat mi

+
Nullam laoreet ante placerat
+

Integer interdum nisl ut neque dictum, et sagittis metus feugiat. Sed in mattis neque. Duis at risus non ipsum semper dapibus. Sed enim sapien, molestie sed commodo vel, lacinia vitae risus. Proin sagittis diam nisi, sed rhoncus diam varius id. Sed malesuada felis tortor, scelerisque pretium elit tempor non. Pellentesque ultrices volutpat tincidunt. Fusce quis viverra urna, quis finibus nulla.

+
+

Mauris tincidunt tincidunt felis vel tempus. Vestibulum rhoncus blandit justo quis finibus. Phasellus lacus lectus, sollicitudin sed posuere non, ultricies ut quam.

+ +
+
Mauris tincidunt tincidunt felis vel tempus
+ +

Phasellus in varius leo. Suspendisse potenti. Donec scelerisque cursus ex varius efficitur. Vivamus pretium nisi sed libero accumsan mattis. Duis convallis, velit eget varius tempus, orci erat aliquam sem, eget porta mauris nisl at mauris.

+ + # Topic and Tags. + field_topic: + - '#process': + callback: reference + args: + - taxonomy_term + - vid: topic + name: 'Demo Topic' + # Add authenticated content + field_authenticated_content: + - '#process': + callback: reference + args: + - taxonomy_term + - vid: authenticated_content + name: test + field_tags: + - '#process': + callback: reference + args: + - taxonomy_term + - vid: tags + name: 'Demo Tag' + field_node_site: + - '#process': + callback: reference + args: + - taxonomy_term + - vid: sites + name: '<%= domain %>' + field_node_primary_site: + - '#process': + callback: reference + args: + - taxonomy_term + - vid: sites + name: '<%= domain %>' diff --git a/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/authenticatedContent/taxonomy.yml b/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/authenticatedContent/taxonomy.yml new file mode 100644 index 000000000..97f3351d9 --- /dev/null +++ b/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/authenticatedContent/taxonomy.yml @@ -0,0 +1,3 @@ +- entity: "taxonomy_term" + vid: "authenticated_content" + name: "test" diff --git a/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/content-preview/1-fe-content-preview-1.yml b/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/content-preview/1-fe-content-preview-1.yml new file mode 100644 index 000000000..368ecab95 --- /dev/null +++ b/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/content-preview/1-fe-content-preview-1.yml @@ -0,0 +1,128 @@ +- entity: node + type: landing_page + title: 1-FE-content-preview-1 + uid: 11222 + uuid: e9db742d-3a43-40fa-81e2-f81b4f0f7a27 + nid: 80903 + path: + - pathauto: 0 + alias: '/1-FE-content-preview-1' + status: 0 + moderation_state: + - '#process': + callback: reference + args: + - content_moderation_state + - workflow: editorial + moderation_state: draft + # Page header. + field_featured_image: + - '#process': + callback: reference + args: + - media + - bundle: image + name: 'Demo: Melbourne tram' + field_landing_page_hero_image: + - '#process': + callback: reference + args: + - media + - bundle: image + name: 'Demo: Melbourne skyline at dusk' + field_graphical_image: + - '#process': + callback: reference + args: + - media + - bundle: image + name: 'Demo: Parliament of Victoria' + field_landing_page_intro_text: Nulla ultricies dignissim leo, posuere vestibulum erat cursus vitae + field_landing_page_summary: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam tincidunt sit amet ligula sit amet lacinia. In a leo nec tortor aliquet faucibus. + field_landing_page_hero_theme: light + field_landing_page_bg_colour: white + # Hero banner. + field_landing_page_hero_banner: + - entity: paragraph + type: hero_banner_with_cta + field_paragraph_cta: + - uri: https://www.google.com + title: Phasellus congue + field_paragraph_freetext: Nulla ultricies dignissim leo, posuere vestibulum erat cursus vitae + field_paragraph_link_text: + - uri: https://www.google.com + title: Nullam laoreet + field_paragraph_background_image: + - '#process': + callback: reference + args: + - media + - bundle: image + name: 'Demo: Staff at Treasury' + field_paragraph_theme: light + # Content Components. + # field_show_table_of_content: 1 + field_landing_page_component: + # Basic Text. + - entity: paragraph + type: basic_text + field_paragraph_body: + - format: rich_text + value: | +

Nulla ultricies dignissim leo, posuere vestibulum erat cursus vitae

+

Phasellus congue aliquam vehicula

+

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam tincidunt sit amet ligula sit amet lacinia. In a leo nec tortor aliquet faucibus. Quisque nec congue ligula, vitae condimentum tellus. Nulla nec urna augue. Curabitur commodo nisi est, eu pulvinar tortor cursus vel. Morbi dictum ex est, et semper diam finibus eu. Cras rutrum, nunc a fringilla convallis, massa est vulputate velit, in blandit augue dui vitae elit. Donec hendrerit commodo augue, in maximus orci tempor congue. Mauris ultricies euismod orci, nec vehicula quam vehicula ac. Nunc dictum tortor dolor, nec eleifend orci luctus sed.

+

Donec scelerisque cursus ex varius efficitur

+

Morbi cursus placerat mi

+
Nullam laoreet ante placerat
+

Integer interdum nisl ut neque dictum, et sagittis metus feugiat. Sed in mattis neque. Duis at risus non ipsum semper dapibus. Sed enim sapien, molestie sed commodo vel, lacinia vitae risus. Proin sagittis diam nisi, sed rhoncus diam varius id. Sed malesuada felis tortor, scelerisque pretium elit tempor non. Pellentesque ultrices volutpat tincidunt. Fusce quis viverra urna, quis finibus nulla.

+
+

Mauris tincidunt tincidunt felis vel tempus. Vestibulum rhoncus blandit justo quis finibus. Phasellus lacus lectus, sollicitudin sed posuere non, ultricies ut quam.

+ +
+
Mauris tincidunt tincidunt felis vel tempus
+ +

Phasellus in varius leo. Suspendisse potenti. Donec scelerisque cursus ex varius efficitur. Vivamus pretium nisi sed libero accumsan mattis. Duis convallis, velit eget varius tempus, orci erat aliquam sem, eget porta mauris nisl at mauris.

+ + # Topic and Tags. + field_topic: + - '#process': + callback: reference + args: + - taxonomy_term + - vid: topic + name: 'Demo Topic' + # Add authenticated content + field_authenticated_content: + - '#process': + callback: reference + args: + - taxonomy_term + - vid: authenticated_content + name: 'test1' + field_tags: + - '#process': + callback: reference + args: + - taxonomy_term + - vid: tags + name: 'Demo Tag' + field_node_site: + - '#process': + callback: reference + args: + - taxonomy_term + - vid: sites + name: '<%= domain %>' + field_node_primary_site: + - '#process': + callback: reference + args: + - taxonomy_term + - vid: sites + name: '<%= domain %>' diff --git a/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/data-driven-component/1-data-driven-component.yml b/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/data-driven-component/1-data-driven-component.yml new file mode 100644 index 000000000..e69de29bb diff --git a/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/event/2-BE-event-1.yml b/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/event/2-BE-event-1.yml index d4a52f83f..dfadd42d6 100644 --- a/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/event/2-BE-event-1.yml +++ b/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/event/2-BE-event-1.yml @@ -61,7 +61,7 @@ - uri: http://www.weatherzone.com.au/vic/central/healesville # Event author. field_node_author: Full Name - field_node_email: jeremy.mcmillan@dpc.vic.gov.au + field_node_email: test.user@dpc.<%= domain %> field_node_phone: '12345678' # Related links field_show_related_content: 1 @@ -69,12 +69,12 @@ - entity: paragraph type: related_links field_paragraph_link: - - uri: https://www.vic.gov.au + - uri: https://www.google.com title: State Government of Victoria - entity: paragraph type: related_links field_paragraph_link: - - uri: https://www.vic.gov.au/department-premier-and-cabinet + - uri: https://www.google.com title: Department of Premier and Cabinet # Contact. field_landing_page_show_contact: 1 @@ -83,7 +83,7 @@ type: contact_us field_paragraph_title: Victorian Government field_paragraph_name: Victorian Government - field_paragraph_email: no-reply@vic.gov.au + field_paragraph_email: no-reply@<%= domain %> field_paragraph_department_name: Department of Premier and Cabinet field_paragraph_location: - country_code: AU @@ -166,4 +166,4 @@ args: - taxonomy_term - vid: sites - name: 'Demo Site' \ No newline at end of file + name: 'Demo Site' diff --git a/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/grant/tc-9a-grant.yml b/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/grant/tc-9a-grant.yml new file mode 100644 index 000000000..c8026aad5 --- /dev/null +++ b/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/grant/tc-9a-grant.yml @@ -0,0 +1,169 @@ +- entity: node + type: grant + title: TC-9a Grant Simple Test - Date Range + path: + - pathauto: 0 + alias: '/tc-9a-grant' + uid: 1 + uuid: 27430be1-39cd-45e8-9e1e-bca46b1e50f9 + nid: 70919 + status: 1 + moderation_state: + - '#process': + callback: reference + args: + - content_moderation_state + - workflow: editorial + moderation_state: published + # Page header. + field_featured_image: + - '#process': + callback: reference + args: + - media + - bundle: image + name: 'Demo: Melbourne tram' + field_landing_page_intro_text: 'Blah blah' + field_overview_title: 'Overview title' + field_audience: + - '#process': + callback: reference + args: + - taxonomy_term + - vid: audience + name: 'Business' + field_call_to_action: + - uri: https://www.google.com + title: More details + field_node_phone: '12345678' + field_node_department: + - '#process': + callback: reference + args: + - taxonomy_term + - vid: department + name: 'Demo Department' + field_news_intro_text: 'news intro test' + field_description: 'Description' + field_node_author: 'bob' + field_node_email: 'test@testr.com' + field_node_funding_level: + - from: '11326' + to: '26494' + field_node_dates: + - value: '2019-04-08T08:00:00' + end_value: '2019-05-08T10:00:00' + field_node_guidelines: + - entity: paragraph + type: accordion + field_paragraph_title: Guidelines + field_paragraph_accordion_style: basic + field_paragraph_accordion: + - entity: paragraph + type: accordion_content + field_paragraph_accordion_name: 'Eligibility' + field_paragraph_accordion_body: 'Lorem ipsum' + - entity: paragraph + type: accordion_content + field_paragraph_accordion_name: 'Assessment criteria' + field_paragraph_accordion_body: 'Lorem ipsum' + - entity: paragraph + type: accordion_content + field_paragraph_accordion_name: 'Assessment process' + field_paragraph_accordion_body: 'Lorem ipsum' + - entity: paragraph + type: accordion_content + field_paragraph_accordion_name: 'How to apply' + field_paragraph_accordion_body: 'Lorem ipsum' + field_node_on_going: false + field_node_documents: + - '#process': + callback: reference + args: + - media + - bundle: document + name: 'Demo Sample Document' + field_node_timeline: + - entity: paragraph + type: timelines + field_paragraph_title: Demo Timeline + field_timeline: + - entity: paragraph + type: timeline + field_paragraph_title: Demo Timeline Item + field_paragraph_date_range: + - value: '2020-01-01T08:00:00' + end_value: '2020-01-01T10:00:00' + field_paragraph_link: https://www.google.com + field_paragraph_media: + - '#process': + callback: reference + args: + - media + - bundle: image + name: 'Demo: Melbourne tram' + field_paragraph_summary: Mauris tincidunt tincidunt felis vel tempus. Vestibulum rhoncus blandit justo quis finibus. + - entity: paragraph + type: timeline + field_paragraph_title: Demo Timeline Item 2 + field_paragraph_cta_text: Alternative + field_paragraph_link: https://www.google.com + field_paragraph_media: + - '#process': + callback: reference + args: + - media + - bundle: image + name: 'Demo: Melbourne tram' + field_paragraph_summary: Anim excepteur magna eu aliqua quis velit voluptate sit culpa. + # Other. + field_show_social_sharing: 1 + field_show_content_rating: 1 + field_show_table_of_content: 1 + field_topic: + - '#process': + callback: reference + args: + - taxonomy_term + - vid: topic + name: 'Demo Topic' + field_tags: + - '#process': + callback: reference + args: + - taxonomy_term + - vid: tags + name: 'Demo Tag' + - '#process': + callback: reference + args: + - taxonomy_term + - vid: tags + name: 'Another Demo Tag' + # Sites. + field_node_site: + - '#process': + callback: reference + args: + - taxonomy_term + - vid: sites + name: 'Demo Site' + - '#process': + callback: reference + args: + - taxonomy_term + - vid: sites + name: 'Demo Section 1' + - '#process': + callback: reference + args: + - taxonomy_term + - vid: sites + name: 'Another Demo Site' + field_node_primary_site: + - '#process': + callback: reference + args: + - taxonomy_term + - vid: sites + name: 'Demo Site' diff --git a/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/grant/tc-9b-grant.yml b/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/grant/tc-9b-grant.yml new file mode 100644 index 000000000..36d61f9c6 --- /dev/null +++ b/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/grant/tc-9b-grant.yml @@ -0,0 +1,169 @@ +- entity: node + type: grant + title: TC-9b Grant page - Closed + path: + - pathauto: 0 + alias: '/tc-9b-grant' + uid: 1 + uuid: 11f8f83c-4d9f-41e6-8480-0dd4d9287bd3 + nid: 70921 + status: 1 + moderation_state: + - '#process': + callback: reference + args: + - content_moderation_state + - workflow: editorial + moderation_state: published + # Page header. + field_featured_image: + - '#process': + callback: reference + args: + - media + - bundle: image + name: 'Demo: Melbourne tram' + field_landing_page_intro_text: 'Blah blah' + field_overview_title: 'Overview title' + field_audience: + - '#process': + callback: reference + args: + - taxonomy_term + - vid: audience + name: 'Business' + field_call_to_action: + - uri: https://www.google.com + title: More details + field_node_phone: '12345678' + field_node_department: + - '#process': + callback: reference + args: + - taxonomy_term + - vid: department + name: 'Demo Department' + field_news_intro_text: 'news intro test' + field_description: 'Description' + field_node_author: 'bob' + field_node_email: 'test@testr.com' + field_node_funding_level: + - from: '11326' + to: '26494' + field_node_dates: + - value: '2019-03-09T08:00:00' + end_value: '2019-04-09T10:00:00' + field_node_guidelines: + - entity: paragraph + type: accordion + field_paragraph_title: Guidelines + field_paragraph_accordion_style: basic + field_paragraph_accordion: + - entity: paragraph + type: accordion_content + field_paragraph_accordion_name: 'Eligibility' + field_paragraph_accordion_body: 'Lorem ipsum' + - entity: paragraph + type: accordion_content + field_paragraph_accordion_name: 'Assessment criteria' + field_paragraph_accordion_body: 'Lorem ipsum' + - entity: paragraph + type: accordion_content + field_paragraph_accordion_name: 'Assessment process' + field_paragraph_accordion_body: 'Lorem ipsum' + - entity: paragraph + type: accordion_content + field_paragraph_accordion_name: 'How to apply' + field_paragraph_accordion_body: 'Lorem ipsum' + field_node_on_going: false + field_node_documents: + - '#process': + callback: reference + args: + - media + - bundle: document + name: 'Demo Sample Document' + field_node_timeline: + - entity: paragraph + type: timelines + field_paragraph_title: Demo Timeline + field_timeline: + - entity: paragraph + type: timeline + field_paragraph_title: Demo Timeline Item + field_paragraph_date_range: + - value: '2020-01-01T08:00:00' + end_value: '2020-01-01T10:00:00' + field_paragraph_link: https://www.google.com + field_paragraph_media: + - '#process': + callback: reference + args: + - media + - bundle: image + name: 'Demo: Melbourne tram' + field_paragraph_summary: Mauris tincidunt tincidunt felis vel tempus. Vestibulum rhoncus blandit justo quis finibus. + - entity: paragraph + type: timeline + field_paragraph_title: Demo Timeline Item 2 + field_paragraph_cta_text: Alternative + field_paragraph_link: https://www.google.com + field_paragraph_media: + - '#process': + callback: reference + args: + - media + - bundle: image + name: 'Demo: Melbourne tram' + field_paragraph_summary: Anim excepteur magna eu aliqua quis velit voluptate sit culpa. + # Other. + field_show_social_sharing: 1 + field_show_content_rating: 1 + field_show_table_of_content: 1 + field_topic: + - '#process': + callback: reference + args: + - taxonomy_term + - vid: topic + name: 'Demo Topic' + field_tags: + - '#process': + callback: reference + args: + - taxonomy_term + - vid: tags + name: 'Demo Tag' + - '#process': + callback: reference + args: + - taxonomy_term + - vid: tags + name: 'Another Demo Tag' + # Sites. + field_node_site: + - '#process': + callback: reference + args: + - taxonomy_term + - vid: sites + name: 'Demo Site' + - '#process': + callback: reference + args: + - taxonomy_term + - vid: sites + name: 'Demo Section 1' + - '#process': + callback: reference + args: + - taxonomy_term + - vid: sites + name: 'Another Demo Site' + field_node_primary_site: + - '#process': + callback: reference + args: + - taxonomy_term + - vid: sites + name: 'Demo Site' diff --git a/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/landingPage/5-be-land-3-landing-page-complete-test.yml b/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/landingPage/5-be-land-3-landing-page-complete-test.yml index d6adc419b..ae7b67a24 100644 --- a/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/landingPage/5-be-land-3-landing-page-complete-test.yml +++ b/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/landingPage/5-be-land-3-landing-page-complete-test.yml @@ -40,11 +40,11 @@ - entity: paragraph type: hero_banner_with_cta field_paragraph_cta: - - uri: https://www.vic.gov.au + - uri: https://www.google.com title: Phasellus congue field_paragraph_freetext: Nulla ultricies dignissim leo, posuere vestibulum erat cursus vitae field_paragraph_link_text: - - uri: https://vic.gov.au + - uri: https://www.google.com title: Nullam laoreet field_paragraph_background_image: - '#process': @@ -60,12 +60,12 @@ type: key_journeys field_paragraph_title: 'Want to know more about...' field_paragraph_links: - - uri: 'https://vic.gov.au' + - uri: 'https://www.google.com' title: Nullam laoreet - - uri: 'https://vic.gov.au' + - uri: 'https://www.google.com' title: Morbi cursus placerat mi field_paragraph_cta: - - uri: https://vic.gov.au + - uri: https://www.google.com title: Nullam laoreet # Header components. field_landing_page_header: @@ -74,9 +74,9 @@ field_paragraph_title: Nulla ultricies dignissim leo, posuere vestibulum erat cursus vitae field_paragraph_summary: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam tincidunt sit amet ligula sit amet lacinia. In a leo nec tortor aliquet faucibus. field_paragraph_links: - - uri: 'https://vic.gov.au' + - uri: 'https://www.google.com' title: Nullam laoreet - - uri: 'https://vic.gov.au' + - uri: 'https://www.google.com' title: Morbi cursus placerat mi # Campaigns. field_landing_page_c_primary: @@ -144,7 +144,7 @@ name: 'Demo: Melbourne tram' field_paragraph_body: 'Mauris tincidunt tincidunt felis vel tempus. Vestibulum rhoncus blandit justo quis finibus. Phasellus lacus lectus, sollicitudin sed posuere non, ultricies ut quam.' field_paragraph_cta: - - uri: https://vic.gov.au + - uri: https://www.google.com title: Victorian Government field_paragraph_cta_style: banner # Card carousel. @@ -189,7 +189,7 @@ address_line1: 35 Collins St field_paragraph_summary: Mauris tincidunt tincidunt felis vel tempus. Vestibulum rhoncus blandit justo quis finibus. field_paragraph_cta: - - uri: https://www.vic.gov.au + - uri: https://www.google.com title: Read more - entity: paragraph type: card_event @@ -219,7 +219,7 @@ address_line1: 35 Collins St field_paragraph_summary: Mauris tincidunt tincidunt felis vel tempus. Vestibulum rhoncus blandit justo quis finibus. field_paragraph_cta: - - uri: https://www.vic.gov.au + - uri: https://www.google.com title: Read more # Card Event. - entity: paragraph @@ -262,7 +262,7 @@ name: 'Demo: Melbourne tram' field_paragraph_summary: Mauris tincidunt tincidunt felis vel tempus. Vestibulum rhoncus blandit justo quis finibus. field_paragraph_link: - - uri: https://www.vic.gov.au + - uri: https://www.google.com title: Vestibulum rhoncus field_paragraph_topic: - '#process': @@ -277,7 +277,7 @@ field_paragraph_title: 'Card Promotion' field_paragraph_summary: Mauris tincidunt tincidunt felis vel tempus. Vestibulum rhoncus blandit justo quis finibus. field_paragraph_link: - - uri: https://www.vic.gov.au + - uri: https://www.google.com title: Vestibulum rhoncus # Card navigation featured. - entity: paragraph @@ -285,7 +285,7 @@ field_paragraph_title: 'Card Promotion' field_paragraph_summary: Mauris tincidunt tincidunt felis vel tempus. Vestibulum rhoncus blandit justo quis finibus. field_paragraph_link: - - uri: https://www.vic.gov.au + - uri: https://www.google.com title: Vestibulum rhoncus field_paragraph_media: - '#process': @@ -304,7 +304,7 @@ field_paragraph_title: 'Demo Key Date' field_paragraph_summary: 'First key date summary.' field_paragraph_link: - - uri: https://www.vic.gov.au + - uri: https://www.google.com title: First key date link - entity: paragraph type: keydates @@ -312,10 +312,10 @@ field_paragraph_title: 'Demo Key Date 2' field_paragraph_summary: 'Second key date summary.' field_paragraph_link: - - uri: https://www.vic.gov.au + - uri: https://www.google.com title: Second key date link field_paragraph_cta: - - uri: https://www.vic.gov.au + - uri: https://www.google.com title: Read more # Card promotion auto. - entity: paragraph @@ -408,7 +408,7 @@ - bundle: image name: 'Demo: Melbourne tram' field_paragraph_cta: - - uri: https://www.vic.gov.au + - uri: https://www.google.com title: See more # Timelines - entity: paragraph @@ -421,7 +421,7 @@ field_paragraph_date_range: - value: '2020-01-01T08:00:00' end_value: '2020-01-01T10:00:00' - field_paragraph_link: https://www.vic.gov.au + field_paragraph_link: https://www.google.com field_paragraph_media: - '#process': callback: reference @@ -434,7 +434,7 @@ type: timeline field_paragraph_title: Demo Timeline Item 2 field_paragraph_cta_text: Alternative - field_paragraph_link: https://www.vic.gov.au + field_paragraph_link: https://www.google.com field_paragraph_media: - '#process': callback: reference @@ -449,12 +449,12 @@ - entity: paragraph type: links field_paragraph_link: - - uri: https://www.vic.gov.au + - uri: https://www.google.com title: State Government of Victoria - entity: paragraph type: links field_paragraph_link: - - uri: https://www.vic.gov.au/department-premier-and-cabinet + - uri: https://www.google.com title: Department of Premier and Cabinet # Related links field_show_related_content: 1 @@ -462,12 +462,12 @@ - entity: paragraph type: related_links field_paragraph_link: - - uri: https://www.vic.gov.au + - uri: https://www.google.com title: State Government of Victoria - entity: paragraph type: related_links field_paragraph_link: - - uri: https://www.vic.gov.au/department-premier-and-cabinet + - uri: https://www.google.com title: Department of Premier and Cabinet # Contact. field_landing_page_show_contact: 1 @@ -476,7 +476,7 @@ type: contact_us field_paragraph_title: Victorian Government field_paragraph_name: Victorian Government - field_paragraph_email: no-reply@vic.gov.au + field_paragraph_email: no-reply@<%= domain %> field_paragraph_department_name: Department of Premier and Cabinet field_paragraph_location: - country_code: AU @@ -529,6 +529,12 @@ - taxonomy_term - vid: sites name: '<%= domain %>' + - '#process': + callback: reference + args: + - taxonomy_term + - vid: sites + name: 'demo.<%= domain %>' field_node_primary_site: - '#process': callback: reference diff --git a/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/media/embedded-video-no-transcript.yml b/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/media/embedded-video-no-transcript.yml new file mode 100644 index 000000000..ba8b14c58 --- /dev/null +++ b/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/media/embedded-video-no-transcript.yml @@ -0,0 +1,19 @@ +- entity: media + bundle: embedded_video + name: 'Embedded video test - no transcript' + uid: 1 + uuid: 90db91cb-eb81-41ee-b87f-6cee6ef67b86 + mid: 17009 + path: + - pathauto: 0 + alias: '/test-embedded-video-no-transcript' + status: 1 + field_media_video_embed_field: 'https://www.youtube.com/watch?v=pZRrtGYx7EM' + field_media_link: 'View transcript' + field_license_type: + - '#process': + callback: reference + args: + - taxonomy_term + - vid: license_type + name: 'Demo License' diff --git a/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/media/embedded-video-test.yml b/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/media/embedded-video-test.yml new file mode 100644 index 000000000..f9543f656 --- /dev/null +++ b/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/media/embedded-video-test.yml @@ -0,0 +1,64 @@ +- entity: node + type: landing_page + title: Embedded video test + status: 1 + moderation_state: + - '#process': + callback: reference + args: + - content_moderation_state + - workflow: editorial + moderation_state: published + # Page header. + + field_landing_page_summary: Embedded video test. + field_landing_page_hero_theme: light + field_landing_page_bg_colour: white + + # Content Components. + field_landing_page_component: + # Basic Text. + - entity: paragraph + type: basic_text + field_paragraph_body: + - format: rich_text + value: | +

Victorian women say thank you

+ +

In September 2019, recipients of the 2019 Queen’s Birthday Honours were presented with their Order of Australia medals, by the Governor at official ceremonies at Government House, Melbourne.

+ +

In April 2019, recipients of the 2019 Australian Day Honours were presented with their Order of Australia medals, by the Governor at official ceremonies at Government House, Melbourne.

+ + # Other. + field_show_social_sharing: 0 + field_show_content_rating: 0 + field_show_site_section_nav: 0 + # Topic and Tags. + field_topic: + - '#process': + callback: reference + args: + - taxonomy_term + - vid: topic + name: 'Equality' + # Sites. + field_node_site: + - '#process': + callback: reference + args: + - taxonomy_term + - vid: sites + name: '<%= domain %>' + - '#process': + callback: reference + args: + - taxonomy_term + - vid: sites + name: 'demo.<%= domain %>' + field_node_primary_site: + - '#process': + callback: reference + args: + - taxonomy_term + - vid: sites + name: '<%= domain %>' diff --git a/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/media/embedded-video.yml b/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/media/embedded-video.yml new file mode 100644 index 000000000..83de5e0b4 --- /dev/null +++ b/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/media/embedded-video.yml @@ -0,0 +1,20 @@ +- entity: media + bundle: embedded_video + name: 'Demo: Wodonga Local Aboriginal Network - Bringing People Together' + uid: 1 + status: 1 + uuid: fa4aba0b-a58a-40c2-9a8d-2234ed555577 + mid: 17008 + path: + - pathauto: 0 + alias: '/test-embedded-video' + field_media_video_embed_field: 'https://www.youtube.com/watch?v=pZRrtGYx7EM' + field_media_link: 'View transcript' + field_media_transcript: 'this is the transcript' + field_license_type: + - '#process': + callback: reference + args: + - taxonomy_term + - vid: license_type + name: 'Demo License' diff --git a/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/news/news.yml b/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/news/news-1.yml similarity index 87% rename from packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/news/news.yml rename to packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/news/news-1.yml index d9e60c522..2630d71a7 100644 --- a/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/news/news.yml +++ b/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/news/news-1.yml @@ -1,7 +1,6 @@ - entity: node type: news - uuid: 11dede11-10c0-111e1-1100-000000000320 - title: Demo News + title: Test news page 1 uid: 1 status: 1 moderation_state: @@ -59,12 +58,12 @@ - entity: paragraph type: related_links field_paragraph_link: - - uri: https://www.vic.gov.au + - uri: https://www.google.com title: State Government of Victoria - entity: paragraph type: related_links field_paragraph_link: - - uri: https://www.vic.gov.au/department-premier-and-cabinet + - uri: https://www.google.com title: Department of Premier and Cabinet # Other. field_show_social_sharing: 1 @@ -85,26 +84,8 @@ - taxonomy_term - vid: tags name: 'Demo Tag' - - '#process': - callback: reference - args: - - taxonomy_term - - vid: tags - name: 'Another Demo Tag' - # Sites. + # Sites. field_node_site: - - '#process': - callback: reference - args: - - taxonomy_term - - vid: sites - name: 'Demo Site' - - '#process': - callback: reference - args: - - taxonomy_term - - vid: sites - name: 'Demo Section 1' - '#process': callback: reference args: @@ -117,4 +98,4 @@ args: - taxonomy_term - vid: sites - name: '<%= domain %>' \ No newline at end of file + name: '<%= domain %>' diff --git a/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/news/news-2.yml b/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/news/news-2.yml new file mode 100644 index 000000000..55cfec63d --- /dev/null +++ b/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/news/news-2.yml @@ -0,0 +1,101 @@ +- entity: node + type: news + title: Test news page 2 + uid: 1 + status: 1 + moderation_state: + - '#process': + callback: reference + args: + - content_moderation_state + - workflow: editorial + moderation_state: published + # Page Header. + field_news_date: + - value: '2019-07-01T23:00:00' + field_featured_image: + - '#process': + callback: reference + args: + - media + - bundle: image + name: 'Demo: Melbourne tram' + field_news_intro_text: Nulla ultricies dignissim leo, posuere vestibulum erat cursus vitae + field_node_department: + - '#process': + callback: reference + args: + - taxonomy_term + - vid: department + name: 'Demo Department' + field_location: + - '#process': + callback: reference + args: + - taxonomy_term + - vid: location + name: 'Western metropolitan Melbourne' + # Body content. + body: + - format: rich_text + value: | +

Nulla ultricies dignissim leo, posuere vestibulum erat cursus vitae

+

Phasellus congue aliquam vehicula

+

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam tincidunt sit amet ligula sit amet lacinia. In a leo nec tortor aliquet faucibus. Quisque nec congue ligula, vitae condimentum tellus. Nulla nec urna augue. Curabitur commodo nisi est, eu pulvinar tortor cursus vel. Morbi dictum ex est, et semper diam finibus eu. Cras rutrum, nunc a fringilla convallis, massa est vulputate velit, in blandit augue dui vitae elit. Donec hendrerit commodo augue, in maximus orci tempor congue. Mauris ultricies euismod orci, nec vehicula quam vehicula ac. Nunc dictum tortor dolor, nec eleifend orci luctus sed.

+

Donec scelerisque cursus ex varius efficitur

+

Morbi cursus placerat mi

+
Nullam laoreet ante placerat
+

Integer interdum nisl ut neque dictum, et sagittis metus feugiat. Sed in mattis neque. Duis at risus non ipsum semper dapibus. Sed enim sapien, molestie sed commodo vel, lacinia vitae risus. Proin sagittis diam nisi, sed rhoncus diam varius id. Sed malesuada felis tortor, scelerisque pretium elit tempor non. Pellentesque ultrices volutpat tincidunt. Fusce quis viverra urna, quis finibus nulla.

+
+

Mauris tincidunt tincidunt felis vel tempus. Vestibulum rhoncus blandit justo quis finibus. Phasellus lacus lectus, sollicitudin sed posuere non, ultricies ut quam.

+ +
+
Mauris tincidunt tincidunt felis vel tempus
+ +

Phasellus in varius leo. Suspendisse potenti. Donec scelerisque cursus ex varius efficitur. Vivamus pretium nisi sed libero accumsan mattis. Duis convallis, velit eget varius tempus, orci erat aliquam sem, eget porta mauris nisl at mauris.

+ + # Related links + field_show_related_content: 1 + field_related_links: + - entity: paragraph + type: related_links + field_paragraph_link: + - uri: https://www.google.com + title: State Government of Victoria + - entity: paragraph + type: related_links + field_paragraph_link: + - uri: https://www.google.com + title: Department of Premier and Cabinet + # Other. + field_show_social_sharing: 1 + field_show_content_rating: 1 + field_show_table_of_content: 1 + # Topic and Tags. + field_topic: + - '#process': + callback: reference + args: + - taxonomy_term + - vid: topic + name: 'Demo Topic' + # Sites. + field_node_site: + - '#process': + callback: reference + args: + - taxonomy_term + - vid: sites + name: '<%= domain %>' + field_node_primary_site: + - '#process': + callback: reference + args: + - taxonomy_term + - vid: sites + name: '<%= domain %>' diff --git a/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/page/8-BE-page-1-basic-page.yml b/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/page/8-BE-page-1-basic-page.yml index 22daa1e02..b444423f5 100644 --- a/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/page/8-BE-page-1-basic-page.yml +++ b/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/page/8-BE-page-1-basic-page.yml @@ -47,21 +47,19 @@
Mauris tincidunt tincidunt felis vel tempus
-

Phasellus in varius leo. Suspendisse potenti. Donec scelerisque cursus ex varius efficitur. Vivamus pretium nisi sed libero accumsan mattis. Duis convallis, velit eget varius tempus, orci erat aliquam sem, eget porta mauris nisl at mauris.

- # What's Next. field_show_whats_next: 1 field_whats_next: - entity: paragraph type: links field_paragraph_link: - - uri: https://www.vic.gov.au + - uri: https://www.google.com title: State Government of Victoria - entity: paragraph type: links field_paragraph_link: - - uri: https://www.vic.gov.au/department-premier-and-cabinet + - uri: https://www.google.com title: Department of Premier and Cabinet # Related links field_show_related_content: 1 @@ -69,12 +67,12 @@ - entity: paragraph type: related_links field_paragraph_link: - - uri: https://emergency.vic.gov.au/respond/# + - uri: https://www.google.com title: Related Link external text - entity: paragraph type: related_links field_paragraph_link: - - uri: https://www.vic.gov.au/department-premier-and-cabinet + - uri: https://www.google.com title: Department of Premier and Cabinet # Other. field_show_social_sharing: 1 @@ -115,4 +113,4 @@ args: - taxonomy_term - vid: sites - name: '<%= domain %>' \ No newline at end of file + name: '<%= domain %>' diff --git a/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/page/8-FE-page-1-figure.html b/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/page/8-FE-page-1-figure.html new file mode 100644 index 000000000..50181159c --- /dev/null +++ b/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/page/8-FE-page-1-figure.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/alert/1-BE-Alert-3.yml b/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/page/anchorlinktest.yml similarity index 54% rename from packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/alert/1-BE-Alert-3.yml rename to packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/page/anchorlinktest.yml index 8c923ce2f..9137b45ee 100644 --- a/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/alert/1-BE-Alert-3.yml +++ b/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/page/anchorlinktest.yml @@ -1,7 +1,6 @@ - entity: node - type: alert - title: 1-BE-Alert-3 Demo Alert - uid: 1 + type: page + title: Anchorlink test status: 1 moderation_state: - '#process': @@ -10,17 +9,28 @@ - content_moderation_state - workflow: editorial moderation_state: published - field_call_to_action: - - uri: https://<%= domain %> - title: More details - # Alert type. - field_alert_type: + field_page_intro_text: test + # Body content. + body: + - format: rich_text + value: | +

heading

+ Test link + # Topic and Tags. + field_topic: - '#process': callback: reference args: - taxonomy_term - - vid: alert_type - name: 'Flood' + - vid: topic + name: 'Demo Topic' + field_tags: + - '#process': + callback: reference + args: + - taxonomy_term + - vid: tags + name: 'Demo Tag' # Sites. field_node_site: - '#process': @@ -35,4 +45,4 @@ args: - taxonomy_term - vid: sites - name: '<%= domain %>' \ No newline at end of file + name: '<%= domain %>' diff --git a/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/profile/4-BE-Profile-1.html b/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/profile/4-BE-Profile-1.html new file mode 100644 index 000000000..9e19d14e3 --- /dev/null +++ b/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/profile/4-BE-Profile-1.html @@ -0,0 +1 @@ +

So now all who escaped death in battle or by shipwreck had got safely home except Ulysses, and he, though he was longing to return to his wife and country, was detained by the goddess Calypso, who had got him into a large cave and wanted to marry him. But as years went by, there came a time when the gods settled that he should go back to Ithaca; even then, however, when he was among his own people, his troubles were not yet over; nevertheless all the gods had now begun to pity him except Neptune, who still persecuted him without ceasing and would not let him get home.

\ No newline at end of file diff --git a/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/profile/4-BE-Profile-1.yml b/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/profile/4-BE-Profile-1.yml new file mode 100644 index 000000000..3fc08672e --- /dev/null +++ b/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/profile/4-BE-Profile-1.yml @@ -0,0 +1,82 @@ +- entity: node + type: profile + title: Profile-4-BE-profile-1 + uid: 1 + status: 1 + moderation_state: + - '#process': + callback: reference + args: + - content_moderation_state + - workflow: editorial + moderation_state: published + field_landing_page_summary: As I walked out one evening, Walking down Bristol Street, The crowds upon the pavement Were fields of harvest wheat. And down by the brimming river I heard a lover sing Under an arch of the railway. Love has no ending. But all the clocks in the city Began to whirr and chime 'O let not Time deceive you, You cannot conquer Time. + field_profile_intro_text: Nulla ultricies dignissim leo, posuere vestibulum erat cursus vitae + # Profile Detail + field_featured_image: + - '#process': + callback: reference + args: + - media + - bundle: image + name: 'Demo: Melbourne tram' + field_profile_category: + - '#process': + callback: reference + args: + - taxonomy_term + - vid: profile_category + name: 'Trailblazer' + field_expertise: + - '#process': + callback: reference + args: + - taxonomy_term + - vid: expertise + name: 'Business and finance' + field_year: + - value: '2017' + field_life_span: + - value: 'Life span text' + field_location: + - '#process': + callback: reference + args: + - taxonomy_term + - vid: location + name: 'Eastern metropolitan Melbourne' + body: + - format: rich_text + value: | +

So now all who escaped death in battle or by shipwreck had got safely home except Ulysses, and he, though he was longing to return to his wife and country, was detained by the goddess Calypso, who had got him into a large cave and wanted to marry him. But as years went by, there came a time when the gods settled that he should go back to Ithaca; even then, however, when he was among his own people, his troubles were not yet over; nevertheless all the gods had now begun to pity him except Neptune, who still persecuted him without ceasing and would not let him get home.

+ # Secondary Campaign + field_landing_page_c_secondary: + - '#process': + callback: reference + args: + - block_content + - type: campaign + field_block_title: 'LGBTI inclusive language guide' + # Topic and Tags. + field_topic: + - '#process': + callback: reference + args: + - taxonomy_term + - vid: topic + name: 'Education' + # Sites. + field_node_site: + - '#process': + callback: reference + args: + - taxonomy_term + - vid: sites + name: '<%= domain %>' + field_node_primary_site: + - '#process': + callback: reference + args: + - taxonomy_term + - vid: sites + name: '<%= domain %>' diff --git a/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/publication/17-BE-pub-1-Create-Parent-Page.yml b/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/publication/17-BE-pub-1-Create-Parent-Page.yml new file mode 100644 index 000000000..f77f399ca --- /dev/null +++ b/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/publication/17-BE-pub-1-Create-Parent-Page.yml @@ -0,0 +1,113 @@ +- entity: node + type: publication + title: 17-BE-pub-1 Create Parent Page + uid: 1 + status: 1 + moderation_state: + - '#process': + callback: reference + args: + - content_moderation_state + - workflow: editorial + moderation_state: published + # Page header. + field_publication_date: '2019-06-25' + field_featured_image: + - '#process': + callback: reference + args: + - media + - bundle: image + name: 'Demo: Melbourne tram' + field_license_type: + - '#process': + callback: reference + args: + - taxonomy_term + - vid: license_type + name: Copyright + field_landing_page_intro_text: INTRO Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like). END + field_landing_page_summary: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam tincidunt sit amet ligula sit amet lacinia. In a leo nec tortor aliquet faucibus. + # Content Components. + field_show_table_of_content: 1 + field_landing_page_component: + # Complex Image. + - entity: paragraph + type: complex_image + field_complex_image_title: + - value: Complex Image Title + field_complex_image_media: + - '#process': + callback: reference + args: + - media + - bundle: image + name: 'Demo: Melbourne tram' + field_complex_image_source: + - value: Complex Image Source + field_complex_image_data: + - value: Complex Image Data + field_complex_image_full_label: + - value: Complex Image Fullscreen + field_complex_image_data_label: + - value: Complex Image additional data + field_complex_image_dl_label: + - value: Complex Image Download + # Accordion - basic. + - entity: paragraph + type: accordion + field_paragraph_title: Accordion Title + field_paragraph_accordion_style: numbered + field_paragraph_accordion: + - entity: paragraph + type: accordion_content + field_paragraph_accordion_name: 'Accordion Content' + field_paragraph_accordion_body: 'Lorem ipsum' + - entity: paragraph + type: accordion_content + field_paragraph_accordion_name: 'Accordion Content 1' + field_paragraph_accordion_body: 'Lorem ipsum' + # Basic Text. + - entity: paragraph + type: basic_text + field_paragraph_body: + - format: rich_text + value: | + And in the sky the clouds were twisting and darkness flowed through all the cracks into the sinking vessel of the landscape. Only in the telegraph wires a message still crackled END + # Documents. + field_node_documents: + - '#process': + callback: reference + args: + - media + - bundle: document + name: 'Demo Sample Document' + - '#process': + callback: reference + args: + - media + - bundle: document + name: 'Demo Sample PDF' + # Topic + field_topic: + - '#process': + callback: reference + args: + - taxonomy_term + - vid: topic + name: 'Science and technology' + # Sites. + field_node_site: + - '#process': + callback: reference + args: + - taxonomy_term + - vid: sites + name: '<%= domain %>' + field_node_primary_site: + - '#process': + callback: reference + args: + - taxonomy_term + - vid: sites + name: '<%= domain %>' diff --git a/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/search/sitesearch-filters.json b/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/search/sitesearch-filters.json new file mode 100644 index 000000000..74140314b --- /dev/null +++ b/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/search/sitesearch-filters.json @@ -0,0 +1,24 @@ +{ + "took": 0, + "timed_out": false, + "_shards": { "total": 5, "successful": 5, "skipped": 0, "failed": 0 }, + "hits": { "total": 3777, "max_score": 0.0, "hits": [] }, + "aggregations": { + "field_topic_name_options": { + "doc_count_error_upper_bound": 0, + "sum_other_doc_count": 84, + "buckets": [ + { "key": "Arts, culture and heritage", "doc_count": 174 }, + { "key": "Business", "doc_count": 270 }, + { "key": "Communities", "doc_count": 451 }, + { "key": "Demo Topic", "doc_count": 5 }, + { "key": "Education", "doc_count": 15 }, + { "key": "Environment", "doc_count": 17 }, + { "key": "Equality", "doc_count": 100 }, + { "key": "Event", "doc_count": 1988 }, + { "key": "Governance", "doc_count": 430 }, + { "key": "Health", "doc_count": 145 } + ] + } + } +} diff --git a/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/search/sitesearch.json b/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/search/sitesearch.json new file mode 100644 index 000000000..e5810cf16 --- /dev/null +++ b/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/search/sitesearch.json @@ -0,0 +1,202 @@ +{ + "hits": { + "total": 577, + "hits": [ + { + "_index": "a83890f7a31dea14e1ae83c6f0afacca--elasticsearch_index_nonprod_node", + "_type": "node", + "_id": "entity:node/168:en", + "_score": 110.55268, + "_source": { + "field_tags_name": ["Women", "Victims of crime & victim survivors"], + "created": ["2018-05-21T15:53:16+10:00"], + "field_landing_page_summary": [ + "Women Victoria aims to change attitudes and promote gender equality, prevent family violence and increase the number women in leadership." + ], + "field_topic_name": ["Equality"], + "title": ["About Women Victoria"], + "type": ["landing_page"], + "url": ["/site-4/about-women-victoria"], + "changed": ["2019-09-19T13:59:17+10:00"] + } + }, + { + "_index": "a83890f7a31dea14e1ae83c6f0afacca--elasticsearch_index_nonprod_node", + "_type": "node", + "_id": "entity:node/4477:en", + "_score": 108.4313, + "_source": { + "field_tags_name": ["Business", "Government"], + "created": ["2019-09-16T16:33:57+10:00"], + "field_landing_page_summary": [ + "Industrial Relations Victoria works towards achieving a positive working environment for all Victorians." + ], + "field_topic_name": ["Jobs"], + "title": ["Industrial Relations Victoria"], + "type": ["landing_page"], + "url": ["/site-4/industrial-relations-victoria"], + "changed": ["2019-09-17T14:18:23+10:00"] + } + }, + { + "_index": "a83890f7a31dea14e1ae83c6f0afacca--elasticsearch_index_nonprod_node", + "_type": "node", + "_id": "entity:node/1735:en", + "_score": 100.798195, + "_source": { + "field_tags_name": ["People with disability"], + "created": ["2019-06-07T16:53:43+10:00"], + "field_landing_page_summary": [ + "Information and resources for disability service providers, including how to register and your obligations around quality and safeguards." + ], + "field_topic_name": ["Health"], + "title": ["NDIS providers in Victoria"], + "type": ["landing_page"], + "url": ["/site-4/ndis-providers-victoria"], + "changed": ["2019-07-22T10:36:51+10:00"] + } + }, + { + "_index": "a83890f7a31dea14e1ae83c6f0afacca--elasticsearch_index_nonprod_node", + "_type": "node", + "_id": "entity:node/1318:en", + "_score": 100.798195, + "_source": { + "created": ["2019-03-27T15:35:40+11:00"], + "field_landing_page_summary": [ + "In Victoria, we celebrate Australia Day with a large program of events and activities." + ], + "field_topic_name": ["Arts, culture and heritage"], + "title": ["About Australia Day Victoria"], + "type": ["landing_page"], + "url": ["/site-4/about-australia-day-victoria"], + "changed": ["2019-04-29T13:22:11+10:00"] + } + }, + { + "_index": "a83890f7a31dea14e1ae83c6f0afacca--elasticsearch_index_nonprod_node", + "_type": "node", + "_id": "entity:node/2502:en", + "_score": 98.95356, + "_source": { + "created": ["2019-09-04T12:20:08+10:00"], + "field_topic_name": ["Health"], + "summary_processed": [""], + "title": ["Family Safety Victoria established"], + "type": ["news"], + "url": ["/site-4/family-safety-victoria-launched"], + "changed": ["2019-09-04T16:34:32+10:00"] + } + }, + { + "_index": "a83890f7a31dea14e1ae83c6f0afacca--elasticsearch_index_nonprod_node", + "_type": "node", + "_id": "entity:node/2149:en", + "_score": 97.203735, + "_source": { + "created": ["2019-07-31T16:43:42+10:00"], + "field_landing_page_summary": [ + "Support and advice for renters, information for property managers and changes to renting laws." + ], + "field_topic_name": ["Housing"], + "title": ["Renting in Victoria"], + "type": ["landing_page"], + "url": ["/site-4/renting-victoria"], + "changed": ["2019-07-31T16:45:07+10:00"] + } + }, + { + "_index": "a83890f7a31dea14e1ae83c6f0afacca--elasticsearch_index_nonprod_node", + "_type": "node", + "_id": "entity:node/3862:en", + "_score": 95.27418, + "_source": { + "created": ["2019-09-13T10:02:04+10:00"], + "field_landing_page_summary": [ + "Sale Polocrosse will host their annual state tournament, with players and teams from across Victoria coming to Sale to compete across the weekend. Come along" + ], + "field_topic_name": ["Event"], + "summary_processed": [""], + "title": ["Polocrosse Victoria Tournament"], + "type": ["event"], + "url": ["/site-4/polocrosse-victoria-tournament"], + "changed": ["2019-09-13T10:02:04+10:00"] + } + }, + { + "_index": "a83890f7a31dea14e1ae83c6f0afacca--elasticsearch_index_nonprod_node", + "_type": "node", + "_id": "entity:node/749:en", + "_score": 95.27418, + "_source": { + "created": ["2018-09-20T16:38:17+10:00"], + "field_landing_page_summary": [ + "The Brand Victoria Guidelines must be used for all Victorian Government communications and advertising. Covers logos, fonts, colour and other elements." + ], + "field_topic_name": ["Governance"], + "title": ["Brand Victoria Guidelines"], + "type": ["landing_page"], + "url": ["/site-4/brand-victoria-guidelines"], + "changed": ["2019-05-15T09:53:04+10:00"] + } + }, + { + "_index": "a83890f7a31dea14e1ae83c6f0afacca--elasticsearch_index_nonprod_node", + "_type": "node", + "_id": "entity:node/1030:en", + "_score": 93.723595, + "_source": { + "created": ["2019-01-17T14:39:52+11:00"], + "field_landing_page_summary": [ + "Family Safety Victoria was established in July 2017 to drive key elements of Victoria’s family violence strategy and coordinate support for families to help them care for children and young people." + ], + "field_topic_name": ["Health"], + "title": ["Family Safety Victoria"], + "type": ["landing_page"], + "url": ["/site-4/family-safety-victoria"], + "changed": ["2019-10-17T11:24:24+11:00"] + } + }, + { + "_index": "a83890f7a31dea14e1ae83c6f0afacca--elasticsearch_index_nonprod_node", + "_type": "node", + "_id": "entity:node/1490:en", + "_score": 93.723595, + "_source": { + "field_tags_name": ["Business", "Under 18s", "Parents & carers"], + "created": ["2019-04-30T14:37:44+10:00"], + "field_landing_page_summary": [ + "The Victorian Wage Inspectorate provides practical advice, information and support to Victorian employees and employers about state-specific laws, their work rights and responsibilities." + ], + "field_topic_name": ["Governance"], + "title": ["Wage Inspectorate Victoria"], + "type": ["landing_page"], + "url": ["/site-4/wage-inspectorate-victoria"], + "changed": ["2019-09-19T10:34:40+10:00"] + } + } + ] + }, + "aggregations": { + "field_topic_name": { + "doc_count_error_upper_bound": 0, + "sum_other_doc_count": 0, + "buckets": [ + { "key": "Arts, culture and heritage", "doc_count": 15 }, + { "key": "Business", "doc_count": 4 }, + { "key": "Communities", "doc_count": 99 }, + { "key": "Education", "doc_count": 5 }, + { "key": "Environment", "doc_count": 5 }, + { "key": "Equality", "doc_count": 59 }, + { "key": "Event", "doc_count": 78 }, + { "key": "Governance", "doc_count": 167 }, + { "key": "Health", "doc_count": 78 }, + { "key": "Housing", "doc_count": 10 }, + { "key": "Jobs", "doc_count": 14 }, + { "key": "Justice", "doc_count": 9 }, + { "key": "Science and technology", "doc_count": 8 }, + { "key": "Transport", "doc_count": 1 } + ] + } + } +} diff --git a/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/users/user-1.yml b/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/users/user-1.yml new file mode 100644 index 000000000..8e872459e --- /dev/null +++ b/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/users/user-1.yml @@ -0,0 +1,18 @@ +- entity: user + status: 1 + uid: 11221 + name: 'e2e-test-1@example.com' + mail: 'e2e-test-1@example.com' + roles: + - '#process': + callback: 'reference' + args: + - 'user_role' + - id: 'test_role' + field_user_site: + - '#process': + callback: reference + args: + - taxonomy_term + - vid: sites + name: '<%= domain %>' diff --git a/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/users/user-2.yml b/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/users/user-2.yml new file mode 100644 index 000000000..d7210bb1f --- /dev/null +++ b/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/users/user-2.yml @@ -0,0 +1,19 @@ +- entity: user + status: 1 + uid: 11222 + name: 'e2e-test-2@example.com' + mail: 'e2e-test-2@example.com' + roles: + - '#process': + callback: 'reference' + args: + - 'user_role' + - id: 'editor' + # Sites. + field_user_site: + - '#process': + callback: reference + args: + - taxonomy_term + - vid: sites + name: '<%= domain %>' diff --git a/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/webforms/contact-us-form-failure.json b/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/webforms/contact-us-form-failure.json new file mode 100644 index 000000000..077404aaa --- /dev/null +++ b/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/webforms/contact-us-form-failure.json @@ -0,0 +1,3 @@ +{ + +} \ No newline at end of file diff --git a/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/webforms/contact-us-form-success.json b/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/webforms/contact-us-form-success.json new file mode 100644 index 000000000..cba008af4 --- /dev/null +++ b/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/webforms/contact-us-form-success.json @@ -0,0 +1,67 @@ +{ + "jsonapi": { + "version": "1.0", + "meta": { + "links": { "self": { "href": "http://jsonapi.org/format/1.0/" } } + } + }, + "data": { + "type": "webform_submission--connect_with_us", + "id": "a8499930-69e4-4058-b202-9e2846c4b4c4", + "attributes": { + "serial": 1853, + "drupal_internal__sid": 12699, + "token": "qiV7LMDxGbY7lzHyWWhXoeKIoKVamzZe5JxRGc0gabY", + "uri": "/api/v1/webform_submission/connect_with_us", + "created": "2020-03-10T01:24:27+00:00", + "completed": "2020-03-10T01:24:27+00:00", + "changed": "2020-03-10T01:24:27+00:00", + "in_draft": false, + "current_page": null, + "remote_addr": "203.219.192.17", + "langcode": "en", + "entity_type": null, + "entity_id": null, + "locked": false, + "sticky": false, + "notes": null, + "metatag": null, + "metatag_normalized": [], + "data": null + }, + "relationships": { + "uid": { + "data": null, + "links": { + "self": { + "href": "https://develop.content.vic.gov.au/api/v1/webform_submission/connect_with_us/a8499930-69e4-4058-b202-9e2846c4b4c4/relationships/uid" + } + } + }, + "webform_id": { + "data": { + "type": "webform--webform", + "id": "fa8cae13-d8b0-4157-b3a6-fe53397e4ef1" + }, + "links": { + "self": { + "href": "https://develop.content.vic.gov.au/api/v1/webform_submission/connect_with_us/a8499930-69e4-4058-b202-9e2846c4b4c4/relationships/webform_id" + }, + "related": { + "href": "https://develop.content.vic.gov.au/api/v1/webform_submission/connect_with_us/a8499930-69e4-4058-b202-9e2846c4b4c4/webform_id" + } + } + } + }, + "links": { + "self": { + "href": "https://develop.content.vic.gov.au/api/v1/webform_submission/connect_with_us/a8499930-69e4-4058-b202-9e2846c4b4c4" + } + } + }, + "links": { + "self": { + "href": "https://develop.content.vic.gov.au/api/v1/webform_submission/connect_with_us" + } + } +} diff --git a/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/webforms/content-rating-form-failure.json b/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/webforms/content-rating-form-failure.json new file mode 100644 index 000000000..9e26dfeeb --- /dev/null +++ b/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/webforms/content-rating-form-failure.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/webforms/content-rating-form-success.json b/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/webforms/content-rating-form-success.json new file mode 100644 index 000000000..be32fb51d --- /dev/null +++ b/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/webforms/content-rating-form-success.json @@ -0,0 +1,67 @@ +{ + "jsonapi": { + "version": "1.0", + "meta": { + "links": { "self": { "href": "http://jsonapi.org/format/1.0/" } } + } + }, + "data": { + "type": "webform_submission--tide_webform_content_rating", + "id": "4ea029d1-d8a7-40ac-b178-4b266e327c08", + "attributes": { + "serial": 6695, + "drupal_internal__sid": 12690, + "token": "EXdZni3tkM236vdxa5MDRymMvKpziusPr2oSAXn-C34", + "uri": "/api/v1/webform_submission/tide_webform_content_rating", + "created": "2020-03-09T23:31:33+00:00", + "completed": "2020-03-09T23:31:33+00:00", + "changed": "2020-03-09T23:31:33+00:00", + "in_draft": false, + "current_page": null, + "remote_addr": "203.219.192.17", + "langcode": "en", + "entity_type": null, + "entity_id": null, + "locked": false, + "sticky": false, + "notes": null, + "metatag": null, + "metatag_normalized": [], + "data": null + }, + "relationships": { + "uid": { + "data": null, + "links": { + "self": { + "href": "https://develop.content.vic.gov.au/api/v1/webform_submission/tide_webform_content_rating/4ea029d1-d8a7-40ac-b178-4b266e327c08/relationships/uid" + } + } + }, + "webform_id": { + "data": { + "type": "webform--webform", + "id": "d39d6519-6c87-4725-8ac3-65125391bd8a" + }, + "links": { + "self": { + "href": "https://develop.content.vic.gov.au/api/v1/webform_submission/tide_webform_content_rating/4ea029d1-d8a7-40ac-b178-4b266e327c08/relationships/webform_id" + }, + "related": { + "href": "https://develop.content.vic.gov.au/api/v1/webform_submission/tide_webform_content_rating/4ea029d1-d8a7-40ac-b178-4b266e327c08/webform_id" + } + } + } + }, + "links": { + "self": { + "href": "https://develop.content.vic.gov.au/api/v1/webform_submission/tide_webform_content_rating/4ea029d1-d8a7-40ac-b178-4b266e327c08" + } + } + }, + "links": { + "self": { + "href": "https://develop.content.vic.gov.au/api/v1/webform_submission/tide_webform_content_rating" + } + } +} diff --git a/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/webforms/test-form-page.yml b/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/webforms/test-form-page.yml new file mode 100644 index 000000000..6ac94b0ee --- /dev/null +++ b/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/webforms/test-form-page.yml @@ -0,0 +1,50 @@ +- entity: node + type: landing_page + title: Test form + status: 1 + moderation_state: + - '#process': + callback: reference + args: + - content_moderation_state + - workflow: editorial + moderation_state: published + + # Content Components. + field_landing_page_component: + - entity: paragraph + type: embedded_webform + field_paragraph_title: test form + field_paragraph_webform: + - target_id: test_form_1 + + # Topic and Tags. + field_topic: + - '#process': + callback: reference + args: + - taxonomy_term + - vid: topic + name: 'Equality' + # Sites. + field_node_site: + - '#process': + callback: reference + args: + - taxonomy_term + - vid: sites + name: '<%= domain %>' + - '#process': + callback: reference + args: + - taxonomy_term + - vid: sites + name: 'demo.<%= domain %>' + field_node_primary_site: + - '#process': + callback: reference + args: + - taxonomy_term + - vid: sites + name: '<%= domain %>' + diff --git a/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/webforms/test_form.yml b/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/webforms/test_form.yml new file mode 100644 index 000000000..fc882e2ae --- /dev/null +++ b/packages/create-ripple-app/template/_tests/_modules/test/e2e/fixtures/webforms/test_form.yml @@ -0,0 +1,254 @@ +- entity: webform + langcode: en + status: open + dependencies: { } + open: null + close: null + weight: 0 + uid: 7155 + template: false + archive: false + id: test_form_1 + title: 'test form ' + description: 'TEST form for automated end to end testing' + category: '' + elements: | + text_field: + '#type': textfield + '#title': 'Text field' + textarea: + '#type': textarea + '#title': Textarea + email: + '#type': email + '#title': Email + '#required': true + '#required_error': 'Email address is a required field' + telephone: + '#type': tel + '#title': Telephone + '#required': true + number: + '#type': number + '#title': Number + '#required': true + '#required_error': 'Number is a required field' + '#min': '1' + '#max': '30' + '#step': '1' + address: + '#type': webform_address + '#title': Address + markup: + '#type': processed_text + '#text': | +

This is markup

+ +

https://www.google.com.au

+ + + + '#format': rich_text + select: + '#type': select + '#title': Select + '#options': + 'Option 1': 'Option 1' + 'Option 2': 'Option 2' + 'Option 3': 'Option 3' + date: + '#type': date + '#title': Date + '#datepicker': true + checkboxes: + '#type': checkbox + '#title': Checkboxes + '#options': + 'Option 1': 'Option 1' + 'Option 2': 'Option 2' + 'Option 3': 'Option 3' + radios: + '#type': radios + '#title': Radios + '#options': + 'Option 1': 'Option 1' + 'Option 2': 'Option 2' + 'Option 3': 'Option 3' + privacy_statement: + '#type': webform_privacy_statement + '#required': true + '#privacy_statement_heading': '' + '#privacy_statement_content': | +

The Department of Premier and Cabinet (the Department) collects the information that you provide with this complaint form. The information that you provide is used to respond to your enquiry. You can request access to, and corrections of, any personal information provided in this form. Requests for access or correction should be sent to contact@dpc.<%= domain %>.

+

The Department is using the services of Drupal 8 to administer this form. The information that you provide is stored in our Drupal 8 content management system and Amazon Web Services servers.

+

For more information on the Department’s handling of any personal information, please refer to the Department’s Privacy Statement.

+

If you do not provide all or part of the information requested, the Department may not be able to contact you regarding your enquiry. Please contact the Department of Premier and Cabinet if you wish to use an alternative mechanism to the online form.

+ + '#title': 'I have read and understand how Department of Premier and Cabinet stores information.' + actions: + '#type': webform_actions + '#title': Submit + '#submit__label': Submit + css: '' + javascript: '' + settings: + ajax: false + ajax_scroll_top: form + ajax_progress_type: '' + ajax_effect: '' + ajax_speed: null + page: true + page_submit_path: '' + page_confirm_path: '' + page_admin_theme: false + form_title: both + form_submit_once: false + form_exception_message: '' + form_open_message: '' + form_close_message: '' + form_previous_submissions: true + form_confidential: false + form_confidential_message: '' + form_remote_addr: true + form_convert_anonymous: false + form_prepopulate: false + form_prepopulate_source_entity: false + form_prepopulate_source_entity_required: false + form_prepopulate_source_entity_type: '' + form_reset: false + form_disable_autocomplete: false + form_novalidate: false + form_disable_inline_errors: false + form_required: false + form_unsaved: false + form_disable_back: false + form_submit_back: false + form_autofocus: false + form_details_toggle: false + form_access_denied: default + form_access_denied_title: '' + form_access_denied_message: '' + form_access_denied_attributes: { } + form_file_limit: '' + submission_label: '' + submission_log: false + submission_views: { } + submission_views_replace: { } + submission_user_columns: { } + submission_user_duplicate: false + submission_access_denied: default + submission_access_denied_title: '' + submission_access_denied_message: '' + submission_access_denied_attributes: { } + submission_exception_message: '' + submission_locked_message: '' + submission_excluded_elements: { } + submission_exclude_empty: false + submission_exclude_empty_checkbox: false + previous_submission_message: '' + previous_submissions_message: '' + autofill: false + autofill_message: '' + autofill_excluded_elements: { } + wizard_progress_bar: true + wizard_progress_pages: false + wizard_progress_percentage: false + wizard_progress_link: false + wizard_start_label: '' + wizard_preview_link: false + wizard_confirmation: true + wizard_confirmation_label: '' + wizard_track: '' + preview: 0 + preview_label: '' + preview_title: '' + preview_message: '' + preview_attributes: { } + preview_excluded_elements: { } + preview_exclude_empty: true + preview_exclude_empty_checkbox: false + draft: none + draft_multiple: false + draft_auto_save: false + draft_saved_message: '' + draft_loaded_message: '' + draft_pending_single_message: '' + draft_pending_multiple_message: '' + confirmation_type: page + confirmation_title: '' + confirmation_message: '' + confirmation_url: '' + confirmation_attributes: { } + confirmation_back: true + confirmation_back_label: '' + confirmation_back_attributes: { } + confirmation_exclude_query: false + confirmation_exclude_token: false + confirmation_update: false + limit_total: null + limit_total_interval: null + limit_total_message: '' + limit_total_unique: false + limit_user: null + limit_user_interval: null + limit_user_message: '' + limit_user_unique: false + entity_limit_total: null + entity_limit_total_interval: null + entity_limit_user: null + entity_limit_user_interval: null + purge: none + purge_days: null + results_disabled: false + results_disabled_ignore: false + token_update: false + access: + create: + roles: + - anonymous + - authenticated + users: { } + permissions: { } + view_any: + roles: { } + users: { } + permissions: { } + update_any: + roles: { } + users: { } + permissions: { } + delete_any: + roles: { } + users: { } + permissions: { } + purge_any: + roles: { } + users: { } + permissions: { } + view_own: + roles: { } + users: { } + permissions: { } + update_own: + roles: { } + users: { } + permissions: { } + delete_own: + roles: { } + users: { } + permissions: { } + administer: + roles: { } + users: { } + permissions: { } + test: + roles: { } + users: { } + permissions: { } + configuration: + roles: + - anonymous + - authenticated + users: { } + permissions: { } + handlers: { } diff --git a/packages/create-ripple-app/template/_tests/_modules/test/e2e/integration/core-modules/alert/alert.feature b/packages/create-ripple-app/template/_tests/_modules/test/e2e/integration/core-modules/alert/alert.feature index 8fbb6bdcd..226616736 100644 --- a/packages/create-ripple-app/template/_tests/_modules/test/e2e/integration/core-modules/alert/alert.feature +++ b/packages/create-ripple-app/template/_tests/_modules/test/e2e/integration/core-modules/alert/alert.feature @@ -1,13 +1,29 @@ Feature: Global Notifications (Alert) As a citizen I need to be alerted to important site wide notifications. - - Background: Cleanup alerts - # Given there are no alerts in the system - Scenario: 1-FE-Alert-1 Displays global alert - Given I have created a node with the YAML fixture "alert/1-BE-Alert-1" + Scenario: BE - Add alerts + Given I have logged into the backend + And in the backend there are no "alert" nodes + And in the backend there is a node at "/1-BE-Alert-1" with "alert/1-BE-Alert-1" data + And in the backend there is a node at "/1-BE-Alert-2" with "alert/1-BE-Alert-2" data + + Scenario: Warm the cache + When I visit the page "/" + + Scenario: FE - 1-FE-Alert-1 Displays global alert When I visit the page "/" Then there should be the following global notifications: - | title | type | link | linkText | - | 1-BE-Alert-1 Demo Alert | Demo Alert Type | https://<%= domain %> | More details | + | title | type | link | linkText | + | 1-BE-Alert-1 Demo Alert | Demo Alert Type | https://www.google.com | More details | + + Scenario: FE- 1-FE-Alert-2 Displays alert for site section + When I visit the page "/housing-and-property" + Then there should be the following global notifications: + | title | type | link | linkText | + | 1-BE-Alert-1 Demo Alert | Demo Alert Type | https://www.google.com | More details | + | 1-BE-Alert-2 Demo Alert | Heat wave | https://www.google.com | More details | + When I visit the page "/housing-and-property" + Then there should be the following global notifications: + | title | type | link | linkText | + | 1-BE-Alert-1 Demo Alert | Demo Alert Type | https://www.google.com | More details | \ No newline at end of file diff --git a/packages/create-ripple-app/template/_tests/_modules/test/e2e/integration/core-modules/authenticatedContent/authenticated-content.feature b/packages/create-ripple-app/template/_tests/_modules/test/e2e/integration/core-modules/authenticatedContent/authenticated-content.feature index 0d674d442..6abf46f59 100644 --- a/packages/create-ripple-app/template/_tests/_modules/test/e2e/integration/core-modules/authenticatedContent/authenticated-content.feature +++ b/packages/create-ripple-app/template/_tests/_modules/test/e2e/integration/core-modules/authenticatedContent/authenticated-content.feature @@ -1,6 +1,54 @@ Feature: Protected content - This test is not ready yet + As authorized I want to be able to login to the site so I can view pages which are not for the general public - @skip - Scenario: Test \ No newline at end of file + Scenario: BE - Setup environment + Given I have logged into the backend + And in the backend there is a role "test-role" + And in the backend there is a user "users/user-1" + And in the backend there is a node at "/authenticatedcontent/test-auth-term" with "authenticatedContent/taxonomy" data + # And the authenticated content term "test" has the role "test_role" + And in the backend there is a node at "/1-fe-auth-content-4" with "authenticatedContent/1-FE-auth-content-4" data + + Scenario: 1-FE-auth-content-1 - Login form renders correctly + Given I visit the page "/login" + Then there should be a login form with the title "Login" + And there should be a form field with the label "Username" + And there should be a form field with the label "Password" + And there should be a submit button with the text "Submit" + And there should be a login form button with the text "Register" + And there should be a login form button with the text "Forgot password" + + Scenario: 1-FE-auth-content-3 - Login failure + Given I visit the page "/login" + When I enter the the following login credentials: + | login | password | + | dummyuser | Pasword-21 | + And I submit the login form + Then the login status colour should should be "red" + And the login status message should be "Login Failed. Please try again" + + Scenario: 1-FE-auth-content-4 - Should not be able to access a protected content page when unauthenticated + When I attempt to visit the page "/1-fe-auth-content-4" + Then I should see a 404 page + + Scenario: 1-FE-auth-content-2 - Login success + And I visit the page "/login" + When I enter the the following login credentials: + | login | password | + | e2e-test-1@example.com | ******** | + And I submit the login form + Then the login status colour should should be "green" + And the login status message should be "Login Successful." + + Scenario: Accessing a protected content page when authenticated + When I visit the page "/login" + When I enter the the following login credentials: + | login | password | + | administrator1.test@example.com | ******** | + And I submit the login form + Then the current page url should be "/" + When I wait for 3 seconds + Given I visit the page "/1-fe-auth-content-4" + Then the page title should be "1-FE-auth-content-4" + And the h1 should be "1-FE-auth-content-4" diff --git a/packages/create-ripple-app/template/_tests/_modules/test/e2e/integration/core-modules/dataDrivenComponent/data-driven-component.feature b/packages/create-ripple-app/template/_tests/_modules/test/e2e/integration/core-modules/dataDrivenComponent/data-driven-component.feature index 47fad1136..c05d2c2e9 100644 --- a/packages/create-ripple-app/template/_tests/_modules/test/e2e/integration/core-modules/dataDrivenComponent/data-driven-component.feature +++ b/packages/create-ripple-app/template/_tests/_modules/test/e2e/integration/core-modules/dataDrivenComponent/data-driven-component.feature @@ -1,6 +1,9 @@ Feature: Data driven component - This test is not ready yet + As a citizen I need to be able to view maps on the site - @skip - Scenario: Test \ No newline at end of file + # Not ready yet - ddc doesnt seem to be working + @skip + Scenario: BE - Create landingpage with data driven component + Given I have logged into the backend + And in the backend there is a node at "/2-data-driven-component" with "data-driven-component/1-data-driven-component" data diff --git a/packages/create-ripple-app/template/_tests/_modules/test/e2e/integration/core-modules/event/event.feature b/packages/create-ripple-app/template/_tests/_modules/test/e2e/integration/core-modules/event/event.feature index 2752f92fb..19fc4e706 100644 --- a/packages/create-ripple-app/template/_tests/_modules/test/e2e/integration/core-modules/event/event.feature +++ b/packages/create-ripple-app/template/_tests/_modules/test/e2e/integration/core-modules/event/event.feature @@ -1,9 +1,11 @@ Feature: Event page As a citizen I can view information for all available content on an event page - Prerequisite: Events Simple Test 1-BE-event-1 + + Scenario: BE - add event + Given I have logged into the backend + And in the backend there is a node at "/2-be-event-1" with "event/2-BE-event-1" data Scenario: Event Page loads correctly - Given the "/2-be-event-1" page exists with fixture "event/2-BE-event-1" data When I visit the page "/2-be-event-1" Then the page title should be "2-BE-event-1" And the event page Description should be "So now all who escaped death in battle or by shipwreck had got safely home except Ulysses, and he, though he was longing to return to his wife and country, was detained by the goddess Calypso, who had got him into a large cave and wanted to marry him. But as years went by, there came a time when the gods settled that he should go back to Ithaca; even then, however, when he was among his own people, his troubles were not yet over; nevertheless all the gods had now begun to pity him except Neptune, who still persecuted him without ceasing and would not let him get home." @@ -14,3 +16,31 @@ Feature: Event page And the event page Body should be "So now all who escaped death in battle or by shipwreck had got safely home except Ulysses, and he, though he was longing to return to his wife and country, was detained by the goddess Calypso, who had got him into a large cave and wanted to marry him. But as years went by, there came a time when the gods settled that he should go back to Ithaca; even then, however, when he was among his own people, his troubles were not yet over; nevertheless all the gods had now begun to pity him except Neptune, who still persecuted him without ceasing and would not let him get home." And the event page Booking Url link should be "http://examplebook.com" And the event page Booking Text should be "Booking URL" + + # Related links + And the related links component should exist + And the related links title should be "Related links" + And the related links should contain the following links: + | title | url | + | State Government of Victoria | https://www.google.com | + | Department of Premier and Cabinet | https://www.google.com | + + # Social Sharing + And the share this component should exist + And the share this component should have the title "Share this" + And the share this component should have the following social links: + | network | + | Twitter | + | Facebook | + | LinkedIn | + And the share this links should read "open in a new window" to screen readers + + # Contact Us + And the contact component title should be "Victorian Government" + And the contact component details should be "Victorian Government Department of Premier and Cabinet Department of Premier and Cabinet, GPO Box 4509, Melbourne, VIC 3001" + And the contact component should have the following items: + | link | linktext | + | https://www.google.com.au/maps?q=Department%20of%20Premier%20and%20Cabinet,%20GPO%20Box%204509,%20Melbourne,%20VIC%203001 | Department of Premier and Cabinet, GPO Box 4509, Melbourne, VIC 3001 | + | tel:1300366356 | Calls in Australia 1300 366 356 | + | tel:+61396038804 | Calls from overseas +61 3 9603 8804 | + | mailto:no-reply@vic.gov.au | no-reply@vic.gov.au | \ No newline at end of file diff --git a/packages/create-ripple-app/template/_tests/_modules/test/e2e/integration/core-modules/grant/grant.feature b/packages/create-ripple-app/template/_tests/_modules/test/e2e/integration/core-modules/grant/grant.feature index 0a887750d..2ac7d4b8d 100644 --- a/packages/create-ripple-app/template/_tests/_modules/test/e2e/integration/core-modules/grant/grant.feature +++ b/packages/create-ripple-app/template/_tests/_modules/test/e2e/integration/core-modules/grant/grant.feature @@ -1,6 +1,41 @@ -Feature: Grant +Feature: Grant page - This test is not ready yet + As a citizen I can view information about a specific grant, including grant amount, audience, etc. + https://digital-engagement.atlassian.net/browse/SDPA-175 - @skip - Scenario: Test \ No newline at end of file + Background: Reset date to today before each test + Given the current date is today + + Scenario: BE - Create TC-9a Grant + Given I have logged into the backend + And in the backend there is a node at "/tc-9a-grant" with "grant/TC-9a-grant" data + And in the backend there is a node at "/tc-9b-grant" with "grant/TC-9b-grant" data + + Scenario: FE - TC-9a Grant - Simple Test - Date Range + Given that the current date is "April 10, 2019 00:00:00" + And I visit the page "/tc-9a-grant" + Then the page title should be "TC-9a Grant Simple Test - Date Range" + And the grant overview price should be "$11,326 - $26,494" + And the grant overview audience should be "Businesses" + And the grant overview open status is "Open, closing in 28 days" + And the timeline component should exist + And the timeline title should be "Demo Timeline" + And there should be the following timeline items: + | title | link | image | subtitle | description | + | Demo Timeline Item | https://www.google.com | Melbourne-tram.jpg | 01 January | Mauris tincidunt tincidunt felis vel tempus. Vestibulum rhoncus blandit justo quis finibus. | + And the grant guideline section title should be "Guidelines" + And the grant guideline should have the following accordions + | "Eligibility" | + | "Assessment criteria" | + | "Assessment process" | + | "How to apply" | + And the page should have the following documents: + | title | size | type | + | Demo Sample Document | 7.53 KB | docx | + And the content rating component should exist + + Scenario: FE - TC-9b Grant page - Closed + Given that the current date is "April 10, 2019 00:00:00" + And I visit the page "/tc-9b-grant" + Then the page title should be "TC-9b Grant page - Closed" + And the grant overview open status is "Closed" diff --git a/packages/create-ripple-app/template/_tests/_modules/test/e2e/integration/core-modules/grant/submit-a-grant.feature b/packages/create-ripple-app/template/_tests/_modules/test/e2e/integration/core-modules/grant/submit-a-grant.feature index 86f5a37e0..285c6f9f7 100644 --- a/packages/create-ripple-app/template/_tests/_modules/test/e2e/integration/core-modules/grant/submit-a-grant.feature +++ b/packages/create-ripple-app/template/_tests/_modules/test/e2e/integration/core-modules/grant/submit-a-grant.feature @@ -1,6 +1,20 @@ Feature: Submit a grant - This test is not ready yet - + Form to submit a grant + + # Before : Create Landing page with submit a grant form + @skip + Scenario: Submitting a form successfully + Given I have navigated to the created page + Then the page title should be "Submit a grant landing page" + Then the form title should be "Submit a grant" + Given I have entered the form correctly + When I submit the form + Then I should see the form success message + And the form submission should be saved @skip - Scenario: Test \ No newline at end of file + Scenario: Client side error validation + Given I have navigated to the created test page + And I dont fill out any fields + When I submit the form + Then I should see 10 validation errors \ No newline at end of file diff --git a/packages/create-ripple-app/template/_tests/_modules/test/e2e/integration/core-modules/grant/submit-a-grant/hooks.js b/packages/create-ripple-app/template/_tests/_modules/test/e2e/integration/core-modules/grant/submit-a-grant/hooks.js new file mode 100644 index 000000000..1b954eaf5 --- /dev/null +++ b/packages/create-ripple-app/template/_tests/_modules/test/e2e/integration/core-modules/grant/submit-a-grant/hooks.js @@ -0,0 +1,14 @@ +/* global before, after, cy */ + +before(function () { + cy.fixture('Pages/grantlandingpage').as('pageData') + cy.get('@pageData').then(data => { + cy.task('createLandingPage', data).as('nodeId') + }) +}) + +after(function () { + if (this.nodeId) { + cy.task('deleteNode', this.nodeId) + } +}) diff --git a/packages/create-ripple-app/template/_tests/_modules/test/e2e/integration/core-modules/gtm/googletagmanager.feature b/packages/create-ripple-app/template/_tests/_modules/test/e2e/integration/core-modules/gtm/googletagmanager.feature index fd03852a0..c5e3dbaf2 100644 --- a/packages/create-ripple-app/template/_tests/_modules/test/e2e/integration/core-modules/gtm/googletagmanager.feature +++ b/packages/create-ripple-app/template/_tests/_modules/test/e2e/integration/core-modules/gtm/googletagmanager.feature @@ -1,6 +1,12 @@ -Feature: Quick exit +Feature: GTM - This test is not ready yet + As a site admin I need to ensure that Google Tag Manager is installed on the site and Google Anlytics is capturing page views - @skip - Scenario: Test \ No newline at end of file + Scenario: GTM is installed on page + Given I visit the page "/" + Then the GTM script should be installed with id "GTM-T5283GW" + + # @stubga + # Scenario: Google analytics page view fires + # Given I click the link "Contact us" + # Then the google analytics tracking request should be made \ No newline at end of file diff --git a/packages/create-ripple-app/template/_tests/_modules/test/e2e/integration/core-modules/landingPage/AnchorLink.feature b/packages/create-ripple-app/template/_tests/_modules/test/e2e/integration/core-modules/landingPage/AnchorLink.feature new file mode 100644 index 000000000..b29f689d6 --- /dev/null +++ b/packages/create-ripple-app/template/_tests/_modules/test/e2e/integration/core-modules/landingPage/AnchorLink.feature @@ -0,0 +1,20 @@ +Feature: Anchor link + + As a citizen I need to be able to scroll to a section in the page content when clicking an anchor link + + Scenario: BE - Create landingpage + Given I have logged into the backend + And in the backend there is a node at "/anchorlink-test" with "page/anchorlinktest" data + + Scenario: FE - Visit a url with anchor link via link + When I visit the page "/anchorlink-test" + And I click the link "/demo-landing-page#accordion-header-basic" + When I wait for 4 seconds + Then the current page url should be "/demo-landing-page#accordion-header-basic" + Then the page should scroll to "#accordion-header-basic" + + Scenario: FE - Visit a url with anchor link + Given I visit the page "/demo-landing-page#accordion-header-basic" + When I wait for 8 seconds + And the page should scroll to "#accordion-header-basic" + diff --git a/packages/create-ripple-app/template/_tests/_modules/test/e2e/integration/core-modules/landingPage/LandingPage.feature b/packages/create-ripple-app/template/_tests/_modules/test/e2e/integration/core-modules/landingPage/LandingPage.feature index 5b286e3cf..75866a234 100644 --- a/packages/create-ripple-app/template/_tests/_modules/test/e2e/integration/core-modules/landingPage/LandingPage.feature +++ b/packages/create-ripple-app/template/_tests/_modules/test/e2e/integration/core-modules/landingPage/LandingPage.feature @@ -1,6 +1,208 @@ -Feature: Landing Page +Feature: Landing page - This test is not ready yet - - @skip - Scenario: Test \ No newline at end of file + As a citizen I can view information for all available content on any given landing page + + Scenario: BE - Create landing page + Given I have logged into the backend + And in the backend there is a node at "/5-be-land-3-landing-page-complete-test" with "landingPage/5-be-land-3-landing-page-complete-test" data + + Scenario: FE - 5-FE-land-6 Landing Page - Complete Test + When I visit the page "/5-be-land-3-landing-page-complete-test" + + # Page Header + Then the page title should be "5-BE-land-3 Landing Page - Complete Test" + And the hero banner desciption should be "5-BE-land-3 Landing Page - Complete Test Intro" + + # Primary Campaign + And the campaign primary banner component should exist + And the campaign primary banner should contain: + | title | body | ctatext | ctalink | + | Demo Campaign | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed vobis voluptatum perceptarum recordatio vitam beatam facit | Find out more | https://www.vic.gov.au | + + # Secondary Campaign + And the campaign secondary component should exist + And the campaign secondary component should contain: + | title | body | ctatext | ctalink | + | Another Demo Campaign | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed vobis voluptatum perceptarum recordatio vitam beatam facit | Find out more | https://www.vic.gov.au | + + # Body Content + And the order number 1 wysiwyg content contains fixture "landingPage/5-be-land-3-landing-page-complete-test" + + # Accordion + And there should be 2 accordion components + And the number 1 accordion title should be "Accordion Title" + And the accordion titled "Accordion Title" should contain the following items: + | title | body | + | Accordion Content | Lorem ipsum | + + # Card Event carousel + And there should be a card carousel titled "Latest items (Event)" + And the card carousel titled "Latest items (Event)" should have 9 items + # Disabled as Event Carousel data is not stable. + # And the card carousel titled "Latest items (Event)" should have the following items: + # | date | title | summary | address | link | linktext | + # | 02 to 07 July | Demo Event | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam tincidunt sit amet ligula sit amet lacinia. In a leo nec tortor aliquet faucibus. | Department of Premier and Cabinet, GPO Box 4509, Melbourne, VIC 3001 | /demo-event | See event details | + # | 05 February to 13 September 2019 | Little Seeds - Early Years Nature Play and Gardening Program | Calling all Little Seeds. Come and get your hands dirty and let your imagination run free as you tend to your very own garden patch. | Birdwood Avenue, South Yarra, VIC 3141 | /little-seeds-early-years-nature-play-and-gardening-program | See event details | + # | 02 to 13 September | La Vuelta Winemakers Lunch at Mitchelton | This Grand Final Eve, Mitchelton is celebrating Australia’s love of ball sports, days off and rotating beef on the spit. Enjoy mixed cuts of succulent | 470 Mitchellstown Road, Nagambie, VIC 3608 | /la-vuelta-winemakers-lunch-mitchelton | See event details | + # | 13 September | My Little - exhibition opening | Lord Coconut presents the fifth annual Melbourne Cufflink Exhibition and Student Acquisitive Prize.\\n\\nThe exhibition features handcrafted cufflinks by some of the best jewellery students | 358 Lonsdale Street, Level 5 Mitchell House, Melbourne, VIC 3000 | /my-little-exhibition-opening | See event details | + # | 13 September | Convent Kids: Sapling School | Join an outdoor expedition for curious kids and their adults led by play specialist Catherine Sewell and gardener Matthew Henry. Through singing, storytelling and hands-on | 1 St Heliers Street, Abbotsford, VIC 3067 | /convent-kids-sapling-school | See event details | + # | 13 September | 2019 Toyota AFL Finals, SF1: Geelong Cats v West Coast Eagles | 13 September 2019 Toyota AFL Finals, SF1: Geelong Cats v West Coast Eagles September. It's the miracle month. Four weeks of unscripted drama that compels, captivates and astounds. The thrill of possibility.\\n\\nWitness history made, legends born and | Jolimont Road, East Melbourne, VIC 3002 | /2019-toyota-afl-finals-sf1-geelong-cats-v-west-coast-eagles | See event details | + # | 13 September | Albert Park College - Vaudeville: HERO | Albert Park College proudly presents Vaudeville 2019: HERO. A highlight of our school calendar, Vaudeville is a celebration of our school through the performing arts | 20 Carlisle Street, St Kilda, VIC 3182 | /albert-park-college-vaudeville-hero | See event details | + # | 13 September | Tiny Acts Of Kindness Really Do Change The World | Join us for a delicious vegan lunch from the Edgar’s Mission cook book “Cooking with Kindness” matched with wines from Baillieu and Elgee Park.\\nPam | 3460 Frankston - Flinders Road, Merricks, VIC 3916 | /tiny-acts-kindness-really-do-change-world | See event details | + # | 13 September | Hey Hey It's Friday Presents: Poppa & Jonesy | Hey Hey It's Friday Presents: Poppa & Jonesy\\n\\nAfter performing sold out shows in the Melbourne International Comedy Festival Poppa Rozaia and Cody Jones have | 60 Lydiard Street North, Ballarat Central, VIC 3350 | /hey-hey-its-friday-presents-poppa-jonesy | See event details | + + # Promotion + And there should be a promotion card with the title "Card Promotion" + And the promotion card titled "Card Promotion" should contain the following: + | date | title | summary | ctalink | ctatext | + | 02 July | Card Promotion | Mauris tincidunt tincidunt felis vel tempus. Vestibulum rhoncus blandit justo quis finibus. | https://www.vic.gov.au | Vestibulum rhoncus | + + # Card Promotion Automated + And there should be a promotion card with the title "Demo Page" + And the promotion card titled "Demo Page" should contain the following: + | title | ctalink | ctatext | + | Demo Page | /demo-page | Read more | + + # Navigation Featured + And there should be a navigation featured card with the title "Card Promotion" + And the navigation card featured titled "Card Promotion" should contain the following: + | title | image | summary | link | + | Card Promotion | Melbourne-tram.jpg | Mauris tincidunt tincidunt felis vel tempus. Vestibulum rhoncus blandit justo quis finibus. | https://www.vic.gov.au | + + # Navigation Featured Automated + And there should be a navigation featured automated card with the title "Demo News" + And the navigation featured automated card titled "Demo News" should contain the following: + | title | image | link | + | Demo News | Melbourne-tram.jpg | /demo-news | + + # Navigation + And there should be a navigation card with the title "Card Promotion" + And the navigation card titled "Card Promotion" should contain the following: + | title | summary | link | linktext | + | Card Promotion | Mauris tincidunt tincidunt felis vel tempus. Vestibulum rhoncus blandit justo quis finibus. | https://www.google.com | Vestibulum rhoncus | + + # Navigation Automated + And there should be a navigation card with the title "Demo Page" + And the navigation card titled "Demo Page" should contain the following: + | title | link | + | Demo Page | /demo-page | + + # Key Dates + And there should be a keydates card with the title "Key calendar dates" + And the keydates card titled "Key calendar dates" should contain the following: + | title | ctalink | ctatext | + | Key calendar dates | https://www.vic.gov.au | Read more | + And the keydates card titled "Key calendar dates" should have the following items: + | date | title | description | + | 1 June | Demo Key Date | First key date summary. | + | 2 June | Demo Key Date 2 | Second key date summary. | + + # Featured News + And the featured news listing component should have the following items: + | date | tag | title | link | + | 02 July | Demo Topic | Demo News | /demo-news | + + # News Listing + And the news listing component should exist + # And there should be the following news listing components: + # | date | tag | title | link | + # | 02 July 2019 | Demo Topic | Test news page 1 | /test-news-page-1-5 | + # | 02 July 2019 | Demo Topic | Demo News | /demo-news | + + # Image Gallery + And the image gallery component should have the following items: + | image | title | + | 2018-19-State-Budget.jpg | 1 / 4 - Demo: 2018-19 State Budget | + | Aerial-shot-of-new-housing-development.jpg | 2 / 4 - Demo: Aerial shot of new housing development | + | Bendigo-Hospital.jpg | 3 / 4 - Demo: Bendigo Hospital | + | Melbourne-tram.jpg | 4 / 4 - Demo: Melbourne tram | + + # Card Event Automated + And there should be an event card with the title "Demo Event" + And the event card titled "Demo Event" should contain the following: + | date | title | summary | address | link | linktext | + | 02 to 07 July | Demo Event | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam tincidunt sit amet ligula sit amet lacinia. In a leo nec tortor aliquet faucibus. | Melbourne | /demo-event | View more | + + # Card Carousel - add card event + And there should be a card carousel titled "Card Carousel for Card Event" + And the card carousel titled "Card Carousel for Card Event" should have 2 items + And the card carousel titled "Card Carousel for Card Event" should have the following items: + | date | title | image | summary | address | link | linktext | + | 01 January to 12 December 2020 | Carousel Card Event | Melbourne-tram.jpg | Mauris tincidunt tincidunt felis vel tempus. Vestibulum rhoncus blandit justo quis finibus. | Melbourne | https://www.vic.gov.au | Read more | + | 01 January | Carousel Card Event 2 | Melbourne-tram.jpg | Mauris tincidunt tincidunt felis vel tempus. Vestibulum rhoncus blandit justo quis finibus. | Melbourne | https://www.vic.gov.au | Read more | + + # Latest Events + And there should be a latest events titled "Demo latest events" + And the latest events titled "Demo latest events" should have 6 items + # Disabled as Latest Events data is not stable. + # And the latest events titled "Demo latest events" should have the following items: + # | date | title | summary | address | link | linktext | + # | 02 to 07 July | Demo Event | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam tincidunt sit amet ligula sit amet lacinia. In a leo nec tortor aliquet faucibus. | Department of Premier and Cabinet, GPO Box 4509, Melbourne, VIC 3001 | /demo-event | See event details | + And the latest events titled "Demo latest events" should have a call to action card with the following: + | title | body | image | linktext | link | + | Latest Event 1 | Mauris tincidunt tincidunt felis vel tempus. | Melbourne-tram.jpg | See more | https://www.vic.gov.au | + + # Timelines + And the timeline component titled "Demo Timeline" should exist + And the timeline component titled "Demo Timeline" should have the following items: + | title | date | summary | image | link | + | Demo Timeline Item | 01 January | Mauris tincidunt tincidunt felis vel tempus. Vestibulum rhoncus blandit justo quis finibus. | Melbourne-tram.jpg | https://www.vic.gov.au | + | Demo Timeline Item 2 | Alternative | Anim excepteur magna eu aliqua quis velit voluptate sit culpa. | Melbourne-tram.jpg | https://www.vic.gov.au | + + # Key Journeys + And the key journey component should exist + And the key journey component should have the following items: + | linktext | link | + | Nullam laoreet | https://vic.gov.au| + | Nullam laoreet | https://vic.gov.au| + + # Contact Us + And the contact component title should be "Victorian Government" + And the contact component details should be "Victorian Government Department of Premier and Cabinet Department of Premier and Cabinet, GPO Box 4509, Melbourne, VIC 3001" + And the contact component should have the following items: + | link | linktext | + | https://www.google.com.au/maps?q=Department%20of%20Premier%20and%20Cabinet,%20GPO%20Box%204509,%20Melbourne,%20VIC%203001 | Department of Premier and Cabinet, GPO Box 4509, Melbourne, VIC 3001 | + | tel:1300366356 | Calls in Australia 1300 366 356 | + | tel:+61396038804 | Calls from overseas +61 3 9603 8804 | + | mailto:no-reply@vic.gov.au | no-reply@vic.gov.au | + | https://twitter.com/VicGovAu | Twitter | + + # Call to action + And there should be a call to action component with the title "Phasellus in varius leo" + And the call to action component titled "Phasellus in varius leo" should contain the following: + | title | image | summary | link | linktext | + | Phasellus in varius leo | Melbourne-tram.jpg | Mauris tincidunt tincidunt felis vel tempus. Vestibulum rhoncus blandit justo quis finibus. Phasellus lacus lectus, sollicitudin sed posuere non, ultricies ut quam. | https://vic.gov.au | Victorian Government | + + # Related Links + And the related links component should exist + And the related links title should be "Related links" + And the related links should contain the following links: + | title | url | + | State Government of Victoria | https://www.vic.gov.au | + | Department of Premier and Cabinet | https://www.vic.gov.au/department-premier-and-cabinet | + + # What's Next + And the whats next component should exist + And the whats next title should be "What's next?" + And the whats next links should be: + | title | url | + | State Government of Victoria | https://www.vic.gov.au | + | Department of Premier and Cabinet | https://www.vic.gov.au/department-premier-and-cabinet | + + # Social Sharing + And the share this component should exist + And the share this component should have the title "Share this" + And the share this component should have the following social links: + | network | + | Twitter | + | Facebook | + | LinkedIn | + And the share this links should read "open in a new window" to screen readers + + # Content Rating + And the content rating component should exist + And the content rating component legend should be "Was this page helpful?" + When I click the "Yes" radio button in the content rating component + Then the content rating component summary textfield should display + And the the content rating component "Cancel" button should be visible + And the the content rating component "Submit" button should be visible diff --git a/packages/create-ripple-app/template/_tests/_modules/test/e2e/integration/core-modules/media/media.feature b/packages/create-ripple-app/template/_tests/_modules/test/e2e/integration/core-modules/media/media.feature index 0bbc4c452..f3fe0badf 100644 --- a/packages/create-ripple-app/template/_tests/_modules/test/e2e/integration/core-modules/media/media.feature +++ b/packages/create-ripple-app/template/_tests/_modules/test/e2e/integration/core-modules/media/media.feature @@ -1,6 +1,32 @@ -Feature: Media page +Feature: Embedded Media - This test is not ready yet + As a citizen I am able to view videos published to the website - @skip - Scenario: Test \ No newline at end of file + Scenario: BE - Create media + Given I have logged into the backend + And in the backend there is a node at "/embedded-video-test" with "media/embedded-video-test" data + And in the backend there is a node at "/test-embedded-video" with "media/embedded-video" data + And in the backend there is a node at "/test-embedded-video-no-transcript" with "media/embedded-video-no-transcript" data + + Scenario: Landing page with Embedded media video + When I visit the page "/embedded-video-test" + Then there should be 2 embedded videos + And there should be a embedded video transcript link "/test-embedded-video" + + Scenario: Media page for video with transcript + When I attempt to visit the page "/test-embedded-video" + Then the current page should not be an error page + And the page title should be "Demo: Wodonga Local Aboriginal Network - Bringing People Together" + And the hero banner title should be "Demo: Wodonga Local Aboriginal Network - Bringing People Together" + And there should be 2 breadcrumb items + And there should be 1 embedded videos + And the embedded video transcript should contain the text "this is the transcript" + + Scenario: Media page for video without transcript + When I attempt to visit the page "/test-embedded-video-no-transcript" + Then the current page should not be an error page + And the page title should be "Embedded video test - no transcript" + And the hero banner title should be "Embedded video test - no transcript" + And there should be 2 breadcrumb items + And there should be 1 embedded videos + diff --git a/packages/create-ripple-app/template/_tests/_modules/test/e2e/integration/core-modules/news/news.feature b/packages/create-ripple-app/template/_tests/_modules/test/e2e/integration/core-modules/news/news.feature new file mode 100644 index 000000000..e476d3cfd --- /dev/null +++ b/packages/create-ripple-app/template/_tests/_modules/test/e2e/integration/core-modules/news/news.feature @@ -0,0 +1,22 @@ +Feature: News page + + As a citizen I need to be able to read view news articles + + Scenario: BE - Creating a news page + Given I have logged into the backend + And in the backend there is a node at "/test-news-page" with "news/news-1" data + And in the backend there is a node at "/test-news-page-2" with "news/news-2" data + + Scenario: FE - News page + Given I visit the page "/test-news-page-1" + Then the page title should be "Test news page" + And the h1 should be "Test news page" + And there should be 2 breadcrumb items + And the hero banner title should be "Test news page" + And the hero banner desciption should be "Nulla ultricies dignissim leo, posuere vestibulum erat cursus vitae" + And the publish date and author component should exist + And the publish date and location should read "02/07/19 9.00am" + And the publish author should be "Published by Demo Department" + And the content rating component should exist + And the related links component should exist + And the content rating component should exist diff --git a/packages/create-ripple-app/template/_tests/_modules/test/e2e/integration/core-modules/page/page.feature b/packages/create-ripple-app/template/_tests/_modules/test/e2e/integration/core-modules/page/page.feature index b1ddec418..5077607c0 100644 --- a/packages/create-ripple-app/template/_tests/_modules/test/e2e/integration/core-modules/page/page.feature +++ b/packages/create-ripple-app/template/_tests/_modules/test/e2e/integration/core-modules/page/page.feature @@ -2,30 +2,33 @@ Feature: Basic Page As a citizen I want to view a Basic page within the site + Scenario: BE - create basic page + Given I have logged into the backend + And in the backend there is a node at "/8-be-page-1-create-basic-page" with "page/8-BE-page-1-basic-page" data + Scenario: 8-FE-page-2 View Basic Page - Given the "/8-be-page-1-create-basic-page" page exists with fixture "page/8-BE-page-1-basic-page" data When I visit the page "/8-be-page-1-create-basic-page" # Page Header Then the page title should be "8-BE-page-1 Create Basic page" And the hero banner desciption should be "Intro So now all who escaped death in battle or by shipwreck had got safely home except Ulysses, and he, though he was longing to return to his wife and country, was detained by the goddess Calypso, who had got him into a large cave and wanted to marry him. But as years went by, there came a time when the gods settled that he should go back to Ithaca; even then, however, when he was among his own people, his troubles were not yet over; nevertheless all the gods had now begun to pity him except Neptune, who still persecuted him without ceasing and would not let him get END." - # #Body + # wysiwyg And the order number 1 wysiwyg content contains fixture "snippets/callout" And the order number 1 wysiwyg content contains fixture "snippets/blockquote" - And the order number 1 wysiwyg content contains fixture "snippets/document" - # # Related Links + # And the order number 1 wysiwyg content contains fixture "snippets/document" + # Related Links And the related links component should exist And the related links title should be "Related links" And the related links should contain the following links: - | title | url | - | Related Link external text | https://emergency.vic.gov.au/respond/# | - | Department of Premier and Cabinet | https://www.vic.gov.au/department-premier-and-cabinet | + | title | url | + | Related Link external text | https://www.google.com | + | Department of Premier and Cabinet | https://www.google.com | # Whats Next And the whats next component should exist And the whats next title should be "What's next?" And the whats next links should be: - | title | url | - | State Government of Victoria | https://www.vic.gov.au | - | Department of Premier and Cabinet | https://www.vic.gov.au/department-premier-and-cabinet | + | title | url | + | State Government of Victoria | https://www.google.com | + | Department of Premier and Cabinet | https://www.google.com | # Share this And the share this component should exist And the share this component should have the title "Share this" @@ -34,3 +37,5 @@ Feature: Basic Page | Twitter | | Facebook | | LinkedIn | + + diff --git a/packages/create-ripple-app/template/_tests/_modules/test/e2e/integration/core-modules/profile/profile.feature b/packages/create-ripple-app/template/_tests/_modules/test/e2e/integration/core-modules/profile/profile.feature index 6ec686044..0060393ed 100644 --- a/packages/create-ripple-app/template/_tests/_modules/test/e2e/integration/core-modules/profile/profile.feature +++ b/packages/create-ripple-app/template/_tests/_modules/test/e2e/integration/core-modules/profile/profile.feature @@ -1,6 +1,18 @@ Feature: Profile page - This test is not ready yet + As a citizen I want to be able to see information about inductees in the honour roll. - @skip - Scenario: Test \ No newline at end of file + Scenario: BE - Create profile page + Given I have logged into the backend + And in the backend there is a node at "/profile-4-be-profile-1" with "profile/4-BE-Profile-1" data + + Scenario: FE - Profile page + When I visit the page "/profile-4-be-profile-1" + Then the page title should be "Profile-4-BE-profile-1" + And the h1 should be "Profile-4-BE-profile-1" + And there should be a honour roll profile image containing url "tram.jpg" + And there should be a description list with the following items: + | term | value | + | Inducted | 2017 | + | Category | Trailblazer | + And the order number 1 wysiwyg content contains fixture "profile/4-BE-Profile-1.html" \ No newline at end of file diff --git a/packages/create-ripple-app/template/_tests/_modules/test/e2e/integration/core-modules/publication/publication.feature b/packages/create-ripple-app/template/_tests/_modules/test/e2e/integration/core-modules/publication/publication.feature index 51e7cc0ea..7bcdfdc27 100644 --- a/packages/create-ripple-app/template/_tests/_modules/test/e2e/integration/core-modules/publication/publication.feature +++ b/packages/create-ripple-app/template/_tests/_modules/test/e2e/integration/core-modules/publication/publication.feature @@ -1,5 +1,50 @@ Feature: Publication - This test is not ready yet + + As a citizen I can view information for all available content on an publication page - @skip - Scenario: Test \ No newline at end of file + Scenario: Publication page + Given I visit the page "/demo-publication" + And the author information component should exist + Then there should be a description list with the following items: + | term | value | + | Author | Demo Department | + | Date | July 2019 | + And the anchor links component should exist + And the contact component should exist + And the accordion component should exist + And there should be a navigation card with the title "Demo Publication - Chapter 1" + And there should be a navigation card with the title "Demo Publication - Chapter 2" + And there should be a navigation card with the title "Demo Publication - Chapter 3" + And the content rating component should exist + + Scenario: Print all publication pages + Given the "/demo-publication" route exists + Given the "/demo-publication/demo-publication-chapter-1" route exists + Given the "/demo-publication/demo-publication-chapter-2" route exists + Given the "/demo-publication/demo-publication-chapter-1/demo-publication-chapter-1-page-1" route exists + When I visit the page "/demo-publication/print-all" + Then the page title should be "Demo Publication" + And the following section title ids should exist: + | section | + | demo-publication-chapter-1 | + | demo-publication-chapter-1-page-1 | + | demo-publication-chapter-2 | + | demo-publication-chapter-2-page-1 | + And the author information component should exist + And there should be a description list with the following items: + | term | value | + | Author | Demo Department | + | Date | July 2019 | + And the anchor links component should exist + And the anchor link title should be "On this page:" + And there should be the following anchor links: + | text | link | + | Demo Publication - Chapter 1 | demo-publication-chapter-1 | + | Demo Publication - Chapter 1 - Page 1 | demo-publication-chapter-1-page-1 | + | Demo Publication - Chapter 1 - Page 2 | demo-publication-chapter-1-page-2 | + | Demo Publication - Chapter 2 | demo-publication-chapter-2 | + | Demo Publication - Chapter 2 - Page 1 | demo-publication-chapter-2-page-1 | + | Demo Publication - Chapter 2 - Page 2 | demo-publication-chapter-2-page-2 | + | Demo Publication - Chapter 2 - Page 3 | demo-publication-chapter-2-page-3 | + | Demo Publication - Chapter 3 | demo-publication-chapter-3 | + And the contact component should exist diff --git a/packages/create-ripple-app/template/_tests/_modules/test/e2e/integration/core-modules/search/search.feature b/packages/create-ripple-app/template/_tests/_modules/test/e2e/integration/core-modules/search/search.feature deleted file mode 100644 index e74508c7a..000000000 --- a/packages/create-ripple-app/template/_tests/_modules/test/e2e/integration/core-modules/search/search.feature +++ /dev/null @@ -1,6 +0,0 @@ -Feature: Search - - This test is not ready yet - - @skip - Scenario: Test \ No newline at end of file diff --git a/packages/create-ripple-app/template/_tests/_modules/test/e2e/integration/core-modules/search/sitesearch.feature b/packages/create-ripple-app/template/_tests/_modules/test/e2e/integration/core-modules/search/sitesearch.feature new file mode 100644 index 000000000..65afa2b49 --- /dev/null +++ b/packages/create-ripple-app/template/_tests/_modules/test/e2e/integration/core-modules/search/sitesearch.feature @@ -0,0 +1,45 @@ +Feature: Search (Site search) + + As a citizen I want to be able to search the site for information I want by keyword + + Scenario: Test search page loads SSR + Given I am using a "macbook-15" device + When I visit the page "/search" + Then the current page should not be an error page + + Scenario: Global site search from header desktop + Given I have mocked the search request with fixture "search/sitesearch" and params "from=0&size=10&filter_path=hits.hits,hits.total,aggregations&_source=changed,created,field_landing_page_summary,field_node_primary_site,field_page_intro_text,field_tags_name,field_topic_name,summary_processed,title,type,url" + Given I have mocked the search request with fixture "search/sitesearch-filters" and params "size=0" + Given I am using a "macbook-15" device + When I visit the page "/" + Then the search button in the site header should exist + Then the search button in the site header should have the text "Search website" + When I scroll to the "top" of the page + And I click the search button in the site header + Then the site search box should be visible + Then the site search box should have the placeholder "Start typing..." + When I type "victoria" into the site search input and hit enter + Then I should be on the page "/search?q=victoria" + And the current page should not be an error page + Then there should be "10 of 577" search results + And there should be the following search results: + | title | url | date | description | + | About Women Victoria | /about-women-victoria | Sep 19, 2019 | Women Victoria aims to change attitudes and promote gender equality, prevent family violence and increase the number women in leadership. | + | Industrial Relations Victoria | /industrial-relations-victoria | Sep 17, 2019 | Industrial Relations Victoria works towards achieving a positive working environment for all Victorians. | + | NDIS providers in Victoria | /ndis-providers-victoria | Jul 22, 2019 | Information and resources for disability service providers, including how to register and your obligations around quality and safeguards. | + | About Australia Day Victoria | /about-australia-day-victoria | Apr 29, 2019 | In Victoria, we celebrate Australia Day with a large program of events and activities. | + | Family Safety Victoria established | /family-safety-victoria-launched | Sep 4, 2019 | | + | Renting in Victoria | /renting-victoria | Jul 31, 2019 | Support and advice for renters, information for property managers and changes to renting laws. | + | Polocrosse Victoria Tournament | /polocrosse-victoria-tournament | Sep 13, 2019 | | + | Brand Victoria Guidelines | /brand-victoria-guidelines | May 15, 2019 | The Brand Victoria Guidelines must be used for all Victorian Government communications and advertising. Covers logos, fonts, colour and other elements. | + | Family Safety Victoria | /family-safety-victoria | Oct 17, 2019 | Family Safety Victoria was established in July 2017 to drive key elements of Victoria’s family violence strategy and coordinate support for families to help them care for children and young people.| + | Wage Inspectorate Victoria | /wage-inspectorate-victoria | Sep 19, 2019 | The Victorian Wage Inspectorate provides practical advice, information and support to Victorian employees and employers about state-specific laws, their work rights and responsibilities. | + And the pagination component should exist + And the pagination component should have 5 steps + And page 1 should be active in the pagination component + + Scenario: Global site search from header mobile + Given I am using a "iphone-6+" device + When I visit the page "/" + Then the search button in the site header should exist + And the search button text in the site header should not be visible diff --git a/packages/create-ripple-app/template/_tests/_modules/test/e2e/integration/core-modules/search/topic-tags-search.feature b/packages/create-ripple-app/template/_tests/_modules/test/e2e/integration/core-modules/search/topic-tags-search.feature new file mode 100644 index 000000000..fe9adfeb9 --- /dev/null +++ b/packages/create-ripple-app/template/_tests/_modules/test/e2e/integration/core-modules/search/topic-tags-search.feature @@ -0,0 +1,17 @@ +Feature: Topics and Tags Search Page + + As a Citizen I can explore results on the site for a given tag/topic so that I can navigate to the related content I want to read + + Scenario: View tag search results + When I visit the page "/tags/aboriginal-victorians" + Then the page title should be "Tags - Aboriginal Victorians" + And the h1 should be "Aboriginal Victorians" + And the search results component should exist + And the content rating component should exist + + Scenario: View topic search results + When I visit the page "/topic/arts-culture-and-heritage" + Then the page title should be "Topic - Arts, culture and heritage" + And the h1 should be "Arts, culture and heritage" + And the search results component should exist + And the content rating component should exist \ No newline at end of file diff --git a/packages/create-ripple-app/template/_tests/_modules/test/e2e/integration/core-modules/site/sitemap.feature b/packages/create-ripple-app/template/_tests/_modules/test/e2e/integration/core-modules/site/sitemap.feature index 0f5538743..a9830f638 100644 --- a/packages/create-ripple-app/template/_tests/_modules/test/e2e/integration/core-modules/site/sitemap.feature +++ b/packages/create-ripple-app/template/_tests/_modules/test/e2e/integration/core-modules/site/sitemap.feature @@ -1,5 +1,15 @@ Feature: Sitemap - This test is not ready yet + As a citizen I want to be able to see all pages available in the site - @skip - Scenario: Test \ No newline at end of file + Scenario: Sitemap page + Given I visit the page "/sitemap" + Then the page title should be "Site map" + And the h1 should be "Site Map" + And the site header is visible + And the site footer is visible + And there should be 2 breadcrumb items + And the sitemap component should exist + + Scenario: Sitemap xml + Given a request is made to "/sitemap.xml" + Then the response code should be 200 \ No newline at end of file diff --git a/packages/create-ripple-app/template/_tests/_modules/test/e2e/integration/core-modules/webform/contact-form.feature b/packages/create-ripple-app/template/_tests/_modules/test/e2e/integration/core-modules/webform/contact-form.feature new file mode 100644 index 000000000..992ec7047 --- /dev/null +++ b/packages/create-ripple-app/template/_tests/_modules/test/e2e/integration/core-modules/webform/contact-form.feature @@ -0,0 +1,42 @@ +Feature: Contact form + + As a public user I can submit a question to the site authors + + Scenario: Submit a contact form - success + Given I stubbed the form "connect_with_us" response with "webforms/contact-us-form-success" fixture + And I visit the page "/contact-us" + And i enter the following information into the form "form-connect_with_us": + | label | value | type | + | What type of enquiry do you have? | General enquiry | rpl-select | + | What best describes your enquiry? | test | textarea | + | Full name | Dylan kelly | text | + | Email address | test-dpc@mailinator.com | text | + | Contact number | 03 9999 9999 | tel | + | I have read and understand how Department of Premier and Cabinet stores information. | true | checkbox | + + And I click the form submit button "Submit" + When I wait for 5 seconds + Then I should see the form success message + + Scenario: Submit a contact form - submission failure + Given I stubbed the form "connect_with_us" response with "webforms/contact-us-form-failure" fixture + And I visit the page "/contact-us" + And i enter the following information into the form "form-connect_with_us": + | label | value | type | + | What type of enquiry do you have? | General enquiry | rpl-select | + | What best describes your enquiry? | test | textarea | + | Full name | Dylan kelly | text | + | Email address | test-dpc@mailinator.com | text | + | Contact number | 03 9999 9999 | tel | + | I have read and understand how Department of Premier and Cabinet stores information. | true | checkbox | + + And I click the form submit button "Submit" + When I wait for 5 seconds + Then I should see the form failure message + + Scenario: Submit a contact form - validation + Given I stubbed the form "tide_webform_contact_us" response with "webforms/contact-us-form-failure" fixture + And I visit the page "/contact-us" + When I click the form submit button "Submit" + And I should see 4 form validation errors + diff --git a/packages/create-ripple-app/template/_tests/_modules/test/e2e/integration/core-modules/webform/content-rating.feature b/packages/create-ripple-app/template/_tests/_modules/test/e2e/integration/core-modules/webform/content-rating.feature new file mode 100644 index 000000000..747a0df94 --- /dev/null +++ b/packages/create-ripple-app/template/_tests/_modules/test/e2e/integration/core-modules/webform/content-rating.feature @@ -0,0 +1,24 @@ +Feature: Content rating form + + As a public user I can submit feedback about a page + + Scenario: Submit a content rating form - success + Given I stubbed the form "tide_webform_content_rating" response with "webforms/content-rating-form-success" fixture + And I visit the page "/" + And I enter the following into the content rating form: + | helpful | comment | + | Yes | this is a test comment | + And I click the form submit button "Submit" + When I wait for 5 seconds + Then I should see the form success message + + Scenario: Submit a content rating form - failure + Given I stubbed the form "tide_webform_content_rating" response with "webforms/content-rating-form-failure" fixture + And I visit the page "/" + And I enter the following into the content rating form: + | helpful | comment | + | Yes | this is a test comment | + And I click the form submit button "Submit" + When I wait for 5 seconds + Then I should see the form failure message + diff --git a/packages/create-ripple-app/template/_tests/_modules/test/e2e/integration/core-modules/webform/webform.feature b/packages/create-ripple-app/template/_tests/_modules/test/e2e/integration/core-modules/webform/webform.feature new file mode 100644 index 000000000..c75f3ce05 --- /dev/null +++ b/packages/create-ripple-app/template/_tests/_modules/test/e2e/integration/core-modules/webform/webform.feature @@ -0,0 +1,54 @@ +Feature: Webform + + As a site admin I can create a webform and receive submissions + + Scenario: BE - Create a custom webform + Given I have logged into the backend + Given in the backend there there is a form named "test-form" with the fixture "webforms/test_form" + And in the backend there is a node at "/test-form" with "webforms/test-form-page" data + + Scenario: FE - test form submission + When I visit the page "/test-form" + Given I stubbed the form "test_form_1" response with "webforms/contact-us-form-success" fixture + And i enter the following information into the form "form-test_form_1": + | label | value | type | + | Text field | General enquiry | text | + | Textarea | test | textarea | + | Email | tester@mailinator.com | email | + | Telephone | 03 999 0000 | tel | + | Number | 12345678910 | number | + | Select | Option 1 | rpl-select | + | Date | 18/03/2020 | date | + | Radios | Option 2 | radios | + | Checkboxes | true | checkbox | + | I have read and understand how Department of Premier and Cabinet stores information. | true | checkbox | + + And I click the form submit button "Submit" + When I wait for 5 seconds + Then I should see the form success message + + Scenario: FE - test form submission failure + When I visit the page "/test-form" + Given I stubbed the form "test_form_1" response with "webforms/contact-us-form-failure" fixture + And i enter the following information into the form "form-test_form_1": + | label | value | type | + | Text field | General enquiry | text | + | Textarea | test | textarea | + | Email | tester@mailinator.com | email | + | Telephone | 03 999 0000 | tel | + | Number | 12345678910 | number | + | Select | Option 1 | rpl-select | + | Date | 18/03/2020 | date | + | Radios | Option 2 | radios | + | Checkboxes | true | checkbox | + | I have read and understand how Department of Premier and Cabinet stores information. | true | checkbox | + + And I click the form submit button "Submit" + When I wait for 5 seconds + Then I should see the form failure message + + Scenario: FE - test form validation + When I visit the page "/test-form" + When I click the form submit button "Submit" + And I should see 4 form validation errors + diff --git a/packages/create-ripple-app/template/_tests/_modules/test/e2e/integration/core-modules/webform/webforms.feature b/packages/create-ripple-app/template/_tests/_modules/test/e2e/integration/core-modules/webform/webforms.feature deleted file mode 100644 index a57b1b76e..000000000 --- a/packages/create-ripple-app/template/_tests/_modules/test/e2e/integration/core-modules/webform/webforms.feature +++ /dev/null @@ -1,6 +0,0 @@ -Feature: Webforms - - This test is not ready yet - - @skip - Scenario: Test \ No newline at end of file diff --git a/packages/create-ripple-app/template/_tests/_smoke/test/e2e/integration/smoke/tide-is-up.feature b/packages/create-ripple-app/template/_tests/_smoke/test/e2e/integration/smoke/tide-is-up.feature index d038e74a7..292f26673 100644 --- a/packages/create-ripple-app/template/_tests/_smoke/test/e2e/integration/smoke/tide-is-up.feature +++ b/packages/create-ripple-app/template/_tests/_smoke/test/e2e/integration/smoke/tide-is-up.feature @@ -4,15 +4,15 @@ Feature: Test Tide backend is up @smoke Scenario: Route endpoint returns a correct response - Given a request is made to "/api/v1/route?site=4&path=/" + Given a request is made to "/api/v1/route?site=<%= siteid %>&path=/" Then the response code should be 200 @smoke Scenario: Sites endpoint returns a correct response - Given a request is made to "/api/v1/taxonomy_term/sites?site=4" + Given a request is made to "/api/v1/taxonomy_term/sites?site=<%= siteid %>" Then the response code should be 200 @smoke Scenario: Alert endpoint returns a correct response - Given a request is made to "/api/v1/node/alert?site=4&include=field_alert_type" + Given a request is made to "/api/v1/node/alert?site=<%= siteid %>&include=field_alert_type" Then the response code should be 200 \ No newline at end of file diff --git a/packages/create-ripple-app/update.sh b/packages/create-ripple-app/update.sh index b5a757b17..684355555 100755 --- a/packages/create-ripple-app/update.sh +++ b/packages/create-ripple-app/update.sh @@ -14,3 +14,7 @@ mv template/_tests/_common/test/e2e/fixtures template/_tests/_modules/test/e2e/f # Move snippets back mkdir -p template/_tests/_common/test/e2e/fixtures/snippets mv template/_tests/_modules/test/e2e/fixtures/snippets/* template/_tests/_common/test/e2e/fixtures/snippets/ + +# Replace vic.gov.au with domain var + +find template/_tests/_modules/test/e2e/fixtures -name '*.yml' -exec sed -i '' -e 's/vic.gov.au/<%= domain %>/g' {} \; diff --git a/packages/ripple-nuxt-tide/lib/components/AppContentRating.vue b/packages/ripple-nuxt-tide/lib/components/AppContentRating.vue index 168df1045..adb8428d7 100644 --- a/packages/ripple-nuxt-tide/lib/components/AppContentRating.vue +++ b/packages/ripple-nuxt-tide/lib/components/AppContentRating.vue @@ -1,6 +1,7 @@