vasu31dev / playwright-ts-template

Playwright Typescript Automation testing framework Template is designed for Web (Desktop & Mobile), API, and Electron apps. Stable and Robust layer on top of Playwright with inbuilt Utilities, Linting, Logger, Web hooks, Github actions, Reports and much more
113 stars 5 forks source link

Template project with Utils project #27

Open rameshnss opened 2 months ago

rameshnss commented 2 months ago

Hello Vasu31dev, your way of architecture of playwright project is excellent and I’d like to exercise for my learning. I skipped using cli and directly cloned your template project and installing your utils project. When I run tests from template using ‘npm run test’ , I’m getting playwright not recognized error. Pls advise. What I’m missing.

vcannam commented 2 months ago

Hi @rameshnss , Sorry for the late response. I have updated the packages just now. Can you please pull the latest code from the template project, run the npm run ready command and run the tests again. If you still face errors then can you please let me know the the OS, playwright version and the error message that you are getting.

rameshnss commented 2 weeks ago

Hi , I have your lib and template project. I did npm install in lib project. Then I did npm link in template project. I’m seeing “@playwright/test required second time “ error. If I do npm install in template project then I can run tests without any issue. I’m using your package.json file. Not changing any version of playwright. I’m using windows OS. I’m seeing few issues online related to this issue but I could not get any solution yet. please advise how can I use your lib project as dependency in my local dev environment

vasu31dev commented 2 weeks ago

Hi @rameshnss, You can just clone the template project and use npm install This will automatically install all the dependencies needed for the library as well in the template project. No need to link or clone the library. This should help you with the clean setup.

rameshnss commented 2 weeks ago

Yeah right , for me I need to add one more library to lib so I need local changes to reflect in template project. So I need to link projects so I can keep linking for dev environment. I will use install for prod environment. Any idea why I’m getting the playwright/test required second time error?

vasu31dev commented 2 weeks ago

@rameshnss You can add the new library directly as a dependency in the package.json file. Instead of linking the libraries, include them as dependencies. If you're still encountering errors, please share the package.json file. Also, avoid adding a separate Playwright library, as it is already included in my library.