[Integration-Test] Add test for number of downloads, fixes #810

This commit is contained in:
Dhyey Thakore 2019-01-09 19:32:11 +05:30
parent 1bb1e8123f
commit e9a9ead762
4 changed files with 31 additions and 3 deletions

View file

@ -34,4 +34,27 @@ describe('Firefox Send', function() {
assert.ok(fs.existsSync(path.join(downloadDir, file)));
});
});
it('should update the download count on home page after 1 download', function() {
const expectedExpiresAfterText = 'Expires after 1 download';
browser.chooseFile(
homePage.uploadInput,
`${testFilesPath}/${testFiles[0]}`
);
browser.waitForExist(homePage.uploadButton);
browser.waitForExist(homePage.downloadCountDropdown);
browser.selectByIndex(homePage.downloadCountDropdown, 1);
browser.click(homePage.uploadButton);
browser.waitForExist(homePage.shareUrl);
const downloadPage = new DownloadPage(browser.getValue(homePage.shareUrl));
downloadPage.open();
downloadPage.download();
browser.waitForExist(downloadPage.downloadComplete);
browser.back();
browser.waitForExist(homePage.expiresAfterText);
assert.ok(
browser.getText(homePage.expiresAfterText).substring(0, 24) ===
expectedExpiresAfterText
);
});
});