Skip to content

Instantly share code, notes, and snippets.

@nightspirit
Created April 29, 2018 09:15
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 nightspirit/e95401e2b5b996f6cee3fe18a28721dc to your computer and use it in GitHub Desktop.
Save nightspirit/e95401e2b5b996f6cee3fe18a28721dc to your computer and use it in GitHub Desktop.
import { Selector } from 'testcafe'
fixture `Login`
.page `http://localhost:3000/login`
test('Login with bad credential', async t => {
await t
.typeText('input[name="username"]', 'blah')
.typeText('input[name="password"]', 'blah')
.click('button[type="submit"]')
.expect(Selector('#alert').innerText).eql('Invalid Username/Password')
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment