diff --git a/tests/browser/upload.test.js b/tests/browser/upload.test.js index b368194f..afabce1a 100644 --- a/tests/browser/upload.test.js +++ b/tests/browser/upload.test.js @@ -3,6 +3,9 @@ const Wendigo = require('../..'); const configUrls = require('../config.json').urls; const utils = require('../test_utils'); +const path = require('path'); + +const filePath = path.join(__filename, '..', '..', 'dummy_file'); describe("Upload", function() { this.timeout(5000); @@ -20,19 +23,19 @@ describe("Upload", function() { await browser.close(); }); - it("File Input Set Relative Path", async() => { - await browser.uploadFile(".input3", "dummy_file"); + it("File Input Set Absolute Path", async() => { + await browser.uploadFile(".input3", filePath); await browser.assert.value(".input3", "C:\\fakepath\\dummy_file"); }); - it("File Input Set Absolute Path", async() => { - await browser.uploadFile(".input3", "/directory/dummy_file"); + it.skip("File Input Set Relative Path", async() => { + await browser.uploadFile(".input3", "../../dummy_file"); await browser.assert.value(".input3", "C:\\fakepath\\dummy_file"); }); it("File Input Missing Element", async() => { await utils.assertThrowsAsync(async() => { - await browser.uploadFile(".missing", "dummy_file"); + await browser.uploadFile(".missing", filePath); }, `QueryError: [uploadFile] Selector ".missing" doesn't match any element to upload file.`); }); }); diff --git a/tests/dummy_file b/tests/dummy_file new file mode 100644 index 00000000..2cdad292 --- /dev/null +++ b/tests/dummy_file @@ -0,0 +1 @@ +Dummy