View Source

# module selenium-webdriver/io

## Functions

### copy(src, dst)code »

Copies one file to another.

Parameters

src`string`

  The source file.

dst`string`

  The destination file.

Returns

`webdriver.promise.Promise`

  A promise for the copied file's path.

### copyDir(src, dst, opt_exclude)code »

Recursively copies the contents of one directory to another.

Parameters

src`string`

  The source directory to copy.

dst`string`

  The directory to copy into.

opt_exclude`?(RegEx|function(string): boolean)=`

  An exclusion filter as either a regex or predicate function. All files matching this filter will not be copied.

Returns

`webdriver.promise.Promise`

  A promise for the destination directory's path once all files have been copied.

### exists(path)code »

Tests if a file path exists.

Parameters

path`string`

  The path to test.

Returns

`webdriver.promise.Promise`

  A promise for whether the file exists.

### findInPath(file, opt_checkCwd)code »

Searches the `PATH` environment variable for the given file.

Parameters

file`string`

  The file to locate on the PATH.

opt_checkCwd`boolean=`

  Whether to always start with the search with the current working directory, regardless of whether it is explicitly listed on the PATH.

Returns

`?string`

  Path to the located file, or `null` if it could not be found.

### rmDir(path)code »

Recursively removes a directory and all of its contents. This is equivalent to `rm -rf` on a POSIX system.

Parameters

path`string`

  Path to the directory to remove.

Returns

`webdriver.promise.Promise`

  A promise to be resolved when the operation has completed.

### tmpDir()code »

Returns

`webdriver.promise.Promise`

  A promise for the path to a temporary directory.

### tmpFile(opt_options)code »

Parameters

opt_options`{postfix: string}=`

  Temporary file options.

Returns

`webdriver.promise.Promise`

  A promise for the path to a temporary file.

### unlink(path)code »

Deletes a name from the filesystem and possibly the file it refers to. Has no effect if the file does not exist.

Parameters

path`string`

  The path to remove.

Returns

`webdriver.promise.Promise`

  A promise for when the file has been removed.