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
90 commits
Select commit Hold shift + click to select a range
449c4c2
[WIP] cypress pack initial commit
khalidelaggan Jan 31, 2020
e8f092a
Added the first 101 test for RCMP QC training
khalidelaggan Jan 31, 2020
ca7501f
remove unwanted tests
khalidelaggan Jan 31, 2020
8ec2817
working FormArrayControl component and Adapters for radio and checkboxes
amazingphilippe Feb 6, 2020
43b350c
broken, but added a Field component to ease markup
amazingphilippe Feb 10, 2020
224e8dd
Merge branch 'master' of github.com:cds-snc/report-a-cybercrime into …
amazingphilippe Feb 10, 2020
0554387
rebuilt the howdiditstart page using checkbox component.
amazingphilippe Feb 10, 2020
984bb3f
lint and passing tests. Not all new components have tests
amazingphilippe Feb 11, 2020
aa7c496
added a test for FormArrayControl
amazingphilippe Feb 11, 2020
082a5fc
merged with master
amazingphilippe Feb 11, 2020
cffe09b
Merge remote-tracking branch 'origin/master' into cypress
khalidelaggan Feb 12, 2020
66fe8e5
Merge remote-tracking branch 'origin/checkbox-component' into cypress
khalidelaggan Feb 12, 2020
4ca1052
Resolved Merge Conflict with deleted dev dependencies
khalidelaggan Feb 12, 2020
84c20a6
[RCMP QC] 101 demo and training tests
khalidelaggan Feb 13, 2020
31eb6c2
[RCMP QC Training] How to read fixture data
khalidelaggan Feb 13, 2020
568b310
Merge Master into Cypress
khalidelaggan Feb 19, 2020
cf6e693
Merge remote-tracking branch 'origin/master' into cypress
khalidelaggan Feb 19, 2020
131cd6f
Added a simple step definition file + cleanups
khalidelaggan Feb 19, 2020
9e5c7eb
Generate e2e test report for RCMP QC team demo
khalidelaggan Feb 19, 2020
4a1cd54
Enabled only HTML output format
khalidelaggan Feb 19, 2020
3d216db
Added Staging url placeholder
khalidelaggan Feb 19, 2020
44d9865
Added axe checks to the HP
khalidelaggan Feb 19, 2020
8a50dae
Added visual test folders
khalidelaggan Feb 19, 2020
1f51a91
Added the correct verb
khalidelaggan Feb 19, 2020
71b08d8
updated with direct path as this won't work on windows
khalidelaggan Feb 19, 2020
b57dff6
Merge remote-tracking branch 'origin/master' into cypress
khalidelaggan Feb 20, 2020
1a908c0
[Testing] Adding tests - configs
khalidelaggan Feb 20, 2020
d078ab1
Adding the missing scripts
khalidelaggan Feb 20, 2020
88de650
Added to the correct workflow
khalidelaggan Feb 20, 2020
3ef3183
Syntax error - try again
khalidelaggan Feb 20, 2020
edaddd4
Syntax error -
khalidelaggan Feb 20, 2020
d07ec08
Another check failed
khalidelaggan Feb 20, 2020
39c7bd0
another fail testing
khalidelaggan Feb 20, 2020
416037e
Added to ignore
khalidelaggan Feb 20, 2020
83af38c
Added start-server-and-test
khalidelaggan Feb 20, 2020
100c184
More tweaks
khalidelaggan Feb 20, 2020
1a40de5
Testing the CLI
khalidelaggan Feb 20, 2020
8904892
Another test to debug things
khalidelaggan Feb 20, 2020
d29e7b1
Merge remote-tracking branch 'origin/master' into cypress
khalidelaggan Feb 24, 2020
f09098c
Merge branch 'master' into cypress
khalidelaggan Feb 24, 2020
fa8c1a8
Merge branch 'master' into cypress
khalidelaggan Feb 24, 2020
50383e2
Merge branch 'master' into cypress
khalidelaggan Feb 24, 2020
ad05873
Merge remote-tracking branch 'origin/master' into cypress
khalidelaggan Feb 24, 2020
2acd600
Updated
khalidelaggan Feb 24, 2020
3260fef
Update the lock file
khalidelaggan Feb 24, 2020
1d654a0
Merge branch 'master' into cypress
khalidelaggan Feb 24, 2020
2618da4
Merge branch 'master' into cypress
khalidelaggan Feb 24, 2020
c3c5dbe
Updated with recent cypress dependencies
khalidelaggan Feb 24, 2020
3c381e9
Cypress dependencies
khalidelaggan Feb 24, 2020
962880d
Testing the action log
khalidelaggan Feb 24, 2020
7530d80
Merge branch 'master' into cypress
khalidelaggan Feb 24, 2020
4dd6a2a
Github actions to run local instance
khalidelaggan Feb 24, 2020
7dba04e
Debugging - Initiate a test without the reference
khalidelaggan Feb 25, 2020
ebd5eef
Merge branch 'master' into cypress
khalidelaggan Feb 25, 2020
1731cb7
Debugging - added back the step definition config
khalidelaggan Feb 25, 2020
80d9afc
Merge branch 'cypress' of github.com:cds-snc/report-a-cybercrime into…
khalidelaggan Feb 25, 2020
f7f40e6
Debugging - another failed attempt - not reading the cucumber prepro…
khalidelaggan Feb 25, 2020
ad74b76
Added QC specs + more defensive coding
khalidelaggan Feb 27, 2020
e1e1bec
Testing smart tagging in CI
khalidelaggan Feb 27, 2020
4094414
simplifying the test further
khalidelaggan Feb 27, 2020
130d596
Testing the new upgrade + Firefox support added
khalidelaggan Feb 27, 2020
3bbf26f
Removed testing reports for now
khalidelaggan Feb 27, 2020
7de2f3b
Testing smoke tag with QC
khalidelaggan Feb 28, 2020
bb6588d
Merge remote-tracking branch 'origin/master' into cypress
khalidelaggan Feb 28, 2020
e3a45bd
Merge branch 'master' into cypress
khalidelaggan Feb 28, 2020
c11af06
Trigger another test
khalidelaggan Feb 28, 2020
686f60b
Merge branch 'cypress' of github.com:cds-snc/report-a-cybercrime into…
khalidelaggan Feb 28, 2020
b4d1103
Merge branch 'master' into cypress
khalidelaggan Feb 28, 2020
dbe78de
Merge remote-tracking branch 'origin/master' into cypress
khalidelaggan Mar 9, 2020
5c3c0b0
Added a11y tracker + misc
khalidelaggan Mar 12, 2020
7fa607b
Added a11y
khalidelaggan Mar 17, 2020
7faa56d
Merge branch 'cypress' of github.com:cds-snc/report-a-cybercrime into…
khalidelaggan Mar 17, 2020
ba80208
Merge remote-tracking branch 'origin/master' into cypress
khalidelaggan Mar 17, 2020
d19fc73
cleanup
khalidelaggan Mar 17, 2020
01e8c83
Cleanup + add new tests
khalidelaggan Mar 18, 2020
94900c6
Update the package-lock
khalidelaggan Mar 18, 2020
f7367e8
Fixed merge conflict
khalidelaggan Mar 18, 2020
587c135
Prepare for minimal testing
khalidelaggan Mar 18, 2020
5d510ec
Merge remote-tracking branch 'origin/master' into cypress
khalidelaggan Mar 18, 2020
f60c208
Updated a fresh copy
khalidelaggan Mar 18, 2020
b1dc4e9
Running a minimal test in CI
khalidelaggan Mar 18, 2020
d85dd3c
No needed for this release
khalidelaggan Mar 18, 2020
3e15927
file sync
khalidelaggan Mar 18, 2020
f099db4
Adding more config to properly run a11y
khalidelaggan Mar 18, 2020
3af3c44
Testing configs for a11y
khalidelaggan Mar 18, 2020
fec5bce
typo
khalidelaggan Mar 18, 2020
d60d080
Merge branch 'master' into cypress
khalidelaggan Mar 18, 2020
98f3e83
Remove the fake passport images
khalidelaggan Mar 19, 2020
3ea3b1f
Merge branch 'cypress' of github.com:cds-snc/report-a-cybercrime into…
khalidelaggan Mar 19, 2020
6dcbb53
Merge branch 'master' into cypress
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
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 }}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would need to figure out adding this to the secret

- 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
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