-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test non-standard date and time formats #2127
Test non-standard date and time formats #2127
Conversation
Change helpers to take enum values and not strings.
Uncomment a test that fails with older versions of FireFox.
Added check for Site Validation report.
Add a FolderFormats page. Added a helper in the test that cna be used to validate the format settings on a site, project or folder page.
{ | ||
String format = fieldDefinition.getFormat().trim(); | ||
|
||
int index = format.indexOf(" "); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this works with MMMM dd yyyy
date time format?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right.
I have changed the code to this:
String format = fieldDefinition.getFormat().trim();
int index = format.lastIndexOf(" ");
if (format.substring(index + 1).contains(":"))
{
fieldRow.setDateTimeFormat(
DATE_FORMAT.get(format.substring(0, index)),
TIME_FORMAT.get(format.substring(index + 1)));
If the "last part" of the format string contains a ':' the it has a time value. If it doesn't then it is a date only format.
ddMMMyyyy("ddMMMyyyy"), | ||
ddMMMyy("ddMMMyy"), | ||
MMddyyyy("MM/dd/yyyy"), | ||
MM_dd_yyyy("MM-dd-yyyy"), | ||
MMMM_dd_yyyy("MMMM dd yyyy"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is MMMM_dd_yyyy
used in any test? It's kinda special in that it contains space. I think it's good to check setting date/datetime field that uses this type and verify it's persisted / parsed correctly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have changed a couple of tests in LKS and LKSM to use MMMM_dd_yyyy
|
||
// Private helper to check the Site Validation report. Checks to see if the report should, or should not, contain | ||
// the list of warnings. | ||
private void validateSiteValidationReport(String scope, List<String> expectedWarnings, boolean shouldContain) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there test that checks meta formats "date", "datetime" and "time" won't show up on the report?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The NonStandardDateAndTimeFormatTest.testTextFormatValueOfDate uses the DATE, TIME, DATETIME and none
values. I've added a call to check that the site validation report does not flag them.
Use the date format that has spaces in it in a few tests. In NonStandardDateAndTimeFormatTest.testTextFormatValueOfDate check that using DATE, TIME and DATETIME do not get flagged by the site validation report. In SMNonStandardDateTimes.testAdminPage add a check for setting the formats back to standard values.
Rationale
Test automation for non-standard date and time formats. The tests are in NonStandardDateAndTimeFormatTest.java.
Consolidated various test helpers that set date and time fields. Change various helpers, UI components, other tests, etc... to use the enums defined in the base setting page for the format not a string (not a string).
Added a page to set formats at the page level (FolderFormatsPage).
Added APIContainerHelper.setDateAndTimeFormats. This allows setting of non-standard formats to projects and folders.
Related Pull Requests
Changes