Skip to content

fix: status of iOS Sim images and Android Emulator images are different #3809

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 9, 2018

Conversation

rosen-vladimirov
Copy link
Contributor

fix: status of iOS Sim images and Android Emulator images are different

Whenever CLI returns information for available emulators/simulators, the returned object for each of the image has a status property.
For Android the status is "Running" or "Not running", for iOS it is "Connected" or "Disconnected".
Unify the status properties - use "Running" and "Not running" for both of the images.

Also, for iOS images, the imageIdentifier property has not been populated - fill it with the value of the identifier property, so the API will be consistent for both Android and iOS.
As the property has not been populated for iOS Simulators, the events "emulatorImageFound" and "emulatorImageLost" were never triggered in case you add new iOS Simulator images. Now this should work correctly.

Fix unit tests on Windows - the split by EOL when parsing the output of avdmanager executable is not working on Windows, as the EOL is \r\n, while the avdmanager prints results with \n only.
Also the tests were failing on Windows due to the same reason - test case has \n, while split is by \r\n.

Use some constants in the tests instead of strings for status property.

docs: update changelog for 4.2.1

Update the CHANGELOG for 4.2.1

PR Checklist

What is the current behavior?

When using CLI as a library and call tns.devicesService.getEmulatorImages on macOS, the status properties of iOS and Android images are not consistent.

What is the new behavior?

Status are the same for iOS and Android

Whenever CLI returns information for available emulators/simulators, the returned object for each of the image has a status property.
For Android the status is "Running" or "Not running", for iOS it is "Connected" or "Disconnected".
Unify the status properties - use "Running" and "Not running" for both of the images.

Also, for iOS images, the imageIdentifier property has not been populated - fill it with the value of the identifier property, so the API will be consistent for both Android and iOS.
As the property has not been populated for iOS Simulators, the events "emulatorImageFound" and "emulatorImageLost" were never triggered in case you add new iOS Simulator images. Now this should work correctly.

Fix unit tests on Windows - the split by EOL when parsing the output of avdmanager executable is not working on Windows, as the EOL is `\r\n`, while the avdmanager prints results with `\n` only.
Also the tests were failing on Windows due to the same reason - test case has `\n`, while split is by `\r\n`.

Use some constants in the tests instead of strings for status property.
@rosen-vladimirov rosen-vladimirov added this to the 4.2.1 milestone Aug 9, 2018
@rosen-vladimirov rosen-vladimirov self-assigned this Aug 9, 2018
@rosen-vladimirov rosen-vladimirov requested a review from Fatme August 9, 2018 06:01
@rosen-vladimirov rosen-vladimirov merged commit eea1a18 into release Aug 9, 2018
@rosen-vladimirov rosen-vladimirov deleted the vladimirov/changelog-421 branch August 9, 2018 06:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants