import ChatController from 'automation.client.ui/src/controllers/web/chat.controller.js'
ChatController
Extends:
Constructor Summary
Public Constructor | ||
public |
constructor(args: args) Adds the browser to the controller from the Base Controller constructor. |
Member Summary
Public Members | ||
public |
chatPage: * |
Method Summary
Public Methods | ||
public |
async getChatMessagesForContact(name: String): Array Gets messages for selected contact |
|
public |
async getChatWindowHeaderName(): String Gets contact name from top of chat message window |
|
public |
async getLastMessageForContact(name: String): Object Get last message (as in the newest) for selected contact |
|
public |
async sendChatMessageToContact(name: String, message: String) Selects contact, then sends message to them |
Public Constructors
public constructor(args: args) source
Adds the browser to the controller from the Base Controller constructor. This then gets pushed into the various page objects and is ultimately used there to make calls to the actual browser.
Params:
Name | Type | Attribute | Description |
args | args | Args from client |
Public Members
public chatPage: * source
Public Methods
public async getChatMessagesForContact(name: String): Array source
Gets messages for selected contact
Params:
Name | Type | Attribute | Description |
name | String | name of contact |
Example:
client.chatController.getChatMessagesForContact('Test User')
// Returns...
[{
from: 'Another User',
timestamp: 'Friday, March 21, 2017',
message: 'Hey from another user!'
},
{
from: 'Another User',
timestamp: 'Monday, March 24, 2017',
message: 'Did you get my last message?'
},
{
from: 'Another User 2',
timestamp: 'Tuesday, March 25, 2017',
message: 'Hey, Another User is trying to reach you...'
}]
public async getChatWindowHeaderName(): String source
Gets contact name from top of chat message window
TODO:
- Fix this!
public async getLastMessageForContact(name: String): Object source
Get last message (as in the newest) for selected contact
Params:
Name | Type | Attribute | Description |
name | String | name of contact |
Example:
client.chatController.getLastMessageForContact('Test User')
// Returns...
{
from: 'Another User',
timestamp: 'Friday, March 24, 2017',
message: 'Hey from another user!'
}