Skip to content
All guides

Business tools

Choose Yandex Test Accounts for a Sign In With Yandex Button

The right number of Yandex test accounts comes from the profile states your sign-in code branches on, not from a round number. Map the fields Yandex ID returns to test cases, then buy one account per case.

Contents

Start from your code, not from a round number

If your site or app offers sign-in with Yandex, you need real Yandex accounts to test it, and you probably do not want those tests running on your personal login. Buying test accounts is a reasonable shortcut. The common mistake is buying a round number with no plan and then discovering that most accounts look identical to your code.

The right quantity comes from the profile states your integration has to handle. Work those out from the documentation first, then buy one account per state.

What Yandex ID returns, and why it shapes your tests

The API Yandex ID documentation describes authorization through OAuth 2.0, where the user confirms logging in and allows access to their data. An app can receive only the permissions specified when it was registered. After the token exchange, every response includes the login, id, client_id and psuid fields; everything else depends on the permissions you requested.

Those permissions create the branches you test. The email permission returns default_email and an emails array that, per the documentation, currently holds only the default address. The profile picture permission returns is_avatar_empty and a default_avatar_id. The date of birth permission returns birthday, which is null when the birthday is unknown. The phone number permission returns default_phone.

A three-account plan for a course site

Hypothetical: an online course site requests email and profile picture, and shows a placeholder image when a user has no avatar. Its tests need one account with an avatar set, to exercise the real image path; one account with is_avatar_empty true, to exercise the placeholder; and one account reserved for the first-login path, so a tester can always walk through the consent step as a new user of the site.

If the site later adds the date of birth permission, it adds one branch: a user whose birthday is unknown, which returns null. The account without an avatar can also be the one without a birthday if the two cases never need to run separately, so the plan grows to three or four accounts, not ten.

You can change an account's avatar or birthday between runs, but separate accounts let testers work in parallel and keep each state stable for repeat runs. That stability is what you are paying for.

Turn the permissions into a written matrix

Write the matrix before you open any listing. List the permissions your app registered, then for each one the values your code treats differently. For email that is usually a single row, because only the default address comes back. The profile picture gives two rows, avatar set and avatar empty, and the date of birth gives two, a known date and null. For the phone number, the API Yandex ID documentation does not describe the case of an account without one, so confirm how your code handles a missing default_phone in a test rather than assuming.

Then merge rows that one account can cover without conflict. An account with an avatar and a known birthday covers both present rows at once; an account with neither covers both missing rows. Add the first-login account, and a typical app rarely needs more accounts than the course-site plan above. Add another only when a second tester needs the same state at the same time.

Fit criteria for test-account listings

For testing, unused accounts are the better fit: no earlier sign-ins to other apps and no unexpected profile data. Look for listings that state prior use and phone status, and replace passwords and recovery details on delivery so a test login cannot be taken back in the middle of a sprint.

If you test the phone number permission, you need an account whose phone number is your own, otherwise default_phone would return someone else's number into your test data. Keep personal data out of test accounts wherever a case does not need it.

What test accounts are not for

Test accounts exist to exercise your code paths. They are not production logins for real users, and they are not a way to create user activity in your own or anyone else's service. Keep them inside your test environments and retire them when the integration no longer needs them.

Yandex's user agreement holds the person behind a login responsible for everything done with it and forbids selling or reselling access to Yandex services without Yandex's authorization. Test accounts bought on rStock sit under those terms like any other account, and your app's use of Yandex ID stays bound by Yandex's developer documentation and the permissions you registered.

Buying the test set on rStock

Yandex owns its trademarks, and rStock is a marketplace that operates without any affiliation to Yandex. One order on rStock is one product in the quantity you choose, so buy the whole set from one listing when every account should start in the same state, and from separate listings when cases need different starting points.

Payment comes from your rStock balance, and the accounts arrive as a delivery record on your order page. The payment is held for the window shown there, which is the time to sign in, secure each account and set its profile state. Open the Yandex category with your list of cases and buy only as many accounts as that list has rows.

Frequently asked questions: Choose Yandex Test Accounts for a Sign In With Yandex Button

Keep reading