diff --git a/e2e/tests/functional/plugins/conditionSet/conditionSet.e2e.spec.js b/e2e/tests/functional/plugins/conditionSet/conditionSet.e2e.spec.js index d41f884cb08..a9684daabb3 100644 --- a/e2e/tests/functional/plugins/conditionSet/conditionSet.e2e.spec.js +++ b/e2e/tests/functional/plugins/conditionSet/conditionSet.e2e.spec.js @@ -298,7 +298,7 @@ test.describe('Basic Condition Set Use', () => { }) => { const exampleTelemetry = await createExampleTelemetryObject(page); - await page.getByTitle('Show selected item in tree').click(); + await page.getByLabel('Show selected item in tree').click(); await page.goto(conditionSet.url); // Change the object to edit mode await page.getByLabel('Edit Object').click(); @@ -378,4 +378,83 @@ test.describe('Basic Condition Set Use', () => { await page.goto(conditionSet.url); await expect(outputValue).toHaveText('---'); }); + + test('ConditionSet has correct outputs when test data is enabled', async ({ page }) => { + const exampleTelemetry = await createExampleTelemetryObject(page); + + await page.getByLabel('Show selected item in tree').click(); + await page.goto(conditionSet.url); + // Change the object to edit mode + await page.getByLabel('Edit Object').click(); + + // Create two conditions + await page.locator('#addCondition').click(); + await page.locator('#addCondition').click(); + await page.locator('#conditionCollection').getByRole('textbox').nth(0).fill('First Condition'); + await page.locator('#conditionCollection').getByRole('textbox').nth(1).fill('Second Condition'); + + // Add Telemetry to ConditionSet + const sineWaveGeneratorTreeItem = page + .getByRole('tree', { + name: 'Main Tree' + }) + .getByRole('treeitem', { + name: exampleTelemetry.name + }); + const conditionCollection = page.locator('#conditionCollection'); + await sineWaveGeneratorTreeItem.dragTo(conditionCollection); + + // Modify First Criterion + const firstCriterionTelemetry = page.locator( + '[aria-label="Criterion Telemetry Selection"] >> nth=0' + ); + firstCriterionTelemetry.selectOption({ label: exampleTelemetry.name }); + const firstCriterionMetadata = page.locator( + '[aria-label="Criterion Metadata Selection"] >> nth=0' + ); + firstCriterionMetadata.selectOption({ label: 'Sine' }); + const firstCriterionComparison = page.locator( + '[aria-label="Criterion Comparison Selection"] >> nth=0' + ); + firstCriterionComparison.selectOption({ label: 'is greater than or equal to' }); + const firstCriterionInput = page.locator('[aria-label="Criterion Input"] >> nth=0'); + await firstCriterionInput.fill('0'); + + // Modify Second Criterion + const secondCriterionTelemetry = page.locator( + '[aria-label="Criterion Telemetry Selection"] >> nth=1' + ); + await secondCriterionTelemetry.selectOption({ label: exampleTelemetry.name }); + + const secondCriterionMetadata = page.locator( + '[aria-label="Criterion Metadata Selection"] >> nth=1' + ); + await secondCriterionMetadata.selectOption({ label: 'Sine' }); + + const secondCriterionComparison = page.locator( + '[aria-label="Criterion Comparison Selection"] >> nth=1' + ); + await secondCriterionComparison.selectOption({ label: 'is less than' }); + + const secondCriterionInput = page.locator('[aria-label="Criterion Input"] >> nth=1'); + await secondCriterionInput.fill('0'); + + // Enable test data + await page.getByLabel('Apply Test Data').nth(1).click(); + const testDataTelemetry = page.locator('[aria-label="Test Data Telemetry Selection"] >> nth=0'); + await testDataTelemetry.selectOption({ label: exampleTelemetry.name }); + + const testDataMetadata = page.locator('[aria-label="Test Data Metadata Selection"] >> nth=0'); + await testDataMetadata.selectOption({ label: 'Sine' }); + + const testInput = page.locator('[aria-label="Test Data Input"] >> nth=0'); + await testInput.fill('0'); + + // Validate that the condition set is evaluating and outputting + // the correct value when the underlying telemetry subscription is active. + let outputValue = page.locator('[aria-label="Current Output Value"]'); + await expect(outputValue).toHaveText('false'); + + await page.goto(exampleTelemetry.url); + }); }); diff --git a/e2e/tests/functional/plugins/notebook/notebook.e2e.spec.js b/e2e/tests/functional/plugins/notebook/notebook.e2e.spec.js index 59baf3c1cf9..e412392b6d6 100644 --- a/e2e/tests/functional/plugins/notebook/notebook.e2e.spec.js +++ b/e2e/tests/functional/plugins/notebook/notebook.e2e.spec.js @@ -308,7 +308,7 @@ test.describe('Notebook entry tests', () => { await page.goto(notebookObject.url); // Reveal the notebook in the tree - await page.getByTitle('Show selected item in tree').click(); + await page.getByLabel('Show selected item in tree').click(); await page .getByRole('treeitem', { name: overlayPlot.name }) @@ -332,7 +332,7 @@ test.describe('Notebook entry tests', () => { await page.goto(notebookObject.url); // Reveal the notebook in the tree - await page.getByTitle('Show selected item in tree').click(); + await page.getByLabel('Show selected item in tree').click(); await nbUtils.enterTextEntry(page, 'Entry to drop into'); await page @@ -377,7 +377,7 @@ test.describe('Notebook entry tests', () => { await page.goto(notebookObject.url); // Reveal the notebook in the tree - await page.getByTitle('Show selected item in tree').click(); + await page.getByLabel('Show selected item in tree').click(); await nbUtils.enterTextEntry(page, `This should be a link: ${TEST_LINK} is it?`); @@ -404,7 +404,7 @@ test.describe('Notebook entry tests', () => { await page.goto(notebookObject.url); // Reveal the notebook in the tree - await page.getByTitle('Show selected item in tree').click(); + await page.getByLabel('Show selected item in tree').click(); await nbUtils.enterTextEntry(page, `This should NOT be a link: ${TEST_LINK} is it?`); @@ -421,7 +421,7 @@ test.describe('Notebook entry tests', () => { await page.goto(notebookObject.url); // Reveal the notebook in the tree - await page.getByTitle('Show selected item in tree').click(); + await page.getByLabel('Show selected item in tree').click(); await nbUtils.enterTextEntry(page, `This should NOT be a link: ${TEST_LINK} is it?`); @@ -438,7 +438,7 @@ test.describe('Notebook entry tests', () => { await page.goto(notebookObject.url); // Reveal the notebook in the tree - await page.getByTitle('Show selected item in tree').click(); + await page.getByLabel('Show selected item in tree').click(); await nbUtils.enterTextEntry(page, `This should be a link: ${INVALID_TEST_LINK} is it?`); @@ -455,7 +455,7 @@ test.describe('Notebook entry tests', () => { await page.goto(notebookObject.url); // Reveal the notebook in the tree - await page.getByTitle('Show selected item in tree').click(); + await page.getByLabel('Show selected item in tree').click(); await nbUtils.enterTextEntry(page, `This should be a link: ${TEST_LINK} is it?`); @@ -483,7 +483,7 @@ test.describe('Notebook entry tests', () => { await page.goto(notebookObject.url); // Reveal the notebook in the tree - await page.getByTitle('Show selected item in tree').click(); + await page.getByLabel('Show selected item in tree').click(); await nbUtils.enterTextEntry( page, diff --git a/e2e/tests/functional/recentObjects.e2e.spec.js b/e2e/tests/functional/recentObjects.e2e.spec.js index ca1e3ce80d3..6b18d6eb025 100644 --- a/e2e/tests/functional/recentObjects.e2e.spec.js +++ b/e2e/tests/functional/recentObjects.e2e.spec.js @@ -191,7 +191,7 @@ test.describe('Recent Objects', () => { // Navigate to the clock and reveal it in the tree await page.goto(clock.url); - await page.getByTitle('Show selected item in tree').click(); + await page.getByLabel('Show selected item in tree').click(); // Right click the clock and create an alias using the "link" context menu action const clockTreeItem = page diff --git a/e2e/tests/functional/tree.e2e.spec.js b/e2e/tests/functional/tree.e2e.spec.js index c09752993a4..0db239205f7 100644 --- a/e2e/tests/functional/tree.e2e.spec.js +++ b/e2e/tests/functional/tree.e2e.spec.js @@ -40,7 +40,7 @@ test.describe('Main Tree', () => { type: 'Folder' }); - await page.getByTitle('Show selected item in tree').click(); + await page.getByLabel('Show selected item in tree').click(); const clock = await createDomainObjectWithDefaults(page, { type: 'Clock', diff --git a/src/plugins/condition/components/TestData.vue b/src/plugins/condition/components/TestData.vue index 1fa97b92bdd..7f538a4432d 100644 --- a/src/plugins/condition/components/TestData.vue +++ b/src/plugins/condition/components/TestData.vue @@ -31,10 +31,10 @@
Test Data
-
+
@@ -47,7 +47,11 @@ Set - -