Skip to content

Commit

Permalink
Update create ripple app (#570)
Browse files Browse the repository at this point in the history
* Fix task which copies tests into new projects

* fix test

* CR Changes and add site domain to fixtures

* remove campaign test from homepage
  • Loading branch information
dylankelly authored Oct 18, 2019
1 parent 9730a43 commit d004ac7
Show file tree
Hide file tree
Showing 57 changed files with 723 additions and 1,152 deletions.

This file was deleted.

17 changes: 0 additions & 17 deletions examples/vic-gov-au/test/e2e/fixtures/grant/Forms/tc9c.csv

This file was deleted.

This file was deleted.

17 changes: 0 additions & 17 deletions examples/vic-gov-au/test/e2e/fixtures/grant/Forms/tc9d.csv

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,33 +11,3 @@ Feature: Global Notifications (Alert)
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 |

# Demo content module has an issue creating alert without primary site - skip test until that is fixed
# @skip
# Scenario: 1-FE-Alert-2 Displays site section alert
# Given I have created a node with the YAML fixture "alert/1-BE-Alert-2"
# 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 |
# And I visit the page "/first-home-buyers-checklist"
# And 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 |
# | 1-BE-Alert-2 Demo Alert | Heat Wave | https://vic.gov.au | More details |
# 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 |

# Scenario: 1-FE-Alert-2 Displays site section alert
# When I visit the page "/"
# Given I have created a node with the YAML fixture "alert/1-BE-Alert-3"
# And I wait for 61 seconds
# And I visit the page "/demo-landing-page"
# Then I should see 2 global notification
# And 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 |
# | 1-BE-Alert-3 Demo Alert | Flood | https://vic.gov.au | More details |

Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Feature: Protected content
Given the "/1-fe-auth-content-4" page exists with fixture "landingPage/1-FE-auth-content-4" data
When I 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 "landingPage/1-FE-auth-content-4" data
And there is a user in the system with the following credentials:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ Feature: Event page
And the event page Address should be "45 Collins St, Melbourne, VIC 3000"
And the event page Price should be "34.33 - 89.95"
And the event page Web url should be "http://www.weatherzone.com.au/vic/central/healesville"
# And the Requirements should be "Accessible venue"
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 Image should be present
And the event page Booking Url link should be "http://examplebook.com"
And the event page Booking Text should be "Booking URL"
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,5 @@ Feature: Basic Page
| Twitter |
| Facebook |
| LinkedIn |
And the share this links should read "open in a new window" to screen readers


Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
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: 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"
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ Feature: Home Page
And the breadcrumbs should not exist
And the site header is visible
And the site footer is visible
And the campaign primary banner component should exist

# Need to fix existing errors or work out ruleset to skip
@a11y @skip
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"test:smoke-vic": "cd examples/vic-gov-au/ && yarn test:smoke",
"test:smoke-example": "cd examples/vic-gov-au/ && yarn test:smoke",
"test:unit": "jest --colors",
"test:report": "node ./scripts/cucumberconvertor.js",
"test:report": "node ./packages/ripple-test-tools/scripts/cucumberconvertor.js ./test-results/cucumber",
"build:storybook": "cd src && yarn build-storybook",
"build:vic-gov-au": "cd examples/vic-gov-au && yarn run build",
"lint": "sass-lint && yarn lint:es",
Expand Down Expand Up @@ -63,7 +63,6 @@
"babel-preset-vue": "^2.0.2",
"core-js": "^2.6.5",
"cross-env": "^5.2.0",
"cucumber-junit-convert": "^1.1.0",
"eslint": "^5.11.1",
"eslint-config-standard": "^12.0.0",
"eslint-friendly-formatter": "^3.0.0",
Expand Down
4 changes: 3 additions & 1 deletion packages/create-ripple-app/__tests__/new.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ describe('Test new project generator', () => {
searchurl: 'elasticdev.sdp.vic.gov.au',
searchindex: '',
searchusername: '',
searchpassword: ''
searchpassword: '',
adminuser: 'dummyuser',
adminpass: 'dummypass'
}

const stream = await sao({ generator, logLevel: 2, config }, mockPromptAnswers)
Expand Down
2 changes: 1 addition & 1 deletion packages/create-ripple-app/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const log = (msg, lvl = 'info') => {
const configFile = args.config
let configFileArgs = {}
if (configFile && fs.existsSync(__dirname, configFile)) {
configFileArgs = require(path.resolve(process.cwd(), configFile))
configFileArgs = require(path.resolve(__dirname, configFile))
}
// param args take precedence
const config = {
Expand Down
16 changes: 9 additions & 7 deletions packages/create-ripple-app/generators/new/saofile.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,14 @@ module.exports = {
})
}

if (results.e2e || results.smoke) {
actions.push({
type: 'add',
files: ['**'],
templateDir: '/_tests/_common'
})
if (results.smoke || results.e2e) {
actions.push(
{
type: 'add',
files: ['**'],
templateDir: `${templateDir}/_tests/_common`
}
)
}

if (results.smoke) {
Expand All @@ -71,7 +73,7 @@ module.exports = {
if (results.e2e) {
// only add tests for enabled modules
results.modules.forEach(tideModule => {
const hasTests = fs.existsSync(path.resolve(__dirname, `./template/_tests/_modules/test/e2e/integration/core-modules/${tideModule}`))
const hasTests = fs.existsSync(path.resolve(__dirname, `${templateDir}/_tests/_modules/test/e2e/integration/core-modules/${tideModule}`))
if (hasTests) {
actions.push(
{
Expand Down
4 changes: 2 additions & 2 deletions packages/create-ripple-app/template/_package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
"cy:run-smoke": "cypress run -e TAGS='@smoke' --spec 'test/e2e/integration/smoke/*'",
<%_ if (e2e === true) { _%>
"cy:run": "cypress run -e TAGS='not @skip or @smoke'",
"test:e2e": "cross-env NODE_ENV=test BASIC_AUTH=0 start-server-and-test start:build http://localhost:3000 cy:run",
"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",
"test:smoke": "cross-env NODE_ENV=test BASIC_AUTH=0 start-server-and-test start:build http://localhost:3000 cy:run-smoke",
"test:smoke": "cross-env TEST=1 BASIC_AUTH=0 start-server-and-test start:build http://localhost:3000 cy:run-smoke",
<%_ } _%>
<%_ if (unit === true) { _%>
"test:unit": "BASIC_AUTH=0 NODE_ENV=test jest --passWithNoTests",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# 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

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<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>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<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>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<figure class="rpl-document-link"><a aria-label="Demo Sample Document File type: docx. Size: 7.53 KB" href="/sites/default/files/2019-10/sample.docx" download="" class="rpl-document-link__link"><svg aria-hidden="true" class="rpl-document-link__icon rpl-icon rpl-icon--docx rpl-icon--color_primary" style="width:30px;height:30px;"><use xlink:href="#rpl_icon_docx" href="#rpl_icon_docx"></use></svg> <div class="rpl-document-link__info"><span class="rpl-document-link__title">Demo Sample Document</span> <div class="rpl-document-link__meta"><span class="rpl-document-link__type">docx</span> <span class="rpl-document-link__size rpl-document-link__size--seperator">7.53 KB</span></div></div></a> <!----></figure>
Loading

0 comments on commit d004ac7

Please sign in to comment.