froth-webdriverio-framework 7.0.119-dev1.3 → 7.0.119-dev1.5
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.
|
@@ -1,57 +1,117 @@
|
|
|
1
1
|
module.exports = (bsCaps) => {
|
|
2
2
|
const browserName = (bsCaps.browserName || 'chrome').toLowerCase();
|
|
3
3
|
|
|
4
|
-
//
|
|
5
|
-
const
|
|
6
|
-
chrome: '
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
// Normalize browser names for WebDriver
|
|
5
|
+
const browserNameMap = {
|
|
6
|
+
chrome: 'chrome',
|
|
7
|
+
chromium: 'chrome',
|
|
8
|
+
firefox: 'firefox',
|
|
9
|
+
edge: 'MicrosoftEdge',
|
|
10
|
+
msedge: 'MicrosoftEdge',
|
|
11
|
+
'microsoft edge': 'MicrosoftEdge',
|
|
12
|
+
safari: 'safari',
|
|
13
|
+
ie: 'internet explorer',
|
|
14
|
+
'internet explorer': 'internet explorer',
|
|
15
|
+
'internet-explorer': 'internet explorer'
|
|
12
16
|
};
|
|
13
17
|
|
|
14
|
-
const
|
|
18
|
+
const normalizedBrowserName = browserNameMap[browserName] || 'chrome';
|
|
15
19
|
|
|
16
20
|
const config = {
|
|
17
|
-
|
|
21
|
+
// selenium-standalone-service automatically handles all browser drivers
|
|
22
|
+
// - Downloads Selenium Server JAR to node_modules/ (no admin needed)
|
|
23
|
+
// - Auto-downloads chromedriver, geckodriver, etc. on first run
|
|
24
|
+
// - Caches drivers locally after first download
|
|
25
|
+
// - Supports: Chrome, Firefox, Edge, Safari, IE
|
|
26
|
+
services: [['selenium-standalone', {
|
|
27
|
+
// Check for updates (set to false to use cached version)
|
|
28
|
+
checkArgs: false,
|
|
29
|
+
// Skip Selenium installation if already present (speeds up subsequent runs)
|
|
30
|
+
skipSeleniumInstall: false,
|
|
31
|
+
// Custom arguments for Selenium Server
|
|
32
|
+
seleniumArgs: [],
|
|
33
|
+
// Custom arguments for drivers
|
|
34
|
+
drivers: {
|
|
35
|
+
chrome: {
|
|
36
|
+
version: 'LATEST', // Always use latest ChromeDriver
|
|
37
|
+
baseURL: 'https://chromedriver.storage.googleapis.com'
|
|
38
|
+
},
|
|
39
|
+
firefox: {
|
|
40
|
+
version: 'LATEST', // Always use latest GeckoDriver
|
|
41
|
+
baseURL: 'https://github.com/mozilla/geckodriver/releases'
|
|
42
|
+
},
|
|
43
|
+
edge: {
|
|
44
|
+
version: 'LATEST' // Always use latest Edge Driver
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}]]
|
|
18
48
|
};
|
|
19
49
|
|
|
20
|
-
//
|
|
21
|
-
if (
|
|
50
|
+
// Configure browser-specific capabilities
|
|
51
|
+
if (normalizedBrowserName === 'chrome') {
|
|
22
52
|
config.capabilities = [{
|
|
23
53
|
browserName: 'chrome',
|
|
24
54
|
'goog:chromeOptions': {
|
|
25
|
-
|
|
55
|
+
args: [
|
|
56
|
+
'--no-sandbox',
|
|
57
|
+
'--disable-dev-shm-usage',
|
|
58
|
+
'--disable-gpu',
|
|
59
|
+
'--disable-web-security',
|
|
60
|
+
'--disable-features=VizDisplayCompositor'
|
|
61
|
+
]
|
|
26
62
|
}
|
|
27
63
|
}];
|
|
28
|
-
} else if (
|
|
64
|
+
} else if (normalizedBrowserName === 'firefox') {
|
|
29
65
|
config.capabilities = [{
|
|
30
66
|
browserName: 'firefox',
|
|
31
67
|
'moz:firefoxOptions': {
|
|
32
|
-
|
|
68
|
+
args: ['-headless'],
|
|
69
|
+
prefs: {
|
|
70
|
+
'dom.webdriver.enabled': false,
|
|
71
|
+
'useAutomationExtension': false
|
|
72
|
+
}
|
|
33
73
|
}
|
|
34
74
|
}];
|
|
35
|
-
} else if (
|
|
75
|
+
} else if (normalizedBrowserName === 'MicrosoftEdge') {
|
|
36
76
|
config.capabilities = [{
|
|
37
|
-
browserName: 'MicrosoftEdge'
|
|
77
|
+
browserName: 'MicrosoftEdge',
|
|
78
|
+
'ms:edgeOptions': {
|
|
79
|
+
args: [
|
|
80
|
+
'--no-sandbox',
|
|
81
|
+
'--disable-dev-shm-usage',
|
|
82
|
+
'--disable-gpu'
|
|
83
|
+
]
|
|
84
|
+
}
|
|
38
85
|
}];
|
|
39
|
-
} else if (
|
|
86
|
+
} else if (normalizedBrowserName === 'safari') {
|
|
40
87
|
config.capabilities = [{
|
|
41
|
-
browserName: 'safari'
|
|
88
|
+
browserName: 'safari',
|
|
89
|
+
'safari:options': {
|
|
90
|
+
// Safari requires manual driver enablement in Safari > Preferences > Advanced > "Show Develop menu"
|
|
91
|
+
// Ensure "Allow Remote Automation" is enabled in Develop menu
|
|
92
|
+
}
|
|
42
93
|
}];
|
|
43
|
-
} else if (
|
|
94
|
+
} else if (normalizedBrowserName === 'internet explorer') {
|
|
44
95
|
config.capabilities = [{
|
|
45
|
-
browserName: 'internet explorer'
|
|
96
|
+
browserName: 'internet explorer',
|
|
97
|
+
'se:ieOptions': {
|
|
98
|
+
ignoreProtectedModeSettings: true,
|
|
99
|
+
ignoreZoomSetting: true,
|
|
100
|
+
initialBrowserUrl: 'about:blank'
|
|
101
|
+
}
|
|
46
102
|
}];
|
|
47
103
|
} else {
|
|
48
104
|
// Default to Chrome for unsupported browsers
|
|
49
105
|
config.capabilities = [{
|
|
50
|
-
browserName: 'chrome'
|
|
106
|
+
browserName: 'chrome',
|
|
107
|
+
'goog:chromeOptions': {
|
|
108
|
+
args: ['--no-sandbox', '--disable-dev-shm-usage', '--disable-gpu']
|
|
109
|
+
}
|
|
51
110
|
}];
|
|
52
111
|
}
|
|
53
112
|
|
|
54
|
-
console.log(`🌐 Local execution configured for: ${
|
|
113
|
+
console.log(`🌐 Local execution configured for: ${normalizedBrowserName} using selenium-standalone-service`);
|
|
114
|
+
console.log(`📦 Drivers will auto-download to node_modules/ on first run (no admin permission needed)`);
|
|
55
115
|
|
|
56
116
|
return config;
|
|
57
|
-
};
|
|
117
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "froth-webdriverio-framework",
|
|
3
|
-
"version": "7.0.119-dev1.
|
|
3
|
+
"version": "7.0.119-dev1.5",
|
|
4
4
|
"readme": "WebdriverIO Integration",
|
|
5
5
|
"description": "WebdriverIO and BrowserStack App Automate",
|
|
6
6
|
"license": "MIT",
|
|
@@ -44,11 +44,6 @@
|
|
|
44
44
|
"randexp": "^0.5.3",
|
|
45
45
|
"ts-node": "^10.9.2",
|
|
46
46
|
"typescript": "^5.9.3",
|
|
47
|
-
"vm": "^0.1.0"
|
|
48
|
-
"wdio-chromedriver-service": "^8.1.1",
|
|
49
|
-
"wdio-edgedriver-service": "^3.0.3",
|
|
50
|
-
"wdio-geckodriver-service": "^5.0.2",
|
|
51
|
-
"wdio-iedriver-service": "^0.1.0",
|
|
52
|
-
"wdio-safaridriver-service": "^2.1.1"
|
|
47
|
+
"vm": "^0.1.0"
|
|
53
48
|
}
|
|
54
49
|
}
|