Skip to content

Commit

Permalink
Added logic to add enableCustomTranslation for safari>11 and fixed wi…
Browse files Browse the repository at this point in the history
…ndow handles
  • Loading branch information
shiva-guntoju committed Jan 10, 2023
1 parent a8b2f0a commit 3be0d3a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { LT_AUTH_ERROR, PROCESS_ENVIRONMENT, AUTOMATION_DASHBOARD_URL, AUTOMATIO

const WEB_DRIVER_PING_INTERVAL = 30 * 1000;


wd.configureHttp({
timeout: 15 * 60 * 1000,

Expand Down Expand Up @@ -131,13 +132,15 @@ export default {

// Extra methods
async resizeWindow (id, width, height) {
const _windowHandle = await this.openedBrowsers[id].windowHandle();


const _windowHandle = await this.openedBrowsers[id].windowHandles();

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

async maximizeWindow (id) {
const _windowHandle = await this.openedBrowsers[id].windowHandle();
const _windowHandle = await this.openedBrowsers[id].windowHandles();

await this.openedBrowsers[id].maximize(_windowHandle);
},
Expand Down
2 changes: 2 additions & 0 deletions src/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,8 @@ async function _parseCapabilities (id, capability) {
if (browserName && browserName.toLowerCase() === 'firefox' && browserVersion && browserVersion.split('.')[0] > 47 && !('enableCustomTranslation' in capabilities[id]))
capabilities[id].enableCustomTranslation = true;

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

return capabilities[id];
Expand Down

0 comments on commit 3be0d3a

Please sign in to comment.