-
-
Notifications
You must be signed in to change notification settings - Fork 14
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 #31 from tzAcee/test/init
implement ui tests with vscode-extension-tester
- Loading branch information
Showing
21 changed files
with
1,500 additions
and
34 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
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,5 @@ | ||
"use strict"; | ||
|
||
module.exports = { | ||
timeout: 60000, | ||
}; |
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 |
---|---|---|
@@ -1,22 +1,49 @@ | ||
import { assert } from 'console'; | ||
import { VSBrowser, WebDriver } from 'vscode-extension-tester'; | ||
import { VSController } from './utils/vs-controller'; | ||
import { EditorView } from 'vscode-extension-tester'; | ||
import { CppCreatorExtHelper } from './utils/extension-helper'; | ||
import { ClassHelper } from './utils/class-helper'; | ||
import * as assert from "assert"; | ||
import * as fs from "fs"; | ||
|
||
describe('Activation test suite', () => { | ||
let browser: VSBrowser; | ||
let driver: WebDriver; | ||
const workSpaceDir = "/tmp/cppWs"; | ||
let vsController = new VSController(); | ||
let cppCreatorExt = new CppCreatorExtHelper(); | ||
|
||
before(async () => { | ||
browser = VSBrowser.instance; | ||
driver = browser.driver; | ||
await vsController.openWorkspace(workSpaceDir); | ||
}); | ||
|
||
after(async ()=>{ | ||
}) | ||
|
||
it('Extension can be activated by "Alt+X"', async () => { | ||
console.log("here2"); | ||
// Your test logic for Alt+X activation | ||
}); | ||
await vsController.openNewEmptyEditor(); | ||
|
||
const className = "testClass"; | ||
await cppCreatorExt.openExtPromptByShortcut(className); | ||
|
||
assert(await ClassHelper.fileExistsWithContent(className, workSpaceDir+"/"+className+".h", ClassHelper.defaultHeaderContent(className), true)); | ||
assert(await ClassHelper.fileExistsWithContent(className, workSpaceDir+"/"+className+".cpp", ClassHelper.defaultClassContent(className), true)); | ||
|
||
await new EditorView().closeAllEditors(); | ||
}) | ||
|
||
it('Extension can be activated by the context menu', async () => { | ||
console.log("here"); | ||
// Your test logic for context menu activation | ||
// test logic for context menu activ. | ||
|
||
const className = "testClass"; | ||
await cppCreatorExt.openExtPromptByContextMenu(className, workSpaceDir); | ||
|
||
assert(await ClassHelper.fileExistsWithContent(className, workSpaceDir+"/"+className+".h", ClassHelper.defaultHeaderContent(className), true)); | ||
assert(await ClassHelper.fileExistsWithContent(className, workSpaceDir+"/"+className+".cpp", ClassHelper.defaultClassContent(className), true)); | ||
}) | ||
|
||
it('Extension can be activated by the command pallette', async () => { | ||
const className = "testClass"; | ||
|
||
await cppCreatorExt.openExtPromptByCmdPallette(className); | ||
assert(await ClassHelper.fileExistsWithContent(className, workSpaceDir+"/"+className+".h", ClassHelper.defaultHeaderContent(className), true)); | ||
assert(await ClassHelper.fileExistsWithContent(className, workSpaceDir+"/"+className+".cpp", ClassHelper.defaultClassContent(className), true)); | ||
}); | ||
}); | ||
}) |
Oops, something went wrong.