-
-
Notifications
You must be signed in to change notification settings - Fork 751
fix: appium tests #5229
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
fix: appium tests #5229
Conversation
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.
Pull Request Overview
This PR fixes Appium tests by improving element handling and updating test configurations. The changes focus on standardizing WebDriver element ID handling and enhancing mobile element visibility checks for better test reliability.
- Refactored hardcoded W3C element identifiers to use a centralized constant
- Enhanced Appium mobile element visibility detection using native WebDriver methods
- Updated test configurations to include UiAutomator2 automation name
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
lib/utils.js | Added W3C_ELEMENT_ID constant and getElementId utility function |
lib/helper/WebDriver.js | Removed duplicate getElementId function, now imports from utils |
lib/helper/Appium.js | Enhanced seeElement/dontSeeElement methods with native mobile element visibility checks |
test/helper/WebDriver_test.js | Updated to use W3C_ELEMENT_ID constant instead of hardcoded string |
test/helper/WebDriver.noSeleniumServer_test.js | Updated to use W3C_ELEMENT_ID constant and removed extra whitespace |
test/helper/Appium_test.js | Added automationName configuration for UiAutomator2 |
test/helper/AppiumWeb_test.js | Added automationName configuration for UiAutomator2 |
.github/workflows/appium_Android.yml | Added branch trigger for 5228-fix-appium-tests |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
||
// Check if elements exist | ||
if (!res || res.length === 0) { | ||
throw new AssertionFailedError(`Element ${new Locator(parsedLocator)} was not found`) |
Copilot
AI
Oct 1, 2025
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.
AssertionFailedError is not imported but is being used. Add the import statement at the top of the file.
Copilot uses AI. Check for mistakes.
if (el.ELEMENT) { | ||
return el.ELEMENT | ||
} | ||
return el |
Copilot
AI
Oct 1, 2025
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.
The function should return null when neither W3C_ELEMENT_ID nor ELEMENT properties exist, not the element itself. This could cause issues when the caller expects a string ID but receives an object.
return el | |
return null |
Copilot uses AI. Check for mistakes.
Motivation/Description of the PR
Applicable helpers:
Applicable plugins:
Type of change
Checklist:
npm run docs
)npm run lint
)npm test
)