apla / me.apla.cordova.app-preferences

App preferences plugin for cordova
Apache License 2.0
201 stars 210 forks source link

Browser mocks/testing? #68

Open Zorgatone opened 8 years ago

Zorgatone commented 8 years ago

I've been thinking, is there a way to test/mock this plugin in the browser?

Since it has local storage fallback, it would be good to access it in the browser during development. Do you know how can we do it?

It's very frustrating to have to run on a simulator or device, just to test your application preferences.

I hope it's possible.

apla commented 8 years ago

I've just added ability to test iOS plugin, browser testing is also possible, but I don't understand purpose. Can you clarify a little?

apla commented 8 years ago

Seems I get your message wrong. Probably you wanted to add browser cordova platform. So, I did it. Try version 0.7.7

Zorgatone commented 8 years ago

Sorry I didn't reply in time.

I mean my app needs to know the settings to function, and I also need to be able to test my app without a device or a simulator while developing it. What I tipically use is cordova or ionic serve command. I have the browser platform added, but you mean I should do cordova run browser?

When I said test/mock I meant this. It would be too slow/boring to run everytime on device or simulator, that's why I suggested to support the browser :smile:

Zorgatone commented 8 years ago

I'll try version 0.7.7, as soon as I'll be implementing the settings/preferences of my app. I'm behind schedule of other features atm

apla commented 8 years ago

cordova run browser and cordova serve works fine in desktop browser now.

Zorgatone commented 8 years ago

Great thanks! Can't want to try it out now

pougin commented 8 years ago

Hi apla. Great thanks to your plugin. When I test my app by running ionic serve , I keep getting message Error: Plugin not enabled(…) in Chrome. I am using 0.7.7. And my ngCordova version is v0.1.23-alpha. My ionic.Platform.platforms = browser,ios,ios8,ios8_0 . I change the browser UA to set platform to platforms: browser,macintel . The error keeps. I guess there's some slight difference between ionic serve and cordova serve?

apla commented 8 years ago

@pougin seems like you faced different issue, please take a look https://github.com/apla/me.apla.cordova.app-preferences/issues/70#issuecomment-179686449