From cabf364e1cb62968213c6c4281af0c728d43f4d6 Mon Sep 17 00:00:00 2001 From: "Jeffrey T. Palmer" Date: Wed, 8 Apr 2020 07:29:49 -0400 Subject: [PATCH] Rename report file name input field (#1281) --- html/gui/js/report_builder/ReportCreator.js | 4 +-- tests/ui/test/specs/xdmod/reportGenerator.js | 16 +++++------ .../test/specs/xdmod/reportGenerator.page.js | 28 +++++++++---------- 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/html/gui/js/report_builder/ReportCreator.js b/html/gui/js/report_builder/ReportCreator.js index 1f9859e1aa..3b5ab7df86 100644 --- a/html/gui/js/report_builder/ReportCreator.js +++ b/html/gui/js/report_builder/ReportCreator.js @@ -10,7 +10,7 @@ XDMoD.ReportCreator = Ext.extend(Ext.form.FormPanel, { */ nameFieldConfig: { name: 'report_name', - fieldLabel: 'File Name', + fieldLabel: 'Report Name', emptyText: 'Required, ' + XDMoD.constants.maxReportNameLength + ' max', msgTarget: 'under', @@ -849,7 +849,7 @@ XDMoD.ReportCreator = Ext.extend(Ext.form.FormPanel, { maxLength: maxReportFooterLength, maxLengthText: 'Maximum length (' + maxReportFooterLength + ' characters) exceeded.', - + listeners: { change: function (t, newValue, oldValue) { handleTextFieldChange(t, newValue, oldValue, 'footer text'); diff --git a/tests/ui/test/specs/xdmod/reportGenerator.js b/tests/ui/test/specs/xdmod/reportGenerator.js index b76570c794..b06956bd64 100644 --- a/tests/ui/test/specs/xdmod/reportGenerator.js +++ b/tests/ui/test/specs/xdmod/reportGenerator.js @@ -465,7 +465,7 @@ describe('Report Generator', function () { reportGeneratorPage.createNewReport(); }); it('Check default values', function () { - expect(reportGeneratorPage.getFileName(), 'Default report file name').to.be.equal(defaultReport.name); + expect(reportGeneratorPage.getReportName(), 'Default report name').to.be.equal(defaultReport.name); expect(reportGeneratorPage.getNumberOfChartsPerPage(), 'Default report number of charts per page').to.be.equal(defaultReport.chartsPerPage); expect(reportGeneratorPage.getSchedule(), 'Default report schedule').to.be.equal(defaultReport.schedule); expect(reportGeneratorPage.getDeliveryFormat(), 'Default report delivery format').to.be.equal(defaultReport.deliveryFormat); @@ -518,8 +518,8 @@ describe('Report Generator', function () { it('Create a new report', function () { reportGeneratorPage.createNewReport(); }); - it('Set file name', function () { - reportGeneratorPage.setFileName(testReport.name); + it('Set report name', function () { + reportGeneratorPage.setReportName(testReport.name); }); it('Set report title', function () { reportGeneratorPage.setReportTitle(testReport.title); @@ -597,7 +597,7 @@ describe('Report Generator', function () { }); it('Edit report and compare values', function () { reportGeneratorPage.getMyReportsRows()[1].doubleClick(); - expect(reportGeneratorPage.getFileName(), 'File name is correct').to.be.equal(testReport.name); + expect(reportGeneratorPage.getReportName(), 'Report name is correct').to.be.equal(testReport.name); expect(reportGeneratorPage.getReportTitle(), 'Report title is correct').to.be.equal(testReport.title); expect(reportGeneratorPage.getHeaderText(), 'Header text is correct').to.be.equal(testReport.header); expect(reportGeneratorPage.getFooterText(), 'Footer text is correct').to.be.equal(testReport.footer); @@ -624,7 +624,7 @@ describe('Report Generator', function () { it('Edit report', function () { reportGeneratorPage.getMyReportsRows()[1].doubleClick(); }); - it('Click "Save As" and set file name', function () { + it('Click "Save As" and set report name', function () { reportGeneratorPage.saveReportAs(testReport.name); }); it('Click "Save" in "Save As" window', function () { @@ -668,8 +668,8 @@ describe('Report Generator', function () { it('Open the report', function () { reportGeneratorPage.getMyReportsRows()[reportIndex].doubleClick(); }); - it('Set file name', function () { - reportGeneratorPage.setFileName(testReport.name); + it('Set report name', function () { + reportGeneratorPage.setReportName(testReport.name); }); it('Set report title', function () { reportGeneratorPage.setReportTitle(testReport.title); @@ -715,7 +715,7 @@ describe('Report Generator', function () { }); it('Edit report and compare values', function () { reportGeneratorPage.getMyReportsRows()[reportIndex].doubleClick(); - expect(reportGeneratorPage.getFileName(), 'File name is correct').to.be.equal(testReport.name); + expect(reportGeneratorPage.getReportName(), 'Report name is correct').to.be.equal(testReport.name); expect(reportGeneratorPage.getReportTitle(), 'Report title is correct').to.be.equal(testReport.title); expect(reportGeneratorPage.getHeaderText(), 'Header text is correct').to.be.equal(testReport.header); expect(reportGeneratorPage.getFooterText(), 'Footer text is correct').to.be.equal(testReport.footer); diff --git a/tests/ui/test/specs/xdmod/reportGenerator.page.js b/tests/ui/test/specs/xdmod/reportGenerator.page.js index f307666a4c..a46f966471 100644 --- a/tests/ui/test/specs/xdmod/reportGenerator.page.js +++ b/tests/ui/test/specs/xdmod/reportGenerator.page.js @@ -400,7 +400,7 @@ class ReportGenerator { }, generalInformation: { panel: () => this.selectors.reportEditor.panel() + `//div[${classContains('x-panel')} and .//span[text()="General Information"]]`, - fileNameInput: () => this.selectors.reportEditor.generalInformation.panel() + '//input[@name="report_name"]', + reportNameInput: () => this.selectors.reportEditor.generalInformation.panel() + '//input[@name="report_name"]', reportTitleInput: () => this.selectors.reportEditor.generalInformation.panel() + '//input[@name="report_title"]', headerTextInput: () => this.selectors.reportEditor.generalInformation.panel() + '//input[@name="report_header"]', footerTextInput: () => this.selectors.reportEditor.generalInformation.panel() + '//input[@name="report_footer"]' @@ -477,10 +477,10 @@ class ReportGenerator { }, saveReportAs: { window: () => `//div[${classContains('x-window')} and .//span[text()="Save Report As"]]`, - fileNameInput: () => this.selectors.saveReportAs.window() + '//input[@name="report_name"]', + reportNameInput: () => this.selectors.saveReportAs.window() + '//input[@name="report_name"]', saveButton: () => this.selectors.saveReportAs.window() + '//button[text()="Save"]', closeButton: () => this.selectors.saveReportAs.window() + '//button[text()="Close"]', - fileNameInputInvalid: () => this.selectors.saveReportAs.window() + `//input[@name="report_name" and ${classContains('x-form-invalid')}]` + reportNameInputInvalid: () => this.selectors.saveReportAs.window() + `//input[@name="report_name" and ${classContains('x-form-invalid')}]` }, reportBuilt: { window: () => `//div[${classContains('x-window')} and .//span[text()="Report Built"]]`, @@ -1101,11 +1101,11 @@ class ReportGenerator { } /** - * Save a report with a different file name. + * Save a report with a different name. * * Does not confirm saving the report. * - * @param {String} reportName The new file name to give the report (optional). + * @param {String} reportName The new name to give the report (optional). */ saveReportAs(reportName = undefined) { this.waitForReportEditorPanelVisible(); @@ -1117,8 +1117,8 @@ class ReportGenerator { * and then clicking on save to quickly, this forces it to wait for * the invalid input to not be present */ - browser.setValue(this.selectors.saveReportAs.fileNameInput(), reportName); - browser.waitUntilNotExist(this.selectors.saveReportAs.fileNameInputInvalid()); + browser.setValue(this.selectors.saveReportAs.reportNameInput(), reportName); + browser.waitUntilNotExist(this.selectors.saveReportAs.reportNameInputInvalid()); } } @@ -1226,23 +1226,23 @@ class ReportGenerator { } /** - * Get the file name of the report currently being edited. + * Get the name of the report currently being edited. * * @return {String} */ - getFileName() { + getReportName() { this.waitForReportEditorPanelVisible(); - return browser.getValue(this.selectors.reportEditor.generalInformation.fileNameInput()); + return browser.getValue(this.selectors.reportEditor.generalInformation.reportNameInput()); } /** - * Set the file name of the report currently being edited. + * Set the name of the report currently being edited. * - * @param {String} fileName + * @param {String} name */ - setFileName(fileName) { + setReportName(name) { this.waitForReportEditorPanelVisible(); - return browser.setValue(this.selectors.reportEditor.generalInformation.fileNameInput(), fileName); + return browser.setValue(this.selectors.reportEditor.generalInformation.reportNameInput(), name); } /**