Skip to content

Commit

Permalink
fix: Stabilize send kudos and open kudos list drawer - MEED-2778 - Me…
Browse files Browse the repository at this point in the history
…eds-io/MIPs#81 (#196)

(cherry picked from commit 14619d5)
  • Loading branch information
SaraBoutej authored and exo-swf committed Nov 14, 2023
1 parent 0698761 commit aacb048
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 16 deletions.
15 changes: 8 additions & 7 deletions src/main/java/io/meeds/qa/ui/pages/SpaceHomePage.java
Original file line number Diff line number Diff line change
Expand Up @@ -454,9 +454,8 @@ public void clickOnkudosButtonToActivityStream() {
findByXPathOrCSS("(//*[contains(@class, 'activity-detail')])[1]//*[contains(@class, 'activity-footer-actions')]//*[contains(@id, 'KudosActivity')]");
firstActivityKudosButton.click();
}

public void clickOnkudosButtonToCommentActivity() {
kudosButtonToCommentActivityElement().click();
public void getCommentKudosButton(String comment) {
getCommentKudosFooterButton(comment, "ActivityCommment_comment", "KudosActivity").click();
}

public void clickOnLoadMoreActivities() {
Expand Down Expand Up @@ -1427,6 +1426,12 @@ private ElementFacade getActivityFooterButton(String activity, String buttonIdPa
buttonIdPart));
}

private ElementFacade getCommentKudosFooterButton(String comment, String commentIdPart, String buttonIdPart) {
return findByXPathOrCSS(String.format("//div[contains(text(),'%s')]//ancestor::*[contains(@id, '%s')]//button[contains(@id,'%s')]",
comment,
commentIdPart,
buttonIdPart));
}
private ElementFacade getActivityLikeButton(String activity) {
return getActivityFooterButton(activity, "LikeLink");
}
Expand Down Expand Up @@ -1784,10 +1789,6 @@ private ElementFacade kudosButtonNumberToCommentActivityElement() {
return findByXPathOrCSS("(//button[contains(@id,'KudusCountLinkcomment') and @style=''])[1]");
}

private ElementFacade kudosButtonToCommentActivityElement() {
return findByXPathOrCSS("//div[contains(@class,'white border-radius')][1]//div[contains(@class,'v-list flex')]//div[contains(@class,'d-inline-flex')][1]//div[@role='button']//span[@class='v-btn__content'][last()]");
}

private ElementFacade loadMoreActivitiesBtnElement() {
return findByXPathOrCSS("//*[contains(@class,'v-btn--block v-btn--contained theme--light')]//span");
}
Expand Down
6 changes: 3 additions & 3 deletions src/test/java/io/meeds/qa/ui/steps/SpaceHomeSteps.java
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,10 @@ public void clickKudosFromActivityStream() {
spaceHomePage.clickOnkudosButtonToActivityStream();
}

public void clickKudosFromComment() {
spaceHomePage.clickOnkudosButtonToCommentActivity();
public void clickOnCommentKudosButton(String comment) {
spaceHomePage.getCommentKudosButton(comment);
}

public void clickKudosFromCommentsDrawer() {
spaceHomePage.clickOnkudosButtonFromCommentsDrawerToCommentActivity();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -349,9 +349,9 @@ public void clickOnTheKudosButtonFromTheActivityStream() {
spaceHomeSteps.clickKudosFromActivityStream();
}

@Then("I click on the kudos button from the comment")
public void clickOnTheKudosButtonFromTheComment() {
spaceHomeSteps.clickKudosFromComment();
@Then("I click on the kudos button from the comment '(.*)'$")
public void clickOnCommentKudosButton(String comment) {
spaceHomeSteps.clickOnCommentKudosButton(comment);
}

@Then("I click on the kudos button from the comments drawer")
Expand Down
6 changes: 3 additions & 3 deletions src/test/resources/features/Social/ActivityStream.feature
Original file line number Diff line number Diff line change
Expand Up @@ -1558,7 +1558,7 @@ Feature: Activity Stream
And I go to the random space
Then the activity 'activitytestkudosCAP128' is displayed in activity stream
When In comment 'activitytestkudoscommentCAP128', Kudos label should be black
Then I click on the kudos button from the comment
Then I click on the kudos button from the comment 'activitytestkudoscommentCAP128'
And I send to the comment activity a kudos message 'Test Auto comment Kudos CAP128'
Then In comment 'activitytestkudoscommentCAP128', Kudos label should be blue
And I click on the kudos button number
Expand Down Expand Up @@ -1811,7 +1811,7 @@ Feature: Activity Stream
And I go to the random space
Then the activity 'activitytestkudosUS52' is displayed in activity stream
When In comment 'activitytestkudoscommentUS52', Kudos label should be black
And I click on the kudos button from the comment
And I click on the kudos button from the comment 'activitytestkudoscommentUS52'
And I send to the comment activity a kudos message 'Test Auto comment Kudos US52'
And I click to edit the kudos text
And I set the new kudos comment text 'updated kudos message' and I click on update button
Expand Down Expand Up @@ -2059,4 +2059,4 @@ Feature: Activity Stream
Then the poll drawer is opened
And I create a simple poll with title 'Poll from space toolbar' and Choice One 'Option1' and Choice Two 'Option2'
And I publish the Poll
Then The Poll 'Poll from space toolbar' is displayed in stream page
Then The Poll 'Poll from space toolbar' is displayed in stream page

0 comments on commit aacb048

Please sign in to comment.