Back

Can't admin user, project and api key programmatically while configuring a test env for E2E test

  • 0
  • Self Hosted
  • General
  • Web
  • REST API
anyuru
19 Dec, 2024, 16:37

Hi there, 
I’ve been trying to setup a test environment for my project to support tests at all levels of the test pyramid including unit, integration and end to end tests. 
After doing some research I have to spin up a local appwrite instance for my tests. I’ve managed to spin up the local instance. However, I’m having some concerns with how the setup and teardown of the testing environment. There is no way for me to create an admin user, organisation, project and project api key (with scopes) so that I can the server sdk except through the console ( user interface ). 
Therefore, I’d like to inquire whether there’s any way to automate this because it would be handy during setup and teardown of my test environment.
If that cannot work, I’d like an alternative approach. I've done some research about the console SDK but unfortunately it isn't available for appwrite

TL;DR
Issue: Developer is struggling to automate the creation of admin user, organization, project, and API key programmatically while setting up a test environment for end-to-end testing in Appwrite. Solution: To automate the setup and teardown process, a possible approach could be to make use of API calls to create the necessary entities such as admin user, organization, project, and API key. This can help streamline the testing environment configuration without relying on manual setup through the user interface. Additionally, exploring the Appwrite API documentation for endpoints related to user, organization, project, and API key management could provide further insights on how to achieve this automation.
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more