I am writting a protractor test case to download a file which can be of any type.
How do i check if the file is downloaded correctly or not?
Files required by ProtractorThe test code is written by using the syntax of our testing framework. For example, if we are using Jasmine framework, then the test code will be written by using the syntax of Jasmine. This file will contain all the functional flows and assertions of the test.
By default, Protractor uses the Jasmine test framework for its testing interface. This tutorial assumes some familiarity with Jasmine, and we will use version 2.4. This tutorial will set up a test using a local standalone Selenium Server to control browsers.
Protractor is an end-to-end test framework for Angular and AngularJS applications. Protractor runs tests against your application running in a real browser, using Selenium. We can say in other words that Protractor is a tool that helps us to test Angular Apps using Selenium.
I was able to achieve download testing with Chrome.
Follow this config setup: https://stackoverflow.com/a/26127745/511069
Create a function waitFileExists(fileAbsPath)
and performs your expectations after the file is completely downloaded: https://stackoverflow.com/a/27031924/511069
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With