Skip to content

Commit

Permalink
test: create delete downloaded file command for nightwatch
Browse files Browse the repository at this point in the history
  • Loading branch information
amoncaldas committed Dec 30, 2021
1 parent 91a8d13 commit bab3b0b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* eslint-disable no-undef */
const fs = require('fs')

function clearDownloadedFiles() {}
function clearDownloadFolder() {}

clearDownloadedFiles.prototype.command = function () {
clearDownloadFolder.prototype.command = function () {

let folder =__dirname + '/../download/'

Expand All @@ -17,4 +17,4 @@ clearDownloadedFiles.prototype.command = function () {
})
}.bind(this)

module.exports = clearDownloadedFiles
module.exports = clearDownloadFolder
11 changes: 11 additions & 0 deletions tests/e2e/commands/deleteDownloadedFile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/* eslint-disable no-undef */
const fs = require('fs')

function deleteDownloadedFile() {}

deleteDownloadedFile.prototype.command = function (fileName) {
let path = `${__dirname}/../download/${fileName}`
fs.unlinkSync(path)
}.bind(this)

module.exports = deleteDownloadedFile

0 comments on commit bab3b0b

Please sign in to comment.