Skip to content

Commit 6dc2125

Browse files
fix: Bind commands to this instance (not prototype) so each driver instance uses its own powershell session (#56) [skip ci]
Co-authored-by: Yuri Schwab <yuri.schwab@probolabs.ai>
1 parent c100ffb commit 6dc2125

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/driver.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,10 @@ export class NovaWindowsDriver extends BaseDriver<NovaWindowsDriverConstraints,
7373
this.locatorStrategies = [...LOCATION_STRATEGIES];
7474
this.desiredCapConstraints = UI_AUTOMATION_DRIVER_CONSTRAINTS;
7575

76+
// Bind commands to this instance (not prototype) so each driver instance uses its own
77+
// PowerShell session and state when multiple sessions exist
7678
for (const key in commands) { // TODO: create a decorator that will do that for the class
77-
NovaWindowsDriver.prototype[key] = commands[key].bind(this);
79+
(this as any)[key] = commands[key].bind(this);
7880
}
7981
}
8082

0 commit comments

Comments
 (0)