use of it.vige.rubia.model.Poster in project rubia-forums by flashboss.
the class VerifyTopic method getPoster.
public static Poster getPoster(WebDriver driver, Topic topic) {
WebElement profileLink = driver.findElements(className(PROFILE_LINK)).get(0).findElement(xpath("../tr/td/h3/a[contains(text(),'" + topic.getSubject() + "')]")).findElement(xpath("../../a"));
String userId = profileLink.getText();
profileLink.click();
Poster poster = verifyProfile(driver, userId);
return poster;
}
use of it.vige.rubia.model.Poster in project rubia-forums by flashboss.
the class VerifyTopic method getTopic.
public static Topic getTopic(WebDriver driver) {
Topic topic = new Topic();
WebElement topicTable = driver.findElements(className(TOPIC_TABLE)).get(1);
WebElement subjectComponent = topicTable.findElement(TOPIC_TEMPLATE_LINK.getValue());
String subjectText = subjectComponent.getText();
topic.setSubject(subjectText);
String user = topicTable.findElement(xpath(USER_IN_TOPIC_LINK)).getText();
Date lastPostDate = null;
try {
DateFormat dateFormat = new SimpleDateFormat("EEE MMM dd, yyyy HH:mm a");
String posted = bundle.getString("Posted");
String permanentLink = topicTable.findElement(xpath(LAST_POST_DATE_IN_TOPIC_OUTPUT_TEXT)).getText();
lastPostDate = dateFormat.parse(permanentLink.substring(permanentLink.indexOf(posted) + posted.length() + 1, permanentLink.indexOf(bundle.getString("Post_subject"))).trim());
} catch (ParseException e) {
log.error(e);
}
topic.setLastPostDate(lastPostDate);
Poster poster = new Poster();
poster.setUserId(user);
topic.setPoster(poster);
subjectComponent.click();
topic.setPoll(getPollOfCurrentTopic(driver));
topic.setPosts(getPostsOfCurrentTopic(driver));
addParents(driver, topic);
return topic;
}
use of it.vige.rubia.model.Poster in project rubia-forums by flashboss.
the class MyForumsTopicTest method verifyPostProfile.
@Test
public void verifyPostProfile() {
Post post = new Post();
Message message = new Message();
message.setSubject("Fourth Test Topic");
post.setMessage(message);
Poster poster = ViewAllTopicsSelectPost.selectProfile(driver, post);
assertTrue(poster != null);
assertEquals("root", poster.getUserId());
assertTrue(poster.getPostCount() >= 6);
}
use of it.vige.rubia.model.Poster in project rubia-forums by flashboss.
the class MyForumsForumTest method verifyProfile.
@Test
public void verifyProfile() {
Post post = new Post();
Message message = new Message();
message.setSubject("Second Test Topic");
post.setMessage(message);
Poster poster = ViewAllForumsSelectForum.selectProfile(driver, post);
assertTrue(poster != null);
assertEquals("root", poster.getUserId());
assertTrue(poster.getPostCount() >= 12);
}
use of it.vige.rubia.model.Poster in project rubia-forums by flashboss.
the class MyForumsForumTest method verifyAllForumsProfile.
@Test
public void verifyAllForumsProfile() {
Post post = new Post();
Message message = new Message();
message.setSubject("Fourth Test Topic");
post.setMessage(message);
Poster poster = ViewAllForumsSelectForum.selectAllForumsProfile(driver, post);
assertTrue(poster != null);
assertEquals("root", poster.getUserId());
assertTrue(poster.getPostCount() >= 16);
}
Aggregations