Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(e2e): migrate ui.json of E2E presets #575

Merged
merged 1 commit into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions tests/e2e/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const express = require("express");
const fs = require("node:fs").promises;
const fs = require("node:fs/promises");
const path = require("node:path");
const { spawn } = require("node:child_process");
const httpProxy = require("http-proxy");

Expand Down Expand Up @@ -109,7 +110,7 @@ class WriterProcessPool {
async start(preset) {
const id = this.genId.next().value;
await fs.mkdir(`./runtime/${id}`);
await fs.copyFile(`./presets/${preset}/ui.json`, `./runtime/${id}/ui.json`);
await fs.cp(`./presets/${preset}/.wf`, `./runtime/${id}/.wf`, { recursive: true });
await fs.copyFile(`./presets/${preset}/main.py`, `./runtime/${id}/main.py`);
const process = new WriterProcess(`./runtime/${id}`, this.genPort.next().value);
await process.start();
Expand All @@ -126,6 +127,7 @@ class WriterProcessPool {
await fs.rm(`./runtime/${id}`, { recursive: true });
}


}

const sspp = new WriterProcessPool();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{"id": "qlbz49xq2emx9ip4", "type": "page", "content": {}, "parentId": "root", "position": 0, "handlers": {}, "visible": true}
{"id": "3fzi2hkb6fzfgf40", "type": "section", "content": {"title": ""}, "parentId": "qlbz49xq2emx9ip4", "position": 0, "handlers": {}, "visible": true}
{"id": "gm7nov9whz3q0i7l", "type": "columns", "parentId": "3fzi2hkb6fzfgf40", "content": {}, "handlers": {}, "position": 0, "visible": true}
{"id": "kj09cwig8j3336jc", "type": "column", "parentId": "gm7nov9whz3q0i7l", "content": {"width": "1"}, "handlers": {}, "position": 0, "visible": true}
{"id": "f5kw67b26pht1iys", "type": "column", "parentId": "gm7nov9whz3q0i7l", "content": {"width": "1"}, "handlers": {}, "position": 1, "visible": true}
1 change: 1 addition & 0 deletions tests/e2e/presets/2columns/.wf/components-root.jsonl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"id": "root", "type": "root", "content": {"appName": "My App"}, "parentId": null, "position": 0, "handlers": {}, "visible": true}
3 changes: 3 additions & 0 deletions tests/e2e/presets/2columns/.wf/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"writer_version": "0.3.0"
}
69 changes: 0 additions & 69 deletions tests/e2e/presets/2columns/ui.json

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"id": "qlbz49xq2emx9ip4", "type": "page", "content": {"key": "page1"}, "position": 0, "parentId": "root", "handlers": {}, "visible": true}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"id": "6gnhb317w7k76uhw", "type": "page", "parentId": "root", "content": {"key": "page2"}, "handlers": {}, "position": 1, "visible": true}
1 change: 1 addition & 0 deletions tests/e2e/presets/2pages/.wf/components-root.jsonl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"id": "root", "type": "root", "content": {"appName": "My App"}, "position": 0, "handlers": {}, "visible": true}
3 changes: 3 additions & 0 deletions tests/e2e/presets/2pages/.wf/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"writer_version": "0.3.0"
}
39 changes: 0 additions & 39 deletions tests/e2e/presets/2pages/ui.json

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"id": "qlbz49xq2emx9ip4", "type": "page", "content": {}, "parentId": "root", "position": 0, "handlers": {}, "visible": true}
1 change: 1 addition & 0 deletions tests/e2e/presets/empty_page/.wf/components-root.jsonl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"id": "root", "type": "root", "content": {"appName": "My App"}, "parentId": null, "position": 0, "handlers": {}, "visible": true}
3 changes: 3 additions & 0 deletions tests/e2e/presets/empty_page/.wf/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"writer_version": "0.3.0"
}
27 changes: 0 additions & 27 deletions tests/e2e/presets/empty_page/ui.json

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{"id": "bb4d0e86-619e-4367-a180-be28ab6059f4", "type": "page", "content": {"pageMode": "", "key": "main"}, "isCodeManaged": false, "position": 0, "parentId": "root"}
{"id": "fa1r81mv2rrdhfh9", "type": "jsonviewer", "content": {"data": "{\"name\":\"JSON Viewer\",\"description\":\"A JSON tree viewer where you can expand the keys.\",\"sample\":{\"description\":\"This sample is opened by default\",\"bool\":true,\"null\":null,\"list\":[1,\"two\",{\"key\":3}]},\"sampleClosed\":{\"description\":\"This sample is not opened by default\"},\"createdAt\":\"2024-08-13T20:45:15.668Z\"}", "initialDepth": "0"}, "isCodeManaged": false, "position": 0, "parentId": "bb4d0e86-619e-4367-a180-be28ab6059f4", "handlers": {}, "visible": true}
1 change: 1 addition & 0 deletions tests/e2e/presets/jsonviewer/.wf/components-root.jsonl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"id": "root", "type": "root", "content": {"appName": "Hello", "emptinessColor": "#ffffff"}, "isCodeManaged": false, "position": 0}
3 changes: 3 additions & 0 deletions tests/e2e/presets/jsonviewer/.wf/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"writer_version": "0.6.2rc3"
}
42 changes: 0 additions & 42 deletions tests/e2e/presets/jsonviewer/ui.json

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{"id": "qlbz49xq2emx9ip4", "type": "page", "content": {"key": "setup"}, "isCodeManaged": false, "position": 0, "parentId": "root", "handlers": {}, "visible": true}
{"id": "0jbl2x7sl5gbjdnl", "type": "section", "content": {"title": "Test"}, "isCodeManaged": false, "position": 0, "parentId": "qlbz49xq2emx9ip4", "handlers": {}, "visible": true}
{"id": "byk3srfwyj1hn4wl", "type": "button", "content": {"text": "Run test", "cssClasses": "TestExec"}, "isCodeManaged": false, "position": 1, "parentId": "0jbl2x7sl5gbjdnl", "handlers": {"wf-click": "execute_test"}, "visible": true}
{"id": "1ybermv0ttvw4lhk", "type": "textareainput", "content": {"label": "Input Label", "rows": "5", "cssClasses": "TestInput"}, "isCodeManaged": false, "position": 0, "parentId": "0jbl2x7sl5gbjdnl", "handlers": {}, "visible": true, "binding": {"eventType": "wf-change", "stateRef": "code"}}
{"id": "results", "type": "section", "content": {"title": "Test Results", "cssClasses": "results"}, "isCodeManaged": false, "position": 1, "parentId": "qlbz49xq2emx9ip4", "handlers": {}, "visible": true}
{"id": "5756wvfy52nzjnrl", "type": "textinput", "parentId": "0jbl2x7sl5gbjdnl", "content": {"label": "Input Label"}, "handlers": {}, "position": 2, "visible": true}
{"id": "initialization", "type": "section", "parentId": "qlbz49xq2emx9ip4", "content": {"title": "Initialization", "cssClasses": "initialization"}, "handlers": {}, "position": 2, "visible": true}
1 change: 1 addition & 0 deletions tests/e2e/presets/low_code/.wf/components-root.jsonl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"id": "root", "type": "root", "content": {"appName": "My App"}, "isCodeManaged": false, "position": 0, "handlers": {}, "visible": true}
3 changes: 3 additions & 0 deletions tests/e2e/presets/low_code/.wf/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"writer_version": "0.3.0"
}
111 changes: 0 additions & 111 deletions tests/e2e/presets/low_code/ui.json

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{"id": "qlbz49xq2emx9ip4", "type": "page", "content": {}, "parentId": "root", "position": 0, "handlers": {}, "visible": true}
{"id": "3fzi2hkb6fzfgf40", "type": "section", "parentId": "qlbz49xq2emx9ip4", "content": {"title": ""}, "handlers": {}, "position": 0, "visible": true}
1 change: 1 addition & 0 deletions tests/e2e/presets/section/.wf/components-root.jsonl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"id": "root", "type": "root", "content": {"appName": "My App"}, "parentId": null, "position": 0, "handlers": {}, "visible": true}
3 changes: 3 additions & 0 deletions tests/e2e/presets/section/.wf/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"writer_version": "0.3.0"
}
Loading
Loading