A demo project with React Native and End-to-End tests with SelenideJs + WebdriverIO based Appium implementation.
brew install watchman
sudo gem install cocoapodsTo run E2E-tests:
npm install -g appium@next \
&& appium driver install uiautomator2 \
&& appium driver install xcuitestyarn install --frozen-lockfileTBD
TBD
# list all simulators
xcrun xctrace list devices
# open simulator
open -a Simulator
# list all available and shutdown iPhone devices
xcrun simctl list | grep '(Shutdown)' | grep iPhone | grep -v unavailable
# open device with name "iPhone 14 Pro" in Simulator
xcrun simctl boot "iPhone 14 Pro"
# unarchive builds/ios.tar.gz into builds/
tar -xvzf builds/ios.tar.gz -C builds/
# install builds/*.app into booted device at simulator
xcrun simctl install booted builds/*.app
# reload ios app in simulatorIn parallel terminal:
appium server --relaxed-security(--relaxed-security is required to run adb shell commands)
Then:
yarn test:e2e:metro:androidyarn test:e2e:metro:iosTBD
Given, Appium Inspector installed from official releases,
And opened,
Then ensure Remote Path setting is / (not /wd/hub!),
And connect to already opened android simulator by starting session with the following capabilities:
{
"appium:automationName": "UiAutomator2",
"appium:platformName": "Android",
"appium:settings[disableIdLocatorAutocompletion]": true
}{
"appium:automationName": "XCUITest",
"appium:platformName": "iOS",
"appium:deviceName": "iPhone 14 Pro",
"appium:platformVersion": "16.4"
}- separate e2e tsconfig from main tsconfig, and exclude e2e folder from main tsconfig
- make
$$command support «per platform locators» same as the$command