Automated ERPNext Implementation Testing

I’m quite new to the ERPNext universe. I’ve recently done an implementation for a small business. I wrote a few client scripts and server scripts. After that, all the testing was done manually, which took a lot of time since tests need to be repeated every time I change something in the settings or in the scripts.

So because of this, I was wondering how people actually do testing in a professional team. Is it common for teams to write these tests using Selenium rather than using the REST API directly?

In my scenario, I have two companies set up on the same ERPNext site and there are inter-company transactions and movement of inventory items, and so when certain DocType is created in Company #1, a another DocType is created in Company #2, which is implemented as a Server Script. The ERPNext source code itself is unchanged and there are no custom apps installed.

I see that ERPNext is using Cypress internally for UI tests, although it is not very clear to me how it works if the ERPNext instance is running on a remote server and I want the tests to run on my local machine. I’m also not so sure if this is suitable for testing Funtional Implementation projects or if it is only for development projects.

Any advice would be greatly appreciated.

There is this frappe app to test frappe apps.
You can explore this if it meets your requirements.

I could definitely be mistaken, but I don’t believe that Cypress is designed to do local testing on remote servers out of the box. For both Cypress and unittest, it’s really oriented around development and source management/ci. (I’m not familiar with Barista, but it looks really interesting.)

I’m testing Cypress now and it’s working!

I copied the cypress folder to my local system and set the remote instance’s url as the baseUrl in cypress and I’m able to run my own tests without installing anything on the remote servers.

1 Like

Can you explain step by step where to set the remote instance’s url as the baseUrl in cypress? Because the cypress is existed in the folder.

when i type npx cypress open i am getting these two errors.

ip: http://10.105.0.26/
erpnext version: v12
Cypress package version: 12.14.0
Cypress binary version: 12.14.0
Electron version: 21.0.0
Bundled Node version: 16.16.0

I’ve edited it in cypress.config.js and I’ve also changed the testUser and adminPassword values to those of my remote server.