Basic file content manipulation includes various operations which are targeted to set/get/update file content and relevant information. The following operations are included:
Scenario: Append text to file
Given the "./Test.txt" file doesn't exist
When I append the "./Test.txt" file with the "test line" text
Then I should see the "./Test.txt" file is available
And the "./Test.txt" file content is:
|Line|
|test line|
When I append the "./Test.txt" file with the "test line 2" text
Then I should see the "./Test.txt" file content is:
|Line|
|test line|
|test line 2|
Scenario: Write text to file
Given the "./Test.txt" file doesn't exist
When I write the "test line" text into "./Test.txt" file
Then I should see the "./Test.txt" file is available
And the "./Test.txt" file content is:
|Line|
|test line|
When I write the "test line 2" text into "./Test.txt" file
Then I should see the "./Test.txt" file content is:
|Line|
|test line 2|
Scenario: Get contents, head and tail
Given the "./Test.txt" file doesn't exist
When I append the "./Test.txt" file with the following lines:
|Line|
|test line 1|
|test line 2|
|test line 3|
|test line 4|
|test line 5|
Then I should see the first 3 lines of the "./Test.txt" file are:
|Line|
|test line 1|
|test line 2|
|test line 3|
And the last 2 lines of the "./Test.txt" file are:
|Line|
|test line 4|
|test line 5|
And the lines from 2 of the "./Test.txt" file are:
|Line|
|test line 2|
|test line 3|
|test line 4|
|test line 5|
And the lines from 2 to 4 of the "./Test.txt" file are:
|Line|
|test line 2|
|test line 3|
|test line 4|
Scenario: File size
Given the "./Test.txt" file doesn't exist
When I append the "./Test.txt" file with the "test line" text
Then I should see the "./Test.txt" file size is 11 bytes
When I append the "./Test.txt" file with the "test line2" text
Then I should see the "./Test.txt" file size is 23 bytes
When I delete the "./Test.txt" file
Then I should see the "./Test.txt" file size is -1 bytes
Basic file content manipulation includes various operations which are targeted to set/get/update file content and relevant information. The following operations are included:
Scenario: Append text to file
Given the "./Test.txt" file doesn't exist
When I append the "./Test.txt" file with the "test line" text
Then I should see the "./Test.txt" file is available
And the "./Test.txt" file content is:
|Line|
|test line|
When I append the "./Test.txt" file with the "test line 2" text
Then I should see the "./Test.txt" file content is:
|Line|
|test line|
|test line 2|
Scenario: Write text to file
Given the "./Test.txt" file doesn't exist
When I write the "test line" text into "./Test.txt" file
Then I should see the "./Test.txt" file is available
And the "./Test.txt" file content is:
|Line|
|test line|
When I write the "test line 2" text into "./Test.txt" file
Then I should see the "./Test.txt" file content is:
|Line|
|test line 2|
Scenario: Get contents, head and tail
Given the "./Test.txt" file doesn't exist
When I append the "./Test.txt" file with the following lines:
|Line|
|test line 1|
|test line 2|
|test line 3|
|test line 4|
|test line 5|
Then I should see the first 3 lines of the "./Test.txt" file are:
|Line|
|test line 1|
|test line 2|
|test line 3|
And the last 2 lines of the "./Test.txt" file are:
|Line|
|test line 4|
|test line 5|
And the lines from 2 of the "./Test.txt" file are:
|Line|
|test line 2|
|test line 3|
|test line 4|
|test line 5|
And the lines from 2 to 4 of the "./Test.txt" file are:
|Line|
|test line 2|
|test line 3|
|test line 4|
Scenario: File size
Given the "./Test.txt" file doesn't exist
When I append the "./Test.txt" file with the "test line" text
Then I should see the "./Test.txt" file size is 11 bytes
When I append the "./Test.txt" file with the "test line2" text
Then I should see the "./Test.txt" file size is 23 bytes
When I delete the "./Test.txt" file
Then I should see the "./Test.txt" file size is -1 bytes