-
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 components for charting in apps #1878
Conversation
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.
There is some clean up you should do.
Use the IntelliJ linter it will help identify some nit-pick things to clean up.
{ | ||
return elementCache().reactSelectByLabel("Y Axis").getValue(); | ||
} | ||
|
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.
Wouldn't it be useful to have a getSelectionOptions for XAxis, YAxis & GroupBy? It seems like there should be a test that validates the correct fields/columns are returned for the options.
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.
Yes, those are probably going to be useful to have. I'll implement them here while we're thinking about it
public QueryChartDialog setChartType(CHART_TYPE chartType) | ||
{ | ||
elementCache().selectChartType(chartType); | ||
return this; | ||
} | ||
|
||
public CHART_TYPE getSelectedChartType() | ||
{ | ||
return elementCache().getSelectedChartType(); | ||
} |
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.
public QueryChartDialog setChartType(CHART_TYPE chartType) | |
{ | |
elementCache().selectChartType(chartType); | |
return this; | |
} | |
public CHART_TYPE getSelectedChartType() | |
{ | |
return elementCache().getSelectedChartType(); | |
} | |
public QueryChartDialog setChartType(CHART_TYPE chartType) | |
{ | |
if (getSelectedChartType().equals(chartType)) | |
return this; | |
// note: selecting a chart type will cause most select fields to go stale | |
var el = elementCache().chartBuilderType.withAttribute("data-name", chartType.getChartType()) | |
.waitForElement(this, 1500); | |
getWrapper().shortWait().until(ExpectedConditions.elementToBeClickable(el)); | |
el.click(); | |
WebDriverWrapper.waitFor(()-> getSelectedChartType().equals(chartType), | |
"The requested chart type did not become selected", 2000); | |
return this; | |
} | |
public CHART_TYPE getSelectedChartType() | |
{ | |
var selectedEl = elementCache().chartBuilderType.withAttributeContaining("class", "selected") | |
.waitForElement(this, 1500); | |
String dataName = selectedEl.getAttribute("data-name"); | |
return CHART_TYPE.fromChartType(dataName); | |
} |
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.
This would clean up the elementCache and remove the methods that aren't really elements on the dialog.
Rationale
We have added the ability (in biologics, with an experimental feature) to compose, edit, and delete charts on queryGrids. This change adds and updates classes necessary to interact with new UI in the apps.
The new Dialog
![image](https://private-user-images.githubusercontent.com/16809856/318971189-b2f3d529-ea6f-4a9f-91e2-eba58a25ff16.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkzMDEzMTYsIm5iZiI6MTczOTMwMTAxNiwicGF0aCI6Ii8xNjgwOTg1Ni8zMTg5NzExODktYjJmM2Q1MjktZWE2Zi00YTlmLTkxZTItZWJhNThhMjVmZjE2LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDE5MTAxNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTBkMjRlYjFiN2I3NTc0ZTJlYTc2ZmM4ZWI3MzU3MWM4Y2M2ZDIxY2I3ODZkMmZkOGI5Mzk0OGI2MGJjYzM4MGEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.0R86lMPsJrklO1Gcoa37rb6dZavCtdQuYDwyibm_b7g)
![image](https://private-user-images.githubusercontent.com/16809856/318971278-2275c15e-089d-4451-a580-ea55d0e3de39.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkzMDEzMTYsIm5iZiI6MTczOTMwMTAxNiwicGF0aCI6Ii8xNjgwOTg1Ni8zMTg5NzEyNzgtMjI3NWMxNWUtMDg5ZC00NDUxLWE1ODAtZWE1NWQwZTNkZTM5LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDE5MTAxNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWQ0MGNmMWVlN2Q3MmMzNWQzYjJhNWNmM2I0ZDFjZTNiNjhiNDUxNTNlYTFmNGVkYTA4MmEyOGU0MDU2ODUxODImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.91eF7jyXKF_7CnSTg7R7jKRRdRQGm1Yb0p0lLHtDvPQ)
QueryChartDialog
supports create and edit of charts, and could (if we think that's a good idea) be refactored into 2 dialog classes that would only have methods related to buttons of the dialog in that mode. Here it is in create mode:and in edit mode:
Because we've introduced the ability to add, edit, save, and delete charts in the apps, I've taken the liberty of creating a new component, QueryChartPanel (which contains the chart in the QueryGrid when charts or reports are shown) to surface the ability to find the chart's svg, to click to edit the chart, and to close the chart view- it's highlit in red, here:
![image](https://private-user-images.githubusercontent.com/16809856/318971382-05aa7e9a-55c8-4f65-8d6f-5463bb0728e2.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkzMDEzMTYsIm5iZiI6MTczOTMwMTAxNiwicGF0aCI6Ii8xNjgwOTg1Ni8zMTg5NzEzODItMDVhYTdlOWEtNTVjOC00ZjY1LThkNmYtNTQ2M2JiMDcyOGUyLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDE5MTAxNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWU3N2QzMWE0MDk0NWZiMWU2YzU4N2FmMzhiYTM4NDI0ZDdjYWJiOWQ4YzJlMWNkMTU0NDY0YjhiMzk1YTQyMzkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.zGXuPLd-Myppw-DXpuh2kP-WozwPv2jt6kCKOI63KMg)
Related Pull Requests
https://github.com/LabKey/limsModules/pull/105 <- contains test coverage using new/changed components in this PR
Changes
QueryChartDialog
QueryGrid
,QueryChartPanel
(which provides the means to get the edit dialog, to dismiss the chart when it is shown, to find the chart/report)