@@ -4,7 +4,7 @@ import { WAIT_SECONDS } from './constants';
44 * Check if element exists
55 *
66 * @param {string } selector to be checked
7- * @param {int } seconds to wait
7+ * @param {number } seconds to wait
88 * @returns {Promise<boolean> } True if element exists or false if element doesn't exist
99 */
1010export async function checkIfElementExists ( selector , seconds = WAIT_SECONDS ) {
@@ -17,7 +17,7 @@ export async function checkIfElementExists(selector, seconds = WAIT_SECONDS) {
1717 * Checks whether a non-required selector is already present on the page.
1818 *
1919 * @param {string } selector DOM selector to seek
20- * @return {boolean } Whether element exists
20+ * @return {Promise< boolean> } Whether element exists
2121 */
2222export async function elementExists ( selector ) {
2323 return $ ( selector ) . isDisplayed ( ) ;
@@ -27,7 +27,7 @@ export async function elementExists(selector) {
2727 * Assert URL
2828 *
2929 * @param {string } url to be asserted
30- * @param {int } seconds to wait
30+ * @param {number } seconds to wait
3131 * @return {Promise<boolean> } return if url matched
3232 */
3333export async function checkUrl ( url , seconds = WAIT_SECONDS ) {
@@ -46,7 +46,7 @@ export async function checkUrl(url, seconds = WAIT_SECONDS) {
4646 * Assert URL Regex
4747 *
4848 * @param {string } url to be asserted
49- * @param {int } seconds to wait
49+ * @param {number } seconds to wait
5050 * @return {Promise<boolean> } return if url match regex
5151 */
5252export async function checkUrlMatch ( url , seconds = WAIT_SECONDS ) {
@@ -65,7 +65,7 @@ export async function checkUrlMatch(url, seconds = WAIT_SECONDS) {
6565 * Check webpage title
6666 *
6767 * @param {string } title of webpage
68- * @param {int } seconds to wait
68+ * @param {number } seconds to wait
6969 * @return {Promise<boolean> } return if title matched
7070 */
7171export async function checkTitle ( title , seconds = WAIT_SECONDS ) {
@@ -83,10 +83,10 @@ export async function checkTitle(title, seconds = WAIT_SECONDS) {
8383/**
8484 * Check a specific element contains certain text.
8585 *
86- * @param {Element } element Already-located element.
86+ * @param {WebdriverIO. Element } element Already-located element.
8787 * @param {string } content Expected content.
88- * @param {int } seconds Number of seconds to wait.
89- * @returns {any } `waitUntil()` result.
88+ * @param {number } seconds Number of seconds to wait.
89+ * @returns {Promise< any> } `waitUntil()` result.
9090 */
9191async function checkText ( element , content , seconds = WAIT_SECONDS ) {
9292 return browser . waitUntil (
@@ -110,7 +110,7 @@ async function checkText(element, content, seconds = WAIT_SECONDS) {
110110 *
111111 * @param {string } selector of content
112112 * @param {string } content text
113- * @param {int } seconds to wait
113+ * @param {number } seconds to wait
114114 * @return {Promise<boolean> } return if text exist
115115 */
116116export async function checkSelectorContent ( selector , content , seconds = WAIT_SECONDS ) {
@@ -130,8 +130,8 @@ export async function checkSelectorContent(selector, content, seconds = WAIT_SEC
130130 *
131131 * @param {string } selector DOM element selector.
132132 * @param {string } content text
133- * @param {int } seconds to wait
134- * @returns {any } `waitUntil()` result, assuming 1+ elements visible.
133+ * @param {number } seconds to wait
134+ * @returns {Promise< any> } `waitUntil()` result, assuming 1+ elements visible.
135135 */
136136export async function checkVisibleSelectorContent ( selector , content , seconds = WAIT_SECONDS ) {
137137 console . log ( `CHECK: First visible element "${ selector } " contains content "${ content } "` ) ;
0 commit comments