Skip to content

Commit

Permalink
Document t argument, unconditionally return result
Browse files Browse the repository at this point in the history
  • Loading branch information
zcorpan committed Mar 6, 2020
1 parent c16088f commit 8ea952a
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions test/util/queryElements.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const { By } = require('selenium-webdriver');
/**
* Return an array of elements by selector. Wraps Selenium's findElements, but with a failing text for empty queries
*
* @param {ExecutionContext} t - Test execution context
* @param {String} selector - CSS selector string
* @param {Element} context - Element to query within, defaulting to t.context.session
*
Expand All @@ -17,9 +18,6 @@ module.exports = async function queryElements(t, selector, context) {
const result = await context.findElements(By.css(selector));
if (result.length === 0) {
t.fail(`Element query returned no results: ${selector}`);
return [];
}
else {
return result;
}
return result;
}

0 comments on commit 8ea952a

Please sign in to comment.