froth-webdriverio-framework 7.0.119-dev1.5 → 7.0.119-dev1.7
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,6 +1,6 @@
|
|
|
1
1
|
module.exports = (bsCaps) => {
|
|
2
2
|
const browserName = (bsCaps.browserName || 'chrome').toLowerCase();
|
|
3
|
-
|
|
3
|
+
|
|
4
4
|
// Normalize browser names for WebDriver
|
|
5
5
|
const browserNameMap = {
|
|
6
6
|
chrome: 'chrome',
|
|
@@ -17,39 +17,12 @@ module.exports = (bsCaps) => {
|
|
|
17
17
|
|
|
18
18
|
const normalizedBrowserName = browserNameMap[browserName] || 'chrome';
|
|
19
19
|
|
|
20
|
-
const config = {
|
|
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
|
-
}]]
|
|
48
|
-
};
|
|
49
|
-
|
|
50
20
|
// Configure browser-specific capabilities
|
|
21
|
+
let capabilities;
|
|
22
|
+
let service;
|
|
23
|
+
|
|
51
24
|
if (normalizedBrowserName === 'chrome') {
|
|
52
|
-
|
|
25
|
+
capabilities = [{
|
|
53
26
|
browserName: 'chrome',
|
|
54
27
|
'goog:chromeOptions': {
|
|
55
28
|
args: [
|
|
@@ -61,19 +34,42 @@ module.exports = (bsCaps) => {
|
|
|
61
34
|
]
|
|
62
35
|
}
|
|
63
36
|
}];
|
|
37
|
+
|
|
38
|
+
// Use wdio-chromedriver-service - auto-downloads ChromeDriver at runtime
|
|
39
|
+
// No admin permission needed - downloads to node_modules/
|
|
40
|
+
service = ['chromedriver', {
|
|
41
|
+
// Automatically download ChromeDriver if not present
|
|
42
|
+
chromedriverOptions: {
|
|
43
|
+
// Check for ChromeDriver updates (set to false for faster startup)
|
|
44
|
+
checkForUpdates: true,
|
|
45
|
+
// Use latest ChromeDriver compatible with installed Chrome
|
|
46
|
+
// If false, uses version specified in package.json chromedriver dependency
|
|
47
|
+
autoDownload: true
|
|
48
|
+
}
|
|
49
|
+
}]
|
|
50
|
+
|
|
64
51
|
} else if (normalizedBrowserName === 'firefox') {
|
|
65
|
-
|
|
52
|
+
capabilities = [{
|
|
66
53
|
browserName: 'firefox',
|
|
67
54
|
'moz:firefoxOptions': {
|
|
68
|
-
args: ['-headless'],
|
|
55
|
+
//args: ['-headless'],
|
|
69
56
|
prefs: {
|
|
70
57
|
'dom.webdriver.enabled': false,
|
|
71
58
|
'useAutomationExtension': false
|
|
72
59
|
}
|
|
73
60
|
}
|
|
74
61
|
}];
|
|
62
|
+
|
|
63
|
+
// Use wdio-geckodriver-service for Firefox
|
|
64
|
+
service = ['geckodriver', {
|
|
65
|
+
// Auto-download geckodriver if not present
|
|
66
|
+
geckodriverOptions: {
|
|
67
|
+
// Use the geckodriver from node_modules
|
|
68
|
+
// No need to download separately
|
|
69
|
+
}
|
|
70
|
+
}];
|
|
75
71
|
} else if (normalizedBrowserName === 'MicrosoftEdge') {
|
|
76
|
-
|
|
72
|
+
capabilities = [{
|
|
77
73
|
browserName: 'MicrosoftEdge',
|
|
78
74
|
'ms:edgeOptions': {
|
|
79
75
|
args: [
|
|
@@ -83,35 +79,40 @@ module.exports = (bsCaps) => {
|
|
|
83
79
|
]
|
|
84
80
|
}
|
|
85
81
|
}];
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
// Safari requires manual driver enablement in Safari > Preferences > Advanced > "Show Develop menu"
|
|
91
|
-
// Ensure "Allow Remote Automation" is enabled in Develop menu
|
|
92
|
-
}
|
|
93
|
-
}];
|
|
94
|
-
} else if (normalizedBrowserName === 'internet explorer') {
|
|
95
|
-
config.capabilities = [{
|
|
96
|
-
browserName: 'internet explorer',
|
|
97
|
-
'se:ieOptions': {
|
|
98
|
-
ignoreProtectedModeSettings: true,
|
|
99
|
-
ignoreZoomSetting: true,
|
|
100
|
-
initialBrowserUrl: 'about:blank'
|
|
101
|
-
}
|
|
102
|
-
}];
|
|
82
|
+
|
|
83
|
+
// EdgeDriver is included with Edge browser - no download needed
|
|
84
|
+
service = ['edgedriver'];
|
|
85
|
+
|
|
103
86
|
} else {
|
|
104
87
|
// Default to Chrome for unsupported browsers
|
|
105
|
-
|
|
88
|
+
capabilities = [{
|
|
106
89
|
browserName: 'chrome',
|
|
107
90
|
'goog:chromeOptions': {
|
|
108
91
|
args: ['--no-sandbox', '--disable-dev-shm-usage', '--disable-gpu']
|
|
109
92
|
}
|
|
110
93
|
}];
|
|
94
|
+
|
|
95
|
+
service = ['chromedriver', {
|
|
96
|
+
chromedriverOptions: {
|
|
97
|
+
checkForUpdates: true,
|
|
98
|
+
autoDownload: true
|
|
99
|
+
}
|
|
100
|
+
}];
|
|
111
101
|
}
|
|
112
102
|
|
|
113
|
-
|
|
114
|
-
|
|
103
|
+
const config = {
|
|
104
|
+
// Use direct WebDriver connection without Selenium Grid/Hub
|
|
105
|
+
// Opens Chrome/Firefox directly - no selenium-server
|
|
106
|
+
protocol: 'webdriver',
|
|
107
|
+
|
|
108
|
+
// Auto-download drivers service - no admin permission needed
|
|
109
|
+
services: service.length > 0 ? [service] : [],
|
|
110
|
+
|
|
111
|
+
capabilities: capabilities
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
console.log(`🌐 Local execution configured for: ${normalizedBrowserName}`);
|
|
115
|
+
console.log(`📦 Browser drivers will auto-download to node_modules/ (no admin permission needed)`);
|
|
115
116
|
|
|
116
117
|
return config;
|
|
117
118
|
};
|
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.7",
|
|
4
4
|
"readme": "WebdriverIO Integration",
|
|
5
5
|
"description": "WebdriverIO and BrowserStack App Automate",
|
|
6
6
|
"license": "MIT",
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
"axios": "1.14.0",
|
|
31
31
|
"browserstack-local": "^1.5.8",
|
|
32
32
|
"chai": "^6.2.2",
|
|
33
|
+
"chromedriver": "^149.0.4",
|
|
33
34
|
"crypto-js": "^4.2.0",
|
|
34
35
|
"deepmerge": "^4.3.1",
|
|
35
36
|
"ejs": "^4.0.1",
|
|
@@ -37,6 +38,7 @@
|
|
|
37
38
|
"express": "^5.2.1",
|
|
38
39
|
"form-data": "^4.0.5",
|
|
39
40
|
"fs": "^0.0.1-security",
|
|
41
|
+
"geckodriver": "^4.5.0",
|
|
40
42
|
"js-yaml": "^4.1.1",
|
|
41
43
|
"mysql2": "^3.16.0",
|
|
42
44
|
"node-fetch": "^3.3.2",
|
|
@@ -44,6 +46,9 @@
|
|
|
44
46
|
"randexp": "^0.5.3",
|
|
45
47
|
"ts-node": "^10.9.2",
|
|
46
48
|
"typescript": "^5.9.3",
|
|
47
|
-
"vm": "^0.1.0"
|
|
49
|
+
"vm": "^0.1.0",
|
|
50
|
+
"wdio-chromedriver-service": "^8.1.1",
|
|
51
|
+
"wdio-geckodriver-service": "^5.0.2"
|
|
48
52
|
}
|
|
53
|
+
|
|
49
54
|
}
|