This repository contains end-to-end tests for Bistro Delivery, implemented using Playwright.
The suite covers the 15 automated test cases of the QA Sphere project BD, spread over seven spec
files that mirror the QA Sphere folders:
| Spec file | Cases |
|---|---|
tests/navigation.spec.ts |
BD-057 |
tests/menu.spec.ts |
BD-058, BD-059 |
tests/cart.spec.ts |
BD-060, BD-061, BD-062 |
tests/quantity.spec.ts |
BD-063, BD-064, BD-065 |
tests/checkout.spec.ts |
BD-066, BD-067 |
tests/order.spec.ts |
BD-068, BD-069, BD-070 |
tests/persistence.spec.ts |
BD-071 |
The test cases and the requirements they trace to live in the application repository:
REQUIREMENTS.md and
AUTOMATED.md (see
docs/ for the full set).
Prerequisites: Node.js 22+ (with npm) — qas-cli, used to upload results, requires Node.js 22 or newer.
-
Clone the repository:
git clone git@github.com:Hypersequent/bistro-e2e.git cd bistro-e2e -
Install dependencies:
npm install
-
Install Playwright browsers and dependencies:
npx playwright install --with-deps
npm run test # Run tests in Chromium
npm run test-head # Run tests in headed modeResults are uploaded with qas-cli, a pinned
devDependency of this repository. Its binary is named qasphere, so npm install is enough to run
the commands below via npx qasphere ….
-
Provide your QA Sphere credentials, either in a
.envfile, as environment variables, or in a.qasphereclifile:QAS_TOKEN=<QA Sphere API Token> # Get your token in QA Sphere -> Settings -> API Keys QAS_URL=<QA Sphere Company URL> # Example: https://qasdemo.eu2.qasphere.com
-
Run the suite against a single browser. The configured reporters write
./test-results.json(Playwright JSON) and./junit-results/results.xml(JUnit XML), plus screenshots for every test:npm run test # Chromium only
Do not upload a report produced by a multi-browser run: qas-cli reads only the first project's execution of each spec, so the other browsers' results are silently dropped.
-
Upload the results. Either report format works — pick one:
# Playwright JSON (recommended: richer status and attachment support) npx qasphere playwright-json-upload \ --project-code BD \ --run-name "Bistro Delivery — {YYYY}-{MM}-{DD} {HH}:{mm}" \ --attachments \ ./test-results.json # JUnit XML npx qasphere junit-upload \ --project-code BD \ --run-name "Bistro Delivery — {YYYY}-{MM}-{DD} {HH}:{mm}" \ --attachments \ ./junit-results/results.xml
npm run uploadruns the Playwright JSON variant with the defaults above.--run-nameaccepts the{YYYY},{MM},{DD},{HH}and{mm}placeholders; pass-r <run URL>instead to upload into an existing run.
qas-cli matches a result to a test case by finding a <project code>-<sequence> marker in the
test(...) title, using the pattern /\b([A-Za-z0-9]{1,5})-(\d{3,})\b/. Two consequences:
- The sequence needs at least three digits, so it must be zero-padded: test case
BD-57in QA Sphere is writtenBD-057in the test title. The padding is stripped when matching, soBD-057resolves to sequence 57. - Keep the marker in the
test(...)title.playwright-json-uploadreads only the spec title, so a marker on the enclosingdescribe(...)is not seen.junit-uploaddoes see it, because Playwright's JUnit reporter writes the name asdescribe › test; markingtest(...)works for both.
test('BD-057: Navbar links navigate to the correct routes', async ({ page }) => {
/* … */
})As an alternative, a Playwright annotation whose type contains test case and whose description
is the full test case URL matches too. This suite uses title markers throughout; use one convention
consistently.
Different browsers:
npm run chromium # Run tests in Chromium
npm run firefox # Run tests in Firefox
npm run webkit # Run tests in WebKitPlaywright report:
npm run play-report # Open Playwright HTML reportThis project is licensed under the 0BSD License - see the LICENSE file for details.
Maintained by Hypersequent