Skip to content
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

Merged
merged 1 commit into from
Feb 6, 2019

Conversation

digitronik
Copy link
Member

@digitronik digitronik commented Dec 15, 2018

Part of #67

Adding fallowing widgets with unit test:

1. Sparkline
2. Line Chart
    a. single line
    b. line chart
    c. single spline chart
    d. spline chart
3. Bar Chart
   a. Vertical Bar Chart
    a. Grouped Vertical Bar chart
    b. Stacked Vertical Bar Chart
    c. Horizontal Bar Chart
    d. Grouped Horizontal Bar Chart
    e. Stacked Horizontal Bar Chart

@coveralls
Copy link

coveralls commented Dec 15, 2018

Coverage Status

Coverage increased (+3.2%) to 47.041% when pulling eb44ac3 on digitronik:line_chart into 7cc862b on RedHatQE:master.

@digitronik digitronik force-pushed the line_chart branch 9 times, most recently from 9e6b5b1 to 9ed0e35 Compare December 28, 2018 09:21
@digitronik digitronik changed the title [WIP] Charts: Line, Bar, Spiral widgets Charts: Line, Bar, Spiral widgets Dec 28, 2018
@digitronik
Copy link
Member Author

Notebook for reviewers... include setup and test.

spark_line_chart = SparkLineChart(id="sparklineChart")
"""
ROOT = ParametrizedLocator("{@locator}")
BASE_LOCATOR = ".//div[@id={}]"
Copy link
Collaborator

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).

Copy link
Member Author

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:

  1. We are providing locator as one argument. Users can use locator; if they found such thing in their page design.
  2. If they like to add check for class and don't want to provide locator for specific graph. they can go with inheritance and overwrite BASE_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.

Copy link
Collaborator

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')]'

@digitronik digitronik force-pushed the line_chart branch 2 times, most recently from 99d07e5 to 3b60ef4 Compare January 8, 2019 13:16
@digitronik digitronik force-pushed the line_chart branch 2 times, most recently from 70160f2 to cf9ad5a Compare January 11, 2019 05:17
@izapolsk izapolsk self-requested a review January 14, 2019 15:13
@digitronik
Copy link
Member Author

@mshriver I added changes and questions answers. Please have a look.

@mshriver mshriver self-assigned this Feb 6, 2019
Copy link
Collaborator

@mshriver mshriver left a 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
@mshriver mshriver merged commit ddef267 into RedHatQE:master Feb 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants