kazana-example
Version:
Kazana example app
37 lines (35 loc) • 940 B
JavaScript
var test = require('../utils/test')
test('Log in and out', function (group, server, client) {
group.test('Does not log in as with wrong credentials', function (t) {
return client
.init()
.login('unknown@example.com')
.waitForAlert(function (error, text) {
t.error(error)
t.is(text, 'unauthorized')
this.alertDismiss()
})
.end()
})
group.test('Logs in as with right credentials', function (t) {
return client
.init()
.login()
.waitForText('[data-qa=username]')
.getText('[data-qa=username]')
.then(function (text) {
t.match(text, 'kazana-admin@example.com')
})
.end()
})
group.test('Logs out', function (t) {
return client
.init()
.login()
.waitForVisible('a[data-qa=signout]')
.click('a[data-qa=signout]')
.waitForExist('form[data-qa=login-form]')
.end()
})
group.end()
})