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)

- Convert require() to import statements
- Change webdriverio from dynamic require to static import
- Import webdriverio as namespace (import * as webdriverio)
- Import all dependencies at the top of the file:
  - ElementNotFound from './errors/ElementNotFound.js'
  - dontSeeElementError from './errors/ElementAssertion.js'
- Remove inline require statements from methods:
  - dontSeeElement()
  - seeElement()
  - waitForVisible()
  - waitForInvisible()
- Use Locator.build() instead of new Locator() for ESM compatibility
- Maintain export default Appium at the end
- All imports use .js extensions for ESM compliance

Verified:
- Module loads successfully
- No require() statements remaining
- Tests run without errors
The test was failing with 'Cannot read properties of undefined (reading "be")'
because chai's should assertion style was not initialized.

Added chai.should() call after imports to enable should-style assertions
throughout the test file.

Fixes test: device lock : #seeDeviceIsLocked, #seeDeviceIsUnlocked
@kobenguyent kobenguyent merged commit 604106f into 4.x Nov 10, 2025
12 of 18 checks passed
@kobenguyent kobenguyent deleted the appium-esm-migration branch November 10, 2025 09:51
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.

2 participants