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

Best way to create some test Users that are always "online"? #45

Open
fuzzybabybunny opened this issue Dec 10, 2014 · 8 comments
Open
Labels

Comments

@fuzzybabybunny
Copy link

Since I'm developing on my own, I would like to create several test user accounts (created initially in fixtures) that are always "online." What's the best way to do this? Even if I set status.online: true in the fixtures (via Accounts.onCreateUser()) I bet it would just get changed to false as soon as the package runs.

@fuzzybabybunny
Copy link
Author

Haha, I guess I could just have like 5 browser tabs open at the same time each with a different user logged in.

@mizzao
Copy link
Collaborator

mizzao commented Dec 10, 2014

Yep, multiple browsers are the way to go. You can't actually use the same browser with different tabs because they will share a login token through local storage.

@fuzzybabybunny
Copy link
Author

Hmmm... well, the issue is that I'm building a geo-location app. The online users all should have a different GPS coordinate. So if we have multiple online users via the multiple-browser method, all of the "users" would have the exact same GPS coordinate, haha, which is of limited use.

@mizzao
Copy link
Collaborator

mizzao commented Dec 11, 2014

In the tests for this package, we can create and change the status of connected users. However, I'm not sure that Meteor allows accessing test code of other packages yet. You can take a look at how that is done, and maybe do the same for the situation you are trying to create.

@illuminaut
Copy link

incognito mode doesn't share storage with the regular mode, so that's one extra user you can use per browser. I have tested with quite a few simultaneous logins that way, running on chrome and firefox on the desktop, phone and tablet.

@mizzao
Copy link
Collaborator

mizzao commented Dec 18, 2014

@illuminaut yep, I do that too.

@mizzao
Copy link
Collaborator

mizzao commented Feb 18, 2015

@fuzzybabybunny you can always have your test fixtures create and delete accounts in the setup and teardown phases of your test, too. UserStatus only clears stuff when it's starting up. I think some of the tests in this package also rely on that to work.

@mizzao
Copy link
Collaborator

mizzao commented Sep 3, 2015

As a follow-up to this, see https://github.com/mizzao/cooperation-loadtest for a way to use one Meteor app to use DDP to connect to another Meteor app and mimic real connections. This is probably about as good as it gets without actually using real browser tabs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants