froth-webdriverio-framework 2.0.32 → 2.0.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -23,6 +23,7 @@ let storevalue = null;
23
23
  let storeattributevalue = null;
24
24
  let assertAttributeValue = null;
25
25
  let basepath = null;
26
+ let scrollIntoView = null;
26
27
  if (process.env.LOCATION == 'local') {
27
28
  basepath = ".";
28
29
  } else {
@@ -35,6 +36,7 @@ scrollToLeft = require(basepath + '/scroll').scrollToLeft;
35
36
  scrollToRight = require(basepath + '/scroll').scrollToRight;
36
37
  scrollDownToView = require(basepath + '/scroll').scrollDownToView;
37
38
  scrollRightToView = require(basepath + '/scroll').scrollRightToView;
39
+ scrollIntoView = require(basepath + '/scroll').scrollIntoView;
38
40
 
39
41
  clickIfVisible = require(basepath + "/clickIfVisible");
40
42
 
@@ -100,6 +102,7 @@ module.exports = {
100
102
  randomregex,
101
103
  storetext,
102
104
  storevalue,
103
- storeattributevalue
105
+ storeattributevalue,
106
+ scrollIntoView
104
107
 
105
108
  };
@@ -1,6 +1,6 @@
1
1
  // Function to verify text in Android app
2
2
 
3
- async function assertText(driver, elementSelector, expectedText) {
3
+ async function assertText(elementSelector, expectedText) {
4
4
 
5
5
 
6
6
  console.log("inside the assert text function" + elementSelector)
@@ -31,7 +31,7 @@ async function assertText(driver, elementSelector, expectedText) {
31
31
 
32
32
  }
33
33
 
34
- async function assertAttributeValue(driver, elementSelector, attributeName, expectedText) {
34
+ async function assertAttributeValue(elementSelector, attributeName, expectedText) {
35
35
 
36
36
 
37
37
  console.log("inside the assertAttributeValue function" + elementSelector)
@@ -66,4 +66,17 @@ async function scrollToRight(steps) {
66
66
  console.error(error.message);
67
67
  }
68
68
  }
69
- module.exports = { scrollToEnd, scrollToLeft, scrollToBeginning, scrollRightToView, scrollDownToView, scrollToRight };
69
+
70
+ async function scrollIntoView(element){
71
+ try{
72
+ const elem = await $(element);
73
+ // scroll to specific element
74
+ await elem.scrollIntoView();
75
+ // center element within the viewport
76
+ await elem.scrollIntoView({ block: 'center', inline: 'center' });
77
+
78
+ }catch(error){
79
+ console.error(error.message);
80
+ }
81
+ }
82
+ module.exports = { scrollToEnd, scrollToLeft, scrollToBeginning, scrollRightToView, scrollDownToView, scrollToRight ,scrollIntoView};
@@ -0,0 +1,29 @@
1
+ async function swipeleft(selector,xoffset,speedinsec) {
2
+ try {
3
+ console.log('Swiping left');
4
+
5
+ if(xoffset == null){
6
+ browser.swipeLeft(selector,speedinsec);
7
+ }else{
8
+ browser.swipeLeft(selector,xoffset,speedinsec);
9
+ }
10
+ } catch (error) {
11
+ console.error(error.message);
12
+ }
13
+
14
+ }
15
+
16
+ async function swiperight(selector,xoffset,speedinsec) {
17
+ try {
18
+ console.log('Swiping left');
19
+
20
+ if(xoffset == null){
21
+ browser.swipeRight(selector,speedinsec);
22
+ }else{
23
+ browser.swipeRight(selector,xoffset,speedinsec);
24
+ }
25
+ } catch (error) {
26
+ console.error(error.message);
27
+ }
28
+
29
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "froth-webdriverio-framework",
3
- "version": "2.0.32",
3
+ "version": "2.0.33",
4
4
  "readme": "WebdriverIO Integration",
5
5
  "description": "WebdriverIO and BrowserStack App Automate",
6
6
  "license": "MIT",