Hi, I’m a QE attempting to apply a cucumberjs / puppeteer solution. I’m very green when it comes to ember. I can’t seem to page.click on an ember computed properties:
<p class="ao-label" data-test-upload="true">Drag and Drop Files or
{{#file-upload
name="transactions"
class="ao-file-uploader__file"
multiple=false
onfileadd=(action "validateFile")
accept=allowFileTypeString
}}
<a class="ao-button ao-button--link">Click to Browse</a>
{{/file-upload}}
</p>
Cucumber.js complains that the selector can’t be found.
Does anyone know how I can create element selectors for ember computed properties so that puppeteer can select it with a page.click?
please?
Most likely that template hasn’t actually rendered by the time you’re trying to find the selector. Like any clientside Javascript framework, the actual HTML isn’t present until data loading and rendering have finished, so waiting for DOMREady or some other built-in browser event is not going to work reliably.
While it’s possible to test Ember using puppetteer the same way you could test any Javascript application, that’s going to be harder and less robust than using Ember’s own testing infrastructure. The build in test capability is really good.
You can generate a new acceptance test by running ember generate acceptance-test my-first-test, and then update that test to read like:
No, ember test would run all the tests you’ve defined in your app. I’m suggesting that you could call that once from whatever other test suite you have, in order to delegate a chunk of testing to Ember where you’re testing things that are easiest to test within Ember.