test_plan - thesavant42/retrorecon GitHub Wiki
This document describes the tests required for the new database creation and rename features.
-
Create New DB with Name
- POST
/new_db
withdb_name=client1
. - Verify a file
db/client1.db
is created andsession['db_display_name']
equalsclient1.db
. - Ensure tables exist by querying
urls
.
- POST
-
Create New DB with Default Name
- POST
/new_db
with no name. - Expect file
db/waybax.db
and matching session value.
- POST
-
Rename Database
- Start with a temporary database.
- POST
/rename_db
withnew_name=renamed
. - Assert the old file no longer exists and
renamed.db
contains original data.
-
Invalid Names
- Send names with illegal characters (
../bad
orfoo?bar
). - Assert response flashes an error and file is unchanged.
- Send names with illegal characters (
-
Rename While Open
- Open a connection to the database.
- Attempt
/rename_db
and expect an error message due to lock.
-
List Existing Databases
- Create two databases in the
db/
folder. -
GET /list_dbs
should return JSON containing their filenames. - The unit test
test_list_dbs_and_load_saved
demonstrates this check.
- Create two databases in the
-
Load Saved Database
- POST
/load_saved_db
with one of the names returned from/list_dbs
. - Verify
session['db_display_name']
updates and queries return the stored URL.
- POST
Create .github/workflows/ci.yml
running on pushes and pull requests:
name: CI
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install Python deps
run: pip install -r requirements.txt
- name: Run unit tests
run: pytest -q
- name: Install Node deps
run: |
npm --prefix frontend install
- name: Lint CSS
run: |
npm --prefix frontend run lint
This ensures database workflow tests are executed along with the existing suite and CSS linting on every commit.
-
Add and Retrieve Note
- Start with a database containing one URL.
- POST
/notes
withurl_id=1
andcontent=Test
. - GET
/notes/1
should return JSON with one note containingTest
.
-
Update Note
- POST
/notes
withnote_id=<id>
andcontent=Updated
. - Confirm subsequent
GET /notes/1
shows the updated text.
- POST
-
Delete Note
- POST
/delete_note
withnote_id=<id>
. - Ensure the note list for that URL is empty.
- POST
-
Delete All Notes
- Create two notes, then POST
/delete_note
withurl_id=1
andall=1
. - GET
/notes/1
should return an empty list.
- Create two notes, then POST
-
Export Notes
- Add notes for multiple URLs.
- GET
/export_notes
and validate the JSON structure contains each URL and its notes.
-
Menu Entry
- Click
Tools → Utilities → Text Tools
from the navbar. - Verify the overlay opens only when triggered by this menu option.
- Click
-
URL Encode/Decode
- Enter
This is a sketchy string!?"
in the textarea. - Click URL Encode, then URL Decode.
- The final text should match the original string exactly.
- Enter
-
Base64 Round Trip
- Input a multiline string using CRLF, LF and CR newlines.
- Press Base64 Encode then Base64 Decode.
- Text should return to the original form without errors.
-
Menu Entry
- Select
Tools → Utilities → JWT Tools
from the navbar. - Ensure the overlay opens only from this menu item and not during page load.
- Select
-
Decode Demo Token
- Post a known demo token to
/tools/jwt_decode
. - Response should contain formatted JSON and a readable
exp
timestamp. - The JSON also includes
alg_warning
andkey_warning
flags.
- Post a known demo token to
-
Edit and Encode
- Decode a token, modify the JSON payload and encode it again.
- Decoding the result should reflect the edited fields.
-
Sign with Secret
- Encode
{"sub":1}
with secretsecret123
and verify the signature using the same secret.
- Encode
-
Weak Algorithm Warning
- Decoding a token signed with
none
should return a warning flag in the response.
- Decoding a token signed with
-
Fixed Key Warning
- Provide a token signed with a known default key; decoding should highlight the weak key.
-
Cookie Jar Entry
- After a successful decode,
/jwt_cookies
should list the new token with issuer, algorithm and notes.
- After a successful decode,
-
Menu Entry
- Select
Tools → Active Recon → HTTPolaroid
from the navbar. - Verify the overlay only loads when triggered.
- Select
-
Capture a Page
- POST
/tools/httpolaroid
withurl=https://example.com
. - Expect a JSON response with an ID and a screenshot file.
-
GET /httpolaroids
should list the entry with a ZIP download link.
- POST
-
User Agent Option
- Capture the same URL with
agent=android
and confirm the header log reflects the Android user agent.
- Capture the same URL with
-
Referrer Spoofing
- Capture with
spoof_referrer=1
and verify the logged request headers contain a Referrer matching the target URL.
- Capture with
-
Delete Capture
- POST
/delete_sitezips
with the capture ID and confirm it is removed from/sitezips
.
- POST
-
Overview Page Loads
- Create a database with URLs and subdomains.
- GET
/overview
should return status 200 and list the domain name.
-
JSON Data
- GET
/overview.json
should return counts forurls
anddomains
reflecting the inserted records.
- GET
-
OpenAPI Generation
- Load
/swagger
and verify the UI shows all application routes.
- Load