Hello, everyone! For what is datemyage a long time now, i’ve been planning to compose a write-up exactly how automatic screening is put up at Badoo. I desired to create something could be both useful and interesting. I desired to fairly share experiences that might be simple to put in training in virtually any system. And today the time has come…
As much of you understand, Badoo is a network that is social centers around finding new buddies and acquaintances. One of the more essential tasks it has to take proper care of is user verification.
We’ve other ways of verifying users. Several of those are pretty standard, such as for example verification utilizing an unknown number. Addititionally there is a far more method that is unusual verification by picture. Nevertheless the simplest and fastest means is verification via using internet sites.
This implies of verifying a profile can be obtained from the comfort of the minute a profile is created/registered via a myspace and facebook. To begin with, its quick: one simply click with no requirement for any extra actions utilizing a phone or internet cam. Next, it really is convenient, since, about yourself instead of entering them manually if you want, you can import photographs and information.
I would like to tell you about how registration and verification via Facebook is set up on Badoo and how we taught Selenium some tests to check them today.
So, the step by step list is ready, you have got launched the ensure that you it passes. All things are wonderful. Time for you to be since pleased since this kitten!
We commit the test rule towards the branch, deliver the duty for head and review down to get a coffee. But it to the kitchen there is a message — the task has not passed the review because the test doesn’t work before we make. Something moved wrong…
Directly after we have actually restarted the test, it becomes clear that the issue is the following: the FB account under consideration currently includes a Badoo profile. Rather than registering a unique profile, the test straight away authorises the one that is existing. There’s nothing else for this: you will need to delete the profile when the test is completed. Fortunately, we now have the qaApi that is amazing!
Several years ago, we told the tale of exactly just exactly how QaApi is incorporated with your auto-tests. The piece had been entitled, “Selenium tests. From RC and something individual to WebDriver, Page Object and a pool of users.”
In brief, this will be an interior api to which you can deliver a request and perform various actions from the app side from inside the test. It really is rather easy to trigger:
It goes without stating that QaApi is just in a position to utilize test users and it is just available via an intranet.
If the test had learnt to delete a person after itself, it beginning working regularly and well. Although not for very long.
Phases of Badoo testing
Very nearly at each seminar we tell individuals exactly exactly exactly what stages that are testing have actually inside our company. I want to briefly list people who are of great interest through the viewpoint of Selenium tests:
To begin with, we ran devel environment and staging tests. Nevertheless, in the long run, we stumbled on in conclusion we must be in a position to run shot tests too. Associated with very easy: devel doesn’t constantly copy manufacturing ideally, and it’s also perhaps perhaps not just a a valuable thing to get a bug during the staging phase and take away the big event through the launch. Which means that the duty won’t allow it to be into this launch and certainly will later make it out than prepared.
Let’s return to our test. That is amazing you will be that self-same QA engineer whom has become tasked with teaching the enrollment test be effective in parallel on a few shots as well as on staging.
I’d like to remind you that shots work with a manufacturing environment, in other words, they usually have the exact same individual base. It’s quite apparent that within the present set-up it’s extremely hard to perform tests in synchronous. Then the second test tries to create a profile on Badoo when the first has already created one, and it will inevitably fail if you activate two of these tests a couple of seconds apart on different shots:
How do we re solve this nagging dilemma of ours? Just how can we ensure that the test constantly includes a fresh FB individual?
Initially I attempted to solve this issue the simplest method. We created a table that is mysql that we imported several manually-created FB users and marked their status as ‘available’. The test took a person with this dining dining dining table, and changed their status to ‘busy’. The test crashed, giving the relevant notification if there was no available user.
This method had a few drawbacks that are evident. Above all, if too test that is many had been triggered as well, there have been insufficient records available and there was clearly nowhere getting them from. Additionally, for a few explanation, the test might neglect to surrender an individual by the end (for instance if it absolutely was stopped by pressing ‘Ctrl+C’). None with this ended up being valued on mornings whenever there clearly was significantly less than a full hour to get prior to the launch due date.
We soon got fed up with unstable crashes and out-of-control statuses with FB reports and started initially to try to find a far better solution…
Facebook includes a great API which lets you create test users also to run them — developers.facebook.com/docs/graph-api. it really is organised pretty just: you formulate the demand you want then deliver it to your FB server, and after that the clear answer comes home in json structure.
You will get a software id and key when you subscribe the application on FB (to get more details see here — developers.facebook.com/docs/facebook-login/overview).
A pool that is real of users. Do it: let’s create users! 🙂
Having very very carefully examined graph-api and its own distinctive features, we come up with the after set of small dilemmas: