Frontend addresses flows and dashboards by id: routes /flows/$flowId, /dashboards/$id and /view/$id, query keys, saves, lists, device pickers, search, brain and endpoint links and generated results dashboards go by id, while live values, issues, pauses and message names keep the key; tabs take the title from the document; creating uses POST and opens the issued id; the flow and dashboard panels show key and id with a copy button and a served HTTP or WebSocket node shows its hook URL under the flow id; specs create by POST and ids.spec.ts exercises issued ids
This commit is contained in:
@@ -1,5 +1,11 @@
|
||||
import { expect, test } from "@playwright/test"
|
||||
import { api, apiPage, deleteAll } from "./utils/api"
|
||||
import {
|
||||
api,
|
||||
apiPage,
|
||||
createDashboard,
|
||||
createFlow,
|
||||
deleteAll,
|
||||
} from "./utils/api"
|
||||
|
||||
/**
|
||||
* Dashboards and other flows appear on the canvas but are not part of the flow.
|
||||
@@ -21,30 +27,27 @@ test.beforeAll(async ({ browser }) => {
|
||||
const page = await apiPage(browser)
|
||||
|
||||
// A flow reading a message, and a dashboard control that sets it.
|
||||
await api(page, `/flows/${flowName}`, {
|
||||
method: "PUT",
|
||||
data: {
|
||||
name: flowName,
|
||||
nodes: [
|
||||
{
|
||||
id: "sink",
|
||||
type: "python",
|
||||
requires: [
|
||||
{ name: "level", port: "level", dtype: "float" },
|
||||
{ name: "ceiling", port: "ceiling", dtype: "float" },
|
||||
],
|
||||
provides: [],
|
||||
},
|
||||
],
|
||||
inputs: [
|
||||
{ spec: { name: "level", port: "level", dtype: "float" }, initial: 0 },
|
||||
{
|
||||
spec: { name: "ceiling", port: "ceiling", dtype: "float" },
|
||||
initial: 30,
|
||||
},
|
||||
],
|
||||
version: 1,
|
||||
},
|
||||
await createFlow(page, {
|
||||
name: flowName,
|
||||
nodes: [
|
||||
{
|
||||
id: "sink",
|
||||
type: "python",
|
||||
requires: [
|
||||
{ name: "level", port: "level", dtype: "float" },
|
||||
{ name: "ceiling", port: "ceiling", dtype: "float" },
|
||||
],
|
||||
provides: [],
|
||||
},
|
||||
],
|
||||
inputs: [
|
||||
{ spec: { name: "level", port: "level", dtype: "float" }, initial: 0 },
|
||||
{
|
||||
spec: { name: "ceiling", port: "ceiling", dtype: "float" },
|
||||
initial: 30,
|
||||
},
|
||||
],
|
||||
version: 1,
|
||||
})
|
||||
const saved = await (await api(page, `/flows/${flowName}`)).json()
|
||||
await api(page, `/flows/${flowName}/publish`, {
|
||||
@@ -53,7 +56,7 @@ test.beforeAll(async ({ browser }) => {
|
||||
})
|
||||
|
||||
const dashboard = await (
|
||||
await api(page, `/dashboards/${dashboardName}`, { method: "POST" })
|
||||
await createDashboard(page, { name: dashboardName })
|
||||
).json()
|
||||
dashboard.widgets = [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user