Created
August 21, 2013 23:24
-
-
Save ngokevin/6301476 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | |
// I want to "reload" the page with the above flags switched such | |
// that the prompt shows. Here it times out because the settings | |
// are not correct for the prompt to render. | |
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
The waitFor times out.
The first assertion fails.