Automation Testing for Chat Based Application or Push Notification - testing

I Wonder if is there any possibility of testing the Mobile Chat based application through automation scripts. Lets say we have whatsapp, FB, Skype chat based apps. How people will be doing testing for these apps apart from manual?
I can automate on one side of mobile through some automation tools selendroid, see test and some other like open application, search a contact ,and send text message. But how on the other side of mobile will be automated ? like as soon as it receives message it replies with same message.
Even how push notification automation testing is done?
I can see some apps which do auto reply for sms , but thats not works for testing.
Kindly suggest your thoughts on this.

I have automated the chat apps for mobile on iOS and Android. Automating both sides is possible.
For ex- you have a scenario that you want to login to your chat app account and send a message to another user.
You have to use two devices. Connect them to your system give them different names. Like you mentioned seetest.Two devices can be connected to it at a time.
Lets say device1 and device2.
Pseudo script -
Device1 activate
Launch chat app in device1 - login
Device2 activate
Launch chat app in device2 - login
Device1 activate -select a user(which logged in from device2)- send message
Device2 - check the notification object or the object which will display this message and compare the property say "text" with the message sent from device2.
You can guide the script using the functions from the mobile automation tool to run your script step on a device with particular name or identifier.

Related

APNS handle obtained by Expo in React Native is incorrect

EXPO SDK Version: 42.0.01
Developing for: iOS
Our goal: successfully send a test notification from Test Send tool in Azure Notification Hub to a registered physical iPhone which is running a local instance of an EXPO app.
Progress: we're able to successfully register a physical iPhone with Azure Notification Hub without using a 3rd party library. We can see that registration in the Hub.
Issues: when using the Azure's Test Send tool we're getting an error "The Push Notification System handle for the registration is invalid" and the test notification does not get delivered.
Debugging:
we're using EXPO's Notifications.getDevicePushTokenAsync() API to obtain the push token.
Azure support team analysed the logs and concluded that the problem is the PNS handle i.e. Apple's ID of the phone registered for notifications.
the phone's PNS handle remains the same at all times.
by using "expo credentials:manager" I've added a new Push Notification Key using KeyID, TeamID and .p8 certificate - the PNS handle didn't change after doing that and notifications were failing too.
I haven't found any tools to validate the APNS handle. I'm currently awaiting a .p12 certificate from our corporate team to test notifications by using https://pushtry.com/.
How do we validate the APNS handle and if found that it's invalid - how do we cycle it / request another?
The PNS Handle from APNs does not change that often as it is tied to the device and app installation. See this answer for more details Does the APNS device token ever change, once created?

How does bookmyshow decrypts Whatsapp api to send text?

I am curious to know how Bookmyshow and Redbus decrypts Whatsapp API to send text message via whatsapp ?
Does Whatsapp published their API publically or their technical team decrypt their API ?
So far WhatsApp has not publicly announced API's. It is not sure if there is any API available for premium customers like Bookmyshow or Redbus.
But you can achieve automated message like how Bookmyshow and redbus does by using Selenium combined with WhatsApp Web.
WhatsApp has provided a feature called Click to Chat, reference : https://faq.whatsapp.com/en/26000030/. By this method you can message anyone without having their phone number saved in your phone contacts list.
Click to chat workflow involves
Creating a custom URL with user phone number and text message to send
Clicking on the Send Button (This will open WhatsApp Web with user phone number provided is selected in WhatsApp Web chat area)
Clicking on the send button in chat area of whats app web to send message.
The above 3 steps can be automated using Selenium (Web browser automation).
There are lot of articles explaining this method and one such example can be found at https://www.craftedforeveryone.com/whatsapp-send-api-or-click-to-chat-automation-using-selenium-and-c-sharp/
By using Selenium, WhatsApp for Business and WhatsApp Web you can exactly replicate how bookmyshow sends messages.
WhatsApp for Business provides option to set automatic replies by which you can auto respond to the incoming messages.

Does tvOS support notification facility for chat applications?

I am building a tvOS app for the new Apple TV that needs to get notifications from a server every time that a chat message is sent. This notification is also to be displayed on the Apple TV. As much as I understand push notifications are not allowed with tvOS.
With this being said, are there any alternatives to what I need?
To clarify: This is a chat app that needs to display a notification to the user on the TV screen every time a message is received by the user. The app stays running indefinitely, while showing instant notifications. - I cannot use push notifications.
Please let me know if this makes sense, and thank you in advance for your help!
We recently built an app for apple TV that shows instant messages from different clients connected to our server. A good library that will answer your requirements is socket.io-client
Just google socket.io and learn how it works. Basically, you wait for a connection on your server and then you can send messages to your clients. On the client side (tvOS in your case) you specify what methods to run as response to the different event coming from the server.
Good luck.

how to log pushbullet notifications which is showing through chrome browser extension?

I am using pushbullet to receive my phone notifications to my computer through pushbullet chrome extension. see Now i can get pushbulllet notifications from my phone to computer which is completely fine. but, i want to log those notifications somewhere which is very useful if i'm not in front of my computer because the notification are showing for very limited time.
basically i am a PHP developer,is there any way to achieve this using pushbullet API?.
thanks
charles

Sending SMS Without SMS Gateway in IBM Worklight

I want to send Sms on one number every time when the user clicks the button in my application.I don't want to use any Sms Gateway.The Message can be send with the Phone mobile carrier network.I Could not find it any docs.
Can Any body help me with the docs and the sample code.
Help is appreicated.
You can try the following, which is outside of MobileFirst Platform:
Use the sms:// protocol and launch the system messaging application and send it
Use available 3rd party Cordova plugins
This may require to take care of the whitelisting in Cordova to allow it.