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

Take screenshots of UI throughout functional tests. #7410

Merged

Conversation

cjcenizal
Copy link
Contributor

No description provided.

@cjcenizal cjcenizal force-pushed the improvement/ui-screenshot-coverage branch 2 times, most recently from 42519de to ae9a309 Compare June 9, 2016 23:56
@tylersmalley
Copy link
Contributor

Is this for visual regression testing? Should we also fail the tests for CI if a new screenshot is generated? That way we can ensure the modified screenshots are committed?

@cjcenizal
Copy link
Contributor Author

@tylersmalley Right, exactly. I'm planning on using these in conjunction with our screenshot-comparison tool (#7395) to protect against visual regressions while I refactor our styles.

I think it would be great to incorporate it into our automated testing, but I think we need to use the tool manually for awhile before we can use it to fail builds. For example, right now it can fail due to a resource not loading in time (e.g. a font), which results in a false positive, so we'd need to fix that issue first.

@tylersmalley
Copy link
Contributor

That sounds great. Seeing how this is simply adding more screenshots, this LGTM.

@cjcenizal cjcenizal force-pushed the improvement/ui-screenshot-coverage branch from 24ea8f1 to 50bd95a Compare June 10, 2016 23:41
@cjcenizal cjcenizal force-pushed the improvement/ui-screenshot-coverage branch 3 times, most recently from ccec815 to 64a6786 Compare June 13, 2016 20:36
@tylersmalley
Copy link
Contributor

I am getting a error when running test:visualRegression`:

./node_modules/.bin/grunt  test:visualRegression
Compiling all doT templates...
Compiling visual_regression_gallery.dot to function
Running "test:visualRegression" task
(97.57%) screenshot-LineChart.png
(95.99%) screenshot-VerticalBarChart.png
(97.38%) screenshot-DataTable.png
(95.48%) screenshot-AreaChart.png
{ [Error: ENOENT: no such file or directory, open '/Users/tyler/Code/tylersmalley/kibana/test/screenshots/baseline/screenshot-LineChart.png']
  cause:
   { [Error: ENOENT: no such file or directory, open '/Users/tyler/Code/tylersmalley/kibana/test/screenshots/baseline/screenshot-LineChart.png']
     errno: -2,
     code: 'ENOENT',
     syscall: 'open',
     path: '/Users/tyler/Code/tylersmalley/kibana/test/screenshots/baseline/screenshot-LineChart.png' },
  isOperational: true,
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: '/Users/tyler/Code/tylersmalley/kibana/test/screenshots/baseline/screenshot-LineChart.png' }
Warning: Task "test:visualRegression" failed. Use --force to continue.

Aborted due to warnings.

@cjcenizal
Copy link
Contributor Author

Ah, that's because the task looks in your screenshots/session directory and tries to compare against files with the same name in the screenshots/baseline directory. I changed the way the screenshots are named, so you'll need to run the functional tests first (to re-generate all the session screenshots), and then run test:visualRegression again.

common.debug('Start of test' + testSubName + 'Visualization');
var vizName1 = 'Visualization ' + testSubName;

var vizName1 = 'Visualization MetricChart';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This assignment is being used

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Nice catch!

@tylersmalley
Copy link
Contributor

This ran as expected after the clean:screenshots task was implemented.

The gallery looks great, and I could definitely see us adding filtering down the road.

@cjcenizal cjcenizal force-pushed the improvement/ui-screenshot-coverage branch from 46d4f97 to cf6e7c1 Compare June 14, 2016 03:31
- Add 'test:visualRegression' grunt task.
- Run 'test:visualRegression' as part of npm script 'test'.
- Add 'clean:screenshots task'.
- Clean screenshots/session when funtional tests are run.
@cjcenizal cjcenizal force-pushed the improvement/ui-screenshot-coverage branch from cf6e7c1 to 9e353fd Compare June 14, 2016 15:35
@cjcenizal cjcenizal merged commit aa47599 into elastic:master Jun 14, 2016
@cjcenizal cjcenizal deleted the improvement/ui-screenshot-coverage branch June 14, 2016 15:54
airow pushed a commit to airow/kibana that referenced this pull request Feb 16, 2017
…hot-coverage

Take screenshots of UI throughout functional tests.

Former-commit-id: aa47599
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants