percy / percy-ember

Ember addon for visual regression testing with Percy
https://docs.percy.io/docs/ember
MIT License
73 stars 44 forks source link

new test API #63

Closed kellyselden closed 6 years ago

kellyselden commented 6 years ago

With the new testing API, usage would change to

import { percySnapshot } from 'ember-percy';

test('foo', async function(assert) {
  await percySnapshot('bar');
});

Correct?

fotinakis commented 6 years ago

Yes! This should work as-is, I believe.

fotinakis commented 6 years ago

@kellyselden let me know if this doesn't work!

ballPointPenguin commented 6 years ago

I can confirm that this works in Ember >= 3.x apps without any further configuration.

ie. no import './percy/register-helpers'; or start-app needed. :+1:

nruth commented 5 years ago

It would be great to get this into the documentation https://docs.percy.io/docs/ember – it still describes adding things to files that aren't there anymore.

It's good to hear it works, though I'm confused by percySnapshot in addon/snapshot.js not returning a promise to await. Does it need to block execution (as an async helper like it was, or now async function), or does the ajax request have a copy of the data it's going to send?

https://dockyard.com/blog/2018/01/18/test-helpers-the-next-generation has some interesting pointers on migrating addon helpers.