Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request]. Add diagrams(mermaid) attachment support #2656

Open
vitalics opened this issue Jul 26, 2024 · 0 comments
Open

[Feature Request]. Add diagrams(mermaid) attachment support #2656

vitalics opened this issue Jul 26, 2024 · 0 comments

Comments

@vitalics
Copy link

vitalics commented Jul 26, 2024

Is your feature request related to a problem? Please describe.
The problem with big comprehensive test cases is that they have a lot of dependencies. Sometimes it's better to describe with diagrams, like mermaid.

Describe the solution you'd like
based on docs add a new application type for attachments: E.g. application/vnd.allure.diagrams.mermaid.

Or if we transform in code:

import { test } from '@playwright/test'
import { allure } from 'allure-playwright'

test('some test', async () => {
  allure.attachment('some diagram name', `
            graph TD 
            A[Client] -->|tcp_123| B
            B(Load Balancer) 
            B -->|tcp_456| C[Server1] 
            B -->|tcp_456| D[Server2]
`, 'application/vnd.allure.diagrams.mermaid')
})

Describe alternatives you've considered
For now, you can create attachments by typing text/html with the following content

<html>
  <body>
    <pre class="mermaid">
            graph TD 
            A[Client] --> B[Load Balancer] 
            B --> C[Server1] 
            B --> D[Server2]
    </pre>
    <script type="module">
      import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.esm.min.mjs';
      mermaid.initialize({ startOnLoad: true });
    </script>
  </body>
</html>

Additional context

  1. Why mermaid? Since it provides a lot of kinds of diagrams - pie charts, mindmap, class diagrams, graphs.
  2. application/vnd.allure.diagrams.* gives a flexible approach for other kind of diagram providers, like plantUML
  3. Supporting mermaid will be a good point to support markdown style - like github. More on integrations page. For now it's not supported in TestOps(screen below)
image
@vitalics vitalics changed the title [Feature Request]. Add mermaid attachment [Feature Request]. Add diagrams(mermaid) attachment Jul 26, 2024
@vitalics vitalics changed the title [Feature Request]. Add diagrams(mermaid) attachment [Feature Request]. Add diagrams(mermaid) attachment support Jul 26, 2024
@baev baev transferred this issue from allure-framework/allure-js Jul 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant