const assert = require("assert"); const { centerOfBbox } = require("./helpers"); Feature("Outliner"); const IMAGE = "https://htx-pub.s3.us-east-1.amazonaws.com/examples/images/nick-owuor-astro-nic-visuals-wDifg5xc9Z4-unsplash.jpg"; Scenario("Basic details", async ({ I, LabelStudio, AtOutliner, AtDetails }) => { const RESULT_LABELS = ["a", "b", "c"]; const getRectangleRegion = (results) => { const region = results.find((item) => item.from_name === "rect" && item.type === "rectangle"); assert(region, "Rectangle region not found in serialized results"); return region; }; const result = [ { value: { start: 0, end: 4, labels: ["a", "b", "c"], }, id: "test_t_1", from_name: "label", to_name: "text", type: "labels", }, { value: { start: 5, end: 6, labels: [], }, id: "test_t_2", from_name: "label", to_name: "text", type: "labels", }, { value: { x: 25, y: 25, width: 50, height: 50, }, id: "test_i_1", from_name: "rect", to_name: "img", type: "rectangle", }, { original_width: 2242, original_height: 2802, image_rotation: 0, value: { x: 25, y: 25, width: 50, height: 50, rotation: 0, }, id: "test_i_1", from_name: "rect", to_name: "img", type: "rectangle", origin: "manual", }, { original_width: 2242, original_height: 2802, image_rotation: 0, value: { x: 25, y: 25, width: 50, height: 50, rotation: 0, rating: 4, }, id: "test_i_1", from_name: "rating", to_name: "img", type: "rating", origin: "manual", }, { original_width: 2242, original_height: 2802, image_rotation: 0, value: { x: 25, y: 25, width: 50, height: 50, rotation: 0, text: ["text", "area"], }, id: "test_i_1", from_name: "textarea", to_name: "img", type: "textarea", origin: "manual", }, { original_width: 2242, original_height: 2802, image_rotation: 0, value: { x: 25, y: 25, width: 50, height: 50, rotation: 0, choices: ["option 1", "option 2"], }, id: "test_i_1", from_name: "choices", to_name: "img", type: "choices", origin: "manual", }, ]; const fillByPressKeyDown = (keysList) => { for (const keys of keysList) { for (let idx = 0; idx < keys.length; idx++) { I.pressKeyDown(keys[idx]); } for (let idx = keys.length - 1; idx >= 0; idx--) { I.pressKeyUp(keys[idx]); } } }; I.amOnPage("/"); LabelStudio.init({ config: `