Server: Replace PhantomJS with Cypress

Created on 22 Dec 2017  路  7Comments  路  Source: nextcloud/server

I just stumbled upon this blogpost from Gitlab and was wondering if this will become necessary here as well: https://about.gitlab.com/2017/12/19/moving-to-headless-chrome/

Looks like PhantomJS will not be developed further https://groups.google.com/forum/#!topic/phantomjs/9aI5d-LDuNE and if I am not wrong it is used here as well. So in the long run, it might need to be replaced with headless chrome?!

PS: I am not really familiar with PhantomJS, so please excuse if I got something wrong here.

1. to develop technical debt

All 7 comments

cc @nextcloud/javascript

Yes, PhantomJS was abandoned, sooner or later it needs to re replaced. Firefox can also run in headless mode, whether it is installable on a headless machine idk. In general, yes, we need to move somewhere.

See #8357 and #8258 - cc @juliushaertl

karma has a chrome headless launcher, so it should not be to hard to switch.

https://github.com/nextcloud/server/blob/a18a853e68573d1df18f5e9c322ee27236152ee0/tests/karma.config.js#L301

I recently stumbled across cypress, which is a combination of test framework/assertion library with mocking support that uses chrome headless and seems they will support firefox in the future as well: https://github.com/cypress-io/cypress/issues/1096

Right now I'm trying to use it for some testing on the deck app, and until now I'm really impressed how nice things work there. Maybe it is worth to consider this for the server in some parts as well.

Since we use cypress for the vue-components now as well, I guess this will be the way to go.

We shoud also replace our acceptance tests with cypress :)

Was this page helpful?
0 / 5 - 0 ratings