-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3498 from continuedev/nate/quick-edit-f4d8
prompt files e2e tests
- Loading branch information
Showing
8 changed files
with
188 additions
and
8 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
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,23 @@ | ||
### Setup | ||
|
||
When running e2e tests for the first time, or after changing non-test source code: | ||
|
||
```bash | ||
npm run e2e:all | ||
``` | ||
|
||
### Run | ||
|
||
Afterward, you can run the tests with as long as you've only changed the e2e test code: | ||
|
||
```bash | ||
npm run e2e:quick | ||
``` | ||
|
||
### Writing tests | ||
|
||
All e2e tests are separated (by folder) into | ||
|
||
- `selectors` - functions that return elements | ||
- `actions` - functions that perform actions on the editor | ||
- `tests` - the actual tests, which are typically longer paths of functionality rather than individual actions |
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
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
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
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
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,65 @@ | ||
import { expect } from "chai"; | ||
import { | ||
EditorView, | ||
InputBox, | ||
Key, | ||
TextEditor, | ||
Workbench, | ||
} from "vscode-extension-tester"; | ||
|
||
import { GlobalActions } from "../actions/Global.actions"; | ||
import { DEFAULT_TIMEOUT } from "../constants"; | ||
|
||
describe("Prompt file", () => { | ||
let editor: TextEditor; | ||
|
||
beforeEach(async function () { | ||
this.timeout(DEFAULT_TIMEOUT.XL); | ||
|
||
await GlobalActions.openTestWorkspace(); | ||
await new Workbench().executeCommand("File: New Untitled Text File"); | ||
await new Workbench().executeCommand("Change Language Mode"); | ||
const inputBox = await new InputBox(); | ||
await inputBox.setText("Prompt Language"); | ||
await inputBox.confirm(); | ||
editor = (await new EditorView().openEditor("Untitled-1")) as TextEditor; | ||
}); | ||
|
||
afterEach(async function () { | ||
this.timeout(DEFAULT_TIMEOUT.XL); | ||
await editor.clearText(); | ||
await new EditorView().closeAllEditors(); | ||
}); | ||
|
||
it("Should display intellisense for default context providers and preamble", async () => { | ||
// Check that "@" dropdown in body works | ||
const providers = [ | ||
"currentFile", | ||
"open", | ||
"os", | ||
"problems", | ||
"repo-map", | ||
"terminal", | ||
"tree", | ||
]; | ||
for (const provider of providers) { | ||
await editor.typeText("@" + provider.slice(0, 2)); | ||
await editor.typeText(Key.ENTER); | ||
const text = await editor.getText(); | ||
expect(text).equals("@" + provider); | ||
await editor.clearText(); | ||
} | ||
|
||
// Check that dropdown for properties in preamble works | ||
// await editor.typeText(Key.ENTER); | ||
// await editor.typeText(Key.ENTER); | ||
// await editor.typeText("---"); | ||
// await editor.typeText(Key.UP); | ||
// await editor.typeText(Key.UP); | ||
// await editor.typeText(Key.SPACE); | ||
// await editor.typeText(Key.BACK_SPACE); | ||
// await editor.typeText(Key.ENTER); | ||
// const text = await editor.getText(); | ||
// expect(text).equals("description: \n\n---"); | ||
}).timeout(DEFAULT_TIMEOUT.XL); | ||
}); |
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