-
Notifications
You must be signed in to change notification settings - Fork 10
[CR-2110] Click on element using javascript executor in mobile web #141
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
base: dev
Are you sure you want to change the base?
Conversation
WalkthroughThis pull request introduces three key changes. A new Maven POM file is added to the Changes
Sequence Diagram(s)sequenceDiagram
participant Runner as Test Runner
participant Action as ClickOnElementUsingJsExecutor
participant Driver as AppiumDriver
participant JS as JavascriptExecutor
participant Element as WebElement
Runner->>Action: Call execute()
Action->>Driver: Retrieve WebElement using locator
Driver-->>Action: Return WebElement
Action->>JS: executeScript("arguments[0].click()", Element)
JS-->>Action: Acknowledge click action
Action-->>Runner: Return success result
Possibly related PRs
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 4
🧹 Nitpick comments (4)
javascript_executor 2/pom.xml (3)
12-22
: Dependencies with conflicting versions property defined but not usedI noticed you've defined the property
testsigma.addon.maven.plugin
with version1.0.0
in line 18, but it doesn't appear to be referenced anywhere in the POM file.Unless it's planned for future use, consider removing this unused property.
36-46
: Multiple test frameworks includedYou're including both JUnit Jupiter (with test scope) and TestNG (with compile scope) in your dependencies. This is unusual as they're competing test frameworks.
Consider standardizing on a single test framework. If you need both for compatibility reasons, add a comment explaining why, and consider setting the TestNG dependency to test scope:
<dependency> <groupId>org.testng</groupId> <artifactId>testng</artifactId> <version>6.14.3</version> + <scope>test</scope> </dependency>
74-86
: Missing configuration in maven-shade-pluginThe maven-shade-plugin is configured with minimal settings. For a more robust build, consider adding transformer configuration to handle META-INF services and specifying a main class if this is an executable JAR.
For example:
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-shade-plugin</artifactId> <version>3.2.4</version> <executions> <execution> <phase>package</phase> <goals> <goal>shade</goal> </goals> + <configuration> + <transformers> + <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/> + <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> + <mainClass>com.testsigma.addons.mobile_web.Main</mainClass> + </transformer> + </transformers> + </configuration> </execution> </executions> </plugin>javascript_executor 2/src/main/java/com/testsigma/addons/mobile_web/ClickOnElementUsingJsExecutor.java (1)
22-24
: Remove commented code hintThe comment "Your Awesome code starts here" appears to be a template hint that should be removed in the final implementation.
- //Your Awesome code starts here
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
javascript_executor 2/pom.xml
(1 hunks)javascript_executor 2/src/main/java/com/testsigma/addons/mobile_web/ClickOnElementUsingJsExecutor.java
(1 hunks)javascript_executor 2/src/main/resources/testsigma-sdk.properties
(1 hunks)
🧰 Additional context used
🪛 Gitleaks (8.21.2)
javascript_executor 2/src/main/resources/testsigma-sdk.properties
1-1: Uncovered a JSON Web Token, which may lead to unauthorized access to web applications and sensitive user data.
(jwt)
🔇 Additional comments (3)
javascript_executor 2/src/main/java/com/testsigma/addons/mobile_web/ClickOnElementUsingJsExecutor.java (3)
13-16
: Clear and well-documented action annotationThe action annotation is well-structured with clear actionText, description, and appropriate applicationType for mobile web.
18-19
: Element reference annotation is correctly usedThe Element annotation correctly references "element-locator" which matches the actionText from the Action annotation.
25-26
: Good logging practices implementedThe code includes appropriate logging at different levels (info for execution start and debug for detailed element information).
Jira
https://testsigma.atlassian.net/browse/CR-2110
Indian region (Publish as Public)
Addon name : Javascript Executor (https://jarvis-in.testsigma.com/ui/tenants/1/addons)
account : rachel@testsigma.com
fix
add js executor script to click on the given element
Summary by CodeRabbit