UTNkar / ordsys

4 stars 2 forks source link

Add tests with selenium #406

Open dakaza98 opened 1 year ago

dakaza98 commented 1 year ago

Our application needs tests in order to prevent bugs from slipping in. A good way to do this would be to use selenium which can test our application by clicking around and interacting with it. This makes it possible to test all parts that involve websockets. It also makes the tests perform the actions that uses will do

sgronlund commented 1 year ago

I'd assume this also require some initial menu items for the test to interact with?

dakaza98 commented 1 year ago

Yes it will be necessary

albinantti commented 1 year ago

Could it be combined with django? I long for a dev-set up that includes auto-populating menu items, users and orders

sgronlund commented 1 year ago

There is a feature in Django which is called fixtures which can be used to seed or initialize an environment. To get one from an existing environment, you can do python3 ./managepy dumpdata >> seed.json and then supply the file created to initialize.

NOTE: dumpdata includes every action a user has done when interacting with the system, e.g. as an admin created a menu item or deleted an order.

dakaza98 commented 1 year ago

Ah sweet! Though I think we should open a separate issue for creating initial data