Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

[GH-12304] UI Automation: Write an automated test using Cypress for "Compact view: Markdown quotation" #4151

Merged
merged 9 commits into from
Nov 12, 2019

Conversation

larkox
Copy link
Contributor

@larkox larkox commented Nov 7, 2019

Summary

UI Automation: Write an automated test using Cypress for "Compact view: Markdown quotation"

Ticket Link

mattermost/mattermost#12304

Related Pull Requests

None

Screenshots

None

@saturninoabril saturninoabril added 2: Dev Review Requires review by a core commiter 3: QA Review Requires review by a QA tester labels Nov 7, 2019
@saturninoabril saturninoabril added this to the v5.18.0 milestone Nov 7, 2019
@hahmadia hahmadia removed the 2: Dev Review Requires review by a core commiter label Nov 7, 2019
const blockQuoteRect = quoteElement[0].getBoundingClientRect();

// * We check the username rect does not collide with the quote rect
expect(userRect.right < blockQuoteRect.left || userRect.bottom < blockQuoteRect.top).to.equal(true);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why we need to verify the second condition as it would not be true (as shown in this screenshot).
userRect.bottom < blockQuoteRect.top

Screenshot 2019-11-08 at 9 22 49 PM

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are checking whether the username is left to the blockquote, or over it. The userRect.bottom < blockQuoteRect.top part is to check whether is over it. The problem is that, as you mentioned on your second comment, I am not accessing properly the username when it is in compact view. I will fix it and check the two options:

  • When the username is to the left (first message after the other person talked)
  • When the username is on top (second (or any other) message)
    How does that sound?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On commit 09b252a I did this solution. Please let me know if you think it is enough, or should I check other cases.

Copy link
Contributor

@srkgupta srkgupta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @larkox. Great work so far.

One more observation:
If we re-run the test case, the user's name is not displayed in the compact view and as a result, the coordinates of userRect is always 0 (as shown in this screenshot). So to overcome this, can you add a step to either post a message as sysadmin to this DM channel (before posting the message as user-1). This way, even in the compact view, when user-1 posts a message, their name is always displayed.

Screenshot 2019-11-08 at 9 23 52 PM

@jespino jespino added the 2: Dev Review Requires review by a core commiter label Nov 10, 2019
Copy link
Contributor

@srkgupta srkgupta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @larkox. The new changes are looking great 👍

@prapti prapti merged commit da668b5 into mattermost:master Nov 12, 2019
@prapti
Copy link
Contributor

prapti commented Nov 12, 2019

Thank you for your contribution @larkox ! 🎉

@amyblais amyblais added Changelog/Not Needed Does not require a changelog entry Docs/Not Needed Does not require documentation and removed 2: Dev Review Requires review by a core commiter labels Nov 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
3: QA Review Requires review by a QA tester Changelog/Not Needed Does not require a changelog entry Docs/Not Needed Does not require documentation
Projects
None yet
7 participants