Im new to the community, wasn't sure if this is right place for this question, i hope so
Im working on iOS mobile app that uses Adobe Mobile SDK for analytics tags.
And im curious if there is any way to automate tests for analytics events?
Basically when UI tests is running and, let say specific button was tapped, how can i automatically assert that analytics data got generated and call being placed ?
I google it, and wasn't be able to found anything.
Curious if anyone else face same situation and maybe found some working solution?
Have you got this Test Data going into a Development Virtual report suite? If so may be you can execute the test case at a time when there is less testing going on and build out a segment to narrow down the traffic by Device, OS, and date and time.
This will allow you to cut the data so that you can validate.
Posting a eVar that is persistent for visit with a unique id s the best way to cut the data IMO, but take a bit of set up.
Thx for reply. Test data is going to actual live analytic server. And the idea here is to be able to test it within Swift code, because i have complex UI tests, which generate a lot of data... and when you analyze data afterwards it's hard to validate that every action did generate data or something was missing.
Im trying to find some kind of 1-to-1 verification: 'element tapped->call being placed->call being assert->next step..."
I read it carefully just you made no mention of what or how you did this presently. Helps to have as clear a picture as possible in assisting you.
Anyways, so here is what you could try...
Use Selenium/Selendroid and Appium scripts to run tests where Analytics data is expected. The challenge is if you have 100 pages the script needs to be setup ether to look for each of the 100 pagenames or... see the pagename variable fires...
Thanks for trying to help, let me clear some of this up.
Like I mention before, we have iOS app, written in ObjC and Swift, and we use a native test environment XCTest UI, all this live in Xcode. We run tests via Jenkins using xcodebuild command. We have Adobe SDK that implemented in the App. So when user perform some action - app generate and sent data to analytic server.
So now, we can test this is 2 major ways:
1. Change the Endpoint (using Bloodhound, fake server, wiremock and etc) and check that we received expected data.
Problem with this method is that data is too big, we have 9 hours of UI tests execution and thousands events after this run (including duplications). So its almost impossible to test this reliably.
2. Catch data event as soon as it got created. Basically for example in two words, when app tap 'Sign Up' button and SDK generate event - on very next line of my test code i wanna put assertion (in Swift) that will assert this event data, not only URL, but everything in that form.
And this is what im trying to find out here.
Example for Python solution on Web project is not convertible to my situation, unfortunately.
ok cool again helps me get you some ideas...
Hows this? I think you just need adjust some logging targets and I guess your next challenge will be parsing results...
Its based on some older dev environments but hopefully will work for you. GLTU