munderseth / testspace.testit

Generates and Runs Specs as described in an excel spreadsheet
https://munderseth.stridespace.com/projects/munderseth:testspace.testit
2 stars 1 forks source link

testspace.testit

The concept is to define specs, test cases, and status using an excel spreadsheet. A GitHub Workflow is used to generate the specs, push them to a branch, and then execute session(s) using the defined status.

Spec Spec Description Tag Case Case Description Steps Status Comments
One This is a spec t1 case 1 Do something do this P
One t1 case 2 Do something do that F this is a comment

Multiple tabs within the excel spreadsheet will be represented as groups in Testspace.

Basic Usage

This repo is a template to be used on the s2testorg. All credentials (secrets) have been set up - TESTSPACE_CRED and GH_PAT_FOR_TF.

  1. Create a new repo on s2testorg using this repo.
  2. Create a new project using the repo on s2testorg.
  3. Run the testit workflow manually.

NOTES:

Changes

It is simple to create new specs.

  1. Modify the testit.xlsx on your desktop.
  2. Use the github.dev web-based editor. Just use . on the repo.
  3. Install via Extensions the Excel Viewer (takes ~2 seconds). This enables to modify existings cells.
  4. Or drag and drop an updated file from your desktop and commit the changes.

Note, you can add other spreadsheets to the repo. To execute a different spreadsheet, pass in the name when running the workflow.

Technical

The following tools have been used in developing this utility:

Excelsheet

The following is an overview of the sheet format:

Spec Spec Description Tag Case Case Description Steps Status Comments
One This is a spec t1 case 1 Do something do this P
One t1 case 2 Do something do that F this is a comment
Two Another spec t2 case 1 Basic stuff check it

Setup

Secrets

Installation

pip install -r requirements.txt
npm install 

Desktop Usage

To generate Specs for a branch:

git checkout -b testit
python generate.specs.py testit.xlsx
git add .
git commit -m "auto-gen specs"
git push origin testit

To run sessions:

Onetime setup:

export TESTSPACE_CRED="USERNAME:PASSWORD"  # Using super admins credentials 
export HEADLESS=false  # not working in Codespaces

Project setup:

export GHORG="NAME"  # export GHORG=munderseth or s2testorg
export REPO="NAME"   # export REPO=testspace.testit

To run session(s):

node run.sessions.js BRANCH-NAME specs/allSessions.json  # node run.sessions.js testit specs/allSessions.json

Note, don't forget to make sure that the repo has access to the TESTSPACE_CRED secret. Refer to personal Codespaces settings.

Initial Setup

Create a .testspace.yml file:

manual:
  issues:
    provider: generic 
release:
  - "*"

Create a .gitignore file:

node_modules
_site
.jekyll-cache

Python

Required for script:

pip install pandas
pip install openpyxl

Required for Notebook (Codespaces)

pip install ipykernel
python -m ipykernel install --user --name=testspace.testit

Javascript

Note, don't forget to make sure that the repo has access to the GH_PAT_FOR_TF secret. Refer to personal Codespaces settings.

Production packages required for the /src/ts.js module.

npm install request
npm install request-promise
npm install @octokit/rest
npm install puppeteer

Note. Using ts.js from https://github.com/s2technologies/testspace.test