As I begin the download of a pdf file, I realize that it will take more than 2 minutes to complete. In order to verify if the file has successfully downloaded or not, I will need to wait for the full 2 minutes before performing any verification checks. Can anybody provide guidance on how to effectively use the browser.wait() method in this particular situation?
control.getText().browser.wait(120000).then(function(text) {
var filename = downloadPath+'AmPMIC_' + text +'.pdf';
console.log(filename);
if (fs.existsSync(filename))
{
return deferred.resolve(true);
}
else {
return deferred.reject('verify failed');
}