Merge pull request #1078 from dhyey35/vnext
[Integration-Test] Add test for number of downloads, fixes #810
This commit is contained in:
commit
6fdb5f4f9f
|
@ -42,7 +42,8 @@ module.exports = function(state, emit) {
|
|||
}
|
||||
state.downloadCount = value;
|
||||
emit('render');
|
||||
}
|
||||
},
|
||||
'expire-after-dl-count-dropdown'
|
||||
),
|
||||
dlCountSelect
|
||||
);
|
||||
|
@ -68,7 +69,8 @@ module.exports = function(state, emit) {
|
|||
}
|
||||
state.timeLimit = value;
|
||||
emit('render');
|
||||
}
|
||||
},
|
||||
'expire-after-time-dropdown'
|
||||
),
|
||||
timeSelect
|
||||
);
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
const html = require('choo/html');
|
||||
|
||||
module.exports = function(selected, options, translate, changed) {
|
||||
module.exports = function(selected, options, translate, changed, htmlId) {
|
||||
let x = selected;
|
||||
|
||||
return html`
|
||||
<select
|
||||
id="${htmlId}"
|
||||
class="appearance-none cursor-pointer border rounded-sm bg-blue-lightest hover:border-blue focus:border-blue px-2 py-1 my-2 h-8"
|
||||
onchange="${choose}"
|
||||
>
|
||||
|
|
|
@ -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
|
||||
);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -9,6 +9,8 @@ class HomePage extends Page {
|
|||
this.uploadButton = '#upload-btn';
|
||||
this.progress = 'progress';
|
||||
this.shareUrl = '#share-url';
|
||||
this.downloadCountDropdown = '#expire-after-dl-count-dropdown';
|
||||
this.expiresAfterText = '.text-xs.text-grey-dark.w-full.mt-2.mb-2';
|
||||
}
|
||||
|
||||
waitForPageToLoad() {
|
||||
|
|
Loading…
Reference in New Issue