无效的文件名 - 下载文件
it('Empty download folder - Sponsor', function () {
applicationHelper.emptyFolder(dirPath);
rimraf(dirPath + '*', function () {
console.log('done');
});
});
it('Download draft ct - Sponsor', function () {
clinicalTrialsPage.downloadCt();
pagesNavigation.navigateToByName('Applications');
clinicalTrialsPage.selectDownloadOptionsforPartI();
expect(topBanner.getMessageInToast()).toContain('Successfully Downloaded');
browser.sleep(10000);
});
it('Check contents of zip', function () {
let downloadedZip = glob.sync(dirPath + ctNumber + '*.zip');
var zipFile = fs.readdirSync(dirPath);
console.log(zipFile);
zip = new admZip(dirPath + zipFile[0]);
zip.getEntries().forEach(function (entry) {
console.log(entry.entryName);
zipEntry.push(entry.entryName);
});
zip.extractAllTo(dirPath + "zip/", false);
expect(fs.existsSync(downloadedZip[0])).toBeTruthy();
});
我想检查是否存在下载的文件(确实如此),但是脚本持续失败,而错误的文件名无效。 Console.Log(Zipfile)给出了适当的结果。 我将ChromeDriver用于硒量角器,并正确设置了config.js(功能,prefs等)吗?
it('Empty download folder - Sponsor', function () {
applicationHelper.emptyFolder(dirPath);
rimraf(dirPath + '*', function () {
console.log('done');
});
});
it('Download draft ct - Sponsor', function () {
clinicalTrialsPage.downloadCt();
pagesNavigation.navigateToByName('Applications');
clinicalTrialsPage.selectDownloadOptionsforPartI();
expect(topBanner.getMessageInToast()).toContain('Successfully Downloaded');
browser.sleep(10000);
});
it('Check contents of zip', function () {
let downloadedZip = glob.sync(dirPath + ctNumber + '*.zip');
var zipFile = fs.readdirSync(dirPath);
console.log(zipFile);
zip = new admZip(dirPath + zipFile[0]);
zip.getEntries().forEach(function (entry) {
console.log(entry.entryName);
zipEntry.push(entry.entryName);
});
zip.extractAllTo(dirPath + "zip/", false);
expect(fs.existsSync(downloadedZip[0])).toBeTruthy();
});
I want to check that the downloaded file exists (which it does) but the script keeps failing, with the error invalid filename. The console.log(zipFile) gives a proper result.
I use ChromeDriver for Selenium Protractor and the config.js is properly set up (capabilities,prefs etc) Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论