Blather as IM client for testing purposes (simulating second user)

16 views
Skip to first unread message

Iaroslav Kukharuk

unread,
Dec 3, 2015, 9:35:38 AM12/3/15
to Blather
Hi,
I'm looking for a way to use blather as xmpp client (which is using some custom extensions like OTP's) for testing (automation) purposes. So basically I want to have instance which could login/register/send messages/be extendable(in meaning of custom requests)


cli = CustomBlather.new(@jid)
cli
.register
cli
.login
cli
.message_to(@friend_jid, 'Hi there')
cli
.update_cert
cli
.update_avatar('path/to/file')


Is it possible to build such client with blather?

How can I send custom request like so:
<iq type="set" id="IDENTIFIER">
<query xmlns="custom:iq:authorization">
 <phone>PHONE_NUMBER</phone>
</query>
</iq>



 Thanks alot in advance!

Ben Langfeld

unread,
Dec 9, 2015, 2:53:06 PM12/9/15
to xmpp-b...@googlegroups.com
Yes it's possible; do you have a specific question or some specific problem you've encountered?

--
You received this message because you are subscribed to the Google Groups "Blather" group.
To unsubscribe from this group and stop receiving emails from it, send an email to xmpp-blather...@googlegroups.com.
To post to this group, send email to xmpp-b...@googlegroups.com.
Visit this group at http://groups.google.com/group/xmpp-blather.
For more options, visit https://groups.google.com/d/optout.

Iaroslav Kukharuk

unread,
Dec 14, 2015, 9:29:05 AM12/14/15
to Blather
My messenger uses some custom xmpp extensions. I need to send some custom queries like so:

<iq type="set" id="IDENTIFIER">
<query xmlns="custom:iq:authorization">
 <phone>PHONE_NUMBER</phone>
</query>
</iq>
How can I do it with blather?

So I need to sent few queries before user is authenticated in XMPP sense.


How can I instantiate client? will this work?
class IMApp
  extend Blather::DSL
  def start
    client.run
    new
  end
  
  def auth(phone)
    # sendig custom query here
  end
end

im_cli = IMApp.start
im_cli.auth




среда, 9 декабря 2015 г., 21:53:06 UTC+2 пользователь Ben Langfeld написал:

Iaroslav Kukharuk

unread,
Dec 21, 2015, 7:48:47 AM12/21/15
to Blather
anyone, please?
Reply all
Reply to author
Forward
0 new messages