Skip to content

Commit

Permalink
Rename report file name input field (#1281)
Browse files Browse the repository at this point in the history
  • Loading branch information
jtpalmer authored Apr 8, 2020
1 parent a405d91 commit cabf364
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 24 deletions.
4 changes: 2 additions & 2 deletions html/gui/js/report_builder/ReportCreator.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',

Expand Down Expand Up @@ -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');
Expand Down
16 changes: 8 additions & 8 deletions tests/ui/test/specs/xdmod/reportGenerator.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand All @@ -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 () {
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
28 changes: 14 additions & 14 deletions tests/ui/test/specs/xdmod/reportGenerator.page.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"]'
Expand Down Expand Up @@ -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"]]`,
Expand Down Expand Up @@ -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();
Expand All @@ -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());
}
}

Expand Down Expand Up @@ -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);
}

/**
Expand Down

0 comments on commit cabf364

Please sign in to comment.