0

I could really use some help here, we have been in this for a few days now.

We have an angular 7 nx project, currently there is one app and one e2e app.

We would really like to start using cypress but we are having trouble doing so.

The main issue, i think, is typescript.

Can someone please share a working configuration or structure of a similar project? I'm talking mainly about tsconfig files, webpack config, and other package that need to be used

Thanks

Benny Afriat
  • 393
  • 1
  • 3
  • 12
  • 1
    Typescript should not be effecting you at all. I would not do my cypress in typescript, I would just use plain javascript. I think there is a way you can use typescript with it (but I wonder if it is worth it). What I do is have a separate folder named Cypress or QA/Cypress and put my cypress project in there. I do not mix the two up at all. So they do not share the same package.json file or anything. They are not related at all. They are in same repository for GIT though. – Maccurt Dec 19 '19 at 13:20
  • Thanks, the thing is that the cypress test runner is not able to load my app, because of issues related to typescript, i think. It's looking for my node_modules folder all the way up the hierarchy. and also i get this: Field 'browser' doesn't contain a valid alias configuration – Benny Afriat Dec 19 '19 at 13:26
  • I am not sure how they are related. Cypress should not care about your app being in typescript or any other language. It is simply going to URL and checking for elements. I suggest you create a test cypress project that is not related to your project at all. Not in the same folder, etc.. If your website will come up, cypress should work. I wonder if you have your cypress project mixed into your Angular project somehow and the configuration is out of wack somehow.. Create a totally different cypress project and see if it can get to your URL. I hope I read your question right, sorry – Maccurt Dec 19 '19 at 13:35
  • do you have a public facing version of your app. I could try to run cypress against it – Maccurt Dec 19 '19 at 13:36
  • No, sorry..it's a security system so it's kind of hush hush. I took your advice and completely separated the e2e app and main app, now the e2e app has it's own package.json and node modules and so far it runs, Thanks! – Benny Afriat Dec 19 '19 at 14:27
  • Glad it worked out for you. – Maccurt Dec 19 '19 at 14:30

0 Answers0