Commit 604106f
authored
fix: Appium esm migration (#5292)
* refactor: migrate Appium helper to ESM
- 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
* enable appium tests
* fix: initialize chai.should() in Appium tests
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, #seeDeviceIsUnlocked1 parent 6d59918 commit 604106f
File tree
3 files changed
+10
-16
lines changed- .github/workflows
- lib/helper
- test/helper
3 files changed
+10
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
| 1 | + | |
3 | 2 | | |
4 | 3 | | |
5 | 4 | | |
| |||
10 | 9 | | |
11 | 10 | | |
12 | 11 | | |
| 12 | + | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
181 | 182 | | |
182 | 183 | | |
183 | 184 | | |
184 | | - | |
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
| |||
1549 | 1549 | | |
1550 | 1550 | | |
1551 | 1551 | | |
1552 | | - | |
1553 | | - | |
1554 | 1552 | | |
1555 | 1553 | | |
1556 | | - | |
| 1554 | + | |
1557 | 1555 | | |
1558 | 1556 | | |
1559 | 1557 | | |
| |||
1563 | 1561 | | |
1564 | 1562 | | |
1565 | 1563 | | |
1566 | | - | |
| 1564 | + | |
1567 | 1565 | | |
1568 | 1566 | | |
1569 | 1567 | | |
| |||
1714 | 1712 | | |
1715 | 1713 | | |
1716 | 1714 | | |
1717 | | - | |
1718 | | - | |
1719 | | - | |
1720 | | - | |
1721 | 1715 | | |
1722 | 1716 | | |
1723 | 1717 | | |
| |||
1730 | 1724 | | |
1731 | 1725 | | |
1732 | 1726 | | |
1733 | | - | |
| 1727 | + | |
1734 | 1728 | | |
1735 | 1729 | | |
1736 | 1730 | | |
| |||
1784 | 1778 | | |
1785 | 1779 | | |
1786 | 1780 | | |
1787 | | - | |
1788 | 1781 | | |
1789 | 1782 | | |
1790 | 1783 | | |
| |||
1801 | 1794 | | |
1802 | 1795 | | |
1803 | 1796 | | |
1804 | | - | |
| 1797 | + | |
1805 | 1798 | | |
1806 | 1799 | | |
1807 | 1800 | | |
| |||
1816 | 1809 | | |
1817 | 1810 | | |
1818 | 1811 | | |
1819 | | - | |
1820 | 1812 | | |
1821 | 1813 | | |
1822 | 1814 | | |
| |||
1831 | 1823 | | |
1832 | 1824 | | |
1833 | 1825 | | |
1834 | | - | |
| 1826 | + | |
1835 | 1827 | | |
1836 | 1828 | | |
1837 | 1829 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
0 commit comments