@Test,@System
Feature: System: File content basic manipulation
URL:
https://github.com/mkolisnyk/Sirius/issues/16
Basic file content manipulation includes various operations which are targeted to set/get/update file content and relevant information. The following operations are included:
- [x] Append text
- [x] Write text
- [x] Get contents
- [x] Head/tail file content
- [x] Get file size
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:
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:
When I write the "test line 2" text into "./Test.txt" file
Then I should see the "./Test.txt" file content is:
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