Skip to content
This repository was archived by the owner on May 7, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
b138d7e
Minor copy change (typo) (#1639)
anikbrazeau Mar 6, 2020
9ec975f
extract data from formidable manually (#1641)
sastels Mar 9, 2020
53305eb
fix: upgrade mongodb from 3.5.2 to 3.5.3 (#1632)
snyk-bot Mar 9, 2020
247b48d
fix: upgrade react-scripts from 3.3.1 to 3.4.0 (#1642)
snyk-bot Mar 9, 2020
8245e28
Fix for Logs in another Azure Subscription (#1619)
davidheerema Mar 10, 2020
1a64679
Updating IMAGE_NAME reference (#1597)
davidheerema Mar 10, 2020
2a493d4
change GNCC to GNC3 (#1655)
sastels Mar 10, 2020
edc2c2c
use redirect for equifax links (#1651)
sastels Mar 10, 2020
c79a405
clear file input after alert (#1662)
sastels Mar 12, 2020
407146d
fix keyboard nav (#1660)
sastels Mar 12, 2020
3087d4d
add moneyLost.methodOther field to analyst report (#1647)
sastels Mar 13, 2020
ba03823
more detailed p and text stories (#1643)
amazingphilippe Mar 13, 2020
6e4b252
added stuff to sb docs (#1671)
amazingphilippe Mar 13, 2020
a9965b6
added getting started page to storybook (#1661)
amazingphilippe Mar 13, 2020
bd50ec2
FIX CORS for HTTPS (#1665) (#1669)
Mar 13, 2020
bfc0fe0
clean up logging a bit (#1663)
sastels Mar 13, 2020
7fccfd0
tweak skiplink style (#1658)
sastels Mar 14, 2020
2513237
fix target area for upload button (#1653)
amazingphilippe Mar 16, 2020
487c11d
change "go back" button's height to the same height as "cancel report…
DianeLiu2019 Mar 16, 2020
388dbad
added Messages component. (#1644)
amazingphilippe Mar 16, 2020
d23fabe
fix: upgrade async from 3.1.1 to 3.2.0 (#1680)
snyk-bot Mar 17, 2020
0af1e24
Reports a day counter (#1664)
kevinyang06 Mar 17, 2020
19ba926
Form validation - bump (#1510)
amazingphilippe Mar 17, 2020
20a0a1d
added helmet in server.js (#1674)
kevinyang06 Mar 17, 2020
b5b5dc8
Combine analyst emails (#1628)
sastels Mar 17, 2020
13ce1c7
Prod version number (#1656)
sastels Mar 17, 2020
01261ba
Fixed Field, added container and layout to sb (#1675)
amazingphilippe Mar 18, 2020
c9daa1a
Get email addresses from ldap query (#1682)
sastels Mar 18, 2020
353773e
restrict file number and size on server (#1648)
sastels Mar 18, 2020
3781e1e
remove submit button if already submitted (#1683)
sastels Mar 18, 2020
cd46e37
Fix for Continuous Deployment (#1690)
davidheerema Mar 18, 2020
9ddc583
Validation for location fields (#1689)
kevinyang06 Mar 19, 2020
9650471
cypress pack initial commit (#1247)
khalidelaggan Mar 19, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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": "[email protected]",
"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