From 8129ee44761f02b9f0c8e9b550ad877dd6922a95 Mon Sep 17 00:00:00 2001 From: ankurjuneja Date: Wed, 24 Dec 2025 12:46:43 -0800 Subject: [PATCH 1/3] Handle creating a duplicate custom new metric --- .../window/AddNewMetricWindow.js | 94 ++++++++++++++----- 1 file changed, 70 insertions(+), 24 deletions(-) diff --git a/resources/web/PanoramaPremium/window/AddNewMetricWindow.js b/resources/web/PanoramaPremium/window/AddNewMetricWindow.js index eba112162..494617e27 100644 --- a/resources/web/PanoramaPremium/window/AddNewMetricWindow.js +++ b/resources/web/PanoramaPremium/window/AddNewMetricWindow.js @@ -285,36 +285,82 @@ Ext4.define('Panorama.Window.AddCustomMetricWindow', { this.queryError.setVisible(!isValid); }, - saveNewMetric: function () { - var isValid = this.validateValues(); + checkMetricNameExists: function (metricName, callback) { + let filterArray = [LABKEY.Filter.create('Name', metricName, LABKEY.Filter.Types.EQUAL)]; - if(isValid) { - var records = []; - var newMetric = {}; - newMetric.Name = this.metricNameField.getValue(); - newMetric.QueryName = this.queriesCombo.getValue(); - newMetric.YAxisLabel = this.yAxisLabelField.getValue(); - newMetric.PrecursorScoped = this.metricTypeCombo.getValue(); + // If updating, exclude the current metric from the check + if (this.operation === this.update && this.metric) { + filterArray.push(LABKEY.Filter.create('id', this.metric.id, LABKEY.Filter.Types.NOT_EQUAL)); + } - if(this.operation === this.update) { - newMetric.id = this.metric.id; + LABKEY.Query.selectRows({ + containerPath: LABKEY.container.id, + schemaName: this.SCHEMA_NAME, + queryName: 'qcmetricconfiguration', + filterArray: filterArray, + scope: this, + success: function (data) { + callback.call(this, data.rows.length > 0); + }, + failure: function () { + callback.call(this, false); } + }); + }, - records.push(newMetric); + saveNewMetric: function () { + let isValid = this.validateValues(); - LABKEY.Query.saveRows({ - containerPath: LABKEY.container.id, - commands: [{ - schemaName: 'targetedms', - queryName: 'qcmetricconfiguration', - command: this.operation, - rows: records - }], - scope: this, - method: 'POST', - success: function () { - window.location.reload(); + if(isValid) { + let metricName = this.metricNameField.getValue(); + + // Check if metric name already exists + this.checkMetricNameExists(metricName, function (exists) { + if (exists) { + let errorMessage = 'A metric with the name "' + Ext4.util.Format.htmlEncode(metricName) + '" already exists. Please choose a different name.'; + this.queryError.setText(errorMessage); + this.queryError.setVisible(true); + this.metricNameField.setActiveError('Metric name already exists'); + return; } + + let records = []; + let newMetric = {}; + newMetric.Name = metricName; + newMetric.QueryName = this.queriesCombo.getValue(); + newMetric.YAxisLabel = this.yAxisLabelField.getValue(); + newMetric.PrecursorScoped = this.metricTypeCombo.getValue(); + + if (this.operation === this.update) { + newMetric.id = this.metric.id; + } + + records.push(newMetric); + + LABKEY.Query.saveRows({ + containerPath: LABKEY.container.id, + commands: [{ + schemaName: 'targetedms', + queryName: 'qcmetricconfiguration', + command: this.operation, + rows: records + }], + scope: this, + method: 'POST', + success: function () { + window.location.reload(); + }, + failure: function (response) { + let errorMessage = 'Error saving metric'; + if (response && response.exception) { + errorMessage = response.exception; + } else if (response && response.message) { + errorMessage = response.message; + } + this.queryError.setText(errorMessage); + this.queryError.setVisible(true); + } + }); }); } From d942f4e8a7bd6a3f37dd278084e2f00f155dbcec Mon Sep 17 00:00:00 2001 From: ankurjuneja Date: Sat, 27 Dec 2025 16:09:00 -0800 Subject: [PATCH 2/3] code review suggestions and automation testing support for duplicate metrics --- .../window/AddNewMetricWindow.js | 2 +- .../window/AddNewTraceMetricWindow.js | 146 +++++++++++++----- .../ConfigureMetricsUIPage.java | 43 ++++-- .../TargetedMSQCFolderImportExport.java | 6 +- .../TargetedMSQCPremiumTest.java | 14 +- .../TargetedMSQCConfigureMetricTest.java | 2 +- 6 files changed, 154 insertions(+), 59 deletions(-) diff --git a/resources/web/PanoramaPremium/window/AddNewMetricWindow.js b/resources/web/PanoramaPremium/window/AddNewMetricWindow.js index 494617e27..5ab7bfd43 100644 --- a/resources/web/PanoramaPremium/window/AddNewMetricWindow.js +++ b/resources/web/PanoramaPremium/window/AddNewMetricWindow.js @@ -317,7 +317,7 @@ Ext4.define('Panorama.Window.AddCustomMetricWindow', { // Check if metric name already exists this.checkMetricNameExists(metricName, function (exists) { if (exists) { - let errorMessage = 'A metric with the name "' + Ext4.util.Format.htmlEncode(metricName) + '" already exists. Please choose a different name.'; + let errorMessage = 'A metric with the name "' + metricName + '" already exists. Please choose a different name.'; this.queryError.setText(errorMessage); this.queryError.setVisible(true); this.metricNameField.setActiveError('Metric name already exists'); diff --git a/resources/web/PanoramaPremium/window/AddNewTraceMetricWindow.js b/resources/web/PanoramaPremium/window/AddNewTraceMetricWindow.js index 7494f7f68..684364711 100644 --- a/resources/web/PanoramaPremium/window/AddNewTraceMetricWindow.js +++ b/resources/web/PanoramaPremium/window/AddNewTraceMetricWindow.js @@ -48,7 +48,8 @@ Ext4.define('Panorama.Window.AddTraceMetricWindow', { this.getMetricNameField(), this.getTracesCombo(), this.getYAxisLabelField(), - this.getTraceValueRadioGroup() + this.getTraceValueRadioGroup(), + this.getQueryError() ]; }, @@ -287,6 +288,19 @@ Ext4.define('Panorama.Window.AddTraceMetricWindow', { return this.yAxisLabelField; }, + getQueryError: function() { + if (!this.queryError) { + this.queryError = Ext4.create('Ext.form.Label', { + name: 'errorMsg', + hidden: true, + cls: 'labkey-error', + text:'' + }); + } + + return this.queryError; + }, + getSaveButton: function() { if (!this.saveButton) { this.saveButton = Ext4.create('Ext.button.Button', { @@ -367,52 +381,98 @@ Ext4.define('Panorama.Window.AddTraceMetricWindow', { return isValid; }, + checkMetricNameExists: function (metricName, callback) { + let filterArray = [LABKEY.Filter.create('Name', metricName, LABKEY.Filter.Types.EQUAL)]; + + // If updating, exclude the current metric from the check + if (this.operation === this.update && this.metric) { + filterArray.push(LABKEY.Filter.create('id', this.metric.id, LABKEY.Filter.Types.NOT_EQUAL)); + } + + LABKEY.Query.selectRows({ + containerPath: LABKEY.container.id, + schemaName: 'targetedms', + queryName: 'qcmetricconfiguration', + filterArray: filterArray, + scope: this, + success: function (data) { + callback.call(this, data.rows.length > 0); + }, + failure: function () { + callback.call(this, false); + } + }); + }, + + + saveNewMetric: function () { var isValid = this.validateValues(); if (isValid) { - var records = []; - var newMetric = {}; - newMetric.Name = this.metricNameField.getValue(); - newMetric.QueryName = 'QCTraceMetric'; // dummy text to insert and not an actual query - newMetric.PrecursorScoped = false; - newMetric.TraceName = this.tracesCombo.getValue(); - newMetric.YAxisLabel = this.yAxisLabelField.getValue(); - - if (this.traceValueNumberField.getValue()) { - newMetric.TraceValue = this.traceValueNumberField.getValue(); - } - else { - if (this.timeValueOptionField.getValue()) { - newMetric.TimeValueOption = this.timeValueOptionField.getValue(); - } - if (this.minTimeValueNumberField.getValue()) { - newMetric.MinTimeValue = this.minTimeValueNumberField.getValue(); + var metricName = this.metricNameField.getValue(); + + this.checkMetricNameExists(metricName, function (exists) { + if (exists) { + let errorMessage = 'A metric with the name "' + metricName + '" already exists. Please choose a different name.'; + this.queryError.setText(errorMessage); + this.queryError.setVisible(true); + this.metricNameField.setActiveError('Metric name already exists'); + return; } - if (this.maxTimeValueNumberField.getValue()) { - newMetric.MaxTimeValue = this.maxTimeValueNumberField.getValue(); + + var records = []; + var newMetric = {}; + newMetric.Name = metricName; + newMetric.QueryName = 'QCTraceMetric'; // dummy text to insert and not an actual query + newMetric.PrecursorScoped = false; + newMetric.TraceName = this.tracesCombo.getValue(); + newMetric.YAxisLabel = this.yAxisLabelField.getValue(); + + if (this.traceValueNumberField.getValue()) { + newMetric.TraceValue = this.traceValueNumberField.getValue(); + } else { + if (this.timeValueOptionField.getValue()) { + newMetric.TimeValueOption = this.timeValueOptionField.getValue(); + } + if (this.minTimeValueNumberField.getValue()) { + newMetric.MinTimeValue = this.minTimeValueNumberField.getValue(); + } + if (this.maxTimeValueNumberField.getValue()) { + newMetric.MaxTimeValue = this.maxTimeValueNumberField.getValue(); + } } - } - if(this.operation === this.update) { - newMetric.id = this.metric.id; - } + if (this.operation === this.update) { + newMetric.id = this.metric.id; + } - records.push(newMetric); + records.push(newMetric); - LABKEY.Query.saveRows({ - containerPath: LABKEY.container.id, - commands: [{ - schemaName: 'targetedms', - queryName: 'qcmetricconfiguration', - command: this.operation, - rows: records - }], - scope: this, - method: 'POST', - success: function () { - window.location.reload(); - } + LABKEY.Query.saveRows({ + containerPath: LABKEY.container.id, + commands: [{ + schemaName: 'targetedms', + queryName: 'qcmetricconfiguration', + command: this.operation, + rows: records + }], + scope: this, + method: 'POST', + success: function () { + window.location.reload(); + }, + failure: function (response) { + let errorMessage = 'Error saving metric'; + if (response && response.exception) { + errorMessage = response.exception; + } else if (response && response.message) { + errorMessage = response.message; + } + this.queryError.setText(errorMessage); + this.queryError.setVisible(true); + } + }); }); } @@ -441,6 +501,16 @@ Ext4.define('Panorama.Window.AddTraceMetricWindow', { method: 'POST', success: function () { window.location.reload(); + }, + failure: function (response) { + let errorMessage = 'Error saving metric'; + if (response && response.exception) { + errorMessage = response.exception; + } else if (response && response.message) { + errorMessage = response.message; + } + this.queryError.setText(errorMessage); + this.queryError.setVisible(true); } }); win.close(); diff --git a/test/src/org/labkey/test/pages/panoramapremium/ConfigureMetricsUIPage.java b/test/src/org/labkey/test/pages/panoramapremium/ConfigureMetricsUIPage.java index 991c55f4e..c61010d7c 100644 --- a/test/src/org/labkey/test/pages/panoramapremium/ConfigureMetricsUIPage.java +++ b/test/src/org/labkey/test/pages/panoramapremium/ConfigureMetricsUIPage.java @@ -118,26 +118,26 @@ public String clickSaveExpectingError() return errorMsgId.findElement(getDriver()).getText(); } - public void addNewCustomMetric(Map metricProperties) + public void addNewCustomMetric(Map metricProperties, boolean checkForDuplicate) { click(Locator.tagWithText("button", ADD_NEW_CUSTOM_METRIC)); waitForElement(Ext4Helper.Locators.window("Add New Metric")); Window metricWindow = new Window.WindowFinder(getDriver()).withTitle("Add New Metric").waitFor(); - editCustomMetricValues(metricWindow, metricProperties); + editCustomMetricValues(metricWindow, metricProperties, checkForDuplicate); } - public void addNewTraceMetric(Map traceProperties) + public void addNewTraceMetric(Map traceProperties, boolean checkForDuplicate) { click(Locator.tagWithText("button", "Add New Trace Metric")); waitForElement(Ext4Helper.Locators.window("Add New Trace Metric")); Window metricWindow = new Window.WindowFinder(getDriver()).withTitle("Add New Trace Metric").waitFor(); - editTraceMetricValues(metricWindow, traceProperties); + editTraceMetricValues(metricWindow, traceProperties, checkForDuplicate); } public void editMetric(String metric, Map metricProperties) { Window metricWindow = openForEdit(metric); - editCustomMetricValues(metricWindow, metricProperties); + editCustomMetricValues(metricWindow, metricProperties, false); } public void deleteMetric(String metric) @@ -155,7 +155,7 @@ private Window openForEdit(String metric) return new Window.WindowFinder(getDriver()).withTitle("Edit Metric").waitFor(); } - private void editCustomMetricValues(Window metricWindow, Map metricProperties) + private void editCustomMetricValues(Window metricWindow, Map metricProperties, boolean checkForDuplicate) { metricProperties.forEach((prop, val) -> { if (!prop.isSelect) @@ -176,10 +176,17 @@ private void editCustomMetricValues(Window metricWindow, Map metricWindow, Map metricProperties) + private void editTraceMetricValues(Window metricWindow, Map metricProperties, boolean checkForDuplicate) { metricProperties.forEach((prop, val) -> { if (!prop.isSelect) @@ -195,8 +202,24 @@ else if (prop.formLabel != null) _ext4Helper.selectComboBoxItem(prop.loc, val); } }); - clickAndWait(Ext4Helper.Locators.ext4Button("Save").findElement(metricWindow)); - waitForElement(Locator.linkWithText(metricProperties.get(ConfigureMetricsUIPage.TraceMetricProperties.metricName))); + if (checkForDuplicate) + { + click(Ext4Helper.Locators.ext4Button("Save")); + assertTextPresent("A metric with the name \"" + metricProperties.get(ConfigureMetricsUIPage.TraceMetricProperties.metricName) + "\" already exists. Please choose a different name."); + click(Ext4Helper.Locators.ext4Button("Cancel")); + } + else + { + clickAndWait(Ext4Helper.Locators.ext4Button("Save").findElement(metricWindow)); + waitForElement(Locator.linkWithText(metricProperties.get(ConfigureMetricsUIPage.TraceMetricProperties.metricName))); + } + } + + private void checkForDuplicate(String metricName) + { + click(Ext4Helper.Locators.ext4Button("Save")); + assertTextPresent("A metric with the name \"" + metricName + "\" already exists. Please choose a different name."); + click(Ext4Helper.Locators.ext4Button("Cancel")); } public void clearMetricCache() diff --git a/test/src/org/labkey/test/tests/panoramapremium/TargetedMSQCFolderImportExport.java b/test/src/org/labkey/test/tests/panoramapremium/TargetedMSQCFolderImportExport.java index 385fad5fa..728899553 100644 --- a/test/src/org/labkey/test/tests/panoramapremium/TargetedMSQCFolderImportExport.java +++ b/test/src/org/labkey/test/tests/panoramapremium/TargetedMSQCFolderImportExport.java @@ -64,7 +64,7 @@ public void testQCFolderImport() String annotationType = "Test QC Annotation type"; log("Updating the folder to be exported with data points"); createGuideSet(getProjectName()); - addCustomMetric(getProjectName(), customMetricName, "AQCTest_Metric"); + addCustomMetric(getProjectName(), customMetricName, "AQCTest_Metric", false); addAnnotationType(getProjectName(), annotationType); excludePrecursors(getProjectName(), 0); @@ -118,7 +118,7 @@ private void createGuideSet(String projectName) Assert.assertEquals("Guide Set was not added correctly", 1, table.getDataRowCount()); } - private void addCustomMetric(String projectName, String metricName, String queryName) + private void addCustomMetric(String projectName, String metricName, String queryName, boolean checkForDuplicate) { goToProjectHome(projectName); Map metricProperties = new LinkedHashMap<>(); @@ -128,7 +128,7 @@ private void addCustomMetric(String projectName, String metricName, String query metricProperties.put(ConfigureMetricsUIPage.CustomMetricProperties.metricType, ConfigureMetricsUIPage.MetricType.Precursor.name()); ConfigureMetricsUIPage configureUI = goToConfigureMetricsUI(); - configureUI.addNewCustomMetric(metricProperties); + configureUI.addNewCustomMetric(metricProperties, checkForDuplicate); } private void addAnnotationType(String projectName, String name) diff --git a/test/src/org/labkey/test/tests/panoramapremium/TargetedMSQCPremiumTest.java b/test/src/org/labkey/test/tests/panoramapremium/TargetedMSQCPremiumTest.java index 595bc8864..786d59067 100644 --- a/test/src/org/labkey/test/tests/panoramapremium/TargetedMSQCPremiumTest.java +++ b/test/src/org/labkey/test/tests/panoramapremium/TargetedMSQCPremiumTest.java @@ -155,7 +155,8 @@ public void testAddNewMetric() metricProperties.put(ConfigureMetricsUIPage.CustomMetricProperties.metricType, ConfigureMetricsUIPage.MetricType.Precursor.name()); ConfigureMetricsUIPage configureUI = goToConfigureMetricsUI(); - configureUI.addNewCustomMetric(metricProperties); + configureUI.addNewCustomMetric(metricProperties, false); + configureUI.addNewCustomMetric(metricProperties, true); log("Verifying new metric got added"); goToConfigureMetricsUI(); @@ -208,9 +209,10 @@ public void testTraceMetric() throws IOException, CommandException setUpFolder(projectName, FolderType.QC); importData(SAMPLE_FILE_CHROM_INFO); - addNewTimeTraceMetrics(firstMetric, "First", traceName); - addNewTimeTraceMetrics(minMetric, "Min", "ColumnPressure (channel 4)"); - addNewTimeTraceMetrics(maxMetric, "Max", traceName); + addNewTimeTraceMetrics(firstMetric, "First", traceName, false); + addNewTimeTraceMetrics(firstMetric, "First", traceName, true); + addNewTimeTraceMetrics(minMetric, "Min", "ColumnPressure (channel 4)", false); + addNewTimeTraceMetrics(maxMetric, "Max", traceName, false); log("Verify trace values after metric addition"); assertTrue("Trace values are not present", getTraceMetricValueRowCount() > 0); @@ -266,7 +268,7 @@ private void verifyQCPlot(String metricName, String tooltipValue) Assertions.assertThat(pressureTraceHoverText).as("Tooltip value").contains(tooltipValue); } - private void addNewTimeTraceMetrics(String metricName, String timeValueOption, String traceName) + private void addNewTimeTraceMetrics(String metricName, String timeValueOption, String traceName, boolean checkForDuplicate) { String yAxisLabel = "psi"; String minTimeValue = "5"; @@ -282,7 +284,7 @@ private void addNewTimeTraceMetrics(String metricName, String timeValueOption, S metricProperties.put(ConfigureMetricsUIPage.TraceMetricProperties.maxTimeValue, maxTimeValue); ConfigureMetricsUIPage configureUI = goToConfigureMetricsUI(); - configureUI.addNewTraceMetric(metricProperties); + configureUI.addNewTraceMetric(metricProperties, checkForDuplicate); log("Verify new trace metrics got added"); goToConfigureMetricsUI(); diff --git a/test/src/org/labkey/test/tests/targetedms/TargetedMSQCConfigureMetricTest.java b/test/src/org/labkey/test/tests/targetedms/TargetedMSQCConfigureMetricTest.java index 0a3d10953..89e8708df 100644 --- a/test/src/org/labkey/test/tests/targetedms/TargetedMSQCConfigureMetricTest.java +++ b/test/src/org/labkey/test/tests/targetedms/TargetedMSQCConfigureMetricTest.java @@ -89,7 +89,7 @@ public void testBadMetricQuery() ConfigureMetricsUIPage.CustomMetricProperties.metricName, metricName, ConfigureMetricsUIPage.CustomMetricProperties.queryName, metricName, ConfigureMetricsUIPage.CustomMetricProperties.yAxisLabel, "Label", - ConfigureMetricsUIPage.CustomMetricProperties.metricType, ConfigureMetricsUIPage.MetricType.Precursor.name())); + ConfigureMetricsUIPage.CustomMetricProperties.metricType, ConfigureMetricsUIPage.MetricType.Precursor.name()), false); // Break the query and force a recaching goToSchemaBrowser(); From e76a799c76075d1b53b3174f8ee505df360e7db8 Mon Sep 17 00:00:00 2001 From: ankurjuneja Date: Mon, 29 Dec 2025 09:20:42 -0800 Subject: [PATCH 3/3] code review suggestion - rename variable --- .../ConfigureMetricsUIPage.java | 20 +++++++++---------- .../TargetedMSQCFolderImportExport.java | 4 ++-- .../TargetedMSQCPremiumTest.java | 4 ++-- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/test/src/org/labkey/test/pages/panoramapremium/ConfigureMetricsUIPage.java b/test/src/org/labkey/test/pages/panoramapremium/ConfigureMetricsUIPage.java index c61010d7c..b87419916 100644 --- a/test/src/org/labkey/test/pages/panoramapremium/ConfigureMetricsUIPage.java +++ b/test/src/org/labkey/test/pages/panoramapremium/ConfigureMetricsUIPage.java @@ -118,20 +118,20 @@ public String clickSaveExpectingError() return errorMsgId.findElement(getDriver()).getText(); } - public void addNewCustomMetric(Map metricProperties, boolean checkForDuplicate) + public void addNewCustomMetric(Map metricProperties, boolean duplicateNameErrorExpected) { click(Locator.tagWithText("button", ADD_NEW_CUSTOM_METRIC)); waitForElement(Ext4Helper.Locators.window("Add New Metric")); Window metricWindow = new Window.WindowFinder(getDriver()).withTitle("Add New Metric").waitFor(); - editCustomMetricValues(metricWindow, metricProperties, checkForDuplicate); + editCustomMetricValues(metricWindow, metricProperties, duplicateNameErrorExpected); } - public void addNewTraceMetric(Map traceProperties, boolean checkForDuplicate) + public void addNewTraceMetric(Map traceProperties, boolean duplicateNameErrorExpected) { click(Locator.tagWithText("button", "Add New Trace Metric")); waitForElement(Ext4Helper.Locators.window("Add New Trace Metric")); Window metricWindow = new Window.WindowFinder(getDriver()).withTitle("Add New Trace Metric").waitFor(); - editTraceMetricValues(metricWindow, traceProperties, checkForDuplicate); + editTraceMetricValues(metricWindow, traceProperties, duplicateNameErrorExpected); } public void editMetric(String metric, Map metricProperties) @@ -155,7 +155,7 @@ private Window openForEdit(String metric) return new Window.WindowFinder(getDriver()).withTitle("Edit Metric").waitFor(); } - private void editCustomMetricValues(Window metricWindow, Map metricProperties, boolean checkForDuplicate) + private void editCustomMetricValues(Window metricWindow, Map metricProperties, boolean duplicateNameErrorExpected) { metricProperties.forEach((prop, val) -> { if (!prop.isSelect) @@ -176,9 +176,9 @@ private void editCustomMetricValues(Window metricWindow, Map metricWindow, Map metricWindow, Map metricProperties, boolean checkForDuplicate) + private void editTraceMetricValues(Window metricWindow, Map metricProperties, boolean duplicateNameErrorExpected) { metricProperties.forEach((prop, val) -> { if (!prop.isSelect) @@ -202,7 +202,7 @@ else if (prop.formLabel != null) _ext4Helper.selectComboBoxItem(prop.loc, val); } }); - if (checkForDuplicate) + if (duplicateNameErrorExpected) { click(Ext4Helper.Locators.ext4Button("Save")); assertTextPresent("A metric with the name \"" + metricProperties.get(ConfigureMetricsUIPage.TraceMetricProperties.metricName) + "\" already exists. Please choose a different name."); @@ -215,7 +215,7 @@ else if (prop.formLabel != null) } } - private void checkForDuplicate(String metricName) + private void duplicateNameErrorExpected(String metricName) { click(Ext4Helper.Locators.ext4Button("Save")); assertTextPresent("A metric with the name \"" + metricName + "\" already exists. Please choose a different name."); diff --git a/test/src/org/labkey/test/tests/panoramapremium/TargetedMSQCFolderImportExport.java b/test/src/org/labkey/test/tests/panoramapremium/TargetedMSQCFolderImportExport.java index 728899553..466dbb664 100644 --- a/test/src/org/labkey/test/tests/panoramapremium/TargetedMSQCFolderImportExport.java +++ b/test/src/org/labkey/test/tests/panoramapremium/TargetedMSQCFolderImportExport.java @@ -118,7 +118,7 @@ private void createGuideSet(String projectName) Assert.assertEquals("Guide Set was not added correctly", 1, table.getDataRowCount()); } - private void addCustomMetric(String projectName, String metricName, String queryName, boolean checkForDuplicate) + private void addCustomMetric(String projectName, String metricName, String queryName, boolean duplicateNameErrorExpected) { goToProjectHome(projectName); Map metricProperties = new LinkedHashMap<>(); @@ -128,7 +128,7 @@ private void addCustomMetric(String projectName, String metricName, String query metricProperties.put(ConfigureMetricsUIPage.CustomMetricProperties.metricType, ConfigureMetricsUIPage.MetricType.Precursor.name()); ConfigureMetricsUIPage configureUI = goToConfigureMetricsUI(); - configureUI.addNewCustomMetric(metricProperties, checkForDuplicate); + configureUI.addNewCustomMetric(metricProperties, duplicateNameErrorExpected); } private void addAnnotationType(String projectName, String name) diff --git a/test/src/org/labkey/test/tests/panoramapremium/TargetedMSQCPremiumTest.java b/test/src/org/labkey/test/tests/panoramapremium/TargetedMSQCPremiumTest.java index 786d59067..537dbd401 100644 --- a/test/src/org/labkey/test/tests/panoramapremium/TargetedMSQCPremiumTest.java +++ b/test/src/org/labkey/test/tests/panoramapremium/TargetedMSQCPremiumTest.java @@ -268,7 +268,7 @@ private void verifyQCPlot(String metricName, String tooltipValue) Assertions.assertThat(pressureTraceHoverText).as("Tooltip value").contains(tooltipValue); } - private void addNewTimeTraceMetrics(String metricName, String timeValueOption, String traceName, boolean checkForDuplicate) + private void addNewTimeTraceMetrics(String metricName, String timeValueOption, String traceName, boolean duplicateNameErrorExpected) { String yAxisLabel = "psi"; String minTimeValue = "5"; @@ -284,7 +284,7 @@ private void addNewTimeTraceMetrics(String metricName, String timeValueOption, S metricProperties.put(ConfigureMetricsUIPage.TraceMetricProperties.maxTimeValue, maxTimeValue); ConfigureMetricsUIPage configureUI = goToConfigureMetricsUI(); - configureUI.addNewTraceMetric(metricProperties, checkForDuplicate); + configureUI.addNewTraceMetric(metricProperties, duplicateNameErrorExpected); log("Verify new trace metrics got added"); goToConfigureMetricsUI();