-
Notifications
You must be signed in to change notification settings - Fork 29
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
Charts: Line, Bar, Spiral widgets #78
Conversation
f38f290
to
b5b3253
Compare
9e6b5b1
to
9ed0e35
Compare
Notebook for reviewers... include setup and test. |
spark_line_chart = SparkLineChart(id="sparklineChart") | ||
""" | ||
ROOT = ParametrizedLocator("{@locator}") | ||
BASE_LOCATOR = ".//div[@id={}]" |
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.
Please include 'chart-pf-sparkline' class in the default/BASE_LOCATOR to be more explicit here. The Patternfly spec includes that class. Multiple div's on the page could have the same ID but different classes. (may be a poor page design, but its possible).
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.
@mshriver I agreed it will provide flexibility
and also agreed with may be a poor page design
possibility. I tried changes locally and found some observations.
If we add class
like chart-pf-sparkline
in BaseLocator
as per standard design. most of user need to inherit and create own BaseLocator
. Above condition they can handle by:
- We are providing
locator
as oneargument
. Users can uselocator
; if they found such thing in their page design. - If they like to add check for
class
and don't want to provide locator for specific graph. they can go with inheritance and overwriteBASE_LOCATOR
as per their own requirements like....
BASE_LOCATOR = ".//div[@id={id} and contains(@class, 'chart-miq-spark')]"
What do you think? we should go with more global approach so user can use widget directly and customize only if they needs.
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.
Thanks Nikhil - I think that the default behavior of the widget needs to model the patternfly reference implementation, and be as precise as possible in its xpath locators.
For that reason, I would prefer to have the patternfly reference class in the base locator XPATH. Just as you said, if I want to completely override the locator because my project uses a significantly different base element, I can do that directly. Otherwise, if just the class changes, then subclassing as below is very simple, and explicitly shows how the markup changes for the project where this is used.
class MyProjectSparkLine(SparkLineChart):
BASE_LOCATOR = '//div[@id={} and contains(@class, 'myproject-spark-class')]'
99d07e5
to
3b60ef4
Compare
70160f2
to
cf9ad5a
Compare
@mshriver I added changes and questions answers. Please have a look. |
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.
Looking good!
added line chart in html testing page Sline chart html adding spark line chart adding single line chart and improve sorting adding line chat widget test for line and spline chart adding bar charts for testing adding BarChart and GroupBarChart widget adding parametrize test for line and bar charts widget/test_page refactor
Part of #67
Adding fallowing
widgets
withunit test
: