Skip to content

Instantly share code, notes, and snippets.

@dasDaniel
Last active February 21, 2018 16:18
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 dasDaniel/51e5327651b20a811a0aa3866ca86ff6 to your computer and use it in GitHub Desktop.
Save dasDaniel/51e5327651b20a811a0aa3866ca86ff6 to your computer and use it in GitHub Desktop.
Testcafe does not trim values, and IE/Edge seems to keep the whitespace. This solution trims in-line
/*
<div class="el-with-whitespace>
No spaces at the end
</div>
*/
await t.expect(await Selector('.el-with-whitespace').innerText.then(v => v.trim())).eql('No spaces at the end')
// it requires the `await t` otherwise the element doesn't check the updated value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment