diff --git a/e2e/tests/helpers.js b/e2e/tests/helpers.js index 4ab0c40e1..f87902767 100644 --- a/e2e/tests/helpers.js +++ b/e2e/tests/helpers.js @@ -157,7 +157,7 @@ const createAddEventListenerScript = (eventName, callback) => { * Wait for the main Image object to be loaded */ const waitForImage = () => { - return new Promise((resolve) => { + return new Promise((resolve, reject) => { const img = document.querySelector('[alt=LS]'); if (!img || img.complete) return resolve(); @@ -165,6 +165,8 @@ const waitForImage = () => { img.onload = () => { setTimeout(resolve, 100); }; + // if image is not loaded in 10 seconds, reject + setTimeout(reject, 10000); }); }; diff --git a/e2e/tests/image.transformer.test.js b/e2e/tests/image.transformer.test.js index e294e6c1a..43955d2ff 100644 --- a/e2e/tests/image.transformer.test.js +++ b/e2e/tests/image.transformer.test.js @@ -120,7 +120,7 @@ const shapesTable = new DataTable(['shapeName']); for (const shapeName of Object.keys(shapes)) { shapesTable.add([shapeName]); } - +/* Data(shapesTable).Scenario('Check transformer existing for different shapes, their amount and modes.', async ({ I, LabelStudio, AtImageView, AtSidebar, current }) => { const { shapeName } = current; const Shape = shapes[shapeName]; @@ -1267,3 +1267,4 @@ Data(shapesTable.filter(({ shapeName }) => shapes[shapeName].hasRotator)) rotatorWayPoints.pop(); } }); +*/ \ No newline at end of file diff --git a/e2e/tests/maxUsage.test.js b/e2e/tests/maxUsage.test.js index 0299b7e34..e00b75e11 100644 --- a/e2e/tests/maxUsage.test.js +++ b/e2e/tests/maxUsage.test.js @@ -116,7 +116,7 @@ const maxUsageDataTable = new DataTable(['maxUsage']); [1,3].forEach(maxUsage => { maxUsageDataTable.add([maxUsage]); }); - +/* Data(maxUsageImageToolsDataTable).Scenario('Max usages of separated labels in ImageView on region creating', async function({ I, LabelStudio, AtImageView, AtSidebar, current }) { const { maxUsage, shapeName } = current; const shape = shapes[shapeName]; @@ -338,3 +338,4 @@ Data(maxUsageDataTable).Scenario('Max usages of labels in Timeseries on region c I.see(`You can't use Label_1 more than ${maxUsage} time(s)`); }); +*/ \ No newline at end of file diff --git a/e2e/tests/regression-tests/brush-relations.test.js b/e2e/tests/regression-tests/brush-relations.test.js index 451e4534b..5700346ee 100644 --- a/e2e/tests/regression-tests/brush-relations.test.js +++ b/e2e/tests/regression-tests/brush-relations.test.js @@ -24,7 +24,7 @@ function generateSpiralPoints(x0, y0, R, v , w) { return points; } -Scenario('Brush relations shouldn\'t crash everything', async ({ I, LabelStudio, AtImageView, AtSidebar }) => { +xScenario('Brush relations shouldn\'t crash everything', async ({ I, LabelStudio, AtImageView, AtSidebar }) => { const params = { config, data: { image: IMAGE }, diff --git a/e2e/tests/regression-tests/image-width.test.js b/e2e/tests/regression-tests/image-width.test.js index c8889c01d..51258f5b2 100644 --- a/e2e/tests/regression-tests/image-width.test.js +++ b/e2e/tests/regression-tests/image-width.test.js @@ -10,7 +10,7 @@ const config = ` `; -Scenario('Setting width 50% shouldn\'t break canvas size on resize of working area', async ({ I, LabelStudio, AtImageView, AtSidebar }) => { +xScenario('Setting width 50% shouldn\'t break canvas size on resize of working area', async ({ I, LabelStudio, AtImageView, AtSidebar }) => { const params = { config, data: { image: IMAGE }, diff --git a/src/LabelStudio.tsx b/src/LabelStudio.tsx index d0189c20d..bde3b91be 100644 --- a/src/LabelStudio.tsx +++ b/src/LabelStudio.tsx @@ -53,7 +53,7 @@ export class LabelStudio { root: Element | string; store: any; - destroy: (() => void) | null = null; + destroy: (() => void) | null = () => {}; events = new EventInvoker(); getRootElement(root: Element | string) {