summaryrefslogtreecommitdiff
path: root/src/handlers/utils.js
diff options
context:
space:
mode:
authoreug-vs <eug-vs@keemail.me>2020-11-14 16:35:14 +0300
committereug-vs <eug-vs@keemail.me>2020-11-14 16:37:23 +0300
commit4f0561acef93970f69b0ddda1cea132532355e7d (patch)
tree4abff57990993be797538462f92935015ef46ae0 /src/handlers/utils.js
parent36465387454cdb797f886f732d40a70faa92cbad (diff)
downloadbsu-fantom-4f0561acef93970f69b0ddda1cea132532355e7d.tar.gz
refactor: create handlers folder
Diffstat (limited to 'src/handlers/utils.js')
-rw-r--r--src/handlers/utils.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/handlers/utils.js b/src/handlers/utils.js
new file mode 100644
index 0000000..cf9fe38
--- /dev/null
+++ b/src/handlers/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
+};