Search in sources :

Example 1 with SpecialBlockListPage

use of com.wikia.webdriver.pageobjectsfactory.pageobject.special.block.SpecialBlockListPage in project selenium-tests by Wikia.

the class MessageWallTests method blockedUserCanCreatePostOnHerMessageWall.

/**
   * DAR-2133 bug prevention test case details jira: https://wikia-inc.atlassian.net/browse/DAR-2133
   * pre: test makes sure that QATestsBlockedUser is blocked on tested wikia. 1. user
   * QATestsBlockedUser is allowed to post on his own MessageWall 2. as QATestsBlockedUser go to his
   * messageWall 3. QATestsBlockedUser should be able to post on his MessageWall 4.
   * QATestsBlockedUser should be able to respond on his MessageWall
   */
@Test(groups = { "MessageWall_008", "MessageWall", "MessageWallTests" })
public void blockedUserCanCreatePostOnHerMessageWall() {
    SpecialBlockListPage blockListPage = new SpecialBlockListPage().open();
    boolean isUserBlocked = blockListPage.isUserBlocked(User.CONSTANTLY_BLOCKED_USER.getUserName());
    if (!isUserBlocked) {
        blockListPage.loginAs(User.STAFF.getUserName(), User.STAFF.getPassword(), wikiURL);
        SpecialBlockPage blockPage = new SpecialBlockPage(driver).open();
        blockPage.typeInUserName(User.CONSTANTLY_BLOCKED_USER.getUserName());
        blockPage.typeExpiration("10 year");
        blockPage.typeReason("block QATestsBlockedUser");
        blockPage.deselectAllSelections();
        blockPage.clickBlockButton();
    }
    blockListPage.loginAs(User.CONSTANTLY_BLOCKED_USER.getUserName(), User.CONSTANTLY_BLOCKED_USER.getPassword(), wikiURL);
    MessageWall wall = new MessageWall(driver).open(User.CONSTANTLY_BLOCKED_USER.getUserName());
    MiniEditorComponentObject mini = wall.triggerMessageArea();
    String message = PageContent.MESSAGE_WALL_MESSAGE_PREFIX + wall.getTimeStamp();
    String title = PageContent.MESSAGE_WALL_TITLE_PREFIX + wall.getTimeStamp();
    mini.switchAndWrite(message);
    wall.setTitle(title);
    wall.submit();
    wall.verifyMessageText(title, message, User.CONSTANTLY_BLOCKED_USER.getUserName());
    MiniEditorComponentObject miniReply = wall.triggerReplyMessageArea();
    String reply = PageContent.MESSAGE_WALL_QUOTE_PREFIX + wall.getTimeStamp();
    miniReply.switchAndQuoteMessageWall(reply);
    wall.submitQuote();
    wall.verifyQuote(reply);
}
Also used : MessageWall(com.wikia.webdriver.pageobjectsfactory.pageobject.messagewall.MessageWall) MiniEditorComponentObject(com.wikia.webdriver.pageobjectsfactory.componentobject.minieditor.MiniEditorComponentObject) SpecialBlockPage(com.wikia.webdriver.pageobjectsfactory.pageobject.special.block.SpecialBlockPage) SpecialBlockListPage(com.wikia.webdriver.pageobjectsfactory.pageobject.special.block.SpecialBlockListPage) Test(org.testng.annotations.Test)

Example 2 with SpecialBlockListPage

use of com.wikia.webdriver.pageobjectsfactory.pageobject.special.block.SpecialBlockListPage in project selenium-tests by Wikia.

the class UserAndRights method staffCanUnblockUser.

@Test(groups = { "usersAndRights004" }, dependsOnMethods = { "staffCanBlockUser" })
@Execute(asUser = User.STAFF)
public void staffCanUnblockUser() {
    SpecialUnblockPage unblock = new SpecialUnblockPage().open();
    unblock.unblockUser(credentials.userNameBlocked);
    unblock.verifyUnblockMessage(credentials.userNameBlocked);
    SpecialBlockListPage list = new SpecialBlockListPage().open();
    list.searchForUser(credentials.userNameBlocked);
    list.verifyUserUnblocked();
}
Also used : SpecialUnblockPage(com.wikia.webdriver.pageobjectsfactory.pageobject.special.block.SpecialUnblockPage) SpecialBlockListPage(com.wikia.webdriver.pageobjectsfactory.pageobject.special.block.SpecialBlockListPage) Execute(com.wikia.webdriver.common.core.annotations.Execute) Test(org.testng.annotations.Test)

Example 3 with SpecialBlockListPage

use of com.wikia.webdriver.pageobjectsfactory.pageobject.special.block.SpecialBlockListPage in project selenium-tests by Wikia.

the class UserAndRights method staffCanBlockUser.

@Test(groups = { "usersAndRights001" })
@Execute(asUser = User.STAFF)
public void staffCanBlockUser() {
    SpecialBlockPage block = new SpecialBlockPage(driver).open();
    block.deselectAllSelections();
    block.typeInUserName(credentials.userNameBlocked);
    block.selectExpiration("2 hours");
    block.clickBlockButton();
    SpecialBlockListPage list = new SpecialBlockListPage().open();
    list.searchForUser(credentials.userNameBlocked);
    list.verifyUserBlocked(credentials.userNameBlocked);
}
Also used : SpecialBlockPage(com.wikia.webdriver.pageobjectsfactory.pageobject.special.block.SpecialBlockPage) SpecialBlockListPage(com.wikia.webdriver.pageobjectsfactory.pageobject.special.block.SpecialBlockListPage) Execute(com.wikia.webdriver.common.core.annotations.Execute) Test(org.testng.annotations.Test)

Aggregations

SpecialBlockListPage (com.wikia.webdriver.pageobjectsfactory.pageobject.special.block.SpecialBlockListPage)3 Test (org.testng.annotations.Test)3 Execute (com.wikia.webdriver.common.core.annotations.Execute)2 SpecialBlockPage (com.wikia.webdriver.pageobjectsfactory.pageobject.special.block.SpecialBlockPage)2 MiniEditorComponentObject (com.wikia.webdriver.pageobjectsfactory.componentobject.minieditor.MiniEditorComponentObject)1 MessageWall (com.wikia.webdriver.pageobjectsfactory.pageobject.messagewall.MessageWall)1 SpecialUnblockPage (com.wikia.webdriver.pageobjectsfactory.pageobject.special.block.SpecialUnblockPage)1