Mattermost-server: UI Automation: Write an automated test using Cypress for "Copy a permalink and paste into another channel"

Created on 19 Sep 2019  路  4Comments  路  Source: mattermost/mattermost-server

Test Key: M18702
Test folder: /cypress/integration/messaging
Title: Copy a permalink and paste into another channel

Steps:

  1. Click on the 3-dot menu to the right of any message in any channel (RN apps - long press on a message)
  2. Click on "permalink" (RN apps - select "Copy Permalink" and skip to step 4)
  3. Click on "copy link" then on "close"
  4. Switch to another channel, DM or GM
  5. Paste the copied permalink into the message input box (CTRL+V on webapp, long press & paste on RN), and post

Expected:

  • Permalink should copy and paste properly
  • Once pasted into a new channel it should render properly (note that on community servers, it will convert to )
  • Clicking or tapping on the permalink will take you to the conversation

See our end-to-end testing documentation for reference.

Jira ticket: MM-18702


If you're interested, please comment here and come join our "Contributors" community channel on our daily build server, where you can discuss questions with community members and the Mattermost core team. For technical advice or questions, please join our "Developers" community channel.

New contributors please see our Developer's Guide.

AreE2E Tests Easy Help Wanted

All 4 comments

May I take this one?

@larkox Sure and thanks!

I have been taking a look to this, and there is a problem. Apparently, there is no way to access the clipboard through Cypress. Here are the different solutions I tried and was not able to make them work:

  • Typing Ctrl + V or Cmd + V (printed a V)
  • Calling 'document.execCommand("paste");' (did nothing)
  • Accessing 'window.clipboardData' or 'navigator.clipboard' (undefined)

I also Googled possible solutions from Cypress, and it seems that it is not implemented, and will not have any implementation apart of 'type': https://github.com/cypress-io/cypress/issues/1123

Since the only apparent solution would be to keep the link in a variable, and type it later, this is already done on message_permalink_spec.js. The only difference would be to set the time delay between keys to 0, so the feeling would be similar to something being pasted instead of typed.

That being said, would you like this solution? Or would you feel it is redundant with 'message_permalink_spec.js' and should close this issue since it feels that cannot be implemented?

Thanks for checking. You're right, it's redundant with that specs. Will close this issue now.

Was this page helpful?
0 / 5 - 0 ratings