How to embed screenshots into Cypress 10 Mochawesome report? - cypress

I am trying to implement Mochawsome report to my Cypress 10 framework. I use cypress-mochawesome-reporter plugin and set it up regarding npm package instructions https://www.npmjs.com/package/cypress-mochawesome-reporter. But the problem is that the report is generated without imbedded screenshots despite of using embeddedScreenshots: true parameter in reporterOptions object. cypress/screenshots folder contains the necessary screenshots but they are missing in the report. Could anybody advice?
P.S. I have to add important remark. Further investigation revealed that some screenshots are imbedded, but most of them are not. On the moment of publishing this request I used only few tests to check if the plugin work at all and got a report without screenshots. Now I have a big number of tests: 81 tests total, 26 failed, and only 15 of them have screenshots. Screenshots folder contains images for all failed tests

Related

Cypress 10 - How to run all tests in one go?

I used to use Cypress 9 on previous projects.
By default, when running cypress open or cypress open --browser chrome used to run all tests for all React components.
However I installed Cypress 10 for the first time on a project that didn't have e2e tests yet. I added test specs, but I don't see any option to run all tests altogether.
It seems I have to run the tests one by one, clicking on each of them.
Can anyone please suggest how do I run all the tests automatically?
It's been removed in Cypress v10, here are the change notes related
During cypress open, the ability to "Run all specs" and "Run filtered specs" has been removed. Please leave feedback around the removal of this feature here. Your feedback will help us make product decisions around the future of this feature.
The feedback page to register your displeasure is here
You can create a "barrel" spec to run multiple imported specs.
I can't vouch for it working the same as v9 "Run all tests", but can't see any reason why not.
// all.spec.cy.js
import './test1.spec.cy.js' // relative paths
import './test2.spec.cy.js'
...
As #Constance says, reinstated in v11.20.
But still a very handy technique if you want to run a pre-defined subset of your tests.
In Cypress version 11.2.0 the Run All button has been reinstated.
You need to set experimentalRunAllSpecs to true in cypress.config.js.
Please see Configuration - End-to-End Testing
If Cypress Test Runner is not a must, I suggest to utilize the CLI/Node Cmd approach
You can trigger all the test(s) by npx cypress run(Still the video recording & screenshot on failed steps would be saved in the respective folders) to run all or with any other cypress flags to filter out specific spec files, or browser etc.
As per the feedback discussion there is a workaround the same as #Fody's answer that will achieve the same result as v9. Also worth noting though is the section on Continuous Integration and the Update 1 that includes a fix for preventing this workaround creating issues with the cypress run command.
Are there any current workarounds?
Yes. If you are impacted by the omission of this feature, it is possible to achieve the same level of parity as 9.x with a workaround Gleb Bahmutov explains here: https://glebbahmutov.com/blog/run-all-specs-cypress-v10/
This will still inherit the same problems as the previous implementation (which is why it was removed) but it will work in certain cases where the previous implementation was not problematic for your use case
https://github.com/cypress-io/cypress/discussions/21628#discussion-4098510
It was removed because people used it wrong.
The Test Runner is for debugging single tests. But by running all tests, then performance will quickly become a problem and crash the entire suite.
Running all tests should only be performed from the CLI.
Sources
https://github.com/cypress-io/cypress/issues/681
https://github.com/cypress-io/cypress/discussions/21628

Hyperledger composer generator: Trying to copy from a source that doesn't exist (no concepts support for Angular)

I have a composer-rest-server running on localhost:3000. To go with that, I tried to generate an Angular 2 app using yo hyperledger-composer. My business network models also have a abstract concept Spray{...} present.
I believe the documentation is outdated as I was presented with slightly different options than on the documentation. After choosing Angular and following through the steps, I got an
AssertionError: Trying to copy from source that does not exist ... /concept/concept.component.ts
Based on some quick google searches, I was able to find this issue on their Github - https://github.com/hyperledger/composer/issues/3927 however in my case, I am not even able to build the Angular app so I don't even get to the compilation stage.
Is there any way to build the app right now where it's at?
I've created a Github issue explaining steps to reproduce this and also included a hacky fix which is to comment out the lines in the generator code which copy over the concept files.
Link - https://github.com/hyperledger/composer/issues/4328

Suppress "Error during loading" message in standalone Jasmine 3.1 browser report

When using 3.1 of standalone Jasmine I see the message Error during loading: Script error. for each of my scripts as they load.
When I was using standalone version 2.9.1 I would see the errors in the console but not blasted on the page.
These errors are irrelevant as I mock the missing pieces that are the cause of the errors when I run my tests.
Is there any way to suppress these from showing in the standalone HTML page report?
I was actually able to resolve it.
If I move my source files above the jasmine files in the SpecRunner.html file it does not display the errors in the report but it still runs my tests successfully.

How to generate Test Case Report from Xcode

I'm using default XCTest test framework to write and test application & I could able to do that. But to generate Test-Case report I'm not seeing any option except Xcode Server. Is there any other way to generate Test Case Report!! Any Suggestion !
when u run your test, a report is generated in
/Users/username/Library/Developer/Xcode/DerivedData/projectname/Logs/Test/TestSummary.plist
there you will get your all test information. But if you want a html format report you have to use
xcpretty.
let me know if you want to use xcpretty for html report or u can do your job using the TestSummary.plist
If you run your tests using fastlane/scan, an HTML report will be generated at the end of each test run as standard. It will open automatically in your browser when the tests are finished unless you tell it not to.
Scan is an easy way to simplify your test runs and make them configurable. The report is generated by xcpretty.

XCode 7 code coverage results for UI Testing

I am using XCode Version 7.1 (7B91b) on my local MAC.
And testing my app on the Simulator iPhone 6 (iOS9).
I have created Unit tests for my app, then I found that the code coverage was about 34%. I decided to create UI tests to increase the code coverage. But unfortunately, the code coverage did not increase.
I made a simple trial,
create a project with NavBarContrl, FirstTabelViewController & SecondTableViewController, keep the unit tests as default
Leave unit tests, add one record in UI Tests to navigate from first table view controller to the second. (I am expecting that Both First/Second Table View Controllers must be highlighted in the final Code Coverage report, right?)
Make sure code coverage is enabled
Run Tests then check code coverage, it is 40%
Take a look on the attached code coverage result, Second View Controller coverage is zero !! although when I was watching the simulator, it did navigate from first view controller to the second one. It can't be zero.
is there anything that I m missing here?
I tried to search in Apple official Documentation but cant find any explicit contradiction to have code coverage with UI Testing, any suggestions?
Make sure you have enabled Debug Executable in Test section in your Scheme settings.
It appears that without this option Xcode unable to gather coverage data.

Resources