Created
April 14, 2019 10:36
-
-
Save trovster/d34af7213904bc91c370e71a6d0d4003 to your computer and use it in GitHub Desktop.
Mocha test for clients.
This file contains 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
const assert = require('assert'); | |
const page = require('../../pages/Website/Clients.js'); | |
describe('website clients (as admin)', () => { | |
before(() => { | |
page.login(); | |
browser.url(page.url + '/client'); | |
}); | |
it('should see the clients listing screen', () => { | |
assert.equal(browser.getTitle(), 'Clients — DMW iSite'); | |
assert.equal($('.hero-unit h1 strong').getText(), 'Clients'); | |
}); | |
it('should have an "add client" button', () => { | |
assert.strictEqual($('a[href$="/client/create"]').isExisting(), true); | |
assert.equal($('a[href$="/client/create"]').getText(), 'Add Client'); | |
}); | |
}); | |
describe('website clients (as user)', () => { | |
before(() => { | |
page.logout(); | |
page.login('user'); | |
browser.url(page.url + '/client'); | |
}); | |
it('should NOT have an "add client" button', () => { | |
assert.strictEqual($('a[href$="/client/create"]').isExisting(), false); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment