Skip to content

Instantly share code, notes, and snippets.

@roycollings
Created December 21, 2012 07:59
Show Gist options
  • Save roycollings/4351335 to your computer and use it in GitHub Desktop.
Save roycollings/4351335 to your computer and use it in GitHub Desktop.
AngularJS E2E: nice way to match against multi-line string.
//
// Html
//
<a id="msg1">To start making payments you need to
verify your email address by clicking
the link in the confirmation email ...
</a>
//
// AngularJS E2E test (inside a "describe", obviously) ...
//
it('contains a message about starting to make payments etc...', function() {
var expectedMsg = [
'To start making payments you need to',
'verify your email address by clicking',
'the link in the confirmation email ...'
].join(' *\n *');
expect(element('#msg1').text()).toMatch(expectedMsg);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment