I'm trying to click a button in my Ember-CLI integration test, and it works with Chrome, but tells me click is undefined in PhantomJS. I've seen some other posts that recommend defining your own click event for PhantomJS, but I couldn't get that to work.
$("a:contains('Next'):visible")[0].click();
That works in Chrome, but not PhantomJS. The built in click helper, in Ember-CLI, appears to not work with "a:contains('Next'):visible".
Can anyone help?
Update:
I talked to some guys on the Ember-CLI IRC and got my selectors to work with the Ember click helper in my tests, but now the clicks appear to do nothing. Any ideas?
test("Tour next, back, and cancel builtInButtons work", function(assert) {
assert.expect(6);
visit('/').then(function() {
assert.equal(find('.shepherd-active', 'html').length, 1, "Body gets class of shepherd-active, when shepherd becomes active");
assert.equal(find('.shepherd-enabled', 'body').length, 2, "attachTo element and tour get shepherd-enabled class");
assert.equal(find('#shepherdOverlay', 'body').length, 1, "#shepherdOverlay should exist, since isModal=true");
click('.next-button', '.shepherd-enabled');
andThen(function() {
assert.equal(find('.back-button', '.shepherd-enabled').length, 1, "Ensure that the back button appears");
});
click('.back-button', '.shepherd-enabled');
andThen(function() {
assert.equal(find('.back-button', '.shepherd-enabled').length, 0, "Ensure that the back button disappears");
});
click('.cancel-button', '.shepherd-enabled');
andThen(function() {
assert.equal(find('[class^=shepherd-button]', '.shepherd-enabled').length, 0, "Ensure that all buttons are gone, after exit");
});
});
});