summaryrefslogtreecommitdiff
path: root/src/utils.js
diff options
context:
space:
mode:
authoreug-vs <eug-vs@keemail.me>2020-11-11 01:11:01 +0300
committereug-vs <eug-vs@keemail.me>2020-11-11 01:11:01 +0300
commitc687f40c206e1d1f874e91dd396c8d68c64c83f2 (patch)
tree4776bd99d32b79591b21f19b637e4a3927d0d214 /src/utils.js
parenta52bf99bbf2d394685f92aa13b5bff438ff8ef0a (diff)
downloadbsu-fantom-c687f40c206e1d1f874e91dd396c8d68c64c83f2.tar.gz
refactor: move click handlers to utils
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
+};