Search in sources :

Example 81 with Forum

use of it.vige.rubia.model.Forum in project rubia-forums by flashboss.

the class AdminPanelForumTest method setUp.

@BeforeClass
public static void setUp() {
    driver.get(HOME_URL);
    String message = createCategory(driver, new Category("First Test Category"));
    assertTrue(message.equals(CREATED_CATEGORY_1_MESSAGE));
    message = createCategory(driver, new Category("Second Test Category"));
    assertTrue(message.equals(CREATED_CATEGORY_2_MESSAGE));
    message = createForum(driver, new Forum("First Test Forum", "First Test Description", new Category("First Test Category")));
    assertTrue(message.equals(CREATED_FORUM_0_MESSAGE));
    message = createForum(driver, new Forum("Second Test Forum", "Second Test Description", new Category("First Test Category")));
    assertTrue(message.equals(CREATED_FORUM_1_MESSAGE));
}
Also used : CreateCategory.createCategory(it.vige.rubia.selenium.adminpanel.action.CreateCategory.createCategory) RemoveCategory.removeCategory(it.vige.rubia.selenium.adminpanel.action.RemoveCategory.removeCategory) Category(it.vige.rubia.model.Category) Forum(it.vige.rubia.model.Forum) RemoveForum.removeForum(it.vige.rubia.selenium.adminpanel.action.RemoveForum.removeForum) CreateForum.createForum(it.vige.rubia.selenium.adminpanel.action.CreateForum.createForum) MoveForum.moveForum(it.vige.rubia.selenium.adminpanel.action.MoveForum.moveForum) UpdateForum.updateForum(it.vige.rubia.selenium.adminpanel.action.UpdateForum.updateForum) LockForum.lockForum(it.vige.rubia.selenium.adminpanel.action.LockForum.lockForum) BeforeClass(org.junit.BeforeClass)

Example 82 with Forum

use of it.vige.rubia.model.Forum in project rubia-forums by flashboss.

the class VerifyTopic method getTopicsOfForums.

public static List<Topic> getTopicsOfForums(WebDriver driver, Forum... forums) {
    List<Topic> topics = new ArrayList<Topic>();
    for (Forum forum : forums) {
        VerifyForum.goTo(driver, forum);
        List<WebElement> tableComponents = driver.findElements(className(TOPIC_TABLE));
        int tableComponentsSize = tableComponents.size();
        for (int i = 0; i < tableComponentsSize; i++) {
            List<WebElement> subjectComponents = driver.findElements(className(TOPIC_TABLE)).get(i).findElements(xpath(SUBJECT_LINK));
            int subjectComponentsSize = subjectComponents.size();
            for (int i4 = 0; i4 < subjectComponentsSize; i4++) {
                WebElement topicTable = driver.findElements(className(TOPIC_TABLE)).get(i);
                Topic topic = getTopic(driver, i4, topicTable);
                topics.add(topic);
                driver.findElement(linkText(forum.getName())).click();
            }
        }
    }
    return topics;
}
Also used : ArrayList(java.util.ArrayList) VerifyPost.getPostsOfCurrentTopic(it.vige.rubia.selenium.forum.action.VerifyPost.getPostsOfCurrentTopic) Topic(it.vige.rubia.model.Topic) VerifyPoll.getPollOfCurrentTopic(it.vige.rubia.selenium.forum.action.VerifyPoll.getPollOfCurrentTopic) WebElement(org.openqa.selenium.WebElement) Forum(it.vige.rubia.model.Forum)

Example 83 with Forum

use of it.vige.rubia.model.Forum in project rubia-forums by flashboss.

the class VerifyTopic method addParents.

private static void addParents(WebDriver driver, Topic topic) {
    Forum forum = new Forum();
    forum.setName(driver.findElement(linkText(driver.findElement(FORUM_TEMPLATE_LINK.getValue()).getText())).getText());
    topic.setForum(forum);
    Category category = new Category();
    category.setTitle(driver.findElement(CATEGORY_TEMPLATE_LINK.getValue()).getText());
    forum.setCategory(category);
}
Also used : Category(it.vige.rubia.model.Category) Forum(it.vige.rubia.model.Forum)

Example 84 with Forum

use of it.vige.rubia.model.Forum in project rubia-forums by flashboss.

the class OperationAttachmentTest method stop.

