# Local users for automated UI tests

**URL:** <https://community.auth0.com/t/local-users-for-automated-ui-tests/51469>\
**Category:** Get Help\
**Tags:** jwt, login, auth0\
**Created:** [October 13, 2020, 9:14am UTC](https://community.auth0.com/t/local-users-for-automated-ui-tests/51469 "2020-10-13T09:14:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ruslan](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ruslan/32/12763_2.png) [@ruslan](https://community.auth0.com/u/ruslan)\
**Post date:** [October 13, 2020, 9:14am UTC](https://community.auth0.com/t/local-users-for-automated-ui-tests/51469/1 "2020-10-13T09:14:26Z")

</div>

I am using Cypress to test my CPA in my CI/CD pipeline. For each test to avoide collisions I create new unique test user which performs some actions on the app and then left abandoned. Because I create many users, tests take much time to communicate with Auth0 servers and all these users counted against my quota.

Is there a way to create test users locally?

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [October 13, 2020, 12:13pm UTC](https://community.auth0.com/t/local-users-for-automated-ui-tests/51469/2 "2020-10-13T12:13:52Z")

</div>

Hey there!

Unfortunately I don’t have any experience with Cypress but maybe our general practices on testing as well as the blog article on testing with Cypress will help:

**Testing with Cypress**

- [End-to-End Testing with Cypress and Auth0](https://community.auth0.com/t/end-to-end-testing-with-cypress-and-auth0/19082)
- [End-to-End Testing with Cypress and Auth0](https://auth0.com/blog/end-to-end-testing-with-cypress-and-auth0/)

**Auth0 Testing in General**

- [Get Management API Access Tokens for Testing](https://auth0.com/docs/tokens/management-api-access-tokens/get-management-api-access-tokens-for-testing)
- [Test Applications Locally](https://auth0.com/docs/dev-lifecycle/work-with-auth0-locally)

---

<div class="post-metadata">

**Author:** ![ruslan](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ruslan/32/12763_2.png) [@ruslan](https://community.auth0.com/u/ruslan)\
**Post date:** [October 13, 2020, 12:58pm UTC](https://community.auth0.com/t/local-users-for-automated-ui-tests/51469/3 "2020-10-13T12:58:52Z")

</div>

Thanks Konrad,

Actually my question is not specifically about Cypress and not Testing in General. It is about mocking Auth0 for tests.

In your last link there is paragraph

> Use a browser bot (such as Selenium) to play the role of a user, log in and retrieve a JWT. While this approach may take some effort to develop and maintain, it will allow you to test any [redirection rules](https://auth0.com/docs/rules/redirect-users) or [MFA prompts](https://auth0.com/docs/mfa) that you have configured.

Could you please clarify how can I “log in and retrieve a JWT” locally (without contacting Auth0 server)?

---

<div class="post-metadata">

**Author:** ![ruslan](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ruslan/32/12763_2.png) [@ruslan](https://community.auth0.com/u/ruslan)\
**Post date:** [October 19, 2020, 1:58pm UTC](https://community.auth0.com/t/local-users-for-automated-ui-tests/51469/4 "2020-10-19T13:58:25Z")

</div>

Konrad? can you help?
