@applitools/driver
Advanced tools
Comparing version 1.2.3 to 1.2.4
@@ -7,3 +7,3 @@ { | ||
"version": "file:../dry-run.tgz", | ||
"integrity": "sha512-Dpobb1JiG0th4CbT13OuchQ+JeDMWTCpdU2SXXjY5t/EXOh6pVmRK84b0RRNfJcwppepCchB+y4lALOWGA7HEQ==", | ||
"integrity": "sha512-bWybD9hKoQqS6LFHBKDpgE42vtg3QfQzm9PqlNtvDVhsKFFFZs0ZekT3Kiz8Dbi15T5ELubrwtRSjN4oBjg1AQ==", | ||
"requires": { | ||
@@ -10,0 +10,0 @@ "@applitools/snippets": "2.1.7", |
@@ -6,2 +6,6 @@ # Change Log | ||
## 1.2.4 - 2021/9/24 | ||
- fix issue with switching to the duplicated context | ||
## 1.2.3 - 2021/9/24 | ||
@@ -8,0 +12,0 @@ |
@@ -181,3 +181,3 @@ "use strict"; | ||
if (reference instanceof Context) { | ||
if (reference.parent !== this) { | ||
if (reference.parent !== this && !(await this.equals(reference.parent))) { | ||
throw Error('Cannot attach a child context because it has a different parent'); | ||
@@ -184,0 +184,0 @@ } |
@@ -224,4 +224,6 @@ "use strict"; | ||
async switchTo(context) { | ||
if (await this.currentContext.equals(context)) | ||
if (await this.currentContext.equals(context)) { | ||
this._currentContext = context; | ||
return; | ||
} | ||
const currentPath = this.currentContext.path; | ||
@@ -307,3 +309,3 @@ const requiredPath = context.path; | ||
continue; | ||
const context = await this.currentContext.context(reference instanceof context_1.Context ? await reference.getContextElement() : reference); | ||
const context = await this.currentContext.context(reference); | ||
await context.focus(); | ||
@@ -310,0 +312,0 @@ } |
@@ -70,6 +70,3 @@ "use strict"; | ||
element = element instanceof Element ? element.target : element; | ||
if (this._spec.isEqualElements) { | ||
return this._spec.isEqualElements(this.context.target, this.target, element); | ||
} | ||
else { | ||
if (this.driver.isWeb) { | ||
return this._spec | ||
@@ -79,2 +76,5 @@ .executeScript(this.context.target, snippets.isEqualElements, [this.target, element]) | ||
} | ||
else { | ||
return this._spec.isEqualElements(this.context.target, this.target, element); | ||
} | ||
} | ||
@@ -81,0 +81,0 @@ async init(context) { |
{ | ||
"name": "@applitools/driver", | ||
"version": "1.2.3", | ||
"version": "1.2.4", | ||
"description": "Applitools universal framework wrapper", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -228,3 +228,3 @@ import type * as types from '@applitools/types' | ||
if (reference instanceof Context) { | ||
if (reference.parent !== this) { | ||
if (reference.parent !== this && !(await this.equals(reference.parent))) { | ||
throw Error('Cannot attach a child context because it has a different parent') | ||
@@ -231,0 +231,0 @@ } |
@@ -239,3 +239,6 @@ import type * as types from '@applitools/types' | ||
): Promise<Context<TDriver, TContext, TElement, TSelector>> { | ||
if (await this.currentContext.equals(context)) return | ||
if (await this.currentContext.equals(context)) { | ||
this._currentContext = context | ||
return | ||
} | ||
const currentPath = this.currentContext.path | ||
@@ -320,5 +323,3 @@ const requiredPath = context.path | ||
if (reference === this.mainContext) continue | ||
const context = await this.currentContext.context( | ||
reference instanceof Context ? await reference.getContextElement() : reference, | ||
) | ||
const context = await this.currentContext.context(reference) | ||
await context.focus() | ||
@@ -325,0 +326,0 @@ } |
@@ -81,8 +81,8 @@ import type * as types from '@applitools/types' | ||
element = element instanceof Element ? element.target : element | ||
if (this._spec.isEqualElements) { | ||
return this._spec.isEqualElements(this.context.target, this.target, element) | ||
} else { | ||
if (this.driver.isWeb) { | ||
return this._spec | ||
.executeScript(this.context.target, snippets.isEqualElements, [this.target, element]) | ||
.catch(() => false) | ||
} else { | ||
return this._spec.isEqualElements(this.context.target, this.target, element) | ||
} | ||
@@ -89,0 +89,0 @@ } |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
250889
4521
0