froth-webdriverio-framework 4.0.67 → 4.0.69
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.
|
@@ -41,6 +41,7 @@ let scrollIntoView = null;
|
|
|
41
41
|
let api = null;
|
|
42
42
|
|
|
43
43
|
let selectDropDownValue = null;
|
|
44
|
+
let selectDropDownText = null;
|
|
44
45
|
|
|
45
46
|
let acceptAlert = null;
|
|
46
47
|
let dismissAlert = null;
|
|
@@ -100,6 +101,7 @@ api = require(basepath + '/apicall').callapi;
|
|
|
100
101
|
validate = require(basepath + '/apicall').validate;
|
|
101
102
|
|
|
102
103
|
selectDropDownValue = require(basepath + '/dropDown').select4mDropDownValue;
|
|
104
|
+
selectDropDownText= require(basepath + '/dropDown').select4mDropDownText;
|
|
103
105
|
|
|
104
106
|
acceptAlert = require(basepath + '/alert.js').acceptalert;
|
|
105
107
|
dismissAlert = require(basepath + '/alert.js').dismissalert;
|
|
@@ -136,6 +138,7 @@ module.exports = {
|
|
|
136
138
|
api,
|
|
137
139
|
validate,
|
|
138
140
|
selectDropDownValue,
|
|
141
|
+
selectDropDownText,
|
|
139
142
|
acceptAlert,
|
|
140
143
|
dismissAlert,
|
|
141
144
|
swipeLeft,
|
|
@@ -1,13 +1,26 @@
|
|
|
1
1
|
async function acceptalert() {
|
|
2
2
|
|
|
3
3
|
try {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
let alertFound = false;
|
|
5
|
+
for (let i = 0; i < 6; i++) {
|
|
6
|
+
if (await browser.isAlertOpen()) {
|
|
7
|
+
alertFound = true;
|
|
8
|
+
break;
|
|
9
|
+
}
|
|
10
|
+
await browser.pause(10000); // wait for 10 seconds
|
|
11
|
+
}
|
|
12
|
+
if (!alertFound) {
|
|
13
|
+
console.log('Expected alert to appear but it did not');
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
// await browser.waitUntil(async () => {
|
|
17
|
+
// return await browser.isAlertOpen();
|
|
18
|
+
// }, {
|
|
19
|
+
// timeout: 5000,
|
|
20
|
+
// timeoutMsg: 'Expected alert to appear but it did not'
|
|
21
|
+
// });
|
|
10
22
|
await browser.acceptAlert();
|
|
23
|
+
|
|
11
24
|
} catch (e) {
|
|
12
25
|
console.log("error occured while accepting alert", e)
|
|
13
26
|
}
|
|
@@ -10,6 +10,15 @@ async function select4mDropDownValue(elementSelector, selectOption) {
|
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
+
async function select4mDropDownText(elementSelector, visibleText) {
|
|
14
|
+
try {
|
|
15
|
+
await $(elementSelector).selectByVisibleText(visibleText);
|
|
16
|
+
} catch (error) {
|
|
17
|
+
console.error('Error occurred while selecting the option by text:', error);
|
|
18
|
+
let annotationMessage = `Error occurred while selecting the option by text: ${error.message}.`;
|
|
19
|
+
await amendToBrowserstack(annotationMessage, "error");
|
|
20
|
+
}
|
|
21
|
+
}
|
|
13
22
|
|
|
14
23
|
async function amendToBrowserstack(annotationMessage, level) {
|
|
15
24
|
try {
|
|
@@ -20,4 +29,4 @@ async function amendToBrowserstack(annotationMessage, level) {
|
|
|
20
29
|
// throw error;
|
|
21
30
|
}
|
|
22
31
|
}
|
|
23
|
-
module.exports = { select4mDropDownValue };
|
|
32
|
+
module.exports = { select4mDropDownValue,select4mDropDownText };
|
|
@@ -25,13 +25,7 @@ let capabilities;
|
|
|
25
25
|
try {
|
|
26
26
|
capabilities = yaml.load(fs.readFileSync(path.join(path.resolve(process.cwd(), configFile)), 'utf8'));
|
|
27
27
|
// Merge chrome-specific options if applicable
|
|
28
|
-
|
|
29
|
-
capabilities['goog:chromeOptions'] = {
|
|
30
|
-
prefs: {
|
|
31
|
-
'profile.default_content_setting_values.notifications': 2
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
}
|
|
28
|
+
|
|
35
29
|
} catch (e) {
|
|
36
30
|
const errorMsg = `The capability file does not exist in the currently configured repository at path: ${path.resolve(process.cwd(), configFile)}: ${e.message},Please update the Capability by editing the file`;
|
|
37
31
|
console.error(errorMsg);
|