Skip to content

Commit 3be0d3a

Browse files
committed
Added logic to add enableCustomTranslation for safari>11 and fixed window handles
1 parent a8b2f0a commit 3be0d3a

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/index.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { LT_AUTH_ERROR, PROCESS_ENVIRONMENT, AUTOMATION_DASHBOARD_URL, AUTOMATIO
55

66
const WEB_DRIVER_PING_INTERVAL = 30 * 1000;
77

8+
89
wd.configureHttp({
910
timeout: 15 * 60 * 1000,
1011

@@ -131,13 +132,15 @@ export default {
131132

132133
// Extra methods
133134
async resizeWindow (id, width, height) {
134-
const _windowHandle = await this.openedBrowsers[id].windowHandle();
135+
136+
137+
const _windowHandle = await this.openedBrowsers[id].windowHandles();
135138

136139
await this.openedBrowsers[id].windowSize(_windowHandle, width, height);
137140
},
138141

139142
async maximizeWindow (id) {
140-
const _windowHandle = await this.openedBrowsers[id].windowHandle();
143+
const _windowHandle = await this.openedBrowsers[id].windowHandles();
141144

142145
await this.openedBrowsers[id].maximize(_windowHandle);
143146
},

src/util.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,8 @@ async function _parseCapabilities (id, capability) {
279279
if (browserName && browserName.toLowerCase() === 'firefox' && browserVersion && browserVersion.split('.')[0] > 47 && !('enableCustomTranslation' in capabilities[id]))
280280
capabilities[id].enableCustomTranslation = true;
281281

282+
if (browserName && browserName.toLowerCase() === 'safari' && browserVersion && browserVersion.split('.')[0] > 11 && !('enableCustomTranslation' in capabilities[id]))
283+
capabilities[id].enableCustomTranslation = true;
282284
// showTrace('Parsed Capabilities ', capabilities[id]);
283285

284286
return capabilities[id];

0 commit comments

Comments
 (0)