mattermost / mattermost

Mattermost is an open source platform for secure collaboration across the entire software development lifecycle..
https://mattermost.com
Other
29.83k stars 7.16k forks source link

Write Webapp E2E with Cypress: "MM-T1615 Pasting code block text into external apps does not include line numbers" #18161

Closed saturninoabril closed 2 years ago

saturninoabril commented 3 years ago

See our documentation for Webapp end-to-end testing with Cypress for reference.

MM-T1615 Pasting code block text into external apps does not include line numbers

Steps

  1. Copy the text in the test data field to the right (and shown posted below)
  2. Post it in a channel
  3. Copy the text from the channel
  4. Paste into a program that supports rich text such as Textedit on Mac or an empty Google document

Test Data

```javascript
var foo = 'bar';
function doSomething() {
 return 7;
}
```

Expected

  • Only the code is pasted

Test Folder: /cypress/integration/messaging Test code arrangement:

describe('Messaging', () => {
    it('MM-T1615 Pasting code block text into external apps does not include line numbers', () => {
        // code
    });
});

Notes:

  1. Do not add @prod label in a spec file
    • If you're writing script into a newly created test file, @prod label should not be included.
    • If you're adding script into an existing test file, @prod label should removed.
  2. Use queries from testing-library whenever possible. We share the same philosophy as the testing-library when doing UI automation like "Interact with your app the same way as your users" and so, please follow their guidelines especially when querying an element.

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.

yasserfaraazkhan commented 2 years ago

@saturninoabril I'll be taking this up.

Just to confirm, will checking if clipboard doesn't have the code (quotes) after clicking on 'copy code block' icon suffice ?

yasserfaraazkhan commented 2 years ago

@amyblais I guess, this can be closed