- This is a project based on Vitest+Playwright. It performs UI automation testing for the plugin
typespecin Vscode. When the program is running, the automatically startedvscodemust have the focus all the time. By executing theyarn testcommand, you can run the automated process, which will automatically startvscodefor subsequent operations. - This project relies heavily on the environment required for manual testing. For information about manual testing, please refer to here.
- If want to use the latest plugin, click here. Then install it manually in
vscode.
- Nodejs V20
- Npm 7+
- Visual Code
- TypeSpec Compiler CLI: "npm install -g @typespec/compiler"
- TypeSpec Vscode Extension
- .NET 8.0 SDK
- Java 11 or above, and Maven
- Python 3.8+
The core directory is src, which contains all the test files. They correspond to three types of tests. In addition, there is a common folder, which contains some common utility functions and some specific steps.
common: Public module, including some utility functions.commonSteps.ts: Steps that are common to all tests.createStops.ts:createtype steps.emitSteps.ts:emittype steps.utils.ts: Utility Functions.downloadSetup.ts: Install a newvscode.
create/createTypespec.test.ts: New TypeSpec projects can be created using a variety of templates for specific purposes.emit/emitTypespec.test.ts: Different emitter types can be used to emit different codes to meet specific purposes.import/importTypespec.test.ts: With the TypeSpec emitter for OpenAPI3, users can import a TypeSpec file from a designated OpenAPI3 document. While it is possible to repeatedly convert OpenAPI3 to TypeSpec.
This quickstart will show you how to use this tool to fetch all test data and run test cases locally.
-
Clone this repo.
git clone https://github.com/v-xuto/TypespecAutomation.git -
Install dependencies using
yarn.npm i -g yarn yarnAlternatively, you can also install dependencies using npm directly.
npm i -
Run the test cases.
yarn testAlternatively, you can also run the tests using
npm.npm run test
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.