Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make it easier to add fake users with specific playtime for testing purposes #251

Open
jauggy opened this issue Apr 11, 2024 · 4 comments
Open
Labels
Feature request Not broken but something we want added

Comments

@jauggy
Copy link
Contributor

jauggy commented Apr 11, 2024

Make it easier to add fake users with specific playtime or adjust existing users to have specific player time. Player time is used to calculate rank on login. This feature would be useful for testing.

@L-e-x-o-n L-e-x-o-n added the Feature request Not broken but something we want added label Apr 12, 2024
@jauggy
Copy link
Contributor Author

jauggy commented Apr 14, 2024

To bypass email checks we can change this setting (Require Email Verification):
Screenshot 2024-04-14 210752

I still want a way to set play time though to test various chev levels.

@L-e-x-o-n
Copy link
Collaborator

L-e-x-o-n commented Apr 15, 2024

  1. Run server in interactive mode with iex -S mix phx.server
  2. Go to http://localhost:4000/teiserver/admin/site#Profiles and set Rank method to role
  3. Find out the user ID of the user you want to test (http://localhost:4000/profile/ for example)
  4. Execute command in iex: Teiserver.Account.update_user_stat(<ID>, %{"player_minutes"=> 100*60, "spectator_minutes"=>20*60, "total_minutes"=>130*60}) (you can only set spectator_minutes and player_minutes, only those are used for rank calculation)
  5. Login as the user in game (playtime will be updated after the previous step, but rank is only recalculated on login)
  6. Confirm that your rank changed (for example by visiting http://localhost:4000/profile//playtime)

@jauggy
Copy link
Contributor Author

jauggy commented Apr 15, 2024

So should we put a guide for this and link it somewhere?

Either a new doc or add to testing guide.

@L-e-x-o-n
Copy link
Collaborator

Not necessarily, I am just showing an example of how it can be done if you need it right now for some tests. The issue is still valid and an easier way to do it would be nice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature request Not broken but something we want added
Projects
None yet
Development

No branches or pull requests

2 participants