- Node.js LTS installed
- Android Studio
- Appium Inspector
- clone repo using
git clone [email protected]:Tesena-smart-testing/templates_for_MA_training.git
- run
npm i
- check
wdio.conf.ts
file and itscapabilities
prop. Create AVD emulation in the Android Studio accordingly, so this setup would work. Otherwise, adjust setup values to your emulated mobile device.
- start Android Studio and correct mobile phone emulation
- run
npx wdio run ./wdio.conf.ts
- implementation is based on standard node.js setup
- AVD is created using this excellent github action
- read the documentation of the action repo
- tests are creating HTML test reports including video recordings of each test in
reports/html-reports
- configuration is in
wdio.conf.ts
- this solution uses video-reporter and HTML reporter
- if tests are run on CI/CD pipeline, then they are stored using
actions/upload-artifact
. You can access the report from the details of the given job run - e.g. HERE, in theArtifacts
section
- run
npm init wdio@latest ./path/to/new/project
ornpm init wdio@latest .
if you are already in your selected project folder - when prompted by CLI wizard, select needed options. Do not forget to select Typescript compiler and appium installation
- wait until project is created
- see detailed GUIDE
- enable development mode on your phone
- connect to the computer via USB
- if you have Android Studio installed, then go to
C:\Users\<username>\AppData\Local\Sdk\platform-tools
and run.\adb.exe devices
. You should see your device connected. If not, try to run.\adb.exe usb
and on you mobile device confirm the connection and authorization. - If you have Android 14, then you can just run
npx wdio run ./wdio.adb.conf.ts
. Otherwise adjustcapabilities
in the wdio conf file.
WARNING: Unfortunately, I am able to build an image and run the service, but detecting devices fails and I am at my wits end.
- have Docker installed
- if you are in the ROOT of this project, then run
docker build -t stf -f ./stf/Dockerfile ./stf
to build the image - then start the service using
docker run -it -p 7100:7100 -p 7110:7110 -p 28015:28015 stf /bin/bash
- then open
http://127.0.0.1:7100
in your browser - login as
administrator
with password[email protected]
- see HERE
- be careful, latest update of ESET as of 23.04.2024 breaks nodejs and npm functionalities due to nodejs handling of the certificates. ESET newly implemented scanning of HTTPS protocol and blocks nodejs' network calls. Current workaround is to disable the https scanning or wait few days until this is fixed and rolled out from ESET. See HERE
Sometimes, at least in my case, the appium service does not work correctly, due to selected port blockage. Best way to resolve this is to disable appium service in the wdio.conf.ts
file and run appium manually in the second console. Ensure, that port in wdio.conf.ts is the same, as when running command npx appium --port <port>
.