Skip to content

Commit

Permalink
feat: add ability to run tests
Browse files Browse the repository at this point in the history
  • Loading branch information
DudaGod committed Sep 6, 2024
1 parent b29821d commit 4e8b4fa
Show file tree
Hide file tree
Showing 45 changed files with 25,643 additions and 2,845 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
out/
node_modules
.vscode-test/
*.vsix
.DS_Store
vscode.d.ts
.eslintcache
test-project
samples/**/.*
10 changes: 7 additions & 3 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,21 @@
"version": "0.2.0",
"configurations": [
{
"name": "Run Extension",
"name": "Run Extension Basic Sample",
"type": "extensionHost",
"request": "launch",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}",
"${workspaceFolder}/test-project"
"${workspaceFolder}/samples/basic"
// "${workspaceFolder}/../testplane/examples/component-testing/react-redux"
],
"outFiles": [
"${workspaceFolder}/out/**/*.js"
],
"preLaunchTask": "npm: watch"
// "preLaunchTask": "npm: watch",
"env": {
"TESTPLANE_VSCODE_DEBUG": "true"
}
}
]
}
7 changes: 7 additions & 0 deletions CONTRIBUTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Development

How to build and test the extension:

- Run `npm install` to install deps;
- Run `npm run watch`;
- Press F5 to run extension.
58 changes: 55 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,61 @@
# vscode-testplane

This extension supports [Testplane][testplane] features in VS Code environment. Available features:
This extension supports [Testplane][testplane] features in VS Code environment.

- [Install Testplane](#install-testplane)
- [Using the REPL mode](#using-the-repl-mode)
## Features

- **Run** tests;
- [Install Testplane](#install-testplane);
- [Using the REPL mode](#using-the-repl-mode);

## Requirements

- Visual Studio Code version >= 1.73.0;
- Testplane version >= v8.19.5;
- Node.js version >= 18.0.0 (follows Testplane).

## Usage

You can manage tests from the Testing view and directly within your test files.

### In the Testing View

![Testing view](./images/testing-view.png "Testing view")

You can access the extension from the Testing view in the Visual Studio Code sidebar.

The toolbar at the top provides various commands to manage test execution:
- **Run Failed Tests**: to run only failed tests (displayed only if there are failed tests in the run);
- **Refresh Tests**: to reload your tests list, reflecting any new changes;
- **Run All Tests**: to run all tests that are currently visible;
- **Debug Tests**: is not supported yet;
- **Continuous Run/Stop Continuous Run**: is not supported yet;
- **Show Output**: to display detailed logs from test executions;
- **Miscellaneous Settings**: to customize the Testing view, such as sorting, grouping, collapse tests or even clear all previous results.

The filter bar allows you to narrow down the tests displayed, focusing on specific tests by name or exclusion patterns.

Icons next to each test indicate their status—passed (checkmark), failed (cross), skipped (arrow), queued (yellow icon), or not executed (dot).

#### 💡 Tips & tricks

- Hovering, or right clicking a folder, test file, test suite, or a test will reveal more actions;
- `Option+Left-click` (on Mac OS) and `Alt+Left-click` (on Windows) on folder makes it possible to quickly expand the entire test tree.

### In the Test File

![Testplane test file](./images/test-file.png "Testplane test file")

When viewing a test file, you'll notice test icons in the gutter next to each test case:

- **Run a Single Test:** click the test icon next to a test case to run that specific test in the browsers for which it should run (defined in the config);
- **More Options:** right-click the test icon to open a context menu with additional options:
- `Run All Tests`: execute the selected test case in the browsers for which it should run (defined in the config);
- **Test Name** or **Browser Name**: after `Run All Tests` option, the name of the test and the names of the browsers in which it runs are displayed and they have the following options:
- `Run Test`: execute the selected test case in the browsers for which it should run (defined in the config) if used from **Test Name** and in one specific browser if used from **Browser Name**;
- `Peek Error`: show the error with which the test fail (displayed only in failed tests);
- `Reveal in Test Explorer`: locate and highlight the test in the centralized Testing view.
- `Breakpoint Settings`: set breakpoints to pause execution during debugging. You can add a standard breakpoint, a conditional breakpoint, a logpoint, or a triggered breakpoint.

## Install Testplane

Expand Down
Binary file added images/test-file.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/testing-view.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 4e8b4fa

Please sign in to comment.