I'm developing a mobile app using nativescript + angular and I'm testing it using Appium. When I run appium end to end tests the the following command it loads a previous build of my application.
tns build android
npm run e2e -- --runType device.samsung
If I run the app in the emulator with the following command I get the latest changes
tns run android
Running my e2e after this the app is reverted to an older state.
I've tried uninstalling the app from the emulator, then running my e2e but that fails as there is no application installed. After uninstalling the app I find that I have to use the 'tns run android' command to get the app reinstalled on the device.
Update: Checking install
I've checked my setup by following the guides
I've checked my appium.capabilities.json file
"device.samsung": {
"platformName": "Android",
"platformVersion": "7.0",
"deviceName": "samsung_galaxy_s8",
"avd": "samsung_galaxy_s8",
"lt": 60000,
"newCommandTimeout": 720,
"noReset": true,
"fullReset": false,
"app": ""
},
Update: try turning devMode off
When running my end to end tests it's saying that devMode is on, but when I try and turn it off it's still saying it's on.
npm run e2e -- --devMode=false --runType device.samsung
Update: noReset seems to be the problem
The problem is we want to use 'noReset' as we are trying to test the remember me auto login ability and this requires saving information for the application. If this gets reset then it doesn't work and cannot be tested. If we set 'noReset' to true then our tests work but the app is not updated when running e2e it doesn't use the running version either.
Update: Full verbose output
Full verbose output when running end to end tests https://gist.github.com/map7/9de70cb330d8864c58787a251d5ea128
When starting the end to end tests I can see that it's loading my app three times. The first two times it's the correct version, the last time it runs the app it's the previous version and this is where it runs the tests.
Try to run on the project root:
rm -rf node_modules/ package-lock.json platforms/ hooks/
npm install
That will clean all the project cache.
At last, start again
tns build android
npm run e2e -- --runType device.samsung