Skip to content

Instantly share code, notes, and snippets.

@ngokevin
Created August 21, 2013 23:22
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 ngokevin/6301463 to your computer and use it in GitHub Desktop.
Save ngokevin/6301463 to your computer and use it in GitHub Desktop.
var suite = require('./kasperle').suite();
suite.run('/', function(test, waitFor) {
test('Click close prompt', function(assert) {
suite.evaluate(function() {
// Set chromeless since prompt only shows on browsers.
window.require(['capabilities', 'storage'], function(capabilities, storage) {
capabilities.chromeless = false;
storage.setItem('mktapp-prompt-closed', true);
});
});
waitFor(function() {
// Wait for prompt.
return suite.exists('#mktapp-prompt .prompt-text');
}, function() {
// Click the close button and check the prompt goes away.
assert.selectorExists('#mktapp-prompt .prompt-text');
suite.press('#mktapp-prompt .prompt-close');
assert.selectorDoesNotExist('#mktapp-prompt .prompt-text');
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment