-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Angular: Use Mocha+Chai for end to end tests #8197
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
Conversation
deepu105
left a comment
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.
LGTM but travis is failing
|
You changed |
|
@pascalgrimaud Yep I need to update entities, I'll do that tonight |
|
@wmarques : can you resolve merge conflict plz ? |
|
@pascalgrimaud Done, hope the tests will pass this time ! |
|
I'll try to fix this asap, seems we have to tell Protractor to wait after entities test, he's probably clicking "too soon" |
|
It works on my computer so I don't understand what is going on... Maybe I should add |
|
@wmarques : I'll have a look. I have some strange timeout in Travis with NPM, that I didn't have so much with Yarn |
|
@pascalgrimaud The failing test is the one when you the user types "admin" and "admin" as user/password and then we expect to have the green message that tells a successful login. |
|
I had a look on this:
|
| });<%= closeBlockComment %> | ||
|
|
||
|
|
||
| after(async () => { |
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.
Should not it be placed after the delete test?
|
Finally green ! 🎉🎉 |
| limitations under the License. | ||
| -%> | ||
| import { browser, element, by, ExpectedConditions as ec } from 'protractor'; | ||
| import { browser, element, by, ExpectedConditions } from 'protractor'; |
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.
Why make this change? I prefer to type ec over ExpectedConditions.
|
@wmarques this is totally awesome work -> can you fix the conflict? Then I think it's ready to merge |
|
@jdubois done ! |
|
@wmarques : you worked hard on this. Don't forget to claim the bounty :-) |
|
Just to give my 2 cents here (I am not involved at any level with them) -> I personally use https://www.cypress.io/ Works with every framework, works on docker, hast fixtures, gui app... Learning curve was very low... If you like have a look, maybe for jHipster 6 ;) |
|
I use Cypress at work, I really like it but there are few things I dont like
1. It's very slow, it runs tests at human speed unlike Protractor
2. It cant run parallel suites
Thanks & Regards,
Deepu
…On Mon, Sep 17, 2018 at 11:04 PM Denis R. ***@***.***> wrote:
Just to give my 2 cents here (I am not involved at any level with them) ->
I personally use https://www.cypress.io/
Works with every framework, works on docker, hast fixtures, gui app...
Learning curve was very low... If you like have a look, maybe for jHipster
6 ;)
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#8197 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABDlF28f2QqVgQkGmkNJ9X3AWDzW7n1Dks5ucA5kgaJpZM4WVamr>
.
|
|
I agree, exept with 1. |
|
For me, startup time was never an issue and when you have a lot of e2e cypress really takes time. But I dont hold those gainst cypress its much more easier to use and debug than protractor. But then this is a lot of work and I dont think any of the core team members have the bandwidth for this |
|
@hdurix Also told me about Cypress, I have to check this :) BTW, we can also use Jest + Puppeteer |
|
Last time when I looked into Cypress, they didn't had much support for cross browser testing (mostly chrome flavors). |
|
Yes that is also an issue
Thanks & Regards,
Deepu
…On Wed, Sep 19, 2018 at 1:23 PM Vishal Mahajan ***@***.***> wrote:
Last time when I looked into Cypress, they didn't had much support for
cross browser testing (mostly chrome flavors).
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#8197 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABDlFxqGcQGPgorRb1nMdBsqo5SKY3M8ks5ucikjgaJpZM4WVamr>
.
|
|
Indeed I also use Cypress with Vue.js at work and I also think it's nice! IMHO, Protractor is a lot better than cypress for Angular because it hides a lot of complexities for developer. For the other frameworks (react and maybe Vue.js soon?), I think both have got pros and cons and are quite equivalents. Below a table about how I see the options we have:
As @deepu105 said, all is about time and priorities. We can imagine a Cypress module if someone is interested to do it. |
|
I'm definitely against supporting both as options, that's too much
maintenance work and no much value. I would say we stick to protractor for
now unless someone is ready to spend the effort and do the migration for
both React & Angular. I'm definitely not willing to do it. If anyone wants
to do it you are welcome.
Thanks & Regards,
Deepu
…On Thu, Sep 20, 2018 at 12:58 PM Hippolyte Durix ***@***.***> wrote:
Indeed I also use Cypress with Vue.js at work and I also think it's nice!
It can be slow as human speed but it can be configured: for instance, the
typing is done 1 letter every 10ms, but it's configurable.
And I didn't know about parallel testing, it's a big point.
IMHO, Protractor is a lot better than cypress for Angular because it hides
a lot of complexities for developer. For the other frameworks (react and
maybe Vue.js soon?), I think both have got pros and cons and are quite
equivalents.
Below a table about how I see the options we have:
End user satisfaction JHipster team Efforts
Protractor for all + *
Cypress for all + **
Protractor for Angular / Cypress for react & Vue.js ++ **
2 options (Protractor or Cypress) for all +++ ***
- Switch from Protractor to Cypress will ask work for not a better end
use satisfaction (at least for Angular apps).
- Use Cypress for react will represents a lot of work as well (for
coding and maintaining it).
- The perfect solution would be to ask for the wanted tool during
generation but the amount of work would be huge for creating and
maintaining purposes.
As @deepu105 <https://github.com/deepu105> said, all is about time and
priorities. We can imagine a Cypress module
<https://www.jhipster.tech/modules/creating-a-module/> if someone is
interested to do it.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#8197 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABDlF10A38q5p8joZKVGp1pFsU07Hl1Dks5uc3TMgaJpZM4WVamr>
.
|
|
Protractor is an option here, that means doing cypress as a module should be doable ! |
|
My comment was just an "option for the future", I think jumping on it at this moment maybe is not (yet) a good idea, at least until they have firefox support. Cypress can be used with any framework with any backend and because of that it would be an ideal candidate for jHipster. So the end result could be : there is one codebase for e2e for all jHipster frameworks - cypress, Whatever framework jHipster is supporting today or will support in the feature (Angular, React, Vue, jQuery, frameworkXY...) it does not matter - as long as some html ids, classes or attributes and url routes stay the same in every framework generated project. Also (I assume) 90% of people build their jHipster project in jenkins (and other CI tools) and probably love (as much as I do) the fancy video recording feature. Analyzing the problem (reconstructing) becomes so easy and simple when you see what actually happened with the complete app step by step and how you came to the problem. This is a part protractor cannot cope with, you have to analyze the logs, find the test code and understand what you wanted to do in this test. Then you recreate that propbably manually on the UI. Then you verify... yes it is not working. With cypress -> I watch the video, I see what the user has done to make it not work, then I go into code. I think this is a huge difference (maybe only my opinion but... isn't this how we imagine perfect e2e tests?). I totally agree that cypress can be slow when you write 10000 tests with it but it can also be powerful and it depends how you write your tests. |
|
FWIW, Protractor can record screenshots, a video sounds pretty cool though.
https://blog.ng-book.com/taking-screenshots-with-protractor/
I found this plugin to record videos with Protractor, but haven’t tried it myself.
https://www.npmjs.com/package/protractor-video-reporter
… On Sep 20, 2018, at 3:40 PM, Denis R. ***@***.***> wrote:
My comment was just an "option for the future", I think jumping on it at this moment maybe is not (yet) a good idea, at least until they have firefox support.
Cypress can be used with any framework with any backend and because of that it would be an ideal candidate for jHipster.
So the end result could be : there is one codebase for e2e for all jHipster frameworks - cypress,
Whatever framework jHipster is supporting today or will support in the feature (Angular, React, Vue, jQuery, frameworkXY...) it does not matter - as long as some html ids, classes or attributes and url routes stay the same in every framework generated project.
Also (I assume) 90% of people build their jHipster project in jenkins (and other CI tools) and probably love (as much as I do) the fancy video recording feature. Analyzing the problem (reconstructing) becomes so easy and simple when you see what actually happened with the complete app step by step and how you came to the problem. This is a part protractor cannot cope with, you have to analyze the logs, find the test code and understand what you wanted to do in this test. Then you recreate that propbably manually on the UI. Then you verify... yes it is not working.
With cypress -> I watch the video, I see what the user has done to make it not work, then I go into code. I think this is a huge difference (maybe only my opinion but... isn't this how we imagine perfect e2e tests?).
I totally agree that cypress can be slow when you write 10000 tests with it but it can also be powerful and it depends how you write your tests.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub <#8197 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AABF5IHIIna3Fpvz9iiR6Dn6u7cD_8Mdks5udAtJgaJpZM4WVamr>.
|
|
For now, we will stick to Protractor we can reconsider again for JH6 or JH7
if Cypress adds Firefox support.
Thanks & Regards,
Deepu
On Thu, Sep 20, 2018 at 11:49 PM Matt Raible <notifications@github.com>
wrote:
… FWIW, Protractor can record screenshots, a video sounds pretty cool though.
https://blog.ng-book.com/taking-screenshots-with-protractor/
I found this plugin to record videos with Protractor, but haven’t tried it
myself.
https://www.npmjs.com/package/protractor-video-reporter
> On Sep 20, 2018, at 3:40 PM, Denis R. ***@***.***> wrote:
>
> My comment was just an "option for the future", I think jumping on it at
this moment maybe is not (yet) a good idea, at least until they have
firefox support.
>
> Cypress can be used with any framework with any backend and because of
that it would be an ideal candidate for jHipster.
>
> So the end result could be : there is one codebase for e2e for all
jHipster frameworks - cypress,
>
> Whatever framework jHipster is supporting today or will support in the
feature (Angular, React, Vue, jQuery, frameworkXY...) it does not matter -
as long as some html ids, classes or attributes and url routes stay the
same in every framework generated project.
>
> Also (I assume) 90% of people build their jHipster project in jenkins
(and other CI tools) and probably love (as much as I do) the fancy video
recording feature. Analyzing the problem (reconstructing) becomes so easy
and simple when you see what actually happened with the complete app step
by step and how you came to the problem. This is a part protractor cannot
cope with, you have to analyze the logs, find the test code and understand
what you wanted to do in this test. Then you recreate that propbably
manually on the UI. Then you verify... yes it is not working.
>
> With cypress -> I watch the video, I see what the user has done to make
it not work, then I go into code. I think this is a huge difference (maybe
only my opinion but... isn't this how we imagine perfect e2e tests?).
>
> I totally agree that cypress can be slow when you write 10000 tests with
it but it can also be powerful and it depends how you write your tests.
>
> —
> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub <
#8197 (comment)>,
or mute the thread <
https://github.com/notifications/unsubscribe-auth/AABF5IHIIna3Fpvz9iiR6Dn6u7cD_8Mdks5udAtJgaJpZM4WVamr
>.
>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#8197 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABDlF20wqqHzrgHsqW3JGH13KpAyLRbaks5udA1hgaJpZM4WVamr>
.
|
This is the first step to merge the end to end tests for both Angular and React.
Once we've done that work, we can give the tests to the Vue guys so they can run tests on their Vue UI and see if it matches with other JHipster frameworks :)
Related to #8164
Please make sure the below checklist is followed for Pull Requests.
Travis tests are green
Tests are added where necessary
Documentation is added/updated where necessary
Coding Rules & Commit Guidelines as per our CONTRIBUTING.md document are followed