Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

Mochawesome reporting #3130

Merged
merged 5 commits into from Jul 17, 2019
Merged

Mochawesome reporting #3130

merged 5 commits into from Jul 17, 2019

Conversation

thekiiingbob
Copy link
Contributor

Summary

Use the cypress module to configure cypress and run tests programatically
Integrate mochawesome reports (pretty HTML reports, with integrated screenshots)

To run, just do npm run test, afterwards you should have a mochawesome-report directory. If you open up mochawesome.html in your browser, you can view the report.

Ticket Link

JIRA

@thekiiingbob thekiiingbob added the 2: Dev Review Requires review by a core commiter label Jul 15, 2019
Copy link
Member

@saturninoabril saturninoabril left a comment

Choose a reason for hiding this comment

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

This is great!

Could you please check once again the generated link for screenshot? It's broken on me when I ran it. There were / that's missing in the link.
Screen Shot 2019-07-16 at 2 54 02 PM

e2e/cypress/support/index.js Outdated Show resolved Hide resolved
e2e/cypress/support/index.js Outdated Show resolved Hide resolved
e2e/runTests.js Outdated
@@ -0,0 +1,58 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
Copy link
Member

Choose a reason for hiding this comment

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

Please change filename to e2e/run_tests.js

e2e/runTests.js Outdated Show resolved Hide resolved
@thekiiingbob
Copy link
Contributor Author

This is great!

Could you please check once again the generated link for screenshot? It's broken on me when I ran it. There were / that's missing in the link.
Screen Shot 2019-07-16 at 2 54 02 PM

Ah! Good catch! I was stripping out / from the final filename, I just needed to strip it from the parent names.

@thekiiingbob
Copy link
Contributor Author

@saturninoabril @prapti Everything should be up to date now!

@prapti
Copy link
Contributor

prapti commented Jul 16, 2019

Should I be looking for the mochawesome-report folder inside e2e/results?
I am however, getting the following error while trying to run the test. Am I missing anything?

Error: Command failed: /bin/sh -c npm run test:ci
at makeError (/Users/prapti/go/src/github.com/mattermost/mattermost-webapp/e2e/node_modules/start-server-and-test/node_modules/execa/index.js:174:9)
at /Users/prapti/go/src/github.com/mattermost/mattermost-webapp/e2e/node_modules/start-server-and-test/node_modules/execa/index.js:278:16
at processTicksAndRejections (internal/process/task_queues.js:85:5) {
code: 1,
stdout: null,
stderr: null,
failed: true,
signal: null,
cmd: '/bin/sh -c npm run test:ci',
timedOut: false,
killed: false
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ test: start-test start:webhook 3000 test:ci
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ test script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Copy link
Member

@saturninoabril saturninoabril left a comment

Choose a reason for hiding this comment

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

Looks good to me, except for non-blocking comments/suggestion.

Probably will not affect others in general, especially those who's not running the full test in local but when they do then run style check (npm run check), too many errors will come out that's hard to pinpoint that it's from the generated app.js of mochawesome report. I suggest to add --ignore-pattern e2e/results to check script of main package.json.

.gitignore Outdated
e2e/cypress/videos
e2e/results
e2e/mochawesome-report
e2e/mochawesome-merged.json
Copy link
Member

Choose a reason for hiding this comment

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

Let's clean this up with the only folders to ignore.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@saturninoabril Pushed up changes to remove those unneeded ignores. Added .eslintignore file to handle ignoring e2e/results in linting.

@saturninoabril saturninoabril added 4: Reviews Complete All reviewers have approved the pull request and removed 2: Dev Review Requires review by a core commiter labels Jul 17, 2019
@thekiiingbob thekiiingbob merged commit 7384302 into mattermost:master Jul 17, 2019
@amyblais amyblais added Changelog/Not Needed Does not require a changelog entry Docs/Not Needed Does not require documentation labels Jul 17, 2019
skheria pushed a commit to uber-archive/mattermost-webapp that referenced this pull request Oct 3, 2019
* Mochawesome reporting

* rename script file, move all results into results folder

* Cleanup file ignores

* Missed screenshots folder
skheria pushed a commit to uber-archive/mattermost-webapp that referenced this pull request Oct 3, 2019
* Mochawesome reporting

* rename script file, move all results into results folder

* Cleanup file ignores

* Missed screenshots folder
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
4: Reviews Complete All reviewers have approved the pull request Changelog/Not Needed Does not require a changelog entry Docs/Not Needed Does not require documentation
Projects
None yet
4 participants