summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/com/mavlushechka/a1qa/pages/CommentForm.java2
-rw-r--r--src/main/java/com/mavlushechka/a1qa/pages/CommentsForm.java4
-rw-r--r--src/main/java/com/mavlushechka/a1qa/pages/PostForm.java6
-rw-r--r--src/main/java/com/mavlushechka/a1qa/pages/ProfilePage.java12
-rw-r--r--src/main/java/com/mavlushechka/a1qa/pages/ProfileWallForm.java10
-rw-r--r--src/test/java/com/mavlushechka/a1qa/TestCase1.java8
6 files changed, 21 insertions, 21 deletions
diff --git a/src/main/java/com/mavlushechka/a1qa/pages/CommentForm.java b/src/main/java/com/mavlushechka/a1qa/pages/CommentForm.java
index d087336..8876099 100644
--- a/src/main/java/com/mavlushechka/a1qa/pages/CommentForm.java
+++ b/src/main/java/com/mavlushechka/a1qa/pages/CommentForm.java
@@ -20,7 +20,7 @@ public class CommentForm extends BaseForm {
commentText = AqualityServices.getElementFactory().getLabel(By.xpath(commentXpath + "//*[contains(@class, 'wall_reply_text')]"), "Comment");
}
- public boolean contains(Comment comment) {
+ public boolean containsComment(Comment comment) {
return Objects.equals(Integer.parseInt(commentLabel.getAttribute("data-answering-id")), comment.user().getId())
&& Objects.equals(commentText.getText(), comment.message());
}
diff --git a/src/main/java/com/mavlushechka/a1qa/pages/CommentsForm.java b/src/main/java/com/mavlushechka/a1qa/pages/CommentsForm.java
index 4ae6a01..0cb1c08 100644
--- a/src/main/java/com/mavlushechka/a1qa/pages/CommentsForm.java
+++ b/src/main/java/com/mavlushechka/a1qa/pages/CommentsForm.java
@@ -20,13 +20,13 @@ public class CommentsForm extends BaseForm {
);
}
- public boolean contains(Comment comment) {
+ public boolean containsComment(Comment comment) {
CommentForm commentForm = new CommentForm(comment);
if (nextCommentsButton.getElement().isDisplayed()) {
nextCommentsButton.click();
}
- return commentForm.contains(comment);
+ return commentForm.containsComment(comment);
}
}
diff --git a/src/main/java/com/mavlushechka/a1qa/pages/PostForm.java b/src/main/java/com/mavlushechka/a1qa/pages/PostForm.java
index dc5f8b0..3732698 100644
--- a/src/main/java/com/mavlushechka/a1qa/pages/PostForm.java
+++ b/src/main/java/com/mavlushechka/a1qa/pages/PostForm.java
@@ -30,7 +30,7 @@ public class PostForm extends BaseForm {
likeButton = AqualityServices.getElementFactory().getButton(By.xpath(postXpath + "//*[@data-reaction-set-id='reactions']"), "Like");
}
- public boolean contains(Post post) {
+ public boolean containsPost(Post post) {
boolean containsPost = Objects.equals(authorLabel.getText(), post.owner().getFirstName() + " " + post.owner().getLastName())
&& Objects.equals(textLabel.getText(), post.message());
@@ -43,8 +43,8 @@ public class PostForm extends BaseForm {
return containsPost;
}
- public boolean contains(Comment comment) {
- return new CommentsForm(comment.post()).contains(comment);
+ public boolean containsComment(Comment comment) {
+ return new CommentsForm(comment.post()).containsComment(comment);
}
public void clickLikeButton() {
diff --git a/src/main/java/com/mavlushechka/a1qa/pages/ProfilePage.java b/src/main/java/com/mavlushechka/a1qa/pages/ProfilePage.java
index 816517d..7b6aa9d 100644
--- a/src/main/java/com/mavlushechka/a1qa/pages/ProfilePage.java
+++ b/src/main/java/com/mavlushechka/a1qa/pages/ProfilePage.java
@@ -14,16 +14,16 @@ public class ProfilePage extends BaseForm {
super(AqualityServices.getElementFactory().getLabel(By.id("profile"), "Profile"), "Profile");
}
- public boolean contains(Post post) {
- return profileWallForm.contains(post);
+ public boolean containsPost(Post post) {
+ return profileWallForm.containsPost(post);
}
- public boolean contains(Comment comment) {
- return profileWallForm.contains(comment);
+ public boolean containsComment(Comment comment) {
+ return profileWallForm.containsComment(comment);
}
- public boolean notContains(Post post) {
- return profileWallForm.notContains(post);
+ public boolean notContainsPost(Post post) {
+ return profileWallForm.notContainsPost(post);
}
public void clickPostLikeButton(Post post) {
diff --git a/src/main/java/com/mavlushechka/a1qa/pages/ProfileWallForm.java b/src/main/java/com/mavlushechka/a1qa/pages/ProfileWallForm.java
index d8ddc37..2c01ab0 100644
--- a/src/main/java/com/mavlushechka/a1qa/pages/ProfileWallForm.java
+++ b/src/main/java/com/mavlushechka/a1qa/pages/ProfileWallForm.java
@@ -11,21 +11,21 @@ public class ProfileWallForm extends BaseForm {
super(AqualityServices.getElementFactory().getLabel(By.id("profile_wall"), "Profile wall"), "Profile wall form");
}
- public boolean contains(Post post) {
+ public boolean containsPost(Post post) {
PostForm postForm = new PostForm(post);
if (!postForm.isOpened()) {
return false;
}
- return postForm.contains(post);
+ return postForm.containsPost(post);
}
- public boolean notContains(Post post) {
+ public boolean notContainsPost(Post post) {
return new PostForm(post).notExists();
}
- public boolean contains(Comment comment) {
- return new PostForm(comment.post()).contains(comment);
+ public boolean containsComment(Comment comment) {
+ return new PostForm(comment.post()).containsComment(comment);
}
public void clickPostLikeButton(Post post) {
diff --git a/src/test/java/com/mavlushechka/a1qa/TestCase1.java b/src/test/java/com/mavlushechka/a1qa/TestCase1.java
index c6b3b2d..a1477c5 100644
--- a/src/test/java/com/mavlushechka/a1qa/TestCase1.java
+++ b/src/test/java/com/mavlushechka/a1qa/TestCase1.java
@@ -47,19 +47,19 @@ public class TestCase1 extends BaseTest {
LoggerUtils.step("[API] Create post on the wall with randomly generated text using API-request and save id of the post from the API-response.");
Post post = new Post(VkApiUtils.createPost(postRandomText), user, postRandomText, null);
LoggerUtils.step("[UI] Check that post with the sent text from the correct user appeared on the wall without refreshing the page.");
- Assert.assertTrue(profilePage.contains(post), "This is not the correct post.");
+ Assert.assertTrue(profilePage.containsPost(post), "This is not the correct post.");
Attachment picture = new Attachment(com.mavlushechka.a1qa.constants.Attachment.PHOTO, user.getId(), Integer.parseInt(JsonParser.parseData("testData", "vkontakte.photoFromAlbum.id")));
LoggerUtils.step("[API] Edit the added post using API-request - change text and add(upload) a picture.");
Post editedPost = new Post(post.id(), user, post.message() + "[edited]", picture);
VkApiUtils.editPost(post, editedPost);
profilePage.waitForPostUpdate(editedPost);
LoggerUtils.step("[UI] Check that text was updated and the picture was uploaded(make sure that pictures are the same) without refreshing the page.");
- Assert.assertTrue(profilePage.contains(editedPost), "This is not the correct post.");
+ Assert.assertTrue(profilePage.containsPost(editedPost), "This is not the correct post.");
String commentRandomText = StringUtils.generateRandomText(textLettersLowerBound, textLettersUpperBound, textLength);
LoggerUtils.step("[API] Add a comment to the post with the randomly generated text using API-request.");
Comment comment = new Comment(VkApiUtils.createComment(editedPost.id(), commentRandomText), user, editedPost, commentRandomText);
LoggerUtils.step("[UI] Check that comment from the correct user was added to the post without refreshing the page.");
- Assert.assertTrue(profilePage.contains(comment), "This is not the correct comment.");
+ Assert.assertTrue(profilePage.containsComment(comment), "This is not the correct comment.");
LoggerUtils.step("[UI] Like the post using UI.");
profilePage.clickPostLikeButton(post);
LoggerUtils.step("[API] Check that the post received like from the correct user using API-request.");
@@ -67,7 +67,7 @@ public class TestCase1 extends BaseTest {
LoggerUtils.step("[API] Delete the post using API-request.");
VkApiUtils.deletePost(editedPost);
profilePage.waitForPostDelete(editedPost);
- Assert.assertTrue(profilePage.notContains(editedPost), "The post is not deleted.");
+ Assert.assertTrue(profilePage.notContainsPost(editedPost), "The post is not deleted.");
}
}