Skip to content

Instantly share code, notes, and snippets.

@rwjblue
Last active August 29, 2015 14:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rwjblue/1d0314fb2612ba929e81 to your computer and use it in GitHub Desktop.
Save rwjblue/1d0314fb2612ba929e81 to your computer and use it in GitHub Desktop.
test("Tour next, back, and cancel builtInButtons work", function(assert) {
assert.expect(6);
visit('/').then(function() {
assert.equal($('body.shepherd-active').length, 1, "Body gets class of shepherd-active, when shepherd becomes active");
assert.equal($('.shepherd-enabled').length, 2, "attachTo element and tour get shepherd-enabled class");
assert.equal($('#shepherdOverlay').length, 1, "#shepherdOverlay exists");
click('.shepherd-enabled .next-button');
//$("a:contains('Next'):visible")[0].click();
assert.equal($("a:contains('Back'):visible").length, 1, "Ensure that the back button appears");
click('.shepherd-enabled .back-button');
//$("a:contains('Back'):visible")[0].click();
assert.equal($("a:contains('Back'):visible").length, 0, "Ensure that the back button disappears");
click('.shepherd-enabled .cancel-button');
//$("a:contains('Exit'):visible")[0].click();
assert.equal($('[class^=shepherd-button]:visible').length, 0, "Ensure that all buttons are gone, after exit");
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment