qase-tms / qase-javascript

Qase TMS JavaScript SDK
https://developers.qase.io
47 stars 38 forks source link

Playwright: add custom text comments on the test results page #590

Closed NickVolynkin closed 1 month ago

NickVolynkin commented 1 month ago

Besides attaching custom text snippets as attachments with qase.attach() users can find it useful to attach some comments that will be shown right on the results page.

Value

Such syntax can give users a flexible option to add some textual comments which will be seen right on the test results page, without the need to open attachments.

Syntax

  test('Comment example', async ({ page }) => {
    qase.id(42)
    await page.goto('https://qase.io/');

    qase.comment(`Page title: ${page.title()}`)
    expect(await page.title()).toBe('Qase | Test management software for quality assurance');
  });

Implementation

In both API version there are fields responsible for this type of on-page comments.

Reported with API v1:

Screenshot 2024-05-22 at 15 43 26

Reported with API v2:

Screenshot 2024-05-22 at 15 45 37
cenfun commented 1 month ago

If using qaseio API, it can be easily implemented. add qase metadata with comments:

/**
 * @qase 1
 * @qase_comment Test case comment here
 */
test('passed test', () => {

});

see example

gibiw commented 1 month ago

Added to qase-playwright 2.0.4