/** CaseID: 75275 Check topic AS after Move a topic */
  @Test
  public void test01_CheckTopicASafterMoveTopic() {
    String titleCat = "Category 01";
    String titleForum = "Forum 01";
    String titleTop = "Topic 01";
    String forum2 = "Forum 02";
    String[] addForum2 = {forum2, "1", null, null, forum2};
    String[] permission = {};

    info("Move a topic");
    // create category, forum, topic
    mngTopic.addCategoryForumTopic(titleCat, titleForum, titleTop, titleTop);
    click(By.linkText(titleCat));
    waitForElementNotPresent(ELEMENT_BREAD_FORUM.replace("${forum}", titleForum));

    // Create a forum - destination
    mngFru.addForum(titleCat, addForum2, true, "", "", false, 0, permission);

    // Move topic
    click(By.linkText(titleCat));
    click(By.linkText(titleForum));
    click(mngFru.ELEMENT_TOPIC_LINK.replace("${topic}", titleTop));
    waitForAndGetElement(mngPost.ELEMENT_POST_REPLY_BUTTON);
    mngTopic.moveTopic(titleTop, forum2);

    // Check activity
    navTool.goToHomePage();
    hpgAct.checkCommentAfterMoveTopic(titleTop, titleCat + ">" + forum2);

    // Delete data
    goToForums();
    click(By.linkText(titleCat));
    mngCat.deleteCategoryInForum(titleCat, true);
  }
  /** CaseId: 68917 -> Ban IP */
  @Test
  public void test02_BanIP() {
    String catName = "CategoryBanIP_02";
    String description = "Add new category in forum";
    String forumName = "ForumBanIP_02";
    String topic = "TopicBanIP_02";
    String message = "New topic 02";

    info("Add new category, forum, topic with user admin");
    cat.addNewCategoryInForum(catName, "1", 0, null, description, 0, null);
    forum.quickAddForum(forumName);
    magtopic.quickStartTopic(topic, message);

    String ip = Utils.getIPOfLocal();

    info("Set banIP is localhost");
    setBanIp(ip);
    magAc.signOut();

    info("Check banIp with user demo");
    driver.get("http://" + ip + ":8080/portal");
    magAc.signIn("demo", "gtn");
    goToForums();
    click(By.linkText(forumName));
    waitForAndGetElement(ELEMENT_START_TOPIC_DISABLE);
    waitForTextPresent(MSG_BLOCK_CREATE_TOPIC);
    waitForTextPresent(MSG_BLOCK_POST);
    waitForTextPresent(MSG_BLOCK_POST_ATTACHMENT);
    waitForTextPresent(MSG_BLOCK_EDIT_YOUR_POST);

    click(By.linkText(topic));
    waitForAndGetElement(ELEMENT_POST_DISABLE);
    waitForTextPresent(MSG_BLOCK_CREATE_TOPIC);
    waitForTextPresent(MSG_BLOCK_POST);
    waitForTextPresent(MSG_BLOCK_POST_ATTACHMENT);
    waitForTextPresent(MSG_BLOCK_EDIT_YOUR_POST);
    magAc.signOut();

    driver.get(baseUrl);
    magAc.signIn("john", "gtn");
    goToForums();
    deleteBanIp(ip);
    click(By.linkText(catName));
    cat.deleteCategoryInForum(catName);
  }
  /**
   * Case ID:107032. Test Case Name: Move Post of normal users by Administrator. Pre-Condition:
   * Post-Condition: Done with OSs and browsers : Generated by phuongdt at 2014/01/22 10:24:54
   */
  @Test
  public void test01_MovePostOfNormalUsersByAdministrator() {
    String titleCat = "Category " + getRandomNumber();
    String titleForum = "Forum " + getRandomNumber();
    String titleTop1 = "Topic " + getRandomNumber();
    String titleTop2 = "Topic " + getRandomNumber();
    String post1 = "Post " + getRandomNumber();

    info("Test 01 Move Post of normal users by Administrator");
    /*Step Number: 1
    *Step Name: Step 1: Create topic
    *Step Description:
    	- Login as administrator to create a new category, forum, 2 topics"Topic A.1.1" and "To move demo's post"
    *Input Data:

    *Expected Outcome:
    	- Categories, forums, topics are created*/
    mngFru.addCategoryForum(titleCat, titleForum);
    click(mngTopic.ELEMENT_START_TOPIC_BUTTON);
    mngTopic.startTopic(titleTop1, titleTop1, "", 0, null, true, true);
    click(mngTopic.ELEMENT_START_TOPIC_BUTTON);
    mngTopic.startTopic(titleTop2, titleTop2, "", 0, null, true, true);

    /*Step number: 2
    *Step Name: Step 2: Add post(s) by normal users
    *Step Description:
    	- Log in as demo
    	- Post a reply to "Topic A.1.1"
    *Input Data:

    *Expected Outcome:
    	- Post(s) is created*/
    magAc.signIn(DATA_USER4, DATA_PASS1);
    goToForums();
    click(By.linkText(titleForum));
    click(By.linkText(titleTop1));
    mngPost.postReply(post1, post1, "", "");

    /*Step number: 3
    *Step Name: Step 3: Move post by Admin
    *Step Description:
    	- Login as admin
    	- Move demo's post from "Topic A.1.1" to "To move demo's post"
    *Input Data:

    *Expected Outcome:
    	This post is removed from "Topic A.1.1" and move to "To move demo's post"*/
    magAc.userSignIn(userType.ADMIN);
    goToForums();
    click(By.linkText(titleForum));
    click(By.linkText(titleTop1));
    mngPost.movePost(post1, titleCat + "/" + titleForum + "/" + titleTop2);

    /*Step number: 4
    *Step Name: Step 4: Move to Other topic
    *Step Description:
    	- Move again demo's post from "To move demo's post" to another topic
    *Input Data:

    *Expected Outcome:
    	Move successfully and no Ui error no exception in console*/
    click(By.linkText(titleCat));
    click(By.linkText(titleForum));
    click(By.linkText(titleTop2));
    mngPost.movePost(post1, titleCat + "/" + titleForum + "/" + titleTop1);

    // Clear data
    info("Clear data");
    click(By.linkText(titleCat));
    mngCat.deleteCategoryInForum(titleCat, true);
  }