Extends Helper
Helper for testing filesystem. Can be easily used to check file structures:
I.amInPath('test'); I.seeFile('codecept.json'); I.seeInThisFile('FileSystem'); I.dontSeeInThisFile("WebDriverIO");
Enters a directory In local filesystem. Starts from a current directory
openPath
string (opens new window)
Checks that contents of file found by seeFile
doesn't equal to text.
text
string (opens new window)
encoding
string (opens new window)
Checks that file found by seeFile
doesn't include text.
text
string (opens new window)
encoding
string (opens new window)
Returns file names in current directory.
I.handleDownloads(); I.click('Download Files'); I.amInPath('output/downloads'); const downloadedFileNames = I.grabFileNames();
Checks that file exists
Checks that contents of file found by seeFile
equal to text.
text
string (opens new window)
encoding
string (opens new window)
Checks that contents of the file found by seeFile
equal to contents of the file at pathToReferenceFile
.
pathToReferenceFile
string (opens new window)
encoding
string (opens new window)
encodingReference
string (opens new window)
Checks that file with a name including given text exists in the current directory.
I.handleDownloads(); I.click('Download as PDF'); I.amInPath('output/downloads'); I.seeFileNameMatching('.pdf');
text
Checks that file found by seeFile
includes a text.
text
string (opens new window)
encoding
string (opens new window)
Waits for file to be present in current directory.
I.handleDownloads(); I.click('Download large File'); I.amInPath('output/downloads'); I.waitForFile('largeFilesName.txt', 10); // wait 10 seconds for file
name
string (opens new window)
sec
number (opens new window) seconds to waitWrites test to file
file
string (opens new window)
encoding
string (opens new window)
Returns string (opens new window)
file
string (opens new window)
timeout
number (opens new window)
Returns Promise (opens new window)<any>
© 2015 DavertMik <[email protected]> (http://codegyre.com)
Licensed under the MIT License.
https://codecept.io/helpers/FileSystem/