var Command = require('intern/dojo/node!leadfoot/Command');
var pollUntil = require('intern/dojo/node!leadfoot/helpers/pollUntil');
- Command.prototype.assertElementCount = function (selector, count) {
+ Command.prototype.checkElementCount = function (selector, count) {
return new this.constructor(this, function () {
return this.parent
- .findAllByCssSelector(selector)
- .then(function (elements) {
- assert.equal(count, elements.length, count + ' elements were found by ' + selector);
- })
- .end();
- });
- };
+ .then(pollUntil(function (selector, count) {
+ var elements = document.querySelectorAll(selector);
+ return elements.length === count ? true : null;
+ }, [selector, count]))
+ .then(function () {
- Command.prototype.assertElementExist = function (selector) {
- return new this.constructor(this, function () {
- return this.parent
- .findAllByCssSelector(selector)
- .then(function (elements) {
- assert.ok(elements.length, selector + ' exists');
- })
- .end();
+ }, function () {
+ assert.fail(null, null, 'failed to find ' + count + ' elements by selector "' + selector + '"');
+ });
});
};
- Command.prototype.assertElementNotExist = function (selector) {
+ Command.prototype.checkElementExist = function (selector) {
return new this.constructor(this, function () {
return this.parent
- .findAllByCssSelector(selector)
- .then(function (elements) {
- assert.equal(elements.length, 0, selector + ' does not exist');
- })
- .end();
+ .then(pollUntil(function (selector) {
+ var elements = document.querySelectorAll(selector);
+ return elements.length > 0 ? true : null;
+ }, [selector]))
+ .then(function () {
+
+ }, function () {
+ assert.fail(null, null, 'failed to find elements by selector "' + selector + '"');
+ });
});
};
- Command.prototype.assertElementInclude = function (selector, text) {
+ Command.prototype.checkElementNotExist = function (selector) {
return new this.constructor(this, function () {
return this.parent
- .findAllByCssSelector(selector)
- .getVisibleText()
- .then(function (texts) {
- assert.include(texts.join(''), text, selector + ' contains "' + text + '"');
- })
- .end();
+ .then(pollUntil(function (selector) {
+ var elements = document.querySelectorAll(selector);
+ return elements.length === 0 ? true : null;
+ }, [selector]))
+ .then(function () {
+
+ }, function () {
+ assert.fail(null, null, 'failed to fail to find elements by selector "' + selector + '"');
+ });
});
};
- Command.prototype.assertElementNotInclude = function (selector, text) {
+ Command.prototype.checkElementInclude = function (selector, text) {
return new this.constructor(this, function () {
return this.parent
- .findAllByCssSelector(selector)
- .getVisibleText()
- .then(function (texts) {
- assert.notInclude(texts.join(''), text, selector + ' does not contain "' + text + '"');
- })
- .end();
+ .then(pollUntil(function (selector, text) {
+ var elements = Array.prototype.slice.call(document.querySelectorAll(selector));
+ var result = elements.some(function (element) {
+ return element.textContent.indexOf(text) !== -1;
+ });
+ return result ? true : null;
+ }, [selector, text]))
+ .then(function () {
+
+ }, function () {
+ assert.fail(null, null, 'failed to find elements by selector "' + selector +
+ '" that include "' + text + '"');
+ });
});
};
- Command.prototype.assertElementVisible = function (selector) {
+ Command.prototype.checkElementNotInclude = function (selector, text) {
return new this.constructor(this, function () {
return this.parent
- .findAllByCssSelector(selector)
- .isDisplayed()
- .then(function (displayed) {
- assert.ok(displayed, selector + ' is visible');
- })
- .end();
+ .then(pollUntil(function (selector, text) {
+ var elements = Array.prototype.slice.call(document.querySelectorAll(selector));
+ var result = elements.every(function (element) {
+ return element.textContent.indexOf(text) === -1;
+ });
+ return result ? true : null;
+ }, [selector, text]))
+ .then(function () {
+
+ }, function () {
+ assert.fail(null, null, 'failed to fail to find elements by selector "' + selector +
+ '" that include "' + text + '"');
+ });
});
};
});
};
- Command.prototype.waitForElementCount = function (selector, count) {
- return new this.constructor(this, function () {
- return this.parent
- .then(pollUntil(function (selector, count) {
- var elements = document.querySelectorAll(selector);
- return elements.length === count ? true : null;
- }, [selector, count]));
- });
- };
-
Command.prototype.mockFromFile = function (url, file, options) {
var response = fs.readFileSync('src/test/json/' + file, 'utf-8');
return new this.constructor(this, function () {
App.start({ el: '#content' });
});
}, [app])
- .sleep(2000);
+ .sleep(1000);
});
};
.mockFromFile('/api/issue_filters/app', 'issues-spec/app.json')
.mockFromFile('/api/issues/search', 'issues-spec/search.json')
.startApp('issues')
- .waitForElementCount('.js-filter', 2)
- .waitForElementCount('.js-filter[data-id="31"]', 1)
- .waitForElementCount('.js-filter[data-id="32"]', 1);
+ .checkElementCount('.js-filter', 2)
+ .checkElementCount('.js-filter[data-id="31"]', 1)
+ .checkElementCount('.js-filter[data-id="32"]', 1);
});
bdd.it('should load a saved search', function () {
.startApp('issues')
.clickElement('.search-navigator-filters-show-list')
.clickElement('.js-filter[data-id="31"]')
- .assertElementCount('.js-filter-copy', 1)
- .assertElementCount('.js-filter-edit', 1)
- .assertElementInclude('.issues-filters-name', 'Critical and Blocker Issues')
- .assertElementCount('.js-facet.active[data-value="BLOCKER"]', 1)
- .assertElementCount('.js-facet.active[data-value="CRITICAL"]', 1)
- .assertElementCount('.js-facet.active[data-unresolved]', 1);
+ .checkElementCount('.js-filter-copy', 1)
+ .checkElementCount('.js-filter-edit', 1)
+ .checkElementInclude('.issues-filters-name', 'Critical and Blocker Issues')
+ .checkElementCount('.js-facet.active[data-value="BLOCKER"]', 1)
+ .checkElementCount('.js-facet.active[data-value="CRITICAL"]', 1)
+ .checkElementCount('.js-facet.active[data-unresolved]', 1);
});
bdd.it('should load a saved search and then resets it by new search', function () {
.startApp('issues')
.clickElement('.search-navigator-filters-show-list')
.clickElement('.js-filter[data-id="31"]')
- .assertElementCount('.js-filter-copy', 1)
- .assertElementCount('.js-filter-edit', 1)
- .assertElementInclude('.issues-filters-name', 'Critical and Blocker Issues')
- .assertElementCount('.js-facet.active[data-value="BLOCKER"]', 1)
- .assertElementCount('.js-facet.active[data-value="CRITICAL"]', 1)
- .assertElementCount('.js-facet.active[data-unresolved]', 1)
+ .checkElementCount('.js-filter-copy', 1)
+ .checkElementCount('.js-filter-edit', 1)
+ .checkElementInclude('.issues-filters-name', 'Critical and Blocker Issues')
+ .checkElementCount('.js-facet.active[data-value="BLOCKER"]', 1)
+ .checkElementCount('.js-facet.active[data-value="CRITICAL"]', 1)
+ .checkElementCount('.js-facet.active[data-unresolved]', 1)
.clickElement('.js-new-search')
- .assertElementCount('.js-facet[data-value="BLOCKER"]:not(.active)', 1)
- .assertElementCount('.js-facet[data-value="CRITICAL"]:not(.active)', 1)
- .assertElementCount('.js-facet.active[data-unresolved]', 1)
- .assertElementNotInclude('.issues-filters-name', 'Critical and Blocker Issues');
+ .checkElementCount('.js-facet[data-value="BLOCKER"]:not(.active)', 1)
+ .checkElementCount('.js-facet[data-value="CRITICAL"]:not(.active)', 1)
+ .checkElementCount('.js-facet.active[data-unresolved]', 1)
+ .checkElementNotInclude('.issues-filters-name', 'Critical and Blocker Issues');
});
});
.mockFromFile('/api/issues/search', 'issues-spec/search.json')
.startApp('issues')
.clickElement('.js-new-search')
- .assertElementExist('.facet[data-value=BLOCKER]')
- .assertElementExist('.facet[data-value=CRITICAL]')
- .assertElementExist('.facet[data-value=MAJOR]')
- .assertElementExist('.facet[data-value=MINOR]')
- .assertElementExist('.facet[data-value=INFO]')
-
- .assertElementExist('.facet[data-value=OPEN]')
- .assertElementExist('.facet[data-value=REOPENED]')
- .assertElementExist('.facet[data-value=CONFIRMED]')
- .assertElementExist('.facet[data-value=RESOLVED]')
- .assertElementExist('.facet[data-value=CLOSED]')
-
- .assertElementExist('.facet[data-unresolved]')
- .assertElementExist('.facet[data-value=REMOVED]')
- .assertElementExist('.facet[data-value=FIXED]')
- .assertElementExist('.facet[data-value=FALSE-POSITIVE]')
-
- .assertElementCount('.issue', 50)
- .assertElementCount('.issue.selected', 1)
- //.assertElementInclude('.issue', '1 more branches need to be covered by unit tests to reach')
-
- .assertElementExist('.js-new-search')
- .assertElementExist('.js-filter-save-as')
-
- .assertElementInclude('#issues-total', '4623')
- .assertElementExist('.js-prev')
- .assertElementExist('.js-next')
- .assertElementExist('.js-reload')
- .assertElementExist('.js-bulk-change');
+ .checkElementExist('.facet[data-value=BLOCKER]')
+ .checkElementExist('.facet[data-value=CRITICAL]')
+ .checkElementExist('.facet[data-value=MAJOR]')
+ .checkElementExist('.facet[data-value=MINOR]')
+ .checkElementExist('.facet[data-value=INFO]')
+
+ .checkElementExist('.facet[data-value=OPEN]')
+ .checkElementExist('.facet[data-value=REOPENED]')
+ .checkElementExist('.facet[data-value=CONFIRMED]')
+ .checkElementExist('.facet[data-value=RESOLVED]')
+ .checkElementExist('.facet[data-value=CLOSED]')
+
+ .checkElementExist('.facet[data-unresolved]')
+ .checkElementExist('.facet[data-value=REMOVED]')
+ .checkElementExist('.facet[data-value=FIXED]')
+ .checkElementExist('.facet[data-value=FALSE-POSITIVE]')
+
+ .checkElementCount('.issue', 50)
+ .checkElementCount('.issue.selected', 1)
+ //.checkElementInclude('.issue', '1 more branches need to be covered by unit tests to reach')
+
+ .checkElementExist('.js-new-search')
+ .checkElementExist('.js-filter-save-as')
+
+ .checkElementInclude('#issues-total', '4623')
+ .checkElementExist('.js-prev')
+ .checkElementExist('.js-next')
+ .checkElementExist('.js-reload')
+ .checkElementExist('.js-bulk-change');
});
bdd.it('should show severity facet', function () {
.mockFromFile('/api/issues/search', 'issues-spec/search.json')
.startApp('issues')
.clickElement('.js-new-search')
- .waitForElementCount('.issue', 50)
+ .checkElementCount('.issue', 50)
.clearMocks()
.mockFromFile('/api/issues/search', 'issues-spec/search-reopened.json', { data: { severities: 'BLOCKER' } })
.clickElement('.facet[data-value=BLOCKER]')
- .waitForElementCount('.issue', 4);
+ .checkElementCount('.issue', 4);
});
bdd.it('should select issues', function () {
.mockFromFile('/api/issues/search', 'issues-spec/search.json')
.startApp('issues')
.clickElement('.js-new-search')
- .assertElementExist('.js-selection')
- .assertElementNotExist('.js-selection.icon-checkbox-checked')
- .assertElementExist('.issue .js-toggle')
- .assertElementCount('.js-toggle', 50)
- .assertElementNotExist(issueSelector + ' .js-toggle .icon-checkbox-checked')
+ .checkElementExist('.js-selection')
+ .checkElementNotExist('.js-selection.icon-checkbox-checked')
+ .checkElementExist('.issue .js-toggle')
+ .checkElementCount('.js-toggle', 50)
+ .checkElementNotExist(issueSelector + ' .js-toggle .icon-checkbox-checked')
.clickElement(issueSelector + ' .js-toggle')
- .assertElementExist(issueSelector + ' .js-toggle .icon-checkbox-checked')
- .assertElementExist('.js-selection.icon-checkbox-single.icon-checkbox-checked')
+ .checkElementExist(issueSelector + ' .js-toggle .icon-checkbox-checked')
+ .checkElementExist('.js-selection.icon-checkbox-single.icon-checkbox-checked')
.clickElement('.js-selection')
- .assertElementNotExist('.js-selection.icon-checkbox-checked')
- .assertElementNotExist('.js-toggle .icon-checkbox-checked')
+ .checkElementNotExist('.js-selection.icon-checkbox-checked')
+ .checkElementNotExist('.js-toggle .icon-checkbox-checked')
.clickElement('.js-selection')
- .assertElementExist('.js-selection.icon-checkbox-checked')
- .assertElementCount('.js-toggle .icon-checkbox-checked', 50);
+ .checkElementExist('.js-selection.icon-checkbox-checked')
+ .checkElementCount('.js-toggle .icon-checkbox-checked', 50);
});
bdd.it('should bulk change issues', function () {
.clickElement('.js-new-search')
.clickElement('#issues-bulk-change')
.clickElement('.js-bulk-change')
- .assertElementExist('#bulk-change-form')
- .assertElementInclude('#bulk-change-form', 'bulk change form');
+ .checkElementExist('#bulk-change-form')
+ .checkElementInclude('#bulk-change-form', 'bulk change form');
});
bdd.it('should bulk change selected issues', function () {
'<div id="bulk-change-form">bulk change form</div>', { contentType: 'text/plain' })
.startApp('issues')
.clickElement('.js-new-search')
- .assertElementExist('.js-selection')
- .assertElementNotExist('.js-selection.icon-checkbox-checked')
- .assertElementExist('.issue .js-toggle')
- .assertElementNotExist(issueSelector + ' .js-toggle .icon-checkbox-checked')
+ .checkElementExist('.js-selection')
+ .checkElementNotExist('.js-selection.icon-checkbox-checked')
+ .checkElementExist('.issue .js-toggle')
+ .checkElementNotExist(issueSelector + ' .js-toggle .icon-checkbox-checked')
.clickElement(issueSelector + ' .js-toggle')
- .assertElementExist(issueSelector + ' .js-toggle .icon-checkbox-checked')
- .assertElementExist('.js-selection.icon-checkbox-single.icon-checkbox-checked')
+ .checkElementExist(issueSelector + ' .js-toggle .icon-checkbox-checked')
+ .checkElementExist('.js-selection.icon-checkbox-single.icon-checkbox-checked')
.clickElement('#issues-bulk-change')
.clickElement('.js-bulk-change-selected')
- .assertElementExist('#bulk-change-form')
- .assertElementInclude('#bulk-change-form', 'bulk change form')
+ .checkElementExist('#bulk-change-form')
+ .checkElementInclude('#bulk-change-form', 'bulk change form')
.clearMocks()
.mockFromFile('/api/issues/search', 'issues-spec/search-changed.json')
.execute(function () {
window.onBulkIssues();
})
- .assertElementExist(issueSelector + ' .js-issue-set-severity .icon-severity-blocker')
- .assertElementExist(issueSelector + ' .js-toggle .icon-checkbox-checked');
+ .checkElementExist(issueSelector + ' .js-issue-set-severity .icon-severity-blocker')
+ .checkElementExist(issueSelector + ' .js-toggle .icon-checkbox-checked');
});
bdd.it('should filter similar issues', function () {
.startApp('issues')
.clickElement('.js-new-search')
.clickElement('.issue.selected .js-issue-filter')
- .assertElementExist('.bubble-popup')
- .assertElementExist('.bubble-popup [data-property="severities"][data-value="MAJOR"]')
- .assertElementExist('.bubble-popup [data-property="statuses"][data-value="CONFIRMED"]')
- .assertElementExist('.bubble-popup [data-property="resolved"][data-value="false"]')
- .assertElementExist('.bubble-popup [data-property="rules"][data-value="squid:S1214"]')
- .assertElementExist('.bubble-popup [data-property="assigned"][data-value="false"]')
- .assertElementExist('.bubble-popup [data-property="planned"][data-value="false"]')
- .assertElementExist('.bubble-popup [data-property="tags"][data-value="bad-practice"]')
- .assertElementExist('.bubble-popup [data-property="tags"][data-value="brain-overload"]')
- .assertElementExist('.bubble-popup [data-property="projectUuids"][data-value="69e57151-be0d-4157-adff-c06741d88879"]')
- .assertElementExist('.bubble-popup [data-property="moduleUuids"][data-value="7feef7c3-11b9-4175-b5a7-527ca3c75cb7"]')
- .assertElementExist('.bubble-popup [data-property="fileUuids"][data-value="b0517331-0aaf-4091-b5cf-8e305dd0337a"]')
+ .checkElementExist('.bubble-popup')
+ .checkElementExist('.bubble-popup [data-property="severities"][data-value="MAJOR"]')
+ .checkElementExist('.bubble-popup [data-property="statuses"][data-value="CONFIRMED"]')
+ .checkElementExist('.bubble-popup [data-property="resolved"][data-value="false"]')
+ .checkElementExist('.bubble-popup [data-property="rules"][data-value="squid:S1214"]')
+ .checkElementExist('.bubble-popup [data-property="assigned"][data-value="false"]')
+ .checkElementExist('.bubble-popup [data-property="planned"][data-value="false"]')
+ .checkElementExist('.bubble-popup [data-property="tags"][data-value="bad-practice"]')
+ .checkElementExist('.bubble-popup [data-property="tags"][data-value="brain-overload"]')
+ .checkElementExist('.bubble-popup [data-property="projectUuids"][data-value="69e57151-be0d-4157-adff-c06741d88879"]')
+ .checkElementExist('.bubble-popup [data-property="moduleUuids"][data-value="7feef7c3-11b9-4175-b5a7-527ca3c75cb7"]')
+ .checkElementExist('.bubble-popup [data-property="fileUuids"][data-value="b0517331-0aaf-4091-b5cf-8e305dd0337a"]')
.clickElement('.bubble-popup [data-property="severities"]')
- .waitForElementCount('.issue', 17);
+ .checkElementCount('.issue', 17);
});
});
.mockFromString('/api/l10n/index', '{}')
.mockFromFile('/api/users/search', 'users-spec/search.json')
.startApp('users')
- .assertElementCount('#users-list ul', 1)
- .assertElementCount('#users-list li[data-login]', 3)
- .assertElementInclude('#users-list .js-user-login', 'smith')
- .assertElementInclude('#users-list .js-user-name', 'Bob')
- .assertElementInclude('#users-list .js-user-email', 'bob@example.com')
- .assertElementCount('#users-list .js-user-update', 3)
- .assertElementCount('#users-list .js-user-change-password', 3)
- .assertElementCount('#users-list .js-user-deactivate', 3)
- //.assertElementInclude('#users-list-footer', '3/3')
- .assertElementNotInclude('[data-login="ryan"]', 'another@example.com')
+ .checkElementCount('#users-list ul', 1)
+ .checkElementCount('#users-list li[data-login]', 3)
+ .checkElementInclude('#users-list .js-user-login', 'smith')
+ .checkElementInclude('#users-list .js-user-name', 'Bob')
+ .checkElementInclude('#users-list .js-user-email', 'bob@example.com')
+ .checkElementCount('#users-list .js-user-update', 3)
+ .checkElementCount('#users-list .js-user-change-password', 3)
+ .checkElementCount('#users-list .js-user-deactivate', 3)
+ //.checkElementInclude('#users-list-footer', '3/3')
+ .checkElementNotInclude('[data-login="ryan"]', 'another@example.com')
.clickElement('[data-login="ryan"] .js-user-more-scm')
- .assertElementInclude('[data-login="ryan"]', 'another@example.com')
- .assertElementNotInclude('[data-login="ryan"]', 'four')
+ .checkElementInclude('[data-login="ryan"]', 'another@example.com')
+ .checkElementNotInclude('[data-login="ryan"]', 'four')
.clickElement('[data-login="ryan"] .js-user-more-groups')
- .assertElementInclude('[data-login="ryan"]', 'four');
+ .checkElementInclude('[data-login="ryan"]', 'four');
});
bdd.it('should search users', function () {
.mockFromString('/api/l10n/index', '{}')
.mockFromFile('/api/users/search', 'users-spec/search.json')
.startApp('users')
- .assertElementCount('#users-list ul', 1)
- .assertElementCount('#users-list li[data-login]', 3)
+ .checkElementCount('#users-list ul', 1)
+ .checkElementCount('#users-list li[data-login]', 3)
.clearMocks()
.mockFromFile('/api/users/search', 'users-spec/search-filtered.json')
.fillElement('#users-search-query', 'ryan')
.clickElement('#users-search-submit')
.waitForDeletedByCssSelector('[data-login="admin"]')
- .assertElementCount('#users-list li[data-login]', 1)
+ .checkElementCount('#users-list li[data-login]', 1)
.clearMocks()
.mockFromFile('/api/users/search', 'users-spec/search.json')
.fillElement('#users-search-query', '')
.clickElement('#users-search-submit')
- .assertElementCount('[data-login="admin"]', 1)
- .assertElementCount('#users-list li[data-login]', 3);
+ .checkElementCount('[data-login="admin"]', 1)
+ .checkElementCount('#users-list li[data-login]', 3);
});
bdd.it('should show more', function () {
.mockFromString('/api/l10n/index', '{}')
.mockFromFile('/api/users/search', 'users-spec/search-big-1.json')
.startApp('users')
- .assertElementCount('#users-list ul', 1)
- .assertElementCount('#users-list li[data-login]', 2)
+ .checkElementCount('#users-list ul', 1)
+ .checkElementCount('#users-list li[data-login]', 2)
.clearMocks()
.mockFromFile('/api/users/search', 'users-spec/search-big-2.json')
.clickElement('#users-fetch-more')
- .assertElementCount('[data-login="ryan"]', 1)
- .assertElementCount('#users-list li[data-login]', 3);
+ .checkElementCount('[data-login="ryan"]', 1)
+ .checkElementCount('#users-list li[data-login]', 3);
});
bdd.it('should create a new user', function () {
.mockFromString('/api/l10n/index', '{}')
.mockFromFile('/api/users/search', 'users-spec/search.json')
.startApp('users')
- .assertElementCount('#users-list ul', 1)
- .assertElementCount('#users-list li[data-login]', 3)
+ .checkElementCount('#users-list ul', 1)
+ .checkElementCount('#users-list li[data-login]', 3)
.clickElement('#users-create')
- .assertElementCount('#create-user-form', 1)
+ .checkElementCount('#create-user-form', 1)
.clearMocks()
.mockFromFile('/api/users/search', 'users-spec/search-created.json')
.mockFromString('/api/users/create', '{}')
jQuery('[name="scmAccounts"]').last().val('scm2');
})
.clickElement('#create-user-submit')
- .assertElementCount('[data-login="login"]', 1)
- .assertElementCount('#users-list li[data-login]', 4)
- .assertElementInclude('#users-list .js-user-login', 'login')
- .assertElementInclude('#users-list .js-user-name', 'name')
- .assertElementInclude('#users-list .js-user-email', 'email@example.com');
+ .checkElementCount('[data-login="login"]', 1)
+ .checkElementCount('#users-list li[data-login]', 4)
+ .checkElementInclude('#users-list .js-user-login', 'login')
+ .checkElementInclude('#users-list .js-user-name', 'name')
+ .checkElementInclude('#users-list .js-user-email', 'email@example.com');
});
bdd.it('should update a user', function () {
.mockFromString('/api/l10n/index', '{}')
.mockFromFile('/api/users/search', 'users-spec/search.json')
.startApp('users')
- .assertElementCount('#users-list ul', 1)
+ .checkElementCount('#users-list ul', 1)
.clickElement('[data-login="smith"] .js-user-update')
- .assertElementCount('#create-user-form', 1)
+ .checkElementCount('#create-user-form', 1)
.clearMocks()
.mockFromFile('/api/users/search', 'users-spec/search-updated.json')
.mockFromString('/api/users/update', '{}')
})
.clickElement('#create-user-submit')
.waitForDeletedByCssSelector('#create-user-form')
- .assertElementInclude('[data-login="smith"] .js-user-login', 'smith')
- .assertElementInclude('[data-login="smith"] .js-user-name', 'Mike')
- .assertElementInclude('[data-login="smith"] .js-user-email', 'mike@example.com');
+ .checkElementInclude('[data-login="smith"] .js-user-login', 'smith')
+ .checkElementInclude('[data-login="smith"] .js-user-name', 'Mike')
+ .checkElementInclude('[data-login="smith"] .js-user-email', 'mike@example.com');
});
bdd.it('should change user\'s password', function () {
.mockFromString('/api/l10n/index', '{}')
.mockFromFile('/api/users/search', 'users-spec/search.json')
.startApp('users')
- .assertElementCount('#users-list ul', 1)
+ .checkElementCount('#users-list ul', 1)
.clickElement('[data-login="smith"] .js-user-change-password')
- .assertElementCount('#change-user-password-form', 1)
+ .checkElementCount('#change-user-password-form', 1)
.clearMocks()
.mockFromString('/api/users/change_password', '{}')
.execute(function () {
jQuery('#change-user-password-password-confirmation').val('another');
})
.clickElement('#change-user-password-submit')
- .assertElementCount('.alert.alert-danger', 1)
+ .checkElementCount('.alert.alert-danger', 1)
.execute(function () {
jQuery('#change-user-password-password').val('secret');
jQuery('#change-user-password-password-confirmation').val('secret');
.mockFromString('/api/l10n/index', '{}')
.mockFromFile('/api/users/search', 'users-spec/search.json')
.startApp('users')
- .assertElementCount('#users-list ul', 1)
+ .checkElementCount('#users-list ul', 1)
.clickElement('[data-login="smith"] .js-user-deactivate')
- .assertElementCount('#deactivate-user-form', 1)
+ .checkElementCount('#deactivate-user-form', 1)
.clearMocks()
.mockFromString('/api/users/deactivate', '{}')
.clickElement('#deactivate-user-submit')