I have followed the instructions at https://github.com/wix/detox, created a few simple tests and run them successfully on an iPhone sim. However, when using an iPad (ios 11.2) it stalls after entering text in the first of two text inputs (for a login screen). My test is as follows
it('should log in and take user to feed', async () => {
await element(by.id('email')).typeText('email')
await element(by.id('password')).typeText('password')
await element(by.id('loginButton')).tap()
await expect(element(by.id('feed'))).toBeVisible()
})
As I say, all tests pass on iPhone but not iPad, and when viewing the sim it clearly hangs between the first and second text field. I've also tried replaceText() which results in a failed test, I think due to this issue with EarlGrey https://github.com/wix/detox/issues/151.
I searched around the problem and I think it's related to this https://github.com/google/EarlGrey/issues/239#issuecomment-247737738. If anyone knows a fix I'd be very grateful.
Thanks.
Related
Initially the person before me set up a screen observer so that whenever the page changes, setCurrentScreen is triggered to send a event and log the screen. Because we use a bunch of open containers to animate page opening, the screen observer doesnt get triggered. So I went through the app and added some setCurrentScreen for those that the screenObserver missed, and while there I also added some logEvents to see if people are using specific parts of the app.
The way I set enabled debug view was in xcode, going to Product -> Scheme -> Edit Scheme and adding -FIRAnalyticsDebugEnabled and -FIRDebugEnabled Edit scheme
After ticking both of the above (or just one or the other), only these events are being triggered then the app stops sending events. Completely. What am I missing? output
I cannot find another issue about this. I am using the same package name in the app and firebase, otherwise I would have no output. All other issues are talking about no output at all. I have tried to do this on simulator and on actual iPhone and they both yield the same result. I have also set up a android emulator and have an actual phone. Tried it on both and same result. The above screenshot is from iPhone as I am on Mac and more comfortable working on a iPhone.
i have set IS_ANALYTICS_ENABLED to true in the .plist file and this did not work
My flutter app contains hive boxes where it loads objectlist from firebase with a streamprovider for each box.
After uninstall the hole app including the data from the device (real device or simulator) and reinstall the app only loads data in one box, the other 6 boxes contains nothing.
I have to make an hot restart to load all the data from firebase in the other boxes and I don't understand why?
This code runs before the mainscreen of the app is reached, the code is for all boxes the same. Box listAllPeoples is never empty and is called first:
final listAllPeoples = Provider.of<List<People>>(context);
loadingPeoplesStreamInLocalDb(listAllPeoples);
Future loadingPeoplesStreamInLocalDb(List<Peoples> listAllPeoples)async{
await Hive.openBox('listAllPeoples');
await Hive.box('listAllPeoples').clear();
await Hive.box('listAllPeoples').addAll(listAllPeoples);
}
Flutter Driver code has to tap on the native "Allow" button to continue and simulate the correct user behaviour.
See this screenshot. Native iOS popup before app starts - Allow Notifications
App has not yet completely started and is waiting for this tap.
How does one get the driver to tap on the native iOS popup?
Any suggestions and ideas are welcome.
Here is the code for one attempt to wait for the app before continuing with other tests; it just awaits indefinitely:
setUpAll(() async {
driver = await FlutterDriver.connect();
await driver.waitUntilFirstFrameRasterized();
});
Here is another attempt at finding the word "Allow" in the popup and tapping on it:
test('Allow app to send Notifications.', () async {
final allow = find.byTooltip("Allow");
await delay(750);
await driver.tap(allow);
});
It does not find the word.
The issue is probably that Flutter Driver is not aware of the iOS native popup.
Other tests are very simple once in the app, for example, to tap on fields, enter text, scroll pages, etc.
Any ideas on how to do this?
Unfortunately this feature is currently not possible. Flutter Driver can't interact with native elements (v1.20.4).
https://github.com/flutter/flutter/issues/34345
https://github.com/flutter/flutter/issues/12561
When I do Login I am starting to check observable working but when application is in background it is not executing. I am using observable because after every 5 seconds refresh should happen. It seems it is not running in background. Any other solution to run the code after every 1 minute whether application is in background or foreground. Thanks in advance !
Loginsuccessfully
this.provider.startBackgroundRefreshInterval();
In service class below code added
startBackgroundRefreshInterval() {
var refreshInterval = localStore.getPersistedData(App.ISCHECKBOX_KEY);
this.timerSubscription = Observable.interval(parseInt(refreshInterval))
.subscribe((val) => {
console.log("Observable subscribed");
});
}
/**
* unsubscribe subscription
*/
unSubscribeOnehourSubscription() {
console.log("Observable Unsubscribed");
this.timerOneHourSubscription.unsubscribe();
}
Now refreshInterval is based on checkbox value selection
updateCheckboxList(value:any) {
this.service.unSubscribeSubscription();
this.service.startBackgroundRefreshInterval();
}
Once application will go in background Observable not calling
currently refreshInterval selected as 1 minute
what is other way to call functon continuosly in background in ionic ?
I am currently working on the same thing. While I can't say I know all the things about this, here is what I have found so far.
When your app goes to the background, it is essentially put to sleep. Meaning none of the code you are counting on, including intervals is going to execute.
Here are some solutions to this problem I have worked on.
1) BackgroundFetch as seen here in this cordova plugin https://github.com/transistorsoft/cordova-plugin-background-fetch and https://ionicframework.com/docs/native/background-fetch will in both android and ios attempt to run a callback every approximately 15 minutes (read the link for why that timing is a thing).
2) BackgroundMode as seen here https://ionicframework.com/docs/native/background-mode will put your app into a "stay active while in background" mode that you can control. This will work in keeping your app up and running even in background, but you may find that this is not acceptable to the stores (particularly might get rejected by ios store).
That's what I've found thus far. Hope it's helpful.
I have an application that is currently named "xxxx". The app runs and works perfectly without any problems. However, I have reached a stumbling point. When I try to load the application onto my iPhone, the pictures on my picker view seemed to have disappeared for some strange reason. I've done multiple hours of debugging and everything checks out normal. I then decided I wanted to change the product name from "xxxx" to "xxxx Redo". As soon as I did that, the application loaded perfectly normal (with the pictures in the Picker View as it should be).
In conclusion, it comes to find out that there is no actual bug in the programming aspect of it. However, my question comes up as to why does it not load the correct way with the original product name but then loads the right way when the product name is changed?
The second part of my question is if anyone knows of a way to fix the original application so that way it displays correctly again with the original name?
I have tried the following:
Cleaning the app
Trashing the .app file and rebuilding
Deleting the app on the iPhone and rebuilding.
These things sometimes just happen, you can try the following extra steps:
clean build folder in XCode (press alt while clicking Product menu)
reboot the phone (poweroff/poweron)
I have seen cases where it made a difference.