extend changing username to make sure it shows up the changes in the chat dialogue for new messages

This commit is contained in:
John McLear 2012-10-28 17:47:17 +00:00
parent b4680e42d7
commit e33678e625
1 changed files with 18 additions and 0 deletions

View File

@ -26,6 +26,24 @@ describe("change username value", function(){
//check if the username has been changed to John McLear
expect(correctUsernameValue).to.be(true);
//click on the chat button to make chat visible
var $chatButton = chrome$("#chaticon");
$chatButton.click();
var $chatInput = chrome$("#chatinput");
$chatInput.sendkeys('O hi'); // simulate a keypress of typing JohnMcLear
$chatInput.sendkeys('{enter}'); // simulate a keypress of enter actually does evt.which = 10 not 13
//check if chat shows up
helper.waitFor(function(){
return chrome$("#chattext").children("p").length !== 0; // wait until the chat message shows up
}).done(function(){
var $firstChatMessage = chrome$("#chattext").children("p");
var containsJohnMcLear = $firstChatMessage.text().indexOf("John McLear") !== -1; // does the string contain Jo$
expect(containsJohnMcLear).to.be(true); // expect the first chat message to contain JohnMcLear
});
done();
});
});