-
Notifications
You must be signed in to change notification settings - Fork 15
Updated windows advanced addon to replace ai Request with ocr endpoints. #364
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ManojTestsigma
wants to merge
2
commits into
dev
Choose a base branch
from
windows-advanced-actions
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
windows_advanced_actions/src/main/java/com/testsigma/addons/util/Constants.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| package com.testsigma.addons.util; | ||
|
|
||
| public class Constants { | ||
| public static String VISUAL_SERVER_API_END_POINT = "https://visualtesting-staging.testsigma.com/image_analysis_with_files"; | ||
| public static String VISUAL_SERVER_FIND_IMAGE_ENDPOINT = "https://visualtesting-staging.testsigma.com/find_image_with_files"; | ||
| public static String VISUAL_SERVER_OCR_TEXT_ENDPOINT = "https://visualtesting-staging.testsigma.com/ocr-text-points-with-files"; | ||
|
|
||
|
|
||
|
|
||
| public static String API_TOKEN = "DHRNEYFTDCDGOEDDCOEICVYOEEUY"; | ||
|
|
||
| } | ||
95 changes: 94 additions & 1 deletion
95
.../windowsAdvanced/utils/KeyboardUtils.java → .../testsigma/addons/util/KeyboardUtils.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
windows_advanced_actions/src/main/java/com/testsigma/addons/util/OCRResponse.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| package com.testsigma.addons.util; | ||
|
|
||
| import com.fasterxml.jackson.annotation.JsonProperty; | ||
| import lombok.Data; | ||
|
|
||
| import java.util.List; | ||
|
|
||
| @Data | ||
| public class OCRResponse { | ||
| @JsonProperty("error") | ||
| private String error; | ||
|
|
||
| @JsonProperty("text") | ||
| private List<OCRTextPoint> text; | ||
|
|
||
| // Manual getter methods since Lombok annotation processor is not working | ||
| public String getError() { return error; } | ||
| public List<OCRTextPoint> getText() { return text; } | ||
|
|
||
| // Helper method to check if there are any errors | ||
| public boolean hasError() { | ||
| return error != null && !error.trim().isEmpty(); | ||
| } | ||
|
|
||
| // Helper method to check if text was found | ||
| public boolean hasText() { | ||
| return text != null && !text.isEmpty(); | ||
| } | ||
| } |
45 changes: 45 additions & 0 deletions
45
windows_advanced_actions/src/main/java/com/testsigma/addons/util/OCRTextPoint.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| package com.testsigma.addons.util; | ||
|
|
||
| import com.fasterxml.jackson.annotation.JsonProperty; | ||
| import lombok.Data; | ||
|
|
||
| @Data | ||
| public class OCRTextPoint { | ||
| @JsonProperty("text") | ||
| private String text; | ||
|
|
||
| @JsonProperty("x1") | ||
| private double x1; | ||
|
|
||
| @JsonProperty("x2") | ||
| private double x2; | ||
|
|
||
| @JsonProperty("y1") | ||
| private double y1; | ||
|
|
||
| @JsonProperty("y2") | ||
| private double y2; | ||
|
|
||
| // Manual getter methods since Lombok annotation processor is not working | ||
| public String getText() { return text; } | ||
| public double getX1() { return x1; } | ||
| public double getX2() { return x2; } | ||
| public double getY1() { return y1; } | ||
| public double getY2() { return y2; } | ||
|
|
||
| // Manual setter methods | ||
| public void setText(String text) { this.text = text; } | ||
| public void setX1(double x1) { this.x1 = x1; } | ||
| public void setX2(double x2) { this.x2 = x2; } | ||
| public void setY1(double y1) { this.y1 = y1; } | ||
| public void setY2(double y2) { this.y2 = y2; } | ||
|
|
||
| // Helper method to get center coordinates for clicking | ||
| public double getCenterX() { | ||
| return (x1 + x2) / 2.0; | ||
| } | ||
|
|
||
| public double getCenterY() { | ||
| return (y1 + y2) / 2.0; | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move the visual-server config out of source control.
API_TOKENis embedded in a public addon, and the endpoints are hard-wired to a staging host. That leaks a credential and makes rotation/promotion unsafe; load both from runtime config or a secret store instead.🤖 Prompt for AI Agents