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.
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
.
- Create a new repo on s2testorg using this repo.
- Create a new project using the repo on s2testorg.
- Run the
testit
workflow manually.
NOTES:
- Make the new repo public, otherwise, the
secrets
will not be defined, a Team account is required for private org level secrets. - Specs generated are always committed to a branch and will overwrite any existing specs if the branch already exists. The default branch used is testit. You can also create new branches.
It is simple to create new specs.
- Modify the
testit.xlsx
on your desktop. - Use the github.dev web-based editor. Just use
.
on the repo. - Install via Extensions the
Excel Viewer
(takes ~2 seconds). This enables to modify existings cells. - 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.
The following tools have been used in developing this utility:
- pandas for generating specs from excel
- Jupyter Notebook for developing the python script
- Puppeteer for automating the Testspace UI using Javascript
- GitHub Workflows - for executing automation independent of person's desktop
- Reusable Workflows - used separate workflows
- Git Auto Commit Action - commiting generated specs
- GitHub Codespaces - Just because I wanted to learn about it
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 |
- For multiple cases repeat the Spec name
- Use new line in cel for
Steps
andComments
- Status:
P | p
,F | f
,N | n
(NA) - Status left
blank
is mapped toUntested
- Each
Tab
represents a group, if there is more than 1 tab
TESTSPACE_CRED
- "Username:Password"; eithersuper-admin
ortestuser
GH_PAT_FOR_TF
-s2-testspace
GitHub Personal Access Token used for installing the private testspace test function package
pip install -r requirements.txt
npm install
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.
Create a .testspace.yml
file:
manual:
issues:
provider: generic
release:
- "*"
Create a .gitignore
file:
node_modules
_site
.jekyll-cache
Required for script:
pip install pandas
pip install openpyxl
- marketplace install
Excel Viewer
Required for Notebook (Codespaces)
pip install ipykernel
python -m ipykernel install --user --name=testspace.testit
Note, don't forget to make sure that the repo has access to the GH_PAT_FOR_TF
secret. Refer to personal Codespaces settings.
npm init --yes
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