Hi!
In out team we try to use BitBucket to store test cases in Markdown format. The main goal is to maintain test cases as a code, including pull requests, automatic QG etc.
Our usual test case looks like a table:
| # | Description | Expected result |
| ---- | ------------- | ------------------------------------------------------|
| 1 | Call some API | Answer ```json-object {"responce" : "Hello world!"}```|
Unfortunately BitBucket doesn't format code block inside table cell. Splitting it to several lines manually using <br> also doesn't work. In one line it looks unreadable. Is there any workaround?
In your table, you can use `<br>` to create line breaks within a table cell.
This is an **HTML line break tag** and is commonly used in Markdown tables to:
| # | Description | Expected result |
|----|---------------|------------------------------------------------------------------------------------------|
| 1 | Call some API | <br>{<br> "response": "Hello world!",<br> "status": 200,<br> "iamlong": true<br>}<br> |
Hi Dmitry,
Thanks for reaching out here.
I have used the table you provided in the comment as a sample table, and added some new rows with a few formats as shown in the image attached.
Looking at the rendered view, it properly formats the the code blocks within the cells as expected;
For my case, I have used Bitbucket Server 5.14.0 for this. What version of Bitbucket Server instance are you using to test this out ?
Kind Regards,
Victor.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Victor, thank you for your answer.
I think it was my fault to provide a bad example, let me try once more :)
First exaple is code block with json syntax highlighting NOT in a table cell. It's OK.
Now I try to get the same result in a table cell.
Next example shows that I can't use multiline code block in table cell, ok.
In the third one I try to use br in one-liner and it doesn't work. Highlighting doesn't work aslo.
In last example is the only workaround I could find, but it looks not very beautiful and still no highlighting.
We use Atlassian Bitbucket v5.11.1
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Dmitry,
Thanks for the feedback.
Add the text format of this test case for me to get a better insight on this.
Kind Regards,
Victor.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Victor,
here it is:
```json
{
"responce" : "Hello world!",
"status": 200,
"iamlong": true
}
```
| # | Description | Expected result |
| ---- | ------------- | ------------------------------------------------------|
| 1 | Call some API | Answer ```json
{
"responce" : "Hello world!",
"status": 200,
"iamlong": true
}
```|
| # | Description | Expected result |
| ---- | ----------------------- | -----------------------------------------------------------------------------------------|
| 1 | Call <br> some <br> API | Answer ```json {"responce" : "Hello world!", <br> "status": 200, "iamlong": true } ``` |
| 2 | Call some API | Answer `{"responce" : "Hello world!", ` <br> ` "status": 200, ` <br> ` "iamlong": true }`|
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi - I'm looking for the answer to Dmitry's question and I don't see it. Can someone help me?
I need to add a code block of multiple lines into a table cell.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.