Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/command/definitions.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,9 @@ module.exports = function (genPath, options) {

function addAllMethodsInObject(supportObj, actions, methods, translations) {
for (const action of methodsOfObject(supportObj)) {
let fn = supportObj[action];
const fn = supportObj[action];
if (!fn.name) {
Object.defineProperty(fn, "name", {value: action});
Object.defineProperty(fn, 'name', { value: action });
}
const actionAlias = translations ? translations.actionAliasFor(action) : action;
if (!actions[actionAlias]) {
Expand Down
2 changes: 1 addition & 1 deletion lib/helper/WebDriver.js
Original file line number Diff line number Diff line change
Expand Up @@ -1950,7 +1950,7 @@ async function proceedSee(assertType, text, context, strict = false) {
const selected = await forEachAsync(res, async el => this.browser.getElementText(getElementId(el)));

if (strict) {
if (Array.isArray(selected)) {
if (Array.isArray(selected) && selected.length !== 0) {
return selected.map(elText => equals(description)[assertType](text, elText));
}
return equals(description)[assertType](text, selected);
Expand Down
2 changes: 1 addition & 1 deletion lib/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ function getParams(fn) {
});
return params;
} catch (err) {
console.log('Error in ' + newFn.toString());
console.log(`Error in ${newFn.toString()}`);
console.error(err);
}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const isGenerator = module.exports.isGenerator = function (fn) {
};

const isFunction = module.exports.isFunction = function (fn) {
return typeof fn === 'function'
return typeof fn === 'function';
};

const isAsyncFunction = module.exports.isAsyncFunction = function (fn) {
Expand Down
7 changes: 7 additions & 0 deletions test/helper/WebDriver_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,13 @@ describe('WebDriver', function () {
// e.should.be.instanceOf(AssertionFailedError);
// e.inspect().should.include("expected element h1 'Welcome to test app' to equal 'Welcome to test app!'");
}));

it('should check text is not equal to empty string of element text', () => wd.amOnPage('https://codecept.discourse.group/')
.then(() => wd.seeTextEquals('This is not empty', '[id="site-logo"]'))
.catch((e) => {
e.should.be.instanceOf(Error);
e.message.should.be.equal('expected element [id="site-logo"] "This is not empty" to equal ""');
}));
});

describe('#waitForFunction', () => {
Expand Down