Skip to content

Commit

Permalink
Merge pull request #785 from dpc-sdp/chore/cypress-env-ci
Browse files Browse the repository at this point in the history
Update cypress action for layers so that it is generic for all layers
  • Loading branch information
waitingallday authored Aug 20, 2023
2 parents bd77b09 + b482350 commit 801e29a
Show file tree
Hide file tree
Showing 34 changed files with 187 additions and 111 deletions.
1 change: 1 addition & 0 deletions .github/workflows/components.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: UI Libraries
on:
push:
paths:
- '.github/workflows/components.yml'
- 'packages/ripple-storybook/**'
- 'packages/ripple-ui-core/**'
- 'packages/ripple-ui-forms/**'
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: Docs
on:
push:
paths:
- '.github/workflows/docs.yml'
- 'docs'
- 'packages/ripple-ui-core/**'
- 'packages/ripple-ui-forms/**'
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/nuxt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: Nuxt
on:
push:
paths:
- '.github/workflows/nuxt.yml'
- 'examples/nuxt-app/**'
- 'packages/**'
- 'pnpm-lock.yaml'
Expand Down Expand Up @@ -61,10 +62,9 @@ jobs:
env:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
TZ: 'Australia/Melbourne'
NUXT_PUBLIC_TIDE_BASE_URL: 'https://develop.content.reference.sdp.vic.gov.au/'
NUXT_PUBLIC_TIDE_SITE: '8888'
NUXT_PUBLIC_TIDE_BASE_URL: 'https://test.base.url/'
NUXT_PUBLIC_TIDE_SITE: 'TEST_SITE'
NUXT_PUBLIC_API_URL: 'http://localhost:3001'
NUXT_PUBLIC_TIDE_APP_SEARCH_ENGINE_NAME: a83890f7a31dea14e1ae83c6f0afacca-appsearch-index-default-node
API_PORT: '3001'
LOG_LEVEL: 'debug'
# DEBUG: '@cypress/github-action'
Expand All @@ -74,4 +74,4 @@ jobs:
install: false
build: pnpm build
start: pnpm start
wait-on: 'http://localhost:3000/api/tide/site?id=8888'
wait-on: 'http://localhost:3000/assets/fonts/VIC-Regular.woff2'
1 change: 1 addition & 0 deletions .github/workflows/vue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: Vue
on:
push:
paths:
- '.github/workflows/vue.yml'
- 'examples/vue-app/**'
- 'packages/ripple-ui-core/**'
- 'packages/ripple-ui-forms/**'
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/webcomponents.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: Webcomponents
on:
push:
paths:
- '.github/workflows/webcomponents.yml'
- 'examples/webcomponents/**'
- 'packages/ripple-ui-core/**'
- 'packages/ripple-ui-forms/**'
Expand Down
3 changes: 2 additions & 1 deletion examples/nuxt-app/cypress.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import * as rplCypressConfigPkg from '@dpc-sdp/ripple-test-utils'
export default defineConfig({
projectId: 'mie4kg',
env: {
searchIndex: process.env.NUXT_PUBLIC_TIDE_APP_SEARCH_ENGINE_NAME
searchIndex: process.env.NUXT_PUBLIC_TIDE_APP_SEARCH_ENGINE_NAME,
NUXT_PUBLIC_TIDE_SITE: process.env.NUXT_PUBLIC_TIDE_SITE,
},
e2e: {
baseUrl: 'http://localhost:3000',
Expand Down
6 changes: 3 additions & 3 deletions examples/nuxt-app/test/features/errors/errors.feature
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ Feature: Error pages
As a site user I can see relevant error pages displayed.

Background:
Given the endpoint "/api/tide/site" with query "?id=8888" returns fixture "/site/reference" with status 200
Given the site endpoint returns fixture "/site/reference" with status 200

@mockserver
Example: 500
Given the endpoint "/api/tide/page" with query "?path=/500&site=8888" returns fixture "/errors/500" with status 500
Given the page endpoint for path "/500" returns fixture "/errors/500" with status 500
When I visit the page "/500"
Then the error page "/500" has a status of 500
And the error content contains the status 500

@mockserver
Example: 404
Given the endpoint "/api/tide/page" with query "?path=/404&site=8888" returns fixture "/errors/404" with status 404
Given the page endpoint for path "/404" returns fixture "/errors/404" with status 404
When I visit the page "/404"
Then the error page "/404" has a status of 404
And the error content contains the status 404
Expand Down
4 changes: 2 additions & 2 deletions examples/nuxt-app/test/features/event/event.feature
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ Feature: Event page
Example of mocked page

Background:
Given the endpoint "/api/tide/page" with query "?path=/sample-event&site=8888" returns fixture "/event/sample-event" with status 200
And the endpoint "/api/tide/site" with query "?id=8888" returns fixture "/site/reference" with status 200
Given the page endpoint for path "/sample-event" returns fixture "/event/sample-event" with status 200
And the site endpoint returns fixture "/site/reference" with status 200
When I visit the page "/sample-event"

@mockserver
Expand Down
4 changes: 2 additions & 2 deletions examples/nuxt-app/test/features/grant/grant.feature
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ Feature: Grant page
Example of mocked page

Background:
Given the endpoint "/api/tide/page" with query "?path=/tc-9a-grant-simple-test-date-range&site=8888" returns fixture "/grant/tc-9a-grant-simple-test-date-range" with status 200
And the endpoint "/api/tide/site" with query "?id=8888" returns fixture "/site/reference" with status 200
Given the page endpoint for path "/tc-9a-grant-simple-test-date-range" returns fixture "/grant/tc-9a-grant-simple-test-date-range" with status 200
And the site endpoint returns fixture "/site/reference" with status 200
When I visit the page "/tc-9a-grant-simple-test-date-range"

@mockserver
Expand Down
28 changes: 14 additions & 14 deletions examples/nuxt-app/test/features/landingpage/forms.feature
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ Feature: Forms
@mockserver
Scenario: Kitchen sink
Given the mock server has started
And the endpoint "/api/tide/page" with query "?path=/kitchen-sink&site=8888" returns fixture "/landingpage/full-form" with status 200
And the endpoint "/api/tide/site" with query "?id=8888" returns fixture "/site/reference" with status 200
And the page endpoint for path "/kitchen-sink" returns fixture "/landingpage/full-form" with status 200
And the site endpoint returns fixture "/site/reference" with status 200
Given I visit the page "/kitchen-sink"
Then the landing page component "TideLandingPageWebForm" should exist
And the form with ID "full_form" should exist
Expand Down Expand Up @@ -42,8 +42,8 @@ Feature: Forms
@mockserver
Scenario: Error summary
Given the mock server has started
And the endpoint "/api/tide/page" with query "?path=/kitchen-sink&site=8888" returns fixture "/landingpage/full-form" with status 200
And the endpoint "/api/tide/site" with query "?id=8888" returns fixture "/site/reference" with status 200
And the page endpoint for path "/kitchen-sink" returns fixture "/landingpage/full-form" with status 200
And the site endpoint returns fixture "/site/reference" with status 200
Given I visit the page "/kitchen-sink"
Then the landing page component "TideLandingPageWebForm" should exist
And the form with ID "full_form" should exist
Expand All @@ -61,8 +61,8 @@ Feature: Forms
@mockserver
Scenario: Simple validation
Given the mock server has started
And the endpoint "/api/tide/page" with query "?path=/kitchen-sink&site=8888" returns fixture "/landingpage/full-form" with status 200
And the endpoint "/api/tide/site" with query "?id=8888" returns fixture "/site/reference" with status 200
And the page endpoint for path "/kitchen-sink" returns fixture "/landingpage/full-form" with status 200
And the site endpoint returns fixture "/site/reference" with status 200
Given I visit the page "/kitchen-sink"
Then the landing page component "TideLandingPageWebForm" should exist
And the form with ID "full_form" should exist
Expand All @@ -79,9 +79,9 @@ Feature: Forms
@mockserver
Scenario: Form submission - Error
Given the mock server has started
And the endpoint "/api/tide/page" with query "?path=/kitchen-sink&site=8888" returns fixture "/landingpage/full-form" with status 200
And the endpoint "/api/tide/site" with query "?id=8888" returns fixture "/site/reference" with status 200
And posting to endpoint "/api/tide/webform_submission/full_form" with query "?id=8888" returns fixture "/landingpage/full-form-error-response" with status 500
And the page endpoint for path "/kitchen-sink" returns fixture "/landingpage/full-form" with status 200
And the site endpoint returns fixture "/site/reference" with status 200
And posting form to endpoint "/api/tide/webform_submission/full_form" returns fixture "/landingpage/full-form-error-response" with status 500
Given I visit the page "/kitchen-sink"
Then the landing page component "TideLandingPageWebForm" should exist
And the form with ID "full_form" should exist
Expand All @@ -100,9 +100,9 @@ Feature: Forms
@mockserver
Scenario: Form submission - Success
Given the mock server has started
And the endpoint "/api/tide/page" with query "?path=/kitchen-sink&site=8888" returns fixture "/landingpage/full-form" with status 200
And the endpoint "/api/tide/site" with query "?id=8888" returns fixture "/site/reference" with status 200
And posting to endpoint "/api/tide/webform_submission/full_form" with query "?site=8888" returns fixture "/landingpage/full-form-success-response" with status 201
And the page endpoint for path "/kitchen-sink" returns fixture "/landingpage/full-form" with status 200
And the site endpoint returns fixture "/site/reference" with status 200
And posting form to endpoint "/api/tide/webform_submission/full_form" returns fixture "/landingpage/full-form-success-response" with status 201
Given I visit the page "/kitchen-sink"
Then the landing page component "TideLandingPageWebForm" should exist
And the form with ID "full_form" should exist
Expand All @@ -128,8 +128,8 @@ Feature: Forms
@mockserver
Scenario: Field counter
Given the mock server has started
And the endpoint "/api/tide/page" with query "?path=/kitchen-sink&site=8888" returns fixture "/landingpage/full-form" with status 200
And the endpoint "/api/tide/site" with query "?id=8888" returns fixture "/site/reference" with status 200
And the page endpoint for path "/kitchen-sink" returns fixture "/landingpage/full-form" with status 200
And the site endpoint returns fixture "/site/reference" with status 200
Given I visit the page "/kitchen-sink"
Then the landing page component "TideLandingPageWebForm" should exist
And the form with ID "full_form" should exist
Expand Down
8 changes: 4 additions & 4 deletions examples/nuxt-app/test/features/landingpage/home.feature
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ Feature: Home page

Example of mocked page
Background:
Given the endpoint "/api/tide/page" with query "?path=/&site=8888" returns fixture "/landingpage/home" with status 200
And the endpoint "/api/tide/site" with query "?id=8888" returns fixture "/site/reference" with status 200
Given the page endpoint for path "/" returns fixture "/landingpage/home" with status 200
And the site endpoint returns fixture "/site/reference" with status 200
Given I visit the page "/"

@mockserver
Scenario: On 404
Given the endpoint "/api/tide/page" with query "?path=/404&site=8888" returns fixture "/errors/404" with status 404
Given the page endpoint for path "/404" returns fixture "/errors/404" with status 404
Given I visit the page "/404"

@mockserver
Expand Down Expand Up @@ -62,7 +62,7 @@ Feature: Home page

@mockserver
Scenario: Header component - Search banner
Given the endpoint "/api/tide/page" with query "?path=/search/cats&site=8888" returns fixture "/landingpage/home" with status 200
Given the page endpoint for path "/search/cats" returns fixture "/landingpage/home" with status 200
Then a search banner with ID "1911" should exist with the placeholder "Test search placeholder"
Then in a search banner with ID "1911", searching for "cats" should take me to "/search/cats"

Expand Down
6 changes: 3 additions & 3 deletions examples/nuxt-app/test/features/landingpage/languages.feature
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
Feature: Languages

Background:
Given the endpoint "/api/tide/site" with query "?id=8888" returns fixture "/site/reference" with status 200
Given the site endpoint returns fixture "/site/reference" with status 200

@mockserver
Scenario: RTL languages load with the correct font and direction
Given the endpoint "/api/tide/page" with query "?path=/arabic-page&site=8888" returns fixture "/landingpage/languages-ar" with status 200
Given the page endpoint for path "/arabic-page" returns fixture "/landingpage/languages-ar" with status 200
When I visit the page "/arabic-page"
Then The section ".rpl-header" should be display "rtl" in "ar" with the font "Noto Kufi Arabic"
And The section "#rpl-main" should be display "rtl" in "ar" with the font "Noto Kufi Arabic"

@mockserver
Scenario: LTR languages load with the correct font and direction
Given the endpoint "/api/tide/page" with query "?path=/korean-page&site=8888" returns fixture "/landingpage/languages-ko" with status 200
Given the page endpoint for path "/korean-page" returns fixture "/landingpage/languages-ko" with status 200
When I visit the page "/korean-page"
Then The section ".rpl-header" should be display "ltr" in "ko" with the font "Noto Sans KR"
And The section "#rpl-main" should be display "ltr" in "ko" with the font "Noto Sans KR"
8 changes: 4 additions & 4 deletions examples/nuxt-app/test/features/media/media.feature
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ Feature: Media page

@mockserver
Example: Video
Given the endpoint "/api/tide/page" with query "?path=/media/36&site=8888" returns fixture "/media/36" with status 200
And the endpoint "/api/tide/site" with query "?id=8888" returns fixture "/site/reference" with status 200
Given the page endpoint for path "/media/36" returns fixture "/media/36" with status 200
And the site endpoint returns fixture "/site/reference" with status 200
When I visit the page "/media/36"
Then the title should be "Demo: Embedded Video"
And the media page should display content which includes "Video transcript content"
Expand All @@ -14,8 +14,8 @@ Feature: Media page

@mockserver
Example: Audio
Given the endpoint "/api/tide/page" with query "?path=/media/271&site=8888" returns fixture "/media/271" with status 200
And the endpoint "/api/tide/site" with query "?id=8888" returns fixture "/site/reference" with status 200
Given the page endpoint for path "/media/271" returns fixture "/media/271" with status 200
And the site endpoint returns fixture "/site/reference" with status 200
When I visit the page "/media/271"
Then the title should be "Demo: Audio"
And the media page should display content which includes "Audio transcript content"
Expand Down
4 changes: 2 additions & 2 deletions examples/nuxt-app/test/features/news/news.feature
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Feature: News page

Background:
Given the endpoint "/api/tide/page" with query "?path=/sample-news&site=8888" returns fixture "/news/sample-news" with status 200
And the endpoint "/api/tide/site" with query "?id=8888" returns fixture "/site/reference" with status 200
Given the page endpoint for path "/sample-news" returns fixture "/news/sample-news" with status 200
And the site endpoint returns fixture "/site/reference" with status 200
When I visit the page "/sample-news"

@mockserver
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ Feature: Publication page page
Example of mocked page

Background:
Given the endpoint "/api/tide/page" with query "?path=/demo-publication/demo-publication-chapter-1&site=8888" returns fixture "/publication-page/sample-publication-page" with status 200
Given the page endpoint for path "/demo-publication/demo-publication-chapter-1" returns fixture "/publication-page/sample-publication-page" with status 200
And the endpoint "/api/tide/publication-index" with query "?id=11dede11-10c0-111e1-1100-000000000500" returns fixture "/publication/sample-index" with status 200
And the endpoint "/api/tide/site" with query "?id=8888" returns fixture "/site/reference" with status 200
And the site endpoint returns fixture "/site/reference" with status 200

@mockserver
Example: On load
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ Feature: Publication page
Example of mocked page

Background:
Given the endpoint "/api/tide/page" with query "?path=/sample-publication&site=8888" returns fixture "/publication/sample-publication" with status 200
Given the page endpoint for path "/sample-publication" returns fixture "/publication/sample-publication" with status 200
And the endpoint "/api/tide/publication-index" with query "?id=11dede11-10c0-111e1-1100-000000000500" returns fixture "/publication/sample-index" with status 200
And the endpoint "/api/tide/site" with query "?id=8888" returns fixture "/site/reference" with status 200
And the site endpoint returns fixture "/site/reference" with status 200

@mockserver
Example: On load
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ Feature: Search listing - Aggregations
As a user I can see lists of values filter values, sourced from either drupal Taxonomies or Elastic Aggregations

Background:
Given the endpoint "/api/tide/site" with query "?id=8888" returns fixture "/site/reference" with status 200
Given the site endpoint returns fixture "/site/reference" with status 200
And the search autocomplete request is stubbed with "/search-listing/suggestions/none" fixture
And I am using a "macbook-16" device

@mockserver
Example: Aggregations and Taxonomies
Given the endpoint "/api/tide/page" with query "?path=/aggregations&site=8888" returns fixture "/search-listing/aggregations/page" with status 200
Given the page endpoint for path "/aggregations" returns fixture "/search-listing/aggregations/page" with status 200
And the search network request is stubbed with fixture "/search-listing/aggregations/response" and status 200
And the current date is "Fri, 02 Feb 2050 03:04:05 GMT"

Expand Down
6 changes: 3 additions & 3 deletions examples/nuxt-app/test/features/search-listing/errors.feature
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ Feature: Searching listing - Errors
As a user I get notified of problems on the search listing page

Background:
Given the endpoint "/api/tide/site" with query "?id=8888" returns fixture "/site/reference" with status 200
Given the site endpoint returns fixture "/site/reference" with status 200
And the search autocomplete request is stubbed with "/search-listing/suggestions/none" fixture
And I am using a "macbook-16" device

@mockserver
Example: No results message
Given the endpoint "/api/tide/page" with query "?path=/errors&site=8888" returns fixture "/search-listing/errors/page" with status 200
Given the page endpoint for path "/errors" returns fixture "/search-listing/errors/page" with status 200
And the search network request is stubbed with fixture "/search-listing/errors/response-empty" and status 200
And the current date is "Fri, 02 Feb 2050 03:04:05 GMT"
When I visit the page "/errors"
Expand All @@ -32,7 +32,7 @@ Feature: Searching listing - Errors

@mockserver
Example: Search error
Given the endpoint "/api/tide/page" with query "?path=/errors&site=8888" returns fixture "/search-listing/errors/page" with status 200
Given the page endpoint for path "/errors" returns fixture "/search-listing/errors/page" with status 200
And the search network request is stubbed with fixture "/search-listing/errors/response-error" and status 403
And the current date is "Fri, 02 Feb 2050 03:04:05 GMT"
When I visit the page "/errors"
Expand Down
Loading

0 comments on commit 801e29a

Please sign in to comment.