Skip to content

Commit

Permalink
Adds ability to upload test fixture via YAML file (#469)
Browse files Browse the repository at this point in the history
* Added missing auth token

* [SDPA-2709] Add WIP create-ripple-app package

* Adds ability to define config from json file.

* add template dir to eslint ignorefile

* Add readme

* Add example gif

* fix path

* fix typo

* WIP on per site tests

* Adds script to run all tests

* Adds variable run and test commands

* Adds ability to create node via YAML

* Trigger the build

* Added auth token to route request to make it work

* Remove tests from base project to per example

* Convert Events test to yaml upload

* Adds tests by enabled tide module

* Clean up tests, add basic auth to cypress

* Adds placeholders for each test

* Clean up test folders and move common step_definitions to ripple-test-tools

* dont fail on 404

* fix lint

* Add placeholder tests

* Update tests in create-ripple-app

* fix lint

* remove console

* Update ripple version number and Readme

* Fix authenticated content and event tests

* Adds tests for simple page

* Adds tests for simple page

* CR fixes

* Adds script to update tests

* Add example content to update script

* update ripple-test-tools in example app
  • Loading branch information
dylankelly authored Aug 14, 2019
1 parent 21d6dbb commit 775a1d1
Show file tree
Hide file tree
Showing 158 changed files with 2,622 additions and 1,216 deletions.
2 changes: 1 addition & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
module.exports = process.env.CYPRESS_ENV ? {} : {
presets: [
[
'@babel/preset-env',
Expand Down
File renamed without changes.
14 changes: 14 additions & 0 deletions examples/vic-gov-au/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@
"build": "run-script-os",
"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-smoke": "cypress run -e TAGS='@smoke' --spec 'test/e2e/integration/smoke/*'",
"test:dev": "cross-env BASIC_AUTH=0 start-server-and-test start:build http://localhost:3000 cy:open",
"test:smoke": "start-server-and-test start:build http://localhost:3000 cy:run-smoke",
"test:e2e": "start-server-and-test start:build http://localhost:3000 cy:run",
"test:unit": "cross-env BASIC_AUTH=0 NODE_ENV=test jest",
"start": "run-script-os",
"start:default": "if [ \"$NUXT_HOT_RELOADING\" = \"1\" ] ; then nuxt; else nuxt start; fi",
Expand All @@ -27,6 +33,11 @@
"@babel/plugin-transform-runtime": "^7.4.4",
"@babel/preset-env": "^7.5.0",
"@babel/runtime": "^7.5.1",
"@dpc-sdp/ripple-test-tools": "1.0.0",
"cypress": "^3.1.5",
"cypress-axe": "^0.4.0",
"cypress-cucumber-preprocessor": "^1.11.0",
"start-server-and-test": "^1.7.11",
"babel-core": "^7.0.0-bridge.0",
"babel-eslint": "^10.0.1",
"babel-jest": "^24.8.0",
Expand All @@ -51,6 +62,9 @@
"sass-resources-loader": "^2.0.0",
"vue-jest": "^3.0.4"
},
"cypress-cucumber-preprocessor": {
"nonGlobalStepDefinitions": true
},
"browserslist": [
"> 1%",
"IE 11",
Expand Down
169 changes: 169 additions & 0 deletions examples/vic-gov-au/test/e2e/fixtures/event/2-BE-event-1.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
- entity: node
type: event
title: 2-BE-event-1
uid: 1
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_news_intro_text: Nulla ultricies dignissim leo, posuere vestibulum erat cursus vitae
field_landing_page_summary: Tell me, O muse, of that ingenious hero who travelled far and wide after he had sacked the famous town of Troy. Many cities did he visit, and many were the nations with whose manners and customs END
field_event_description:
- format: rich_text
value: |
<p>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.</p>
# Body content.
body:
- format: rich_text
value: |
<p>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.</p>
# Event details.
field_event_details:
- entity: paragraph
type: event_details
field_paragraph_date_range:
- value: '2019-05-20T11:02:20'
end_value: '2019-05-20T11:11:1'
field_paragraph_location:
- country_code: AU
administrative_area: VIC
locality: Melbourne
postal_code: 3000
address_line1: 45 Collins St
address_line2:
field_paragraph_event_price_from: 34.33
field_paragraph_event_price_to: 89.95
field-event-requirements: Accessible venue (84)
field_paragraph_link:
- uri: http://examplebook.com
title: Booking URL

field_event_category:
- '#process':
callback: reference
args:
- taxonomy_term
- vid: event
name: 'Film and cinema (78)'
field_node_link:
- uri: http://www.weatherzone.com.au/vic/central/healesville
# Event author.
field_node_author: Full Name
field_node_email: [email protected]
field_node_phone: '12345678'
# Related links
field_show_related_content: 1
field_related_links:
- entity: paragraph
type: related_links
field_paragraph_link:
- uri: https://www.vic.gov.au
title: State Government of Victoria
- entity: paragraph
type: related_links
field_paragraph_link:
- uri: https://www.vic.gov.au/department-premier-and-cabinet
title: Department of Premier and Cabinet
# Contact.
field_landing_page_show_contact: 1
field_landing_page_contact:
- entity: paragraph
type: contact_us
field_paragraph_title: Victorian Government
field_paragraph_name: Victorian Government
field_paragraph_email: [email protected]
field_paragraph_department_name: Department of Premier and Cabinet
field_paragraph_location:
- country_code: AU
administrative_area: VIC
locality: Melbourne
postal_code: 3001
address_line1: Department of Premier and Cabinet
address_line2: GPO Box 4509
field_paragraph_postal_address:
- country_code: AU
administrative_area: VIC
locality: Melbourne
postal_code: 3001
address_line1: Department of Premier and Cabinet
address_line2: GPO Box 4509
field_paragraph_phones:
- entity: paragraph
type: phone
field_paragraph_phone_title: Calls in Australia
field_paragraph_phone_number: '1300 366 356'
- entity: paragraph
type: phone
field_paragraph_phone_title: Calls from overseas
field_paragraph_phone_number: '+61 3 9603 8804'
field_paragraph_social_media:
- entity: paragraph
type: social_link
field_paragraph_social_list: twitter
field_paragraph_link:
- uri: 'https://twitter.com/VicGovAu'
title: Twitter
# 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'
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'
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
- entity: node
type: landing_page
title: 1-FE-auth-content-4
uid: 1
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_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: 'Member'
# Hero banner.
field_landing_page_hero_banner:
- entity: paragraph
type: hero_banner_with_cta
field_paragraph_cta:
- uri: https://www.vic.gov.au
title: Phasellus congue
field_paragraph_freetext: Nulla ultricies dignissim leo, posuere vestibulum erat cursus vitae
field_paragraph_link_text:
- uri: https://vic.gov.au
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: |
<h2>Nulla ultricies dignissim leo, posuere vestibulum erat cursus vitae</h2>
<h3>Phasellus congue aliquam vehicula</h3>
<p class="wysiwyg-callout">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.</p>
<h3>Donec scelerisque cursus ex varius efficitur</h3>
<h4>Morbi cursus placerat mi</h4>
<h5>Nullam laoreet ante placerat</h5>
<p>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.</p>
<blockquote class='quotation'>
<p>Mauris tincidunt tincidunt felis vel tempus. Vestibulum rhoncus blandit justo quis finibus. Phasellus lacus lectus, sollicitudin sed posuere non, ultricies ut quam.</p>
<footer>
<cite>
<span class="quotation__author">Duis ligula lacus</span><br />
<span class="quotation__author-title">Phasellus est turpis, efficitur nec odio imperdiet</span><br />
</cite>
</footer>
</blockquote>
<h6>Mauris tincidunt tincidunt felis vel tempus</h6>
<drupal-entity data-embed-button="tide_media" data-entity-embed-display="view_mode:media.embedded" data-entity-type="media" data-entity-uuid='11dede11-10c0-111e1-1100-000000000124'></drupal-entity>
<p>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.</p>
<drupal-entity data-embed-button="tide_media" data-entity-embed-display="view_mode:media.embedded" data-entity-type="media" data-entity-uuid='11dede11-10c0-111e1-1100-000000000007'></drupal-entity>
# 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: 'Member'
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: 'vic.gov.au'
field_node_primary_site:
- '#process':
callback: reference
args:
- taxonomy_term
- vid: sites
name: 'vic.gov.au'
Loading

0 comments on commit 775a1d1

Please sign in to comment.