-
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 Automation for Date-only and Time-only Fields #1836
Merged
Merged
Changes from 24 commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
f367b9e
Add date and time types to FieldDefinition.
labkey-danield 0be3b4f
Merge branch 'develop' into fb_dateAndTimeAutomation
labkey-danield 943b685
Merge branch 'develop' into fb_dateAndTimeAutomation
labkey-danield 19d30d6
Merge from develop.
labkey-danield dee0c41
Consolidate LookAndFeelSettingsPage and ProjectSettingsPage.
labkey-danield 875bbb4
Clean up tests validating checking site settings vs project settings.
labkey-danield 98134ba
Merge branch 'develop' into fb_dateAndTimeAutomation
labkey-danield 9b70169
Merge branch 'develop' into fb_dateAndTimeAutomation
labkey-danield 95a6e08
Use a date object and a date formatter for the expected data checks.
labkey-danield f33fa34
Merge branch 'develop' into fb_dateAndTimeAutomation
labkey-danield d430de2
Merge branch 'develop' into fb_dateAndTimeAutomation
labkey-danield 451c56a
Cleaned up the ListTest to some degree.
labkey-danield 953224f
Merge branch 'develop' into fb_dateAndTimeAutomation
labkey-danield cefc8af
Breaking the daet-only and time-only tests out of the older ListTest.…
labkey-danield b9362c0
Add more comments.
labkey-danield 122565c
Add a method to DomainFieldRow that returns the dialog. This is used …
labkey-danield 777575d
Change test to expect 00:00:00 if a date is given for a time-only field.
labkey-danield b2e2663
Merge branch 'develop' into fb_dateAndTimeAutomation
labkey-danield 3e38995
Merge branch 'develop' into fb_dateAndTimeAutomation
labkey-danield c6bef5d
Merge branch 'develop' into fb_dateAndTimeAutomation
labkey-danield 80243ed
Test for site-wide vs project specific import formats.
labkey-danield b1f28a9
Merge branch 'develop' into fb_dateAndTimeAutomation
labkey-danield 20b2f7d
Date-only and Time-only Tests for Assays
labkey-danield 8335273
DataClass tests for date-only and time-only fields.
labkey-danield adafea1
Remove unused / unneeded code.
labkey-danield 618e3ba
Merge branch 'develop' into fb_dateAndTimeAutomation
labkey-danield ed88035
Merge branch 'develop' into fb_dateAndTimeAutomation
labkey-danield c1bb451
Add test to validate date-only and time-only fields in assay run fields.
labkey-danield d402d57
Merge branch 'develop' into fb_dateAndTimeAutomation
labkey-danield 06fc497
Remove check from VarListDefinition.
labkey-danield 9d64c83
Fix setting the date in the future.
labkey-danield 942999a
Adding a couple of comments.
labkey-danield ccc1260
Remove unused import.
labkey-danield 811f04b
Merge branch 'develop' into fb_dateAndTimeAutomation
labkey-danield 63dd712
Added test that converts date, time and dateTime fields that are in a…
labkey-danield c86162e
Merge branch 'develop' into fb_dateAndTimeAutomation
labkey-danield 4b2d459
Yet more code review feedback.
labkey-danield 4c9ccbf
Merge branch 'develop' into fb_dateAndTimeAutomation
labkey-danield d8ba9de
Make sure project settings are reset before test.
labkey-danield 105aaa4
Take into account different sort order between MSSQL and postgres for…
labkey-danield File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
303 changes: 303 additions & 0 deletions
303
src/org/labkey/test/pages/core/admin/BaseSettingsPage.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,303 @@ | ||
package org.labkey.test.pages.core.admin; | ||
|
||
import org.labkey.test.Locator; | ||
import org.labkey.test.components.html.RadioButton; | ||
import org.labkey.test.pages.LabKeyPage; | ||
import org.openqa.selenium.WebDriver; | ||
import org.openqa.selenium.WebElement; | ||
|
||
public class BaseSettingsPage extends LabKeyPage<LabKeyPage<?>.ElementCache> | ||
{ | ||
|
||
public BaseSettingsPage(WebDriver driver) | ||
{ | ||
super(driver); | ||
waitForPage(); | ||
} | ||
|
||
@Override | ||
protected void waitForPage() | ||
{ | ||
Locator.waitForAnyElement(shortWait(), Locator.tagWithText("span","Save"), Locator.tagWithText("span","Done")); | ||
} | ||
|
||
public String getSystemDescription() | ||
{ | ||
return getFormElement(elementCache().systemDescription); | ||
} | ||
|
||
public void setSystemDescription(String description) | ||
{ | ||
setFormElement(elementCache().systemDescription, description); | ||
} | ||
|
||
public String getHeaderShortName() | ||
{ | ||
return getFormElement(elementCache().headerShortName); | ||
} | ||
|
||
public void setHeaderShortName(String shortName) | ||
{ | ||
setFormElement(elementCache().headerShortName, shortName); | ||
} | ||
|
||
public String getTheme() | ||
{ | ||
return getSelectedOptionText(elementCache().theme); | ||
} | ||
|
||
public void setTheme(String theme) | ||
{ | ||
selectOptionByText(elementCache().theme, theme); | ||
} | ||
|
||
public boolean isShowNavAlwaysChecked() | ||
{ | ||
return new RadioButton(elementCache().showNavAlways).isChecked(); | ||
} | ||
|
||
public void checkShowNavAlways() | ||
{ | ||
new RadioButton(elementCache().showNavAlways).check(); | ||
} | ||
|
||
public boolean isShowNavAdminChecked() | ||
{ | ||
return new RadioButton(elementCache().showNavForAdmin).isChecked(); | ||
} | ||
|
||
public void checkShowNavAdmin() | ||
{ | ||
new RadioButton(elementCache().showNavForAdmin).check(); | ||
} | ||
|
||
public boolean isShowAppNavAlwaysChecked() | ||
{ | ||
return new RadioButton(elementCache().showAppNavAlways).isChecked(); | ||
} | ||
|
||
public void checkShowAppNavAlways() | ||
{ | ||
new RadioButton(elementCache().showAppNavAlways).check(); | ||
} | ||
|
||
public boolean isShowAppNavAdminChecked() | ||
{ | ||
return new RadioButton(elementCache().showAppNavForAdmin).isChecked(); | ||
} | ||
|
||
public void checkShowAppNavAdmin() | ||
{ | ||
new RadioButton(elementCache().showAppNavForAdmin).check(); | ||
} | ||
|
||
public boolean getHelpMenu() | ||
{ | ||
return elementCache().helpMenuEnabledChk.isSelected(); | ||
} | ||
|
||
public void setHelpMenu(boolean enable) | ||
{ | ||
if (enable) | ||
checkCheckbox(elementCache().helpMenuEnabledChk); | ||
else | ||
uncheckCheckbox(elementCache().helpMenuEnabledChk); | ||
} | ||
|
||
public boolean getObjectLevelDiscussions() | ||
{ | ||
return elementCache().discussionEnabledChk.isEnabled(); | ||
} | ||
|
||
public void setObjectLevelDiscussions(boolean enable) | ||
{ | ||
if (enable) | ||
checkCheckbox(elementCache().discussionEnabledChk); | ||
else | ||
uncheckCheckbox(elementCache().discussionEnabledChk); | ||
} | ||
|
||
public String getLogoLink() | ||
{ | ||
return getFormElement(elementCache().logoLinkTxt); | ||
} | ||
|
||
public void setLogoLink(String link) | ||
{ | ||
setFormElement(elementCache().logoLinkTxt,link); | ||
} | ||
|
||
public String getSupportLink() | ||
{ | ||
return getFormElement(elementCache().supportLinkTxt); | ||
} | ||
|
||
public void setSupportLink(String link) | ||
{ | ||
setFormElement(elementCache().supportLinkTxt, link); | ||
} | ||
|
||
public String getSupportEmail() | ||
{ | ||
return getFormElement(elementCache().supportEmailTxt); | ||
} | ||
|
||
public void setSupportEmail(String email) | ||
{ | ||
setFormElement(elementCache().supportEmailTxt, email); | ||
} | ||
|
||
public String getSystemEmail() | ||
{ | ||
return getFormElement(elementCache().systemEmailTxt); | ||
} | ||
|
||
public void setSystemEmail(String email) | ||
{ | ||
setFormElement(elementCache().systemEmailTxt, email); | ||
} | ||
|
||
public String getOrgName() | ||
{ | ||
return getFormElement(elementCache().organizationNameTxt); | ||
} | ||
|
||
public void setOrgName(String name) | ||
{ | ||
setFormElement(elementCache().organizationNameTxt, name); | ||
} | ||
|
||
public String getDefaultDateDisplay() | ||
{ | ||
return getFormElement(elementCache().defaultDateFormat); | ||
} | ||
|
||
public void setDefaultDateDisplay(String displayFormat) | ||
{ | ||
setFormElement(elementCache().defaultDateFormat, displayFormat); | ||
} | ||
|
||
public String getDefaultDateTimeDisplay() | ||
{ | ||
return getFormElement(elementCache().defaultDateTimeFormat); | ||
} | ||
|
||
public void setDefaultDateTimeDisplay(String displayFormat) | ||
{ | ||
setFormElement(elementCache().defaultDateTimeFormat, displayFormat); | ||
} | ||
|
||
public String getDefaultTimeDisplay() | ||
{ | ||
return getFormElement(elementCache().defaultTimeFormat); | ||
} | ||
|
||
public void setDefaultTimeDisplay(String displayFormat) | ||
{ | ||
setFormElement(elementCache().defaultTimeFormat, displayFormat); | ||
} | ||
|
||
public String getDefaultNumberDisplay() | ||
{ | ||
return getFormElement(elementCache().defaultNumberFormat); | ||
} | ||
|
||
public void setDefaultNumberDisplay(String numberFormat) | ||
{ | ||
setFormElement(elementCache().defaultNumberFormat, numberFormat); | ||
} | ||
|
||
public String getAdditionalParsingPatternDates() | ||
{ | ||
return getFormElement(elementCache().additionalParsingPatternDates); | ||
} | ||
|
||
public void setAdditionalParsingPatternDates(String pattern) | ||
{ | ||
setFormElement(elementCache().additionalParsingPatternDates, pattern); | ||
} | ||
|
||
public String getAdditionalParsingPatternDateAndTime() | ||
{ | ||
return getFormElement(elementCache().additionalParsingPatternDateAndTime); | ||
} | ||
|
||
public void setAdditionalParsingPatternDateAndTime(String pattern) | ||
{ | ||
setFormElement(elementCache().additionalParsingPatternDateAndTime, pattern); | ||
} | ||
|
||
public String getAdditionalParsingPatternTimes() | ||
{ | ||
return getFormElement(elementCache().additionalParsingPatternTimes); | ||
} | ||
|
||
public void setAdditionalParsingPatternTimes(String pattern) | ||
{ | ||
setFormElement(elementCache().additionalParsingPatternTimes, pattern); | ||
} | ||
|
||
public void setRestrictChartingCols(boolean restrict) | ||
{ | ||
if (restrict) | ||
checkCheckbox(elementCache().restrictChartingColsChk); | ||
else | ||
uncheckCheckbox(elementCache().restrictChartingColsChk); | ||
} | ||
|
||
public boolean getRestrictChartingCols() | ||
{ | ||
return elementCache().restrictChartingColsChk.isSelected(); | ||
} | ||
|
||
public void save() | ||
{ | ||
clickAndWait(elementCache().saveBtn); | ||
} | ||
|
||
public void reset() | ||
{ | ||
elementCache().resetBtn.click(); | ||
acceptAlert(); | ||
} | ||
|
||
@Override | ||
protected ElementCache elementCache() | ||
{ | ||
return (ElementCache) super.elementCache(); | ||
} | ||
|
||
@Override | ||
protected ElementCache newElementCache() | ||
{ | ||
return new ElementCache(); | ||
} | ||
|
||
protected class ElementCache extends LabKeyPage<?>.ElementCache | ||
{ | ||
WebElement systemDescription = Locator.name("systemDescription").findWhenNeeded(this); | ||
WebElement headerShortName = Locator.name("systemShortName").findWhenNeeded(this); | ||
WebElement theme = Locator.name("themeName").findWhenNeeded(this); | ||
WebElement showNavAlways = Locator.xpath("//input[@name='folderDisplayMode' and @value='ALWAYS']").findWhenNeeded(this); | ||
WebElement showNavForAdmin = Locator.xpath("//input[@name='folderDisplayMode' and @value='ADMIN']").findWhenNeeded(this); | ||
WebElement showAppNavAlways = Locator.xpath("//input[@name='applicationMenuDisplayMode' and @value='ALWAYS']").findWhenNeeded(this); | ||
WebElement showAppNavForAdmin = Locator.xpath("//input[@name='applicationMenuDisplayMode' and @value='ADMIN']").findWhenNeeded(this); | ||
WebElement helpMenuEnabledChk = Locator.name("helpMenuEnabled").findWhenNeeded(this); | ||
WebElement discussionEnabledChk = Locator.name("discussionEnabled").findWhenNeeded(this); | ||
WebElement logoLinkTxt = Locator.inputByNameContaining("logoHref").findWhenNeeded(this); | ||
WebElement supportLinkTxt = Locator.inputByNameContaining("reportAProblemPath").findWhenNeeded(this); | ||
WebElement supportEmailTxt = Locator.inputByNameContaining("supportEmail").findWhenNeeded(this); | ||
WebElement systemEmailTxt = Locator.inputByNameContaining("systemEmailAddress").findWhenNeeded(this); | ||
WebElement organizationNameTxt = Locator.inputByNameContaining("companyName").findWhenNeeded(this); | ||
WebElement defaultDateFormat = Locator.inputByNameContaining("defaultDateFormat").findWhenNeeded(this); | ||
WebElement defaultTimeFormat = Locator.inputByNameContaining("defaultTimeFormat").findWhenNeeded(this); | ||
WebElement defaultDateTimeFormat = Locator.inputByNameContaining("defaultDateTimeFormat").findWhenNeeded(this); | ||
WebElement defaultNumberFormat = Locator.inputByNameContaining("defaultNumberFormat").findWhenNeeded(this); | ||
WebElement additionalParsingPatternDates = Locator.inputByNameContaining("extraDateParsingPattern").findElement(this); | ||
WebElement additionalParsingPatternTimes = Locator.inputByNameContaining("extraTimeParsingPattern").findElement(this); | ||
WebElement additionalParsingPatternDateAndTime = Locator.inputByNameContaining("extraDateTimeParsingPattern").findElement(this); | ||
WebElement restrictChartingColsChk = Locator.checkboxByName("restrictedColumnsEnabled").findWhenNeeded(this); | ||
WebElement saveBtn = Locator.lkButton("Save").findWhenNeeded(this); | ||
WebElement resetBtn = Locator.lkButton("Reset").findWhenNeeded(this); | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
If you change how this is declared, you won't have to override
elementCache
below.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.
Changed.