ortoniKC / ortoni-report

Welcome to Ortoni Report, a comprehensive and visually appealing HTML report generator tailored for Playwright tests. Designed with powerful features and customizable options, Ortoni Report simplifies the process of reviewing and managing test results, making test reporting more intuitive and accessible.
https://www.npmjs.com/package/ortoni-report
GNU General Public License v3.0
50 stars 3 forks source link

not able to find report-template.hbs #1

Closed shortcut2yp closed 5 months ago

shortcut2yp commented 5 months ago

Added ortoni-report 1.0.7 as dev dependency and added it in reporter config. On running the test cases getting below error.

Error in reporter Error: ENOENT: no such file or directory, open '/Users/automation-playwright/report-template.hbs'

Seems this is added in .gitignore file of the repo.

ortoniKC commented 5 months ago

Hi, hbs file should be within the dist folder, which is not included in the git. If you go to node_modules/ortoni-report/dist you should see this. Could you please share the playwright.config reporting part to understand the issue.

shortcut2yp commented 5 months ago
reporter: [['list', { printSteps: true }],["html",{open:"never"}],['json', {  outputFile: 'results.json' }],['ortoni-report']]
ortoniKC commented 5 months ago

Yes, I am also facing the same issue. Thanks for the report. I will update now.

ortoniKC commented 5 months ago

Released version 1.0.8, it should be fixed. pls check.

shortcut2yp commented 5 months ago

working now ! Thanks 🙌 Somehow I feel it is creating a new folder each time at top level , seems issue with naming convention of the screenshot folder. Do check if its same for you. Can close this issue.

Screenshot 2024-06-16 at 11 00 08 AM
ortoniKC commented 5 months ago

In my test it is like image Pls confirm if you're able to see the screenshots within the report?

I will try to debug the path issue if exists, Kindly share the report in your LinkedIn if possible. Thanks.

shortcut2yp commented 5 months ago
Screenshot 2024-06-16 at 11 21 15 AM

report looks like this , no screenshots. Seems some issue with my config , will check.

Sure once I generate proper report , will share in linkedln 🙌

shortcut2yp commented 5 months ago

can it be because I am using UNIX based system and the code has

const screenshotsDir = path.join(process.cwd(), 'screenshots\\' + test.id);})

whereas UNIX uses / to determine folder structure.

can we use const screenshotsDir = path.join(process.cwd(), 'screenshots', test.id); in place of above code ?

The backslash (\\) is treated as a literal character in the string. This means the path separator is explicitly Windows-style, regardless of the operating system. If run on a Unix-like system (Linux, macOS), the backslash might not be interpreted as a path separator, leading to potential issues.
ortoniKC commented 5 months ago

Great, I am providing a fix.

ortoniKC commented 5 months ago

Fixed with version 1.0.9 Also custom attributes like projectName, authorName & testType - https://www.npmjs.com/package/ortoni-report?activeTab=readme Do check it out & if any issue pls create a new one. Thanks for the support.