Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>N2PTF Test RunnerNew to Visual Studio Code? Get it now.
N2PTF Test Runner

N2PTF Test Runner

N-Squared Software (NZ) Limited

|
1 install
| (0) | Free
N-Squared Protocol Testing Framework test runner extension for VS Code.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

N-Squared Protocol Testing Framework

Execute and debug tests via the N-Squared Protocol Testing Framework.

N2PTF (N-Squared Protocol Testing Framework) allows for the execution of N-Squared Lua Tests in a native VS Code environment supporting remote test execution and summary without needing to utilize command line tools or external tools. Instead tests can be stored in a repository and edited and executed via VS Code all within a familiar developer / testing environment.

Getting Started

N2PTF is a bundled extension file either provided by N-Squared Software or installed via the VS Code extension marketplace.

If installing from a provided .vsix file this can simply be installed by accessing the VS Code extensions page selecting the ... dropdown menu and clicking on Install from VSIX....

The plugin will require basic configuration to instruct it where to send N2PTF payloads when executing tests via the plugin.

Accessing the settings menu navigate to Extensions -> N2PTF - N-Squared Protocol Testing Framework. The following configuration field are available:

Property Type Default Description
Connection String http://localhost:18080 [Required] Specifies the connection string that will be used as the base URI when connecting to an N2PTF middleware layer.
Libraries String[] None List of library files to include when executing a test. Each loaded library file will be available as a Lua require at test run time. The following formats are supported:
A) Path to a single Lua file.
B) Path to a directory in which all Lua files will be recursively loaded.
C) Path to a single Lua file with a prefixed delimiter which will act as the require name when importing the library.
Initial Arguments JSON None A freeform JSON object which may be specified. This will be provided as part of the first argument provided to the Lua script at runtime.
Note: Only one of Initial Arguments or Initial Arguments File may be configured at once.
Initial Arguments File String None The path to a JSON file containing freeform JSON which will be loaded and provided as part of the first argument provided to the Lua script at runtime.
Note: Only one of Initial Arguments or Initial Arguments File may be configured at once.
Log Level Choice Default Specifies the level of logging to utilize when executing test runs.

Libraries

When specifying library configuration there are several supported formats. These formats will generally change the way the require is structured in the Lua test itself.

For example given the following directory structure:

example-project/
├── libs/
│   ├── n2/
│   │   └── library_one.lua
│   │   └── library_two.lua
│   └── single_library.lua
├── mapped_library.lua
└── test.lua

The following table outlines various library import definitions and what the require imports will look like once the library files are loaded:

Library Configuration Type Available Imports
./libs Recursive directory import. require "n2.library_one"
require "n2.library_two"
require "single_library"
./libs/single_library.lua Single file import. require "single_library"
mapped_name=mapped_library.lua Single file import with overridden require name. require "mapped_name"

Authentication

The N2PTF extension supports several different authentication mechanism against its backend API.

Type Description
none Open authentication. All requests will automatically be accepted by the backend.
basic Basic username and password authentication. If no existing user session exists the user will be prompted to enter a username and password when running the first test.
oauth Integrate with an external or internal OAuth provider.
Currently only supports Public OAuth flows.

Certificates

If the N2PTF extension is deployed against a backend or utilizes an OAuth provider which uses self signed certificates for their HTTPS encryption the CA certificates will need to be configured for use in both Windows and Visual Studio code.

Installing CA certificates in Windows is outside of the remit of this read me however information doing this can be found here.

Once installed in the Windows CA store VS code needs to be instructed to utilize the Windows CA store when performing requests via Node JS.

The following settings within VS Code should be enabled:

  • System Certificates
  • System Certificates V2
  • System Certificates Node

Running Tests

Once configured running a Lua test is simple with two options available:

  1. Right clicking on a Lua test script and selecting Run via N-Squared PTF.
  2. While viewing a Lua test file clicking the Run via N-Squared PTF in the header bar.

Note: When using mode 2) additional execution information will be visible within the script itself rather than only the Output console. Test match stages will be highlighted based on pass/fail criteria.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft