use of fi.otavanopisto.muikku.atests.DiscussionGroup in project muikku by otavanopisto.
the class CourseDiscussionTestsBase method courseDiscussionReplyTest.
@Test
@TestEnvironments(browsers = { TestEnvironments.Browser.CHROME, TestEnvironments.Browser.FIREFOX, TestEnvironments.Browser.INTERNET_EXPLORER, TestEnvironments.Browser.EDGE, TestEnvironments.Browser.SAFARI })
public void courseDiscussionReplyTest() throws Exception {
loginAdmin();
Workspace workspace = createWorkspace("testcourse", "test course for testing", "1", Boolean.TRUE);
try {
DiscussionGroup discussionGroup = createWorkspaceDiscussionGroup(workspace.getId(), "test group");
try {
Discussion discussion = createWorkspaceDiscussion(workspace.getId(), discussionGroup.getId(), "test discussion");
try {
DiscussionThread thread = createWorkspaceDiscussionThread(workspace.getId(), discussionGroup.getId(), discussion.getId(), "Testing", "<p>Testing testing daa daa</p>", false, false);
try {
navigate(String.format("/workspace/%s/discussions", workspace.getName()), true);
waitAndClick(".di-message-meta-topic>span");
waitAndClick(".di-message-reply-link");
addTextToCKEditor("Test reply for test.");
click("*[name='send']");
waitForPresent(".di-replies-container .mf-item-content-text p");
assertText(".di-replies-container .mf-item-content-text p", "Test reply for test.");
} finally {
deleteWorkspaceDiscussionThread(workspace.getId(), discussionGroup.getId(), discussion.getId(), thread.getId());
}
} finally {
deleteWorkspaceDiscussion(workspace.getId(), discussionGroup.getId(), discussion.getId());
}
} finally {
deleteWorkspaceDiscussionGroup(workspace.getId(), discussionGroup.getId());
}
} finally {
deleteWorkspace(workspace.getId());
WireMock.reset();
}
}
use of fi.otavanopisto.muikku.atests.DiscussionGroup in project muikku by otavanopisto.
the class CourseDiscussionTestsBase method courseDiscussionReplyReplyTest.
@Test
@TestEnvironments(browsers = { TestEnvironments.Browser.CHROME, TestEnvironments.Browser.FIREFOX, TestEnvironments.Browser.INTERNET_EXPLORER, TestEnvironments.Browser.EDGE, TestEnvironments.Browser.SAFARI })
public void courseDiscussionReplyReplyTest() throws Exception {
loginAdmin();
try {
Workspace workspace = createWorkspace("testcourse", "test course for testing", "1", Boolean.TRUE);
try {
DiscussionGroup discussionGroup = createWorkspaceDiscussionGroup(workspace.getId(), "test group");
try {
Discussion discussion = createWorkspaceDiscussion(workspace.getId(), discussionGroup.getId(), "test discussion");
try {
DiscussionThread thread = createWorkspaceDiscussionThread(workspace.getId(), discussionGroup.getId(), discussion.getId(), "Testing", "<p>Testing testing daa daa</p>", false, false);
try {
navigate(String.format("/workspace/%s/discussions", workspace.getName()), true);
waitAndClick(".di-message-meta-topic>span");
waitAndClick(".di-message-reply-link");
addTextToCKEditor("Test reply for test.");
waitForPresent("*[name='send']");
click("*[name='send']");
waitForPresent(".di-replies-container .mf-item-content-text p");
waitAndClick(".di-replies-page .di-reply-answer-link>span");
addTextToCKEditor("Test reply reply for test.");
waitForPresent("*[name='send']");
click("*[name='send']");
waitForPresent(".di-replies-container .di-reply-reply .mf-item-content-text p");
assertText(".di-replies-container .di-reply-reply .mf-item-content-text p", "Test reply reply for test.");
} finally {
deleteWorkspaceDiscussionThread(workspace.getId(), discussionGroup.getId(), discussion.getId(), thread.getId());
}
} finally {
deleteWorkspaceDiscussion(workspace.getId(), discussionGroup.getId(), discussion.getId());
}
} finally {
deleteWorkspaceDiscussionGroup(workspace.getId(), discussionGroup.getId());
}
} finally {
deleteWorkspace(workspace.getId());
}
} finally {
WireMock.reset();
}
}
use of fi.otavanopisto.muikku.atests.DiscussionGroup in project muikku by otavanopisto.
the class CourseDiscussionTestsBase method courseDiscussionSendMessageTest.
@Test
@TestEnvironments(browsers = { TestEnvironments.Browser.CHROME, TestEnvironments.Browser.FIREFOX, TestEnvironments.Browser.INTERNET_EXPLORER, TestEnvironments.Browser.EDGE, TestEnvironments.Browser.SAFARI })
public void courseDiscussionSendMessageTest() throws Exception {
loginAdmin();
Workspace workspace = createWorkspace("testcourse", "test course for testing", "1", Boolean.TRUE);
try {
DiscussionGroup discussionGroup = createWorkspaceDiscussionGroup(workspace.getId(), "test group");
try {
Discussion discussion = createWorkspaceDiscussion(workspace.getId(), discussionGroup.getId(), "test discussion");
try {
navigate(String.format("/workspace/%s/discussions", workspace.getName()), true);
waitAndClick(".di-new-message-button>span");
waitForPresent(".di-newmessage-form-container");
waitForPresent(".mf-textfield-subcontainer input");
sendKeys(".mf-textfield-subcontainer input", "Test title for discussion");
addTextToCKEditor("Test text for discussion.");
click("*[name='send']");
waitForPresent(".di-message-meta-content>span>p");
assertText(".di-message-meta-content>span>p", "Test text for discussion.");
} finally {
deleteWorkspaceDiscussion(workspace.getId(), discussionGroup.getId(), discussion.getId());
}
} finally {
deleteWorkspaceDiscussionGroup(workspace.getId(), discussionGroup.getId());
}
} finally {
deleteWorkspace(workspace.getId());
WireMock.reset();
}
}
use of fi.otavanopisto.muikku.atests.DiscussionGroup in project muikku by otavanopisto.
the class DiscussionTestsBase method discussionSendMessageTest.
@Test
@TestEnvironments(browsers = { TestEnvironments.Browser.CHROME, TestEnvironments.Browser.FIREFOX, TestEnvironments.Browser.INTERNET_EXPLORER, TestEnvironments.Browser.EDGE, TestEnvironments.Browser.SAFARI })
public void discussionSendMessageTest() throws Exception {
loginAdmin();
DiscussionGroup discussionGroup = createDiscussionGroup("test group");
try {
Discussion discussion = createDiscussion(discussionGroup.getId(), "test discussion");
try {
navigate("/discussion", true);
waitAndClick(".di-new-message-button");
waitAndClick(".mf-textfield-subcontainer input");
sendKeys(".mf-textfield-subcontainer input", "Test title for discussion");
addTextToCKEditor("Test text for discussion.");
click("*[name='send']");
waitForPresent(".di-message-meta-content>span>p");
assertText(".di-message-meta-content>span>p", "Test text for discussion.");
} finally {
deleteDiscussion(discussionGroup.getId(), discussion.getId());
}
} finally {
deleteDiscussionGroup(discussionGroup.getId());
WireMock.reset();
}
}
use of fi.otavanopisto.muikku.atests.DiscussionGroup in project muikku by otavanopisto.
the class DiscussionTestsBase method discussionAdminCreateAreaTest.
@Test
@TestEnvironments(browsers = { TestEnvironments.Browser.CHROME, TestEnvironments.Browser.FIREFOX, TestEnvironments.Browser.INTERNET_EXPLORER, TestEnvironments.Browser.EDGE, TestEnvironments.Browser.SAFARI })
public void discussionAdminCreateAreaTest() throws Exception {
loginAdmin();
DiscussionGroup discussionGroup = createDiscussionGroup("test group");
try {
Discussion discussion = createDiscussion(discussionGroup.getId(), "test discussion");
try {
navigate("/discussion", true);
waitAndClick(".sm-flex-hide .di-new-area-button");
waitAndSendKeys(".mf-textfield input", "Test area");
click("*[name='send']");
waitForPresent("#discussionAreaSelect option:nth-child(2)");
assertText("#discussionAreaSelect option:nth-child(2)", "Test area");
} finally {
deleteDiscussion(discussionGroup.getId(), discussion.getId());
}
} finally {
deleteDiscussionGroup(discussionGroup.getId());
WireMock.reset();
}
}
Aggregations