Skip to content

Commit 02c80df

Browse files
committed
[JS] Enable test for file uplaod
1 parent 1ec3485 commit 02c80df

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

examples/javascript/test/elements/fileUpload.spec.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
const { suite } = require('selenium-webdriver/testing');
22
const {Browser, By} = require("selenium-webdriver");
3+
const path = require("path");
34

45
suite(function(env) {
56
describe('File Upload Test', function() {
@@ -11,14 +12,16 @@ suite(function(env) {
1112

1213
after(() => driver.quit());
1314

14-
xit('Should be able to upload a file successfully', async function() {
15+
it('Should be able to upload a file successfully', async function() {
16+
const image = path.resolve('./test/resources/selenium-snapshot.png')
17+
1518
await driver.manage().setTimeouts({implicit: 5000});
1619

1720
// Navigate to URL
1821
await driver.get('https://www.selenium.dev/selenium/web/upload.html');
1922

2023
// Upload snapshot
21-
await driver.findElement(By.id("upload")).sendKeys("selenium-snapshot.jpg");
24+
await driver.findElement(By.id("upload")).sendKeys(image);
2225

2326
await driver.findElement(By.id("go")).submit();
2427
});
Loading

0 commit comments

Comments
 (0)