File tree 2 files changed +5
-2
lines changed
2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change 1
1
const { suite } = require ( 'selenium-webdriver/testing' ) ;
2
2
const { Browser, By} = require ( "selenium-webdriver" ) ;
3
+ const path = require ( "path" ) ;
3
4
4
5
suite ( function ( env ) {
5
6
describe ( 'File Upload Test' , function ( ) {
@@ -11,14 +12,16 @@ suite(function(env) {
11
12
12
13
after ( ( ) => driver . quit ( ) ) ;
13
14
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
+
15
18
await driver . manage ( ) . setTimeouts ( { implicit : 5000 } ) ;
16
19
17
20
// Navigate to URL
18
21
await driver . get ( 'https://www.selenium.dev/selenium/web/upload.html' ) ;
19
22
20
23
// Upload snapshot
21
- await driver . findElement ( By . id ( "upload" ) ) . sendKeys ( "selenium-snapshot.jpg" ) ;
24
+ await driver . findElement ( By . id ( "upload" ) ) . sendKeys ( image ) ;
22
25
23
26
await driver . findElement ( By . id ( "go" ) ) . submit ( ) ;
24
27
} ) ;
You can’t perform that action at this time.
0 commit comments