Skip to content

Commit

Permalink
Update generate-openapi3-from-typespec-test-plan.md
Browse files Browse the repository at this point in the history
Update generate-server-stub-from-typespec-test-plan.md

Update create-typespec-project-test-plan.md

Create typespec-extension-basic-features-test-plan.md

Add files via upload

Update typespec-extension-basic-features-test-plan.md

Update typespec-extension-basic-features-test-plan.md

Add files via upload

Update create-typespec-project-test-plan.md

Update generate-client-code-from-typespec-test-plan.md

Update generate-openapi3-from-typespec-test-plan.md

Add files via upload

Update generate-server-stub-from-typespec-test-plan.md

Update import-typespec-from-openapi3-test-plan.md

Update create-typespec-project-test-plan.md

Update generate-client-code-from-typespec-test-plan.md

Update generate-openapi3-from-typespec-test-plan.md

Add files via upload

Update generate-client-code-from-typespec-test-plan.md

Add files via upload

Update typespec-extension-basic-features-test-plan.md

Update typespec-extension-basic-features-test-plan.md

Update generate-client-code-from-typespec-test-plan.md

Update generate-openapi3-from-typespec-test-plan.md

Update create-typespec-project-test-plan.md

Add files via upload

Update generate-openapi3-from-typespec-test-plan.md
  • Loading branch information
xiaohua899 committed Jan 9, 2025
1 parent c5e3807 commit 43bc7bf
Show file tree
Hide file tree
Showing 25 changed files with 220 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Selecting a template involves:
## Test Environment

* OS : Windows or Linux
* Language : Python, Java, JavaScript, .NET
* Template : Empty Project, Generic REST API, TypeSpec Library (with TypeScript), TypeSpec Emitter (with TypeScript)

> Note: The extension should support all test cases in VS Code for Windows and Linux. Mac support is a stretch goal for Selenium semester.
Expand All @@ -27,7 +27,7 @@ Install TypeSpec Compiler before starting to write TypeSpec.

