Skip to content

Commit

Permalink
test fix (#456)
Browse files Browse the repository at this point in the history
* fix in upload test
  • Loading branch information
angrykoala authored Apr 29, 2020
1 parent 5d0d9a0 commit cb774f4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
13 changes: 8 additions & 5 deletions tests/browser/upload.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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.`);
});
});
1 change: 1 addition & 0 deletions tests/dummy_file
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Dummy

0 comments on commit cb774f4

Please sign in to comment.