Simple frontend TypeScript testing utility

Related tags

TestingTSFTest
Overview

TSFTest

Simple frontend TypeScript testing utility.

Installation

Install webpack in your project directory:

npm install --save-dev webpack webpack-cli typescript ts-loader

Install the typescript functions also in your project directory:

npm install --save-dev tsftest

Install chromedriver and add to path https://chromedriver.chromium.org/getting-started

Use pip to install the tsftest command (where path_to_dir is the folder containing setup.py):

pip install path_to_dir --user

Create a test folder in your project if you don't have one already.

Either:

  • Add tsconfig.json and webpack.config.js files to the test folder with settings to compile to test_dir/dist/test.js.

OR

  • See the setup command in the Usage section for a simple command to add these files with a default configuration.

Usage

To add default required configuration files if the files don't exist, run:

python -m tsftest setup path_to_test_folder

To run the tests use (consider setting this in your package.json->scripts.test):

python -m tsftest path_to_test_folder

You can make a browser window open with the tests allowing the use of browser developer tools with:

python -m tsftest --headed path_to_test_folder

Example Test

{ let request = new ApiRequest("GET", "/"); t.describe("ApiRequest should have GET method"); t.assert(request.method, "GET"); } ) test("Api class", async (t: Test) => { let api = new Api(new URL("http://127.0.0.1"), new ApiCredentials()) let request = new ApiRequest("GET", "/"); let response = await api.call(request) t.describe("Api.call should return an instance of Response"); t.assertInstance(response, Response); t.describe("Testing successful Api.call to /"); t.assert(response.ok, true); } ) ">
import { Api, ApiCredentials, ApiRequest } from "../src/api";
import { test, Test } from "tsftest"

test("ApiRequest class",
    (t: Test) => {
        let request = new ApiRequest("GET", "/");

        t.describe("ApiRequest should have GET method");
        t.assert(request.method, "GET");
    }
)

test("Api class",
    async (t: Test) => {
        let api = new Api(new URL("http://127.0.0.1"), new ApiCredentials())
        let request = new ApiRequest("GET", "/");

        let response = await api.call(request)

        t.describe("Api.call should return an instance of Response");
        t.assertInstance(response, Response);

        t.describe("Testing successful Api.call to /");
        t.assert(response.ok, true);
    }
)
Automated testing tool developed in python for Advanced mathematical operations.

Advanced-Maths-Operations-Validations Automated testing tool developed in python for Advanced mathematical operations. Requirements Python 3.5 or late

Nikhil Repale 1 Nov 16, 2021
The Good Old Days. | Testing Out A New Module-

The-Good-Old-Days. The Good Old Days. | Testing Out A New Module- Installation Asciimatics supports Python versions 2 & 3. For the precise list of tes

Syntax. 2 Jun 08, 2022
Aioresponses is a helper for mock/fake web requests in python aiohttp package.

aioresponses Aioresponses is a helper to mock/fake web requests in python aiohttp package. For requests module there are a lot of packages that help u

402 Jan 06, 2023
Webscreener is a tool for mass web domains pentesting.

Webscreener is a tool for mass web domains pentesting. It is used to take snapshots for domains that is generated by a tool like knockpy or Sublist3r. It cuts out most of the pentesting time by scree

Seekurity 3 Jun 07, 2021
PyAutoEasy is a extension / wrapper around the famous PyAutoGUI, a cross-platform GUI automation tool to replace your boooring repetitive tasks.

PyAutoEasy PyAutoEasy is a extension / wrapper around the famous PyAutoGUI, a cross-platform GUI automation tool to replace your boooring repetitive t

Dingu Sagar 7 Oct 27, 2022
Doggo Browser

Doggo Browser Quick Start $ python3 -m venv ./venv/ $ source ./venv/bin/activate $ pip3 install -r requirements.txt $ ./sobaki.py References Heavily I

Alexey Kutepov 9 Dec 12, 2022
Python dilinin Selenium kütüphanesini kullanarak; Amazon, LinkedIn ve ÇiçekSepeti üzerinde test işlemleri yaptığımız bir case study reposudur.

Python dilinin Selenium kütüphanesini kullanarak; Amazon, LinkedIn ve ÇiçekSepeti üzerinde test işlemleri yaptığımız bir case study reposudur. LinkedI

Furkan Gulsen 8 Nov 01, 2022
A configurable set of panels that display various debug information about the current request/response.

Django Debug Toolbar The Django Debug Toolbar is a configurable set of panels that display various debug information about the current request/respons

Jazzband 7.3k Jan 02, 2023
A complete test automation tool

Golem - Test Automation Golem is a test framework and a complete tool for browser automation. Tests can be written with code in Python, codeless using

486 Dec 30, 2022
Faker is a Python package that generates fake data for you.

Faker is a Python package that generates fake data for you. Whether you need to bootstrap your database, create good-looking XML documents, fill-in yo

Daniele Faraglia 15.2k Jan 01, 2023
Whatsapp messages bulk sender using Python Selenium.

Whatsapp Sender Whatsapp Sender automates sending of messages via Whatsapp Web. The tool allows you to send whatsapp messages in bulk. This program re

Yap Yee Qiang 3 Jan 23, 2022
This project is used to send a screenshot by email of your MyUMons schedule using Selenium python lib (headless mode)

MyUMonsSchedule Use MyUMonsSchedule python script to send a screenshot by email (Gmail) of your MyUMons schedule. If you use it on Windows, take care

Pierre-Louis D'Agostino 6 May 12, 2022
The evaluator covering all of the metrics required by tasks within the DUE Benchmark.

DUE Evaluator The repository contains the evaluator covering all of the metrics required by tasks within the DUE Benchmark, i.e., set-based F1 (for KI

DUE Benchmark 4 Jan 21, 2022
A command-line tool and Python library and Pytest plugin for automated testing of RESTful APIs, with a simple, concise and flexible YAML-based syntax

1.0 Release See here for details about breaking changes with the upcoming 1.0 release: https://github.com/taverntesting/tavern/issues/495 Easier API t

909 Dec 15, 2022
Subprocesses for Humans 2.0.

Delegator.py — Subprocesses for Humans 2.0 Delegator.py is a simple library for dealing with subprocesses, inspired by both envoy and pexpect (in fact

Amit Tripathi 1.6k Jan 04, 2023
A framework-agnostic library for testing ASGI web applications

async-asgi-testclient Async ASGI TestClient is a library for testing web applications that implements ASGI specification (version 2 and 3). The motiva

122 Nov 22, 2022
GitHub action for AppSweep Mobile Application Security Testing

GitHub action for AppSweep can be used to continuously integrate app scanning using AppSweep into your Android app build process

Guardsquare 14 Oct 06, 2022
Android automation project with pytest+appium

Android automation project with pytest+appium

1 Oct 28, 2021
CNE-OVS-SIT - OVS System Integration Test Suite

CNE-OVS-SIT - OVS System Integration Test Suite Introduction User guide Discussion Introduction CNE-OVS-SIT is a test suite for OVS end-to-end functio

4 Jan 09, 2022
Argument matchers for unittest.mock

callee Argument matchers for unittest.mock More robust tests Python's mocking library (or its backport for Python 3.3) is simple, reliable, and easy

Karol Kuczmarski 77 Nov 03, 2022