summaryrefslogtreecommitdiff
path: root/src/utils.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils.js')
-rw-r--r--src/utils.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/utils.js b/src/utils.js
new file mode 100644
index 0000000..cf9fe38
--- /dev/null
+++ b/src/utils.js
@@ -0,0 +1,13 @@
+const clickElementByXPath = (page, xPath) => page
+ .waitForXPath(xPath)
+ .then(item => item.click());
+
+const clickElementBySelector = (page, selector) => page
+ .waitForSelector(selector)
+ .then(item => item.click());
+
+
+module.exports = {
+ clickElementByXPath,
+ clickElementBySelector
+};