
# Conflicts: # apps/automated/src/test-runner.ts # apps/automated/src/ui/bottom-navigation/bottom-navigation-navigation-tests.ts # apps/ui/src/bottom-navigation/events-page.ts # apps/ui/src/main-page.ts # apps/ui/src/test-page-main-view-model.ts # package.json # packages/core/color/color-common.ts # packages/core/color/index.d.ts # packages/core/ui/action-bar/index.android.ts # packages/core/ui/bottom-navigation/index.android.ts # packages/core/ui/core/view/index.ios.ts # packages/core/ui/core/view/view-helper/view-helper-common.ts # packages/core/ui/index.ts # packages/core/ui/styling/background.android.ts # packages/core/ui/tab-navigation-base/tab-strip-item/index.ts # packages/webpack/jasmine-config/reporter.ts
e2e tests execution
-
Local setup
-
install appium and all requirments related to
nativescript-dev-appium
plugin usage -
download images:
npm run load-images Emulator-Api23-Default "iPhone X 12"
or load multiple folders:
npm run load-images Emulator-Api23-Default Emulator-Google-Api28 "iPhone X 12"
or load all folders:
npm run load-images all
This command will download https://github.com/NativeScript/functional-tests-images/tree/master/uitestsapp and sparse all passed directories [emulator-name|simulator-name]
-
rename/ create your device so that it matches folder name, respectively api level and density of emulators.
You can also use scripts:
npm run update-emulators
to update your emulator density.If you need to download system image and create emulator use:
npm run update-emulators -- --update-system-images
-
-
Test execution
-
Run test compilation in separate terminal and don't kill it.
npm run test-watch
-
It is highly recommended during the development to use
npm run test [android|ios]
along withtns run [android|ios]
. This command will use already installed app on the device. For example: Open terminal1 and run:tns run android
and open new terminal2 and run:npm run test android
-
-
Debug test.
-
Run:
npm run e2e-debug [android|ios]
run in separate console and don't kill it. This command will start appium server and driver and use the installed app on the device but it will not execute tests. -
Go to vs code debugging and use a config like:
{ "type": "node", "request": "launch", "name": "Debug Tests", "program": "${workspaceFolder}/node_modules/mocha/bin/_mocha", "args": [ "-u", "tdd", "--colors", "--opts", "../config/mocha.opts", "--attachToDebug", "--grpe", "button" ], "internalConsoleOptions": "openOnSessionStart" }
-
mocha options
mocha opt file is located at "../config/mocha.opts".
--timeout 999999
--recursive e2e
--reporter mochawesome
--reporter-options quiet=true,html=true,inline=true,autoOpen=true
--exit
grep particular suit or test
npm run e2e ios -- --grep=tabs-tab(s-\\w+)-suite