Skip to content

Conversation

kobenguyent
Copy link
Collaborator

Motivation/Description of the PR

  • Description of this PR, which problem it solves
  • Resolves #issueId (if applicable).

Applicable helpers:

  • Playwright
  • Puppeteer
  • WebDriver
  • REST
  • FileHelper
  • Appium
  • TestCafe

Applicable plugins:

  • allure
  • autoDelay
  • autoLogin
  • customLocator
  • pauseOnFail
  • coverage
  • retryFailedStep
  • screenshotOnFail
  • selenoid
  • stepByStepReport
  • stepTimeout
  • wdio
  • subtitles

Type of change

  • 🔥 Breaking changes
  • 🚀 New functionality
  • 🐛 Bug fix
  • 🧹 Chore
  • 📋 Documentation changes/updates
  • ♨️ Hot fix
  • 🔨 Markdown files fix - not related to source code
  • 💅 Polish code

Checklist:

  • Tests have been added
  • Documentation has been added (Run npm run docs)
  • Lint checking (Run npm run lint)
  • Local tests are passed (Run npm test)

@kobenguyent kobenguyent linked an issue Oct 1, 2025 that may be closed by this pull request
Copy link
Contributor

@Copilot Copilot AI left a 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`)
Copy link

Copilot AI Oct 1, 2025

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
Copy link

Copilot AI Oct 1, 2025

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.

Suggested change
return el
return null

Copilot uses AI. Check for mistakes.

@kobenguyent kobenguyent closed this Oct 1, 2025
@kobenguyent kobenguyent deleted the 5228-fix-appium-tests branch October 1, 2025 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix appium tests

2 participants