playwright-ts-template icon indicating copy to clipboard operation
playwright-ts-template copied to clipboard

Template project with Utils project

Open rameshnss opened this issue 1 year ago • 5 comments

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.

rameshnss avatar Sep 09 '24 05:09 rameshnss

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.

vcannam avatar Sep 19 '24 22:09 vcannam

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

rameshnss avatar Nov 04 '24 06:11 rameshnss

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.

vasu31dev avatar Nov 04 '24 09:11 vasu31dev

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?

rameshnss avatar Nov 05 '24 04:11 rameshnss

@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.

vasu31dev avatar Nov 05 '24 21:11 vasu31dev