froth-webdriverio-framework 3.0.87 → 3.0.88

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.
@@ -7,6 +7,7 @@ let scrollToLeft = null;
7
7
  let scrollToRight = null;
8
8
  let scrollDownToView = null;
9
9
  let scrollRightToView = null;
10
+ let scrollUpUntilVisible = null;
10
11
 
11
12
  let swipeRight = null;
12
13
  let swipeLeft = null;
@@ -54,6 +55,8 @@ scrollToRight = require(basepath + '/scroll').scrollToRight;
54
55
  scrollDownToView = require(basepath + '/scroll').scrollDownToView;
55
56
  scrollRightToView = require(basepath + '/scroll').scrollRightToView;
56
57
  scrollIntoView = require(basepath + '/scroll').scrollIntoView;
58
+ scrollUpUntilVisible = require(basepath + '/scroll').scrollupUntilVisible;
59
+
57
60
 
58
61
  swipeDown = require(basepath + '/swipe').swipedown;
59
62
  swipeLeft = require(basepath + '/swipe').swipeleft;
@@ -113,6 +116,7 @@ module.exports = {
113
116
  storevalue,
114
117
  storeattributevalue,
115
118
  scrollIntoView,
119
+ scrollUpUntilVisible,
116
120
  api,
117
121
  validate,
118
122
  selectDropDownValue,
@@ -47,18 +47,18 @@ function generateJWTToken(payload) {
47
47
  //console.log('Signed and encoded JWT', jwt)
48
48
 
49
49
 
50
- function main() {
51
- // JWT Payload
52
- const payload = {
53
- iss: "YTLC_TEST_AUTOMATION_APP",
54
- iat: currentTimestamp, // Issued at
55
- exp: currentTimestamp + 200, // Expiry time: 30 seconds from issuance
56
- user_agent: {
57
- id: "janga.reddy@ytl.com"
58
- }
59
- };
50
+ // function main() {
51
+ // // JWT Payload
52
+ // const payload = {
53
+ // iss: "YTLC_TEST_AUTOMATION_APP",
54
+ // iat: currentTimestamp, // Issued at
55
+ // exp: currentTimestamp + 200, // Expiry time: 30 seconds from issuance
56
+ // user_agent: {
57
+ // id: "janga.reddy@ytl.com"
58
+ // }
59
+ // };
60
60
 
61
- console.log('JWT signed token:', generateJWTToken(payload));
62
- }
61
+ // console.log('JWT signed token:', generateJWTToken(payload));
62
+ // }
63
63
  //main()
64
64
  module.exports = { generateJWTToken}
@@ -79,4 +79,26 @@ async function scrollIntoView(element){
79
79
  console.error(error.message);
80
80
  }
81
81
  }
82
- module.exports = { scrollToEnd, scrollToLeft, scrollToBeginning, scrollRightToView, scrollDownToView, scrollToRight ,scrollIntoView};
82
+
83
+ async function scrollupUntilVisible(selector) {
84
+ const element = await $(selector);
85
+
86
+ while (!(await element.isDisplayed())) {
87
+ await driver.performActions([
88
+ {
89
+ type: 'pointer',
90
+ id: 'finger1',
91
+ parameters: { pointerType: 'touch' },
92
+ actions: [
93
+ { type: 'pointerMove', duration: 0, x: 200, y: 800 },
94
+ { type: 'pointerDown', button: 0 },
95
+ { type: 'pause', duration: 100 },
96
+ { type: 'pointerMove', duration: 500, x: 200, y: 200 },
97
+ { type: 'pointerUp', button: 0 }
98
+ ]
99
+ }
100
+ ]);
101
+ await browser.pause(500);
102
+ }
103
+ }
104
+ module.exports = { scrollToEnd, scrollToLeft, scrollToBeginning, scrollRightToView, scrollDownToView, scrollToRight ,scrollIntoView,scrollupUntilVisible};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "froth-webdriverio-framework",
3
- "version": "3.0.87",
3
+ "version": "3.0.88",
4
4
  "readme": "WebdriverIO Integration",
5
5
  "description": "WebdriverIO and BrowserStack App Automate",
6
6
  "license": "MIT",