Skip to content
This repository has been archived by the owner on May 7, 2021. It is now read-only.

Commit

Permalink
Merge pull request #1699 from cds-snc/master
Browse files Browse the repository at this point in the history
* Minor copy change (typo) (#1639)

* extract data from formidable manually (#1641)

* fix: upgrade mongodb from 3.5.2 to 3.5.3 (#1632)

* fix: upgrade react-scripts from 3.3.1 to 3.4.0 (#1642)

* Fix for Logs in another Azure Subscription (#1619)

* Updating IMAGE_NAME reference (#1597)

* change GNCC to GNC3 (#1655)

* use redirect for equifax links (#1651)

* clear file input after alert (#1662)

* fix keyboard nav (#1660)

* add moneyLost.methodOther field to analyst report (#1647)

* more detailed p and text stories (#1643)

* added stuff to sb docs (#1671)

* added getting started page to storybook (#1661)

* FIX CORS for HTTPS (#1665) (#1669)

* clean up logging a bit (#1663)

* tweak skiplink style (#1658)

* fix target area for upload button (#1653)

* change "go back" button's height to the same height as "cancel report" button (#1666)

* added Messages component.  (#1644)

* fix: upgrade async from 3.1.1 to 3.2.0 (#1680)

* Reports a day counter (#1664)

* Form validation - bump (#1510)

* added helmet in server.js (#1674)

* Combine analyst emails (#1628)

* Prod version number (#1656)

* Fixed Field, added container and layout to sb (#1675)

* Get email addresses from ldap query (#1682)

* restrict file number and size on server (#1648)

* remove submit button if already submitted (#1683)

* Fix for Continuous Deployment (#1690)

* Validation for location fields (#1689)

* cypress pack initial commit (#1247)
  • Loading branch information
sastels authored Mar 19, 2020
2 parents 6195d7a + 9650471 commit 8063d3a
Show file tree
Hide file tree
Showing 95 changed files with 13,682 additions and 6,930 deletions.
1 change: 1 addition & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ Fixes #(issue)
- [ ] I have looked at my code on GitHub and it all looks good (ex: no random commented out code or console.logs)
- [ ] I have added and needed tests for my changes (in particular for new screens)
- [ ] I have added a comment to any confusing code
- [ ] I have added documentation to any modified front-end code. (Or added missing documentation)
7 changes: 7 additions & 0 deletions .github/workflows/test_f2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ jobs:
npm run build --if-present
env:
CI: true
- name: Run Cypress end-to-end
working-directory: f2
run: npm run cypress:cli
env:
CI: true
NODE_ENV: testing
A11Y_TRACKER_KEY: ${{ secrets.A11Y_TRACKER_KEY }}
- name: npm test
working-directory: f2
run: npm test
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,8 @@ f2/build
**/locales/*.js
platform/**/.env*
*.cer
f2/cypress/reports
f2/cypress/videos
f2/cypress/screenshots
.vscode
message_*.txt
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ Currently the reports are sent to the RCMP via encrypted email. We use the HERMI
# encrypting email to intake analyst
LDAP_URL=
LDAP_UID=
MAIL_TO=
```

### Sending the encrypted reports to RCMP analysts
Expand Down
3 changes: 0 additions & 3 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@
"MAIL_PASS": {
"required": true
},
"MAIL_TO": {
"required": true
},
"MAIL_FROM": {
"required": true
},
Expand Down
1 change: 0 additions & 1 deletion f2/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ CONTENT_MODERATOR_SERVICE_KEY=
# encrypting email to intake analyst
LDAP_URL=
LDAP_UID=
MAIL_TO=

# sending encrypted emails
MAIL_HOST=
Expand Down
2 changes: 1 addition & 1 deletion f2/.storybook/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ export default create({
inputTextColor: 'black',
inputBorderRadius: 4,

brandTitle: 'Canada',
brandTitle: 'Canada.ca React',
brandUrl: '/',
})
10 changes: 10 additions & 0 deletions f2/cypress.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"projectId": "qe5gas",
"testFiles": "**/*.feature",
"env": {
"production": "https://report.antifraudcentre.ca",
"local": "http://localhost:3000/",
"staging":"https://report-staging.con.rcmp-grc.gc.ca",
"dev":"https://report-dev.con.rcmp-grc.gc.ca"
}
}
Binary file added f2/cypress/fixtures/crime.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added f2/cypress/fixtures/fake.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions f2/cypress/fixtures/form_data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "victim",
"email": "officer_analyst@rcmp.gc.ca",
"phone": "000 000 0000",
"s-p": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua",
"m-p": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. ",
"xl-p": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
}
1 change: 1 addition & 0 deletions f2/cypress/fixtures/scan.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*
31 changes: 31 additions & 0 deletions f2/cypress/integration/CancelAtPrivacy/cancelAtPrivacy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

Given('I open the report home page', () => {
cy.visit(Cypress.env('production'))
});

When('I click on create a report button', () => {
cy.contains('Report now').first().click({force: true});
});

When('I read before you start instructions', () => {
cy.contains('Start report').first().click({force: true});
});

When('I click cancel button', () => {
cy.contains('Cancel report').first().click({force: true});
});

When('I confirm the cancellation', () => {
cy.get('button').contains('Cancel report').first().click({force: true});
});

When('I give the reason to cancel', () => {
cy.contains('Tell us more').first().click({force: true});
});

When('I give the feedback', () => {
cy.get('form').find('[value="finalFeedback.wasServiceHard.neutral"]').check({ force: true })
cy.get('form').find('[value="finalFeedback.wouldYouUseAgain.yes"]').check({ force: true })
cy.get('form').find('[name="howCanWeDoBetter"]').type('testing')
cy.contains('Submit').first().click({force: true});
});
41 changes: 41 additions & 0 deletions f2/cypress/integration/Consent/consent.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@

Given('I open the report home page', () => {
cy.visit(Cypress.env('staging'))
});

Then('Inject axe and check for accessibility issues', () => {
cy.reportA11y();
});

When('I click on create a report button', () => {
cy.contains('Report now').first().click({force: true});
});

When('I read before you start instructions', () => {
cy.contains('Start report').first().click({force: true});
});

When('I click continue without checking the consent', () => {
cy.contains('Continue').first().click({force: true});
});

Then('{string} should be shown', (content) => {
cy.contains(content, {timeout:10000}).should('be.visible')
});

Then('check for accessibility issues', () => {
cy.reportA11y();
});

When('I check the consent checkbox', () => {
cy.get('form').find('[name="consentOptions"]').check({ force: true })
cy.contains('Continue').first().click({force: true});
});

Then('{string} should be shown', (content) => {
cy.contains(content, {timeout:10000}).should('be.visible')
});

Then('check for accessibility issues', () => {
cy.reportA11y();
});
15 changes: 15 additions & 0 deletions f2/cypress/integration/consent.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Feature: Consent

I want to create an online investgation report
@consent
Scenario: Home page
Given I open the report home page
Then Inject axe and check for accessibility issues
When I click on create a report button
When I read before you start instructions
When I click continue without checking the consent
Then "Please accept the terms of the Privacy statement" should be shown
Then check for accessibility issues
And I check the consent checkbox
Then "How did the incident start?" should be shown
Then check for accessibility issues
6 changes: 6 additions & 0 deletions f2/cypress/integration/homepage.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Feature: Accessibility Checks
I want to check for Accessibility issues and pass the data to a11y dashboard
@smoke
Scenario: Home page
Given I open the report home page
Then Inject axe and check for accessibility issues
8 changes: 8 additions & 0 deletions f2/cypress/integration/homepage/homepage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

Given('I open the report home page', () => {
cy.visit(Cypress.env('staging'))
});

Then('Inject axe and check for accessibility issues', () => {
cy.reportA11y();
});
26 changes: 26 additions & 0 deletions f2/cypress/integration/virus-upload.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Feature: Virus scanning test
I want to upload a virus infected file to test virus scanning
Scenario: Home page
Given I open the report home page
When I click on create a report button
When I read before you start instructions
When I click continue without checking consent
When "Please accept the terms of the Privacy statement" should be shown
And I check the consent checkbox
Then "How did the incident start?" should be shown
When I navigate to howdiditstart page and click continue
Then "What do you think could be affected?" should be shown
When I navigate to Whatcouldbeaffected page and click continue
Then "What happened?" should be shown
When I navigate to Whathappened page and click continue
Then "Add suspect clues" should be shown
When I navigate to Addsuspectclues page and click continue
Then "Attach supporting evidence" should be shown
When upload the virus file
Then "Enter your location" should be shown
When I navigate to yourLocation page and click continue
Then "Enter your contact details" should be shown
When I navigate to yourContactDetails page and click continue
Then "Review your report" should be shown
When I navigate to summary page and click Submit
Then "Thank you for reporting" should be shown
66 changes: 66 additions & 0 deletions f2/cypress/integration/virus-upload/virus-upload.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@

Given('I open the report home page', () => {
cy.visit(Cypress.env('staging'))
});

When('I click on create a report button', () => {
cy.contains('Report now').first().click({force: true});
});

When('I read before you start instructions', () => {
cy.contains('Start report').first().click({force: true});
});

When('I click continue without checking consent', () => {
cy.contains('Continue').first().click({force: true});
});

When('{string} should be shown', (content) => {
cy.contains(content, {timeout:10000}).should('be.visible')
});

When('I check the consent checkbox', () => {
cy.get('form').find('[name="consentOptions"]').check({ force: true })
cy.contains('Continue').first().click({force: true});
});

Then('{string} should be shown', (content) => {
cy.contains(content, {timeout:10000}).should('be.visible')
});

When('I navigate to howdiditstart page and click continue', () => {
cy.get('form').find('[value="howManyTimes.once"]').check({ force: true })
cy.contains('Continue').first().click({force: true});
});

When('I navigate to Whatcouldbeaffected page and click continue', () => {
cy.get('form').find('[value="whatWasAffectedForm.other"]').check({ force: true })
cy.contains('Continue').first().click({force: true});
});

When('I navigate to Whathappened page and click continue', () => {
cy.contains('Continue').first().click({force: true});
});

When('I navigate to Addsuspectclues page and click continue', () => {
cy.contains('Continue').first().click({force: true});
});

When('upload the virus file', () => {
const virusFile = 'scan.txt';
cy.get('#uploader').uploadFile(virusFile, 'txt');
cy.wait(1000)
cy.contains('Continue').first().click({force: true});
});

When('I navigate to yourLocation page and click continue', () => {
cy.contains('Continue').first().click({force: true});
});

When('I navigate to yourContactDetails page and click continue', () => {
cy.contains('Continue').first().click({force: true});
});

When('I navigate to summary page and click Submit', () => {
cy.contains('Submit report').first().click({force: true});
});
34 changes: 34 additions & 0 deletions f2/cypress/integration/walkthrough_E.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
Feature: Test the entire report workflow in english
I want to create an online investgation report
Scenario: Home page
Given I open the report home page
When I click on create a report button
When I read before you start instructions
When I click continue without checking consent
When "Please accept the terms of the Privacy statement" should be shown
And I check the consent checkbox
Then "How did the incident start?" should be shown
When I navigate to howdiditstart page fill all forms
Then "What do you think could be affected?" should be shown
When I navigate to Whatcouldbeaffected page fill all forms
Then "How were your money or finances affected?" should be shown
When I navigate to Howwereyourmoney page fill all forms
Then "How was your personal information affected?" should be shown
When I navigate to Howwaspersonalinformationaffected page fill all forms
Then "How were your devices or accounts affected?" should be shown
When I navigate Howwereyourdevicesaffected page fill all forms
Then "How was your business affected?" should be shown
When I navigate to Howyourbusinessaffected page fill all forms
Then "What happened?" should be shown
When I navigate to Whathappened page fill all forms
Then "Add suspect clues" should be shown
When I navigate to Addsuspectclues page fill all forms
Then "Attach supporting evidence" should be shown
When I navigate to AttachSupportingEvidence page fill all forms
Then "Enter your location" should be shown
When I navigate to yourLocation page fill all forms
Then "Enter your contact details" should be shown
When I navigate to yourContactDetails page fill all forms
Then "Review your report" should be shown
When I navigate to summary page fill all forms
Then "Thank you for reporting" should be shown
Loading

0 comments on commit 8063d3a

Please sign in to comment.