* [Node.js 20+](https://nodejs.org/download/)
* Npm 7+
* Install TypeSpec Compiler CLI: `"npm install -g @typespec/compiler"`
* [Install TypeSpec Compiler CLI](https://typespec.io/docs/): `"npm install -g @typespec/compiler"`

## Test Steps

Expand Down Expand Up @@ -61,15 +61,15 @@ _Option 2_. Typing `> TypeSpec: Create TypeSpec Project` in the _Command Palette

![alt text](./images/CreateTypeSpecProject_SelectFolderTest.png)

#### Step 4. Check if TypeSpec Compiler CLI is installed (optional).
### Step 4. Check if TypeSpec Compiler CLI is install. (optional)

If the TypeSpec Compiler is not installed, the Quick Pick will initiate the installation of the TypeSpec Compiler. If TypeSpec Compiler is installed, Skip to the next step.

![alt text](./images/CreateTypeSpecProject_InstallTypeSpecCompiler.png)

### Step 5. After successfully installing TypeSpec Compiler, will go through the questions of `tsp init`.

1. If the specified folder is not empty. If the folder is empty, skip to the next step. _(optional)_
1. If the specified folder is not empty, it will prompt `Folder C:\xxx\xxx\xxx is not empty. Are you sure you want to initialize a new project here?`. If the folder is empty, skip to the next step. _(optional)_

  **Validate:** Will it appear: `Folder C:\xxx\xxx\xxx is not empty. Are you sure you want to initialize a new project here?`

Expand All @@ -91,6 +91,8 @@ If the TypeSpec Compiler is not installed, the Quick Pick will initiate the inst

5. Select libraries to update. _(Multiple choice)_

> Note: Select libraries to update is required only when you select `Generic REST API`. This step will not appear if you select other templates.
![alt text](./images/CreateTypeSpecProject_InstallOrUpdateLibraries.png)

6. Click `OK` and the project will be created, the folder structure will be set up, dependencies will be installed, and tspconfig.yaml will be updated..
Expand Down Expand Up @@ -125,7 +127,7 @@ When an error is detected, it’s necessary to document the findings by using th

| No | Title | Template | Issue Description | Repro Steps | Expected Results | Actual Results | Comments |
| ---------| :--: | :--: | :--: | :--: | :--: | :--: | :--: |
| 1 | e.g. Create typespec project failed | `Empty project` / `Generic REST API` / `TypeSpec Library (With TypeScript)` / `TypeSpec Emitter (With TypeScript)` | Create project feature is not supported by the current TypeSpec Compiler (ver <= 0.63.0). Please upgrade TypeSpec Compiler and try again. | 1. Typing `>TypeSpec: Create TypeSpec Project` in the _Command Palette_. <br> 2. Select an empty folder as the root folder for the new TypeSpec project. <br> 3. Select a template. | There should be a prompt "Select a template", and should see four options: `Empty project`, `Generic REST API`, `TypeSpec Library (With TypeScript)`, `TypeSpec Emitter (With TypeScript)`. | Create project feature is not supported by the current TypeSpec Compiler (ver <= 0.63.0). Please upgrade TypeSpec Compiler and try again. | Issue link |
| 1 | e.g. Create typespec project failed | Empty project / Generic REST API / TypeSpec Library (With TypeScript) / TypeSpec Emitter (With TypeScript) | Create project feature is not supported by the current TypeSpec Compiler (ver <= 0.63.0). Please upgrade TypeSpec Compiler and try again. | 1. Typing `>TypeSpec: Create TypeSpec Project` in the _Command Palette_. <br> 2. Select an empty folder as the root folder for the new TypeSpec project. <br> 3. Select a template. | There should be a prompt "Select a template", and should see four options: `Empty project`, `Generic REST API`, `TypeSpec Library (With TypeScript)`, `TypeSpec Emitter (With TypeScript)`. | Create project feature is not supported by the current TypeSpec Compiler (ver <= 0.63.0). Please upgrade TypeSpec Compiler and try again. | Issue link |

## Test Results Summary

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Install TypeSpec Compiler before starting to write TypeSpec.

* [Node.js 20+](https://nodejs.org/download/)
* Npm 7+
* Install [TypeSpec Compiler CLI](https://typespec.io/docs/): `"npm install -g @typespec/compiler"`
* [Install TypeSpec Compiler CLI](https://typespec.io/docs/): `"npm install -g @typespec/compiler"`

Install required SDK/runtime for executing the specified language:

Expand Down Expand Up @@ -75,29 +75,35 @@ _Option 2_. Typing `>TypeSpec: Generate from TypeSpec` in the _Command Palette_

![alt text](./images/GeneratefromTypeSpec_SelectClientLanguage.png)

### Step 6: Select a Language, the TypeSpec to client code generation is initiated at the back end.
### Step 6: Select a Language, confirm the TypeSpec emitters you want to install and their minimum requirements.

**Validate:** There should be a prompt `Here are libraries to install or update`, and TypeSpec emitters to install and their minimum requirements.

![alt text](./images/GenerateClientCode_ConfirmTypeSpecEmitters.png)

### Step 7: Initiate the generation of client code on the backend.

**Validate:** The emitter package is already installed and the client folder is generated. The result appears in the lower right corner as a notification.

- For `DotNet`.
- For `DotNet`:

![alt text](./images/GenerateClientCode_VerifyInstallEmitter_DotNet.png)
![alt text](./images/GenerateClientCode_VerifyGenerateSuccessful_DotNet.png)
![alt text](./images/GenerateClientCode_VerifyGenerateCodeSucceeded_DotNet.png)

- For `Java`.
- For `Java`:

![alt text](./images/GenerateClientCode_VerifyInstallEmitter_Java.png)
![alt text](./images/GenerateClientCode_VerifyGenerateSuccessful_Java.png)
![alt text](./images/GenerateClientCode_VerifyGenerateCodeSucceeded_Java.png)

- For `JavaScript`.
- For `JavaScript`:

![alt text](./images/GenerateClientCode_VerifyInstallEmitter_JS.png)
![alt text](./images/GenerateClientCode_VerifyGenerateSuccessful_JS.png)
![alt text](./images/GenerateClientCode_VerifyGenerateCodeSucceeded_JS.png)

- For `Python`.
- For `Python`:

![alt text](./images/GenerateClientCode_VerifyInstallEmitter_Python.png)
![alt text](./images/GenerateClientCode_VerifyGenerateSuccessful_Python.png)
Expand All @@ -109,7 +115,7 @@ When an error is detected, it’s necessary to document the findings by using th

| No | Title | Emitter Type | Language | Issue Description | Repro Steps | Expected Results | Actual Results | Comments |
| ---------| :--: | :-: | :--: | :--: | :--: | :--: | :--: | :--: |
| 1 | e.g. Generate Client Code failed | Client Code | `DotNet`/ `Java`/ `JavaScript`/ `Python` | Exception occurred when generating client code for JavaScript. | 1. Typing `>TypeSpec: Generate from TypeSpec` in the _Command Palette_. <br> 2. choose a project. <br> 3. Select a template. <br> 4. Select an Emitter Type. <br> 5. Select a Language.| Generate client code for JavaScript ...Succeeded. | Exception occurred when generating client code for JavaScript. | Issue link |
| 1 | e.g. Generate Client Code failed | Client Code | DotNet/ Java / JavaScript / Python | Exception occurred when generating client code for JavaScript. | 1. Typing `>TypeSpec: Generate from TypeSpec` in the _Command Palette_. <br> 2. choose a project. <br> 3. Select a template. <br> 4. Select an Emitter Type. <br> 5. Select a Language.| Generate client code for JavaScript ...Succeeded. | Exception occurred when generating client code for JavaScript. | Issue link |

## Test Results Summary

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The TypeSpec file itself is not sufficient to generate OpenAPI 3. The conversion
## Test Environment

* OS : Windows or Linux
* Language : Python, Java, JavaScript, .NET
* Language : OpenAPI3

> Note: The extension should support all test cases in VS Code for Windows and Linux. Mac support is a stretch goal for Selenium semester.
Expand All @@ -18,7 +18,7 @@ Install TypeSpec Compiler before starting to write TypeSpec.

* [Node.js 20+](https://nodejs.org/download/)
* Npm 7+
* Install [TypeSpec Compiler CLI](https://typespec.io/docs/): `"npm install -g @typespec/compiler"`
* [Install TypeSpec Compiler CLI](https://typespec.io/docs/): `"npm install -g @typespec/compiler"`

## Test Steps

Expand Down Expand Up @@ -68,20 +68,30 @@ _Option 2_. Typing `>TypeSpec: Generate from TypeSpec` in the _Command Palette_

![alt text](./images/GeneratefromTypeSpec_SelectOpenAPILanguage.png)

### Step 6: Select a Language, the TypeSpec to OpenAPI generation is initiated at the back end.
### Step 6: Select a Language, confirming installation of the required TypeSpec library @typespec/openapi3.

**Validate:** The result appears as a Notification in the bottom right corner, and generate the schema folder.
**Validate**: There should be a prompt `Here are libraries to install or update`, and confirming installation of the required TypeSpec library @typespec/openapi3.

![alt text](./images/GenerateOpenAPI_ConfirmTypeSpecEmitters.png)

### Step 7: Initiate the generation of OpenAPI on the backend.

**Validate:** A detailed trace log should be printed in the OUTPUT window. The result appears as a Notification in the bottom right corner, and generate the schema folder.

![alt text](./images/GeneratefromTypeSpec_GenerateOpenAPIResult_prompt.png)
![alt text](./images/GeneratefromTypeSpec_GenerateOpenAPIResult_Folder.png)

If the OpenAPI 3 generation fails, the error message should indicate the root cause and suggest possible resolutions to continue.

![alt text](./images/GeneratefromTypeSpec_GenerateOpenAPIResult_Fail.png)

## Issue Report

When an error is detected, it’s necessary to document the findings by using the following form:

| No | Title | Emitter Type | Language | Issue Description | Repro Steps | Expected Results | Actual Results | Comments |
| ---------| :--: | :-: | :--: | :--: | :--: | :--: | :--: | :--: |
| 1 | e.g. Generate schema code failed | Protocal Schema | `OpenAPI3` | Exception occurred when generating schema code for OpenAPI3. | 1. Typing `>TypeSpec: Generate from TypeSpec` in the _Command Palette_. <br> 2. choose a project. <br> 3. Select a template. <br> 4. Select an Emitter Type. <br> 5. Select a Language.| Generate schema code for OpenAPI3 ...Succeeded. | Exception occurred when generating schema code for OpenAPI3. | Issue link |
| 1 | e.g. Generate schema code failed | Protocal Schema | OpenAPI3 | Exception occurred when generating schema code for OpenAPI3. | 1. Typing `>TypeSpec: Generate from TypeSpec` in the _Command Palette_. <br> 2. choose a project. <br> 3. Select a template. <br> 4. Select an Emitter Type. <br> 5. Select a Language.| Generate schema code for OpenAPI3 ...Succeeded. | Exception occurred when generating schema code for OpenAPI3. | Issue link |

## Test Results Summary

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
# Generate Server Stub from TypeSpec Test Scenario

The service stub generation support will be PREVIEWED for 2 languages: `.NET` and `JavaScript`.
> Note: Server Stub Emitter is currently under PREVIEW.

> Note: Server Stub Emitter is currently under PREVIEW. JavaScript server code emitter is experimental.
**Important: There must be at least one TypeSpec project in the project folder.**

## Test Environment

* OS : Windows or Linux
* Language : Python, Java, JavaScript, .NET
* Language : JavaScript, .NET

> Note: The extension should support all test cases in VS Code for Windows and Linux. Mac support is a stretch goal for Selenium semester.
Expand All @@ -18,7 +19,7 @@ Install TypeSpec Compiler before starting to write TypeSpec.

* [Node.js 20+](https://nodejs.org/download/)
* Npm 7+
* Install [TypeSpec Compiler CLI](https://typespec.io/docs/): `"npm install -g @typespec/compiler"`
* [Install TypeSpec Compiler CLI](https://typespec.io/docs/): `"npm install -g @typespec/compiler"`

## Test Steps

Expand Down Expand Up @@ -71,25 +72,23 @@ _Option 2_. Typing `>TypeSpec: Generate from TypeSpec` in the _Command Palette_
### Step 6: Select a Language, the TypeSpec to Server Stub generation is initiated at the back end.

**Validate:** The result appears as a Notification in the bottom right corner, and generate the server folder.
- For `DotNet`.

> Note: JavaScript server code emitter is experimental.
- For `DotNet`:

![alt text](./images/GeneratefromTypeSpec_GenerateServerCodeInstallDependencies_DotNet.png)
![alt text](./images/GeneratefromTypeSpec_GenerateServerCodePrompt_DotNet.png)
![alt text](./images/GeneratefromTypeSpec_GenerateServerCodeFolder_DotNet.png)

- For `JavaScript`.

![alt text](./images/GeneratefromTypeSpec_GenerateServerCodeInstallDependencies_JS.png)
![alt text](./images/GeneratefromTypeSpec_GenerateServerCodePrompt_JS.png)
![alt text](./images/GeneratefromTypeSpec_GenerateServerCodeFolder_JS.png)

## Issue Report

When an error is detected, it’s necessary to document the findings by using the following form:

| No | Title | Emitter Type | Language | Issue Description | Repro Steps | Expected Results | Actual Results | Comments |
| ---------| :--: | :-: | :--: | :--: | :--: | :--: | :--: | :--: |
| 1 | e.g. Generate Server Stub failed | Server Stub | `DotNet`/ `JavaScript`/ | Exception occurred when generating server code for JavaScript. | 1. Typing `>TypeSpec: Generate from TypeSpec` in the _Command Palette_. <br> 2. choose a project. <br> 3. Select a template. <br> 4. Select an Emitter Type. <br> 5. Select a Language.| Generate server code for JavaScript ...Succeeded. | Exception occurred when generating server code for JavaScript. | Issue link |
| 1 | e.g. Generate Server Stub failed | Server Stub | DotNet/ JavaScript | Exception occurred when generating server code for JavaScript. | 1. Typing `>TypeSpec: Generate from TypeSpec` in the _Command Palette_. <br> 2. choose a project. <br> 3. Select a template. <br> 4. Select an Emitter Type. <br> 5. Select a Language.| Generate server code for JavaScript ...Succeeded. | Exception occurred when generating server code for JavaScript. | Issue link |

## Test Results Summary

Expand All @@ -98,4 +97,4 @@ The test results will be presented in the following form:
| NO | Test Cases | Platform | Language | Result | Issues | Comments |
| --------------- | :-: |:-: | :--: | :--: | :--: | :--: |
| 1 | Generate Server Stub from TypeSpec Test Scenario | Windows/Linux | DotNet | | | |
| 2 | Generate Server Stub from TypeSpec Test Scenario | Windows/Linux | JavaScript | | | |
| 2 | Generate Server Stub from TypeSpec Test Scenario | Windows/Linux | JavaScript _(Experimental)_ | | | |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ With the TypeSpec emitter for OpenAPI3, users can import a TypeSpec file from a
## Test Environment

* OS : Windows or Linux
* Language : Python, Java, JavaScript, .NET

> Note: The extension should support all test cases in VS Code for Windows and Linux. Mac support is a stretch goal for Selenium semester.
Expand All @@ -15,23 +14,39 @@ Install TypeSpec Compiler before starting to write TypeSpec.

* [Node.js 20+](https://nodejs.org/download/)
* Npm 7+
* Install [TypeSpec Compiler CLI](https://typespec.io/docs/): `"npm install -g @typespec/compiler"`
* [Install TypeSpec Compiler CLI](https://typespec.io/docs/): `"npm install -g @typespec/compiler"`

## Test Steps

### Step 1: "Import TypeSpec from OpenAPI 3.0" from the right-click context menu of a .tsp file.
### Step 1: Install the typespec extension.

_Option 1_. Install using .vsix file:
`Extension` -> `` -> `Install form VSIX...`

![alt text](./images/InstallTypespec_VSIX.png)

Find the .vsix file you want to install locally.

![alt text](./images/InstallTypeSpec_SelectVSIXFileTest.png)

_Option 2_. Install typespec with vscode extension marketplace:
`Extension` -> input `TypeSpec for VS Code` -> `Install`

![alt text](./images/InstallTypespec_ExtensionMarketplaceTest01.png)

### Step 2: "Import TypeSpec from OpenAPI 3.0" from the right-click context menu of a .tsp file.

![alt text](./images/TriggerImportTypeSpecfromOpenAPI3.png)

### Step 2: Confirm the project folder where you will place the TypeSpec file converted from the specified OpenAPI3 specification.
### Step 3: Confirm the project folder where you will place the TypeSpec file converted from the specified OpenAPI3 specification.

![alt text](./images/ImportTypeSpecfromOpenAPI3_ConfirmProjectFolder.png)

### Step 3: Specify the OpenAPI3 specification to convert.
### Step 4: Specify the OpenAPI3 specification to convert.

![alt text](./images/ImportTypeSpecfromOpenAPI3_SpecifyOpenAPI3Specification.png)

### Step 4: Verify that @typespec/http and @typespec/openapi3 are installed.
### Step 5: Verify that `@typespec/http` and `@typespec/openapi3` are installed.

![alt text](./images/ImportTypeSpecfromOpenAPI3_VerifyInstallaDependencies.png)

Expand Down
Loading

0 comments on commit 43bc7bf

Please sign in to comment.