Skip to content

Commit

Permalink
[web]
Browse files Browse the repository at this point in the history
- [FIXED] removed misinterpretation of the return of a JS double click

Signed-off-by: automike <[email protected]>
  • Loading branch information
automike authored and mikeliu-cvet committed Dec 4, 2021
1 parent bbe6d82 commit 7f2cb13
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
9 changes: 7 additions & 2 deletions src/main/java/org/nexial/core/plugins/base/AwtUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,13 @@ public static Dimension getScreenDimension(int monitorIndex) {

@Nullable
public static GraphicsDevice[] getAvailableScreens() {
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
return ge == null ? null : ge.getScreenDevices();
try {
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
return ge == null ? null : ge.getScreenDevices();
} catch (Throwable e) {
ConsoleUtils.error("Error when determining available screen(s): " + e.getMessage());
return null;
}
}


Expand Down
7 changes: 2 additions & 5 deletions src/main/java/org/nexial/core/plugins/web/WebCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -3044,11 +3044,8 @@ protected StepResult doubleClickInternal(String locator) {

boolean useJS = context.getBooleanConfig(getTarget(), getProfile(), FORCE_JS_DBLCLICK);
if (useJS) {
if (BooleanUtils.toBoolean(Objects.toString(jsExecutor.executeScript(JsLib.doubleClick(), element)))) {
return StepResult.success("successfully JS double-clicked on web element '" + locator + "'");
} else {
return StepResult.success("FAILED to JS double-clicked on web element '" + locator + "'");
}
jsExecutor.executeScript(JsLib.doubleClick(), element);
return StepResult.success("successfully JS double-clicked on web element '" + locator + "'");
} else {
new Actions(driver).moveToElement(element).doubleClick(element).build().perform();
return StepResult.success("double-clicked on web element '" + locator + "'");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ abstract class CloudWebTestingPlatform protected constructor(protected var conte
// }

@JvmStatic
protected fun formatStatusDescription(summary: ExecutionSummary): String {
fun formatStatusDescription(summary: ExecutionSummary): String {
return "total: ${summary.totalSteps}, " +
"pass: ${summary.passCount}, " +
"fail: ${summary.failCount}, " +
Expand Down

0 comments on commit 7f2cb13

Please sign in to comment.