Skip to content
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

Test app installation fails; no tests listed #962

Open
mikerusso-tsi opened this issue Apr 26, 2023 · 7 comments
Open

Test app installation fails; no tests listed #962

mikerusso-tsi opened this issue Apr 26, 2023 · 7 comments

Comments

@mikerusso-tsi
Copy link

The following instruction for installing the test app yields an error:
cordova plugin add ../cordova-plugin-ble-central/tests
== > Invalid Plugin! ../cordova-plugin-ble-central/tests needs a valid package.json
True, the repo has no package.json in the tests subdirectory.
As a result, there are no tests listed when running the app.
Is there a repair or work-around? Thanks!

@peitschie
Copy link
Collaborator

Hi @mikerusso-tsi

That's not surprising, as I haven't really used that test suite for a very long time 😅
What's driving your desire to get this running again?

I can see ways to make it work again probably, but it would be good to understand what you're wanting to get out of it!

@mikerusso-tsi
Copy link
Author

mikerusso-tsi commented Apr 27, 2023 via email

@peitschie
Copy link
Collaborator

Right... that makes sense!

In terms of testing the plugin, the easiest thing is to create a clean cordova app, add the plugin, and then put a single ble.scan() with an alert in the demo JS file. There's almost always BLE devices around, and this checks that the underlying BLE hardware is all connecting properly.

The test code here itself relies on a plugin that I'm not sure is well maintained, and I haven't had a chance yet to dig into further. Let me know though if the above doesn't meet your needs well enough however 🙂

Either way, I should either remove or fix the test app instructions so I need to take some action.

@mikerusso-tsi
Copy link
Author

mikerusso-tsi commented Apr 28, 2023

It seemed like there was a very comprehensive set of tests and they would serve well as QA for the plugin, so I would certainly encourage you to get them going again.

I was unsure about your suggestion for an alert in a demo file - alerts weren't showing up for me. Instead, I added the following in jasmineDone() in platform/ios/platform_www/cdvtests/jasmine-2.4.1/jasmine-html.js and ran it on an iPad, tapping the various test run buttons to start new scans:
var bleDevice = 'NO BLE';
ble.scan([], 5, function(device) {
bleDevice = JSON.stringify(device);
alert.appendChild(createDom('span', {className: statusBarClassName}, ' BLE Device = ' + bleDevice, seedBar));
} /*, failure */ );
The scan results then show up in the status bar. Thanks again for you help! Please reply here if you get the tests working!

@peitschie
Copy link
Collaborator

It seemed like there was a very comprehensive set of tests and they would serve well as QA for the plugin, so I would certainly encourage you to get them going again.

This particular aspect is well covered by a much more extensive set of automated multi-platform end-to-end tests I run against a farm of local hardware 🙂. This is used in some medical-related software applications across both iOS and Android, so I have a very vested interest in keeping it long-term stable across a variety of Android platforms and devices especially.

Glad you were able to prove out the build tools to your satisfaction however.

@mikerusso-tsi
Copy link
Author

This particular aspect is well covered by a much more extensive set of automated multi-platform end-to-end tests I run against a farm of local hardware
I share your interest in its stability... Is the testing you mentioned part of this plugin (repo) or outside of it?

@peitschie
Copy link
Collaborator

@mikerusso-tsi currently outside of the repo, unfortunately.

Apart from a standalone test set leveraging webdriver.io, I have access to several applications with their own dedicated automation suites as part of my job which are also leveraged to help test out the edges of the plugin itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants