-
Notifications
You must be signed in to change notification settings - Fork 915
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] add cypress #356
[WIP] add cypress #356
Conversation
package.json
Outdated
"cy:run": "cypress run", | ||
"precy:ci": "npm run build", | ||
"cy:ci": "npm-run-all --parallel --race start:ci \"cy:run -- --config=baseUrl=http://localhost:4000\"", | ||
"start:ci": "angular-http-server --path ./dist -p 4000 --silent" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we prefix everything with cy:
so that it is obvious that they belong together?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes!
@timdeschryver looks very cool! Can we also run it as a part of |
We definitely can, but wanted to hear your thoughts on this, as well as the bullet points under "Need to clear out". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Tim!
I would add this to run with npm run ci
but also kept the protractor as is so people see example of both, we can document that a bit in README.md
(like a small note that they should choose and use just one).
Also how should I understand
Is there a way to run the version build with
npm run build:prod
?
what is the version build?
To build the app I tried using
Thus it can't find the translations. If I build the app with If you need more info, ask away. |
@timdeschryver could cypress be configured so it also run with the context path of Also...
Can you please elaborate a bit more why this is the case? |
This has nothing to do with Cypress but with "hosting" the application yourself. I'll take another look later to see if it's possible. In the past I wasn't succesful in finding a solution 😅 |
This could work?
|
I'll try it later today and keep you posted. |
You are a hero @tomastrajan 😄 |
It should work with the last commit but I don't like it that we have to do the following in the cypress tests. Also I think this might crash the
Another solution would be to not use the |
We're using As for new env / config, I think it would make sense to define CI which doea prod build (angular.json configuration) and can have separate environment.ci.ts with no context paths which makes things easier, just have to think about running prod.build.on Travis CI so we can deploy app built.with context paths onto GH pages. |
With giving it a second look with a fresh head I think we don't need a another env file. I didn't notice we were also hashing the router in dev mode. Our cypress tests runs fine in dev mode and prod mode, so I don't see a need to "complicate" things and add another config. So I think all the things we needed to clear out are done:
If you're OK with this setup I can add it to the README. |
@timdeschryver yes, I think it is great like this, please update the README.md and we can merge this :) |
I added a new module, added new folder under i18n folder and also added TranslateModule.forChild() in imports of new module. Somehow it is not loading translation for new module. What am I missing? |
What:
Introduces cypress to run our e2e tests.
data-testid
attributes are added in the html to use in the tests, prettier also formatted these filesNeed to clear out
npm run build:prod
?Issue number: N/A