Skip to content

Commit

Permalink
Make all e2e test pass. Add search e2e tests (#577)
Browse files Browse the repository at this point in the history
* WIP on e2e test fixes

* Fix event tests

* Add sitesearch tests

* Fix page test

* test e2e in circle

* Add ripple context for env vars

* fix context

* quick test to diagnose CI issues

* take a photo to see whats going on

* Set CI docker timezone to melbourne

* cleanup

* log out searchURL in CI

* wrap puppeteer in a try catch block

* cd into folder froom docker

* semicolon fix runaway ps - see iss
puppeteer #405

* fix cucumber report generation on fail

* when: always

* skip sitemap test

* turn on debug in e2e

* fix debug command

* Enable dashboard and parallelism

* add --parallel

* test log search url out to stdout

* add search trace

* Add cypress failed log to investigate CI fail

* add basic seach page test

* use minimal layout on search page

* Add logs for filter value request

* Fix errorpage test -  add window console logging

* remove trace

* Remove cypress-failed-log

* Fix authenticated content tests - skip until setup properly

* remove console

* remove test branch

* Fixed lint
  • Loading branch information
dylankelly authored and tim-yao committed Nov 12, 2019
1 parent 7a6859e commit 3c4e383
Show file tree
Hide file tree
Showing 37 changed files with 699 additions and 252 deletions.
24 changes: 17 additions & 7 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ version: 2.0

jobs:
build:
context: Ripple
docker:
- image: cypress/base:10
environment:
TERM: xterm
CIRCLE_TEST_REPORTS: test-results
TZ: "Australia/Melbourne"
working_directory: ~/app
steps:
- checkout
Expand Down Expand Up @@ -39,21 +39,21 @@ jobs:
paths: .

warm-up:
context: Ripple
docker:
- image: cypress/base:10
steps:
- run:
name: Awake dev backend
name: wake up dev backend
command: curl https://www.develop.content.vic.gov.au/ --max-time 1000

test:
context: Ripple
docker:
- image: cypress/base:10
environment:
TERM: xterm
CIRCLE_TEST_REPORTS: test-results
TZ: "Australia/Melbourne"

working_directory: ~/app
steps:
- attach_workspace:
Expand All @@ -78,7 +78,7 @@ jobs:
command: yarn test:smoke
- run:
name: prepare cucumber test report
command: yarn test:report
command: yarn test:report
- persist_to_workspace:
root: ~/app
paths: .
Expand All @@ -97,7 +97,10 @@ jobs:
- image: cypress/base:10
environment:
TERM: xterm
TZ: "Australia/Melbourne"

working_directory: ~/app
parallelism: 2
steps:
- attach_workspace:
at: ~/app
Expand All @@ -112,6 +115,7 @@ jobs:
- run:
name: prepare cucumber test report
command: yarn test:report
when: always
- store_artifacts:
path: test-results
- store_test_results:
Expand Down Expand Up @@ -209,12 +213,15 @@ workflows:
version: 2
commit:
jobs:
- build
- build:
context: Ripple
- test:
context: Ripple
requires:
- build
# Run regression tests on release branches
- e2e-vic-gov:
context: Ripple
requires:
- build
filters:
Expand Down Expand Up @@ -258,11 +265,14 @@ workflows:
- develop
jobs:
- warm-up
- build
- build:
context: Ripple
- test:
context: Ripple
requires:
- build
- e2e-vic-gov:
context: Ripple
requires:
- build
- e2e-example:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ Feature: Custom error page
Custom error page content should work

Scenario: Example for adding custom 404 messages
Given I visit the page "/404"
And the example 404 error content is added
Given I attempt to visit the page "/404"
Then the example 404 error content is added

Scenario: Example for adding custom 500 messages
Given I visit the page "/500"
And the example 500 error content is added
Given I attempt to visit the page "/500"
Then the example 500 error content is added
3 changes: 2 additions & 1 deletion examples/vic-gov-au/cypress.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@
"supportFile": "test/e2e/support/index.js",
"videosFolder": "test/e2e/videos",
"ignoreTestFiles": "*.js",
"chromeWebSecurity": false
"chromeWebSecurity": false,
"projectId": "wtymar"
}
4 changes: 3 additions & 1 deletion examples/vic-gov-au/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@
"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-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",
"test:e2e": "cross-env TEST=1 start-server-and-test start http://localhost:3000 cy:run",
"test:e2e": "cross-env TEST=1 start-server-and-test start http://localhost:3000 cy:run-record",
"test:e2e-local": "cross-env TEST=1 start-server-and-test start 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 Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,6 @@
- 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
Expand Down
44 changes: 0 additions & 44 deletions examples/vic-gov-au/test/e2e/fixtures/landingPage/complex.json

This file was deleted.

21 changes: 0 additions & 21 deletions examples/vic-gov-au/test/e2e/fixtures/landingPage/draft.json

This file was deleted.

20 changes: 0 additions & 20 deletions examples/vic-gov-au/test/e2e/fixtures/landingPage/simple.json

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@
</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-000000000111'></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>
# What's Next.
field_show_whats_next: 1
field_whats_next:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<div class="rpl-markup__inner"><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></div>
Original file line number Diff line number Diff line change
@@ -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 }
]
}
}
}
Loading

0 comments on commit 3c4e383

Please sign in to comment.