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

Fixes #7774 column headers missing in RowEvolution graph export. #7878

Merged
merged 4 commits into from May 13, 2015

Conversation

diosmosis
Copy link
Member

This PR includes the small fix mentioned in a comment by @tsteur as well as UI tests for the report exporting feature. The new tests download the export links in phantomjs and compare the contents w/ expected files. To do this, I've added a new keyword file and a new assertion pageContents, which can be used as follows:

expect.file('file.xml').to.be.pageContents(function (page) {
   // ...
});

There is also a new page renderer method downloadLink which hacks around one of phantomjs' limitations. phantomjs will not display non-HTML files by default, so we can't just click an export link. Instead, we have to download via AJAX and set the page contents manually.

Refs #7774

@diosmosis diosmosis added Bug For errors / faults / flaws / inconsistencies etc. not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. Needs Review PRs that need a code review labels May 11, 2015
@diosmosis diosmosis added this to the 2.14.0 milestone May 11, 2015
@tsteur
Copy link
Member

tsteur commented May 11, 2015

Most of the graph UI tests seem to be broken?

Shouldn't there be maybe a $this->requestConfig->disable_queued_filters = 1 somewhere? If all the graphs still work, was it maybe for performance reasons? I think you added this line originally as Fixes #4429, allow processed columns to be sorted in table visualizations.

@diosmosis
Copy link
Member Author

If the queued filters are for processed metrics, then they shouldn't be necessary anymore... I'll look at the test failures.

@diosmosis
Copy link
Member Author

The graph UI tests pass, are you looking at the right build?

@tsteur
Copy link
Member

tsteur commented May 12, 2015

I looked at the linked travis build: https://travis-ci.org/piwik/piwik/jobs/62025592

It says quite often eg

  6) ReportExporting should export an evolution graph report correclty when the CSV export link is clicked:
     No expected output file found at /home/travis/build/piwik/piwik/tests/lib/screenshot-testing/../../../tests/UI/./expected-ui-screenshots/ReportExporting_VisitsSummary.get_exported.csv.txt.
       Url to reproduce: http://localhost/tests/PHPUnit/proxy/?module=Widgetize&action=iframe&idSite=1&period=year&date=2012-08-09&isFooterExpandedInDashboard=1&moduleToWidgetize=VisitsSummary&actionToWidgetize=get&viewDataTable=graphEvolution

Probably master needs to update submodule to expected screenshots?

@diosmosis
Copy link
Member Author

Those are tests for the export links; they need expected output. I was going to put them in after the merge. Otherwise I can create a branch on the ui screenshot repo, but then the merge will have to be done from the command line.

diosmosis added 4 commits May 11, 2015 20:44
…o see if the UI tests build will pass. If processed metrics must be formatted, it may not make sense to disable queued filters in the Graph visualization base.
…s and assertions to screenshot testing library that allow testing contents of pages.
@diosmosis diosmosis force-pushed the 7774_column_headers_missing branch from 4ddf470 to 6880880 Compare May 12, 2015 03:47
@tsteur
Copy link
Member

tsteur commented May 12, 2015

Cool, thought so. For new files I usually add them directly in master branch of screenshot repo as they won't break existing tests. This makes tests green as we'd add them afterwards anyway (unless PR is not merged but that's rare). Branch is certainly not needed. OK to put in after merge

@diosmosis
Copy link
Member Author

@tsteur See any reason not to merge? Otherwise I will merge & update the expected test files.

@tsteur
Copy link
Member

tsteur commented May 12, 2015

Good to merge if it works. I was a bit worried re queued filters and performance regression but doubt it will cause any.

diosmosis pushed a commit that referenced this pull request May 13, 2015
diosmosis added a commit that referenced this pull request May 13, 2015
Fixes #7774 column headers missing in RowEvolution graph export due to disabled_queued_filters being passed on to export link. Removed from link and added new UI tests for export link functionality.
@diosmosis diosmosis merged commit 377e6a9 into master May 13, 2015
@diosmosis diosmosis deleted the 7774_column_headers_missing branch May 13, 2015 05:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc. Needs Review PRs that need a code review not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants