narrow: Extract test for non existing user narrow.

This commit is contained in:
Puneeth Chaganti 2019-06-28 05:32:43 +05:30 committed by Tim Abbott
parent 4dcc1b744f
commit 91b2ac27ae
1 changed files with 12 additions and 8 deletions

View File

@ -157,6 +157,17 @@ function expect_all_pm() {
});
}
function expect_non_existing_user() {
casper.then(function () {
casper.waitUntilVisible('#non_existing_user', function () {
casper.test.info("Empty feed for non existing user visible.");
var expected_message = "\n This user does not exist!" +
"\n ";
this.test.assertEquals(casper.fetchText('#non_existing_user'), expected_message);
});
});
}
function check_narrow_title(title) {
return function () {
// need to get title tag from HTML
@ -193,14 +204,7 @@ function search_silent_user(str, item) {
function search_non_existing_user(str, item) {
common.select_item_via_typeahead('#search_query', str, item);
casper.then(function () {
casper.waitUntilVisible('#non_existing_user', function () {
casper.test.info("Empty feed for non existing user visible.");
var expected_message = "\n This user does not exist!" +
"\n ";
this.test.assertEquals(casper.fetchText('#non_existing_user'), expected_message);
});
});
expect_non_existing_user();
un_narrow();
}