@AfterClass
public static void stop() {
    Post post = new Post(new Topic(new Forum("First Test Forum"), "First Test Topic"), "First Test Body", asList(new Attachment("first", "First Test File"), new Attachment("second", "Second Test File"), new Attachment("third", "Third Test File")));
    String message = removeAttachments(driver, post);
    assertTrue(message.equals(OK));
    message = removePost(driver, post);
    assertTrue(message.equals(OK));
    post = new Post(new Topic(new Forum("First Test Forum"), "Second Test Topic"), "Second Test Body", asList(new Attachment("first", "First Test File"), new Attachment("second", "Second Test File"), new Attachment("third", "Third Test File")));
    message = removeAttachments(driver, post);
    assertTrue(message.equals(OK));
    message = removePost(driver, post);
    post = new Post(new Topic(new Forum("Second Test Forum"), "Third Test Topic"), "Third Test Body", asList(new Attachment("first", "First Test File"), new Attachment("second", "Second Test File"), new Attachment("third", "Third Test File")));
    message = removeAttachments(driver, post);
    assertTrue(message.equals(OK));
    message = removePost(driver, post);
    post = new Post(new Topic(new Forum("Second Test Forum"), "Fourth Test Topic"), "Fourth Test Body", asList(new Attachment("fourth", "Fourth Test File"), new Attachment("fifth", "Fifth Test with Truncation over 25 characters File"), new Attachment("sixth", "Sixth Test File")));
    message = removeAttachments(driver, post);
    assertTrue(message.equals(OK));
    message = removePost(driver, post);
    post = new Post(new Topic(new Forum("First Test Forum"), "First Test Topic"), "First Test Post", asList(new Attachment[] { new Attachment("first", "First Test File"), new Attachment("second", "Second Test File"), new Attachment("third", "Third Test File") }));
    message = removeAttachments(driver, post);
    assertTrue(message.equals(OK));
    post.getTopic().setSubject(RE + "First Test Topic");
    message = removePost(driver, post);
    assertTrue(message.equals(OK));
    post = new Post(new Topic(new Forum("First Test Forum"), RE + "First Test Topic"), "Second Test Post", asList(new Attachment[] { new Attachment("first", "First Test File"), new Attachment("second", "Second Test File"), new Attachment("third", "Third Test File") }));
    message = removeAttachments(driver, post);
    assertTrue(message.equals(OK));
    message = removePost(driver, post);
    assertTrue(message.equals(OK));
    post = new Post(new Topic(new Forum("Second Test Forum"), "Fourth Test Topic"), "Third Test Post", asList(new Attachment[] { new Attachment("seventh", "Seventh Test File"), new Attachment("eight", "Eight Test File"), new Attachment("ninth", "Ninth Test File") }));
    message = removeAttachments(driver, post);
    assertTrue(message.equals(OK));
    post.getTopic().setSubject(RE + "Fourth Test Topic");
    message = removePost(driver, post);
    assertTrue(message.equals(OK));
    post = new Post(new Topic(new Forum("Second Test Forum"), RE + "Fourth Test Topic"), "Fourth Test Post", asList(new Attachment[] { new Attachment("ten", "Ten Test File"), new Attachment("eleven", "Eleven Test File"), new Attachment("twelve", "Twelve Test File") }));
    message = removeAttachments(driver, post);
    assertTrue(message.equals(OK));
    message = removePost(driver, post);
    assertTrue(message.equals(OK));
    post = new Post(new Topic(new Forum("Second Test Forum"), RE + "Fourth Test Topic"), "Fifth Test with Truncation over 25 characters Post", asList(new Attachment[] { new Attachment("thirteen", "Thirteen Test File"), new Attachment("fourteen", "Fourteen Test File"), new Attachment("fifteen", "Fifteen Test File") }));
    message = removeAttachments(driver, post);
    assertTrue(message.equals(OK));
    message = removePost(driver, post);
    assertTrue(message.equals(OK));
    post = new Post(new Topic(new Forum("Second Test Forum"), RE + "Fourth Test Topic"), "Sixth Test Post", asList(new Attachment[] { new Attachment("sixteen", "Sixteen Test File"), new Attachment("seventeen", "Seventeen Test File"), new Attachment("eighteen", "Eighteen Test File") }));
    message = removeAttachments(driver, post);
    assertTrue(message.equals(OK));
    message = removePost(driver, post);
    assertTrue(message.equals(OK));
    message = removeForum(driver, new Forum("First Test Forum"), "Second Test Forum");
    assertTrue(message.equals(REMOVED_FORUM_0_MESSAGE));
    message = removeForum(driver, new Forum("Second Test Forum"), SELECT_FORUM_TYPE);
    assertTrue(message.equals(REMOVED_FORUM_1_MESSAGE));
    message = removeCategory(driver, new Category("First Test Category"), AdminPanelCategoryTest.SELECT_CATEGORY_TYPE);
    assertTrue(message.equals(REMOVED_CATEGORY_0_MESSAGE));
    message = removeCategory(driver, new Category("Second Test Category"), AdminPanelCategoryTest.SELECT_CATEGORY_TYPE);
    assertTrue(message.equals(REMOVED_CATEGORY_1_MESSAGE));
}
Also used : CreateCategory.createCategory(it.vige.rubia.selenium.adminpanel.action.CreateCategory.createCategory) RemoveCategory.removeCategory(it.vige.rubia.selenium.adminpanel.action.RemoveCategory.removeCategory) Category(it.vige.rubia.model.Category) RemovePost.removePost(it.vige.rubia.selenium.forum.action.RemovePost.removePost) VerifyAttachment.getAttachmentsOfCurrentPost(it.vige.rubia.selenium.forum.action.VerifyAttachment.getAttachmentsOfCurrentPost) CreatePost.createPost(it.vige.rubia.selenium.forum.action.CreatePost.createPost) Post(it.vige.rubia.model.Post) Attachment(it.vige.rubia.model.Attachment) CreateTopic.createTopic(it.vige.rubia.selenium.forum.action.CreateTopic.createTopic) Topic(it.vige.rubia.model.Topic) Forum(it.vige.rubia.model.Forum) RemoveForum.removeForum(it.vige.rubia.selenium.adminpanel.action.RemoveForum.removeForum) CreateForum.createForum(it.vige.rubia.selenium.adminpanel.action.CreateForum.createForum) AfterClass(org.junit.AfterClass)

Example 85 with Forum

use of it.vige.rubia.model.Forum in project rubia-forums by flashboss.

the class OperationAttachmentTest method verifyRemoveAllAttachments.

@Test
public void verifyRemoveAllAttachments() {
    Post post = new Post(new Topic(new Forum("Second Test Forum"), "Fourth Test Topic"), "Third Test Post", asList(new Attachment("newseventh", "New Seventh Test File"), new Attachment("neweight", "New Eight Test File"), new Attachment("newninth", "New Ninth Test File")));
    goTo(driver, post);
    addAttachments(driver, post);
    removeAllAttachments(driver, post);
    List<Attachment> attachments = getAttachmentsOfCurrentPost(driver, post);
    assertEquals(0, attachments.size());
    post = new Post(new Topic(new Forum("Second Test Forum"), "Fourth Test Topic"), "Third Test Post", asList(new Attachment("seventh", "Seventh Test File"), new Attachment("eight", "Eight Test File"), new Attachment("ninth", "Ninth Test File")));
    goTo(driver, post);
    addAttachmentsAndSave(driver, post);
    attachments = getAttachmentsOfCurrentPost(driver, post);
    assertEquals(3, attachments.size());
}
Also used : RemovePost.removePost(it.vige.rubia.selenium.forum.action.RemovePost.removePost) VerifyAttachment.getAttachmentsOfCurrentPost(it.vige.rubia.selenium.forum.action.VerifyAttachment.getAttachmentsOfCurrentPost) CreatePost.createPost(it.vige.rubia.selenium.forum.action.CreatePost.createPost) Post(it.vige.rubia.model.Post) Attachment(it.vige.rubia.model.Attachment) CreateTopic.createTopic(it.vige.rubia.selenium.forum.action.CreateTopic.createTopic) Topic(it.vige.rubia.model.Topic) Forum(it.vige.rubia.model.Forum) RemoveForum.removeForum(it.vige.rubia.selenium.adminpanel.action.RemoveForum.removeForum) CreateForum.createForum(it.vige.rubia.selenium.adminpanel.action.CreateForum.createForum) AdminPanelCategoryTest(it.vige.rubia.selenium.adminpanel.test.AdminPanelCategoryTest) Test(org.junit.Test)

Aggregations

Forum (it.vige.rubia.model.Forum)100 CreateForum.createForum (it.vige.rubia.selenium.adminpanel.action.CreateForum.createForum)65 Topic (it.vige.rubia.model.Topic)63 RemoveForum.removeForum (it.vige.rubia.selenium.adminpanel.action.RemoveForum.removeForum)55 Post (it.vige.rubia.model.Post)52 Category (it.vige.rubia.model.Category)50 CreateTopic.createTopic (it.vige.rubia.selenium.forum.action.CreateTopic.createTopic)49 CreateCategory.createCategory (it.vige.rubia.selenium.adminpanel.action.CreateCategory.createCategory)40 RemoveCategory.removeCategory (it.vige.rubia.selenium.adminpanel.action.RemoveCategory.removeCategory)40 RemoveTopic.removeTopic (it.vige.rubia.selenium.forum.action.RemoveTopic.removeTopic)34 Test (org.junit.Test)33 Poll (it.vige.rubia.model.Poll)23 Attachment (it.vige.rubia.model.Attachment)21 PollOption (it.vige.rubia.model.PollOption)21 SecureActionForum (it.vige.rubia.auth.SecureActionForum)16 CreatePost.createPost (it.vige.rubia.selenium.forum.action.CreatePost.createPost)15 Poster (it.vige.rubia.model.Poster)14 JSFUtil.handleException (it.vige.rubia.ui.JSFUtil.handleException)14 BeforeClass (org.junit.BeforeClass)14 AfterClass (org.junit.AfterClass)13