-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
01b480f
commit ff15105
Showing
2 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { expect } from '@playwright/test'; | ||
import { shellLineSimpleN, test } from '../utils'; | ||
|
||
test.describe('cp command', () => { | ||
test('should copy single file', async ({ page }) => { | ||
const output = await shellLineSimpleN(page, [ | ||
// Check initial conditions | ||
'ls file1', | ||
'ls copy', | ||
'cat file1', | ||
// Copy file | ||
'cp file1 copy', | ||
// Check results | ||
'ls file1', | ||
'ls copy', | ||
'cat file1', | ||
'cat copy' | ||
]); | ||
expect(output[0]).toMatch(/^ls file1\r\nfile1\r\n/); | ||
expect(output[1]).toMatch(/cannot access 'copy': No such file or directory/); | ||
expect(output[2]).toMatch(/^cat file1\r\nContents of the file\r\n/); | ||
expect(output[4]).toMatch(/^ls file1\r\nfile1\r\n/); | ||
expect(output[5]).toMatch(/^ls copy\r\ncopy\r\n/); | ||
expect(output[6]).toMatch(/^cat file1\r\nContents of the file\r\n/); | ||
expect(output[7]).toMatch(/^cat copy\r\nContents of the file\r\n/); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { expect } from '@playwright/test'; | ||
import { shellLineSimpleN, test } from '../utils'; | ||
|
||
test.describe('mv command', () => { | ||
test('should move single file', async ({ page }) => { | ||
const output = await shellLineSimpleN(page, [ | ||
// Check initial conditions | ||
'ls file1', | ||
'ls copy', | ||
'cat file1', | ||
// Move file | ||
'mv file1 copy', | ||
// Check results | ||
'ls file1', | ||
'ls copy', | ||
'cat copy' | ||
]); | ||
expect(output[0]).toMatch(/^ls file1\r\nfile1\r\n/); | ||
expect(output[1]).toMatch(/cannot access 'copy': No such file or directory/); | ||
expect(output[2]).toMatch(/^cat file1\r\nContents of the file\r\n/); | ||
expect(output[4]).toMatch(/cannot access 'file1': No such file or directory/); | ||
expect(output[5]).toMatch(/^ls copy\r\ncopy\r\n/); | ||
expect(output[6]).toMatch(/^cat copy\r\nContents of the file\r\n/); | ||
}); | ||
}); |