fix: restore full test suite
Separate the internal API and nginx ports, align browser BDD fixtures with tenant and Go Loose requirements, and correct the invitation outcome interaction order. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
parent
0de20d20f5
commit
660d5291ec
8 changed files with 44 additions and 8 deletions
1
bdd/init.sql
Normal file
1
bdd/init.sql
Normal file
|
|
@ -0,0 +1 @@
|
|||
CREATE SCHEMA ypto AUTHORIZATION go_guess;
|
||||
|
|
@ -4,7 +4,7 @@
|
|||
"version": "0.1.0",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"test": "cucumber-js --config cucumber.mjs"
|
||||
"test": "node run-tests.js"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@cucumber/cucumber": "13.2.1",
|
||||
|
|
|
|||
29
bdd/run-tests.js
Normal file
29
bdd/run-tests.js
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
import { spawn } from "node:child_process";
|
||||
import http from "node:http";
|
||||
|
||||
const authorizationServer = http.createServer((request, response) => {
|
||||
response.setHeader("Content-Type", "application/json");
|
||||
response.end(
|
||||
JSON.stringify({
|
||||
allowed: true,
|
||||
tenant_slug: "ypto",
|
||||
application_slug: "guess",
|
||||
api_key_name: "bdd",
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
authorizationServer.listen(18081, "127.0.0.1", () => {
|
||||
const cucumber = spawn("cucumber-js", ["--config", "cucumber.mjs"], {
|
||||
stdio: "inherit",
|
||||
});
|
||||
cucumber.on("exit", (code, signal) => {
|
||||
authorizationServer.close(() => {
|
||||
if (signal) {
|
||||
process.kill(process.pid, signal);
|
||||
} else {
|
||||
process.exit(code ?? 1);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
@ -6,6 +6,7 @@ setDefaultTimeout(Number(process.env.BDD_STEP_TIMEOUT_MS ?? 15000));
|
|||
Before(async function () {
|
||||
this.browser = await chromium.launch({
|
||||
headless: process.env.BDD_HEADLESS !== "false",
|
||||
args: ["--host-resolver-rules=MAP ypto.guess.local 127.0.0.1"],
|
||||
});
|
||||
this.context = await this.browser.newContext();
|
||||
this.page = await this.context.newPage();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue