Skip to content

Yionse/TypespecAutomation

Repository files navigation

TypeSpec UI Automation

Description

  • This is a project based on Vitest+Playwright. It performs UI automation testing for the plugin typespec in Vscode. When the program is running, the automatically started vscode must have the focus all the time. By executing the yarn test command, you can run the automated process, which will automatically start vscode for 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.

Prerequisites

Quickstart

Project Structure

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: create type steps.
    • emitSteps.ts: emit type steps.
    • utils.ts: Utility Functions.
    • downloadSetup.ts: Install a new vscode.
  • 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.

  1. Clone this repo.

    git clone https://github.com/Yionse/TypespecAutomation.git
    
  2. Install dependencies using yarn.

    npm i -g yarn
    yarn
    

    Alternatively, you can also install dependencies using npm directly.

    npm i
    
  3. Run the test cases.

    yarn test
    

    Alternatively, you can also run the tests using npm.

    npm run test
    

Contributing

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.

About

TypespecUI automation project based on playwright

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published