How to test a taxi booking app like Uber?

How to test a taxi booking app like Uber? They are extremely complex and demand high data security.  On the top, they have to offer unvarying stability and high UX. If you are thinking about testing. you need assistance from someone who knows what they do.
However, some might be thinking that they have put a lot of effort when it comes to the development of the app, they have extremely skilled developers and they can carry out the process with ease.
But remember one thing, user perspective is what matters, your developers might be partial, and this might be has a huge weightage considering the competition that you are going to face and the huge amount of money hat’s been invested.
Testing is indeed extra cost, but the amount of risk it mitigates is immense.
But the question prevails! How to test a taxi booking app like Uber?
before we get into that, let’s know about the need in detail.

Why thorough testing is needed
Every customer user app needs thorough testing to succeed in the market. No customer would be willing to use a non-secure or slow app. In this digital age, competition is very high and most likely you will not get a second chance. Here are some reasons why a thorough and meticulously planned testing effort is needed for a taxi booking app:

  1. Security of Customer/Driver Data: the app would include the customer’s and drivers’ personal data (PII). Any security breach in this area can lead to legal complications for the app company and owner. 
  2. Integrated Payment and Wallets: Most booking app would have an integrated payment gateway to enable easy payment for the rides. These gateways and payment options need to be tested minutely to make sure the clients’ money is safe. 
  3. Easy to Use UI: The app should be designed in such a way that different types of users including aged people and people who are new to the internet can use the app with ease. 
  4. Accuracy of data: The app needs to be tested to ensure data accuracy in multiple points. This will include the data of the customer, driver, the trip details, the offers, the fares, the distance calculations, and much more. The accuracy of every data displayed on the app needs to be verified for its correctness. 

Uber App Screen
What to test in a taxi booking app?
Now that we have understood why testing is so important for the taxi booking app, let us look at some important focus areas and test points. While this list is not exhaustive, it will give you a fair idea of how to get started. Feel free to add points as per the app and requirements in hand.
From a Customer Perspective

  1. Customer Data: The customer data in the app needs to be tested to ensure it is accurate. This will include the personal details, the payment details (if they wish to save), the trip details, favorite pick-up and drop location, the offers available, and more.  
  2. User and driver registration: Registration for both customers and drivers needs to be tested to check the data is getting saved corrected in the server. The users and the drivers should be able to add, edit, and delete their details as well. 
  3. Map Related and live tracking: Testing the map related functionalities are very critical for any taxi booking app. This includes opening the app in the current location, finding cabs in the vicinity, and live tracking of the cab movement before and after confirming the booking. 
  4. Time Tracking: The live movement of the cab should be linked to the time taken to reach the destination or time to reach the customer. These values need to be constantly changed to verify the functionality is working fine. This can be tested by simulating a moving vehicle and then calculating the location and time. A critical requirement here would be the refresh. This needs to be decided by the business, ideally, it should be 1 sec or less, so the customer does not see a lag. But based on the system design and the load the business may decide for 2-5 secs also. 
  5. OTP: Most apps will have an OTP generation system for authenticating the user at the time of registration and even when boarding a cab. The OTP needs to be validated against the customer data with valid and invalid entries. The number of retries allowed is another important yet overlooked point. If the OTP is regenerated, the system should accept only the latest OTP and none of the previous ones should be accepted. Ignore this if not applicable to your app. 
  6. Wallet Transactions and history: Most apps will have an option to load money into the wallet using a pre-established payment gateway. The wallet needs to be checked for money top-up, balance, transaction history, refund, and offers. The same will be true for other payment options like debit card, credit card, UPI, and other options as per the app.
  7. Trip – distance and time: The details regarding the trip needs to be tested. This will include the distance between the pick-up and drop location. The way chosen should be the shortest way with the least traffic based on the congestion points in the location. The estimated time of travel and other details of the trip as per the business needs. 
  8. Trip Modification: The user should be allowed to make changes to the trip. This will include cancellation and changing the destination point. In the case of the latter, the trip distance, time, amount, and route should change accordingly. Check if there is a limit on the number of times the user can make the changes. If there is a limit like 2 or 3 then it needs to be tested that the 4th change is rejected by the system. 
  9. Cab Sharing: Most of the apps would allow the sharing of the cab between people. In this case, it is important to test the distance between the shared pick-up points. This limit must be set by the business. Check with the requirements and then test to make sure the sharing pick-ups are scheduled within that range. 
  10. Driver and cab details: The customers should be able to view all the driver details and his previous customer ratings. They should also be able to see the cab number and the model along with the driver’s contact number. As per the app, these may contain driver pictures as well. 
  11. Push messages and SMS: Every app has its own requirements for SMS, email, and push notifications. These will include notifications for booking confirmation, cab arrival, driver details, OTP, trip completion, the amount payable, cancellation request, feedback request, and others. Each of these needs to be tested to make sure they are time-bound as per the business requirements.
  12. Search: One of the most important aspects of the map search. This will include searching for cabs in the current location and location as per the user’s interest. Suggestions for the location once the user starts typing will be good to have feature. The search should show the cabs available in the area along with a route map. It should inform the customer of the distance and time to the nearest cab. 
  13. Offers: Every now and then, the company may come with offers and discounts for all or specific customers. The offer code and their validity need to be tested along with any specific requirements for availing the offers. The amount being reduced after availing the offer is another test area. 
  14. Feedback and Rating system: The app should include a feedback and rating system for both the customer and the driver. They should be able to give feedback and ratings to each other. These ratings need to be analyzed to improve the drivers and the services provided.
  15. Customer Support and Escalation: The app will have customer support and escalation mechanism in place. This can include support through email, call, or chat. Each must be tested along with the different escalation levels. 

From a Driver Perspective

  1.  Driver Data: Like the customer data, the app will also contain the driver data, his incentive, the number of trips undertaken, the star ratings (if available), his payment schedule, and other details. This again needs to be tested to make sure the mapping in the database or server is correct and the queries used to fetch the data is as expected. 
  2. Trip Visibility and Options: The driver should be able to see the customer search within a specific distance as per his current location as fixed by the business. He should have the option to accept or decline the trip as well. Once accepted the trip should be hidden for the other drivers. 
  3. Benefits and Trip history: Most drivers will be paid based on the number of trips they have undertaken, and the benefits would increase with the increase in the daily or weekly completed trip count. All these details along with the payment options and history should be available for the driver to verify. 
  4. Hiding Customer Personal Data: Customer data is very critical especially the phone numbers. This information need not be shared with the drivers. To contact the customers there should be a hotline number and the customer details should be hidden from the driver. 

Types of Testing 
For all the above test cases, there are different types of testing that will be done. Here is a list of these:

  1. Manual Testing: Critical business functionalities need to be tested manually. Manual testing is also needed in cases where the team does not have the time or money for automation or when the automation feasibility for the features is low. 
  2. Automation Testing: The app will have a lot of validations. If the testing is to be done only once, then automation is not required. But if there are likely to be regular updates or new features added, it would be better to have an automation suite in place to reduce the future testing efforts and save time as well. 
  3. Security Testing: The app server or database contains personal data of the customers and the drivers. This will include the names, address, phone number, mobile number along with the payment details that can include the bank or card numbers. The security of this data is very important. The app should be safeguarded against external attacks. 
  4. Performance Testing: Based on the anticipated load performance testing needs to be done so that the search, map loading time, and other transactions are well within the SLA at peak and off-peak loads.  Based on these results the business will decide to scale-up the infrastructure if needed.
  5. Integration Testing: There are several systems involved in the app. This includes the GPS tracking or mobiles of the driver and customer, the database or server, and the booking app. The integration between these systems needs to be verified for accuracy and data flow. 
  6. DB testing: Customer and driver details along with all the trip information are store in the database. Hence, DB testing is imperative. While testing we need to ensure that the basic operations like adding a record, editing a record, deleting a record, fetching the record are being performed as per the expectation. 
  7. Exploratory Testing: Exploratory testing is a kind of informal testing in which the user would just explore the application trying to go through all the different pages and verify that nothing is broken. 
  8. Responsive Testing: Responsive testing needs to be done to ensure that your taxi booking app renders itself well in devices with different screen sizes and resolution. With so many new devices entering the market and the extensive usage of the internet, responsive testing of the app needs to be taken very seriously. 
  9. UAT Testing: The ultimate testing for any app or software must be the UAT or User Acceptance Testing. UAT gives the usage pattern and the most frequently used areas of the app. This will be helpful in deciding the future features of the app. 

app crash
How do I test the Uber app?
Apps like uber are bound to be installed across many devices with varied OS versions.  Performance testing has to be done at intervals to make sure that the app is working fine and it has what it takes to meet up customer expectations.
While testing make sure that

  • Complete assessment of the business requirement of the apps
  • Identify the important performance testing metrics
  • Create perfect and realistic test scenarios
  • Analyze and validate the test result and measurements
  • Preparation of reports that can also be useful for developers.

Tips for testing apps like uber

  • Apart from the normal workflow of the registration module, you must also make sure that social media login and integration is carried over the system with ease.
  • Check email authentication process to make sure that your domain will not be marked as spam
  • Make sure that there are unnecessary links attached to the mail send by the system
  • Make sure that the user is able to differentiate auto-generated messages
  • Make sure that the geographic information system (GIS)  is in sync with the system and functionalities
  • Check the OS compatibility of the app with various versions
  • Make sure that the information provided to the user is concise and precise
  • Proper localization testing needs to done to make sure that it’s not hurting any sentiments
  • Real drivers and passengers have to be used for testing rather than a simulated environment
  • A payment gateway is integral for taxi booking apps. make sure that it doesn’t have any loophole and is working fine
  • Trace out all the security loopholes in the system
  • Test the authorization workflow and functionality
  • Gamification is indeed the star nowadays. Make sure that it’s in a way that will make the driver and the customer feel rewarded
  • Test the system in varied internet strength and load

Top 10 Taxi booking Apps

  1. Uber
  2. Lyft
  3. Ola Cabs
  4. Taxify
  5. DIDI
  6. Cabify
  7. Lecab
  8. Curb
  9. Gett
  10. GoCatch


Which are the tools that can be used for taxi booking app testing?
While the listed set of testing might be overwhelming, here is a list of tools available in the market to get you started.

  1. Appium and Appium Studio
  2. TestComplete
  3. Calabash
  4. Webload
  5. Zed Attack Proxy
  6. Android Debug Bridge
  7. Lambda Test
  8. Studio Press
  9. DBFit, SQLUnit
  10. Visual Studio Team Edition

Hope you have a fair idea now about how to test a taxi booking app now. This should be enough to get you started and rest you can improvise when you are at it. 

AngularJS Testing Tutorial – Cypress, Karma and Protractor

AngularJS testing using selenium is not a good approach. Due to the asynchronous behavior of the application selenium is not able to handle the asynchronous calls.
So it is necessary to make use of angularJS testing tools so that asynchronous behavior of the application can be handled. Let us see some good approaches to test angular JS websites below.
Unit Testing AngularJS Apps
To make sure that unit testing is happening easily when it comes to AngularJS Testing, Angular JS has been provided with dependency injection for your XHR requests.  The main reason behind is to simulate requests.  The model can also be tested by altering the DOM directly.  in short, individual sort function can be tested in isolation.
ad angular js
What is Karma?
Karma is a JS runner created by the angular JS team themselves. and is one of the best when it comes to AngularJS Testing.
Jasmine is the framework for testing angular JS code while karma provides us with various methods which makes it easier to call Jasmine tests.
For installing karma, you need to install node JS in your machine. After installing node JS, install Karna using npm installer.
How to test AngularJS apps using Karma?
First of all,
One can install karma using below command
npm install karma –save-dev
After running this command, karma dependencies will be installed. It will be present in package.Json after you run the above command. For making karma available globally use -g option so that you can invoke it from anywhere.
Now, the next step is to install karma plugin which would help us in using the jasmine framework and google chrome browser. Run the below command:
npm install karma-jasmine karma-chrome-launcher –save-dev
After running this command, start making tests in command prompt. For creating tests, run the following command.
mkdir tests        // for making tests directory
touch tests/test1.controller.test.JS     //For creating a test called test1
After creating a test, now it is time to put code in test1.
describe(test1,function(){
beforeEach(module(test1));
var$controller;
beforeEach(inject(function(_$controller_){
$controller=_$controller_;
}));
describe(‘sub’,function(){
it(‘1 – 1 should equal 0’,function(){
var$scope={};
varcontroller=$controller(test1Controller,{$scope:$scope});
$scope.x=1;
$scope.y= 1;
$scope.sub();
expect($scope.z).toBe(0);
});
});
});
Now, after creating the test you should know how to create a test runner, and before creating that we should know the configuration required for the test runner. For configuring the test runner perform the following steps.
karma init karma.conf.JS
Now, for running the tests using the test runner run the following command.
karma start karma.conf.JS
The test output should look like the underlying code.
> @ test /Users/devuser/repos/test1
> ./node_modules/karma/bin/karma start karma.conf.JS
INFO [karma]: Karma server started at http://localhost:8080/
INFO [launcher]: Starting browser Chrome
INFO [Chrome 80]: Connected on socket 2absOkNfa1asasaX0fCJ with id 66276373
Chrome 80 test1 encountered a declaration exception FAILED
ReferenceError: module is not defined
at Suite.<anonymous>(/Users/devuser/repos/repo1/tests/test1.controller.test.JS:3:13)
at /Users/devuser/repos/repo1/tests/test1.controller.test.JS:1:1
Chrome 80): Executed 1 of 1 (1 FAILED) ERROR (0.01 secs / 0.005 secs)
Now, add the following lines to your package.JSon.
{
“scripts”:{
“test”:”karma start karma.conf.JS”
},
Now with the help of this script, we will be able to run any test using npm command. Using the below command, run the jasmine tests.
npmtest
Now, it is time to add the controller logic and for adding it run the following commands.
mkdir app
touch app/test1.controller.JS
Add the following code in test1.controller.JS
angular.module(test1,[]).controller(‘testController’,functiontestController($scope){
$scope.sub=function(){
$scope.z=$scope.x-$scope.y;
};
});f
For adding the angular dependencies, run the following commands. Make a directory called lib in your project and then add all libraries in that folder.
mkdir lib
curl -o lib/angular.min.JShttps://code.angularJS.org/1.4.0-rc.2/angular.min.JS
curl -o lib/angular-mocks.JShttps://code.angularJS.org/1.4.0-rc.2/angular-mocks.JS
Now, it is time to edit the karma config file so that it comes to know about the test folder and the library folder so that jasmine tests can run successfully.
files:[
‘lib/angular.min.JS’,
‘lib/angular-mocks.JS’,
‘app/*.JS’,
‘tests/*.JS’
],
Now, run the tests using the npm test. Your test will run now successfully.
How to test AngularJS applications using Protractor?
Protractor work flow
Protractor is impeccable when it comes to AngularJS Testing. In Angular JS applications are hard to test since the application web elements cannot be captured very easily.
Angular JS applications have some extra attributes like ng-repeater, ng-controller, and ng-model which can be identified using Selenium locators. Protractor is a NodeJS program which is written in JavaScript. The pre-requisite of using Protractor is Selenium and NPM.
Let us see how you can proceed with the installation of Protractor. Run the following command to start with the installation of the protractor.
npm install –g protractor
It will install protractor in your system. Using  -g will make it available globally in your system. Now, after installation of protractor If you want to check the version of the protractor. You can find the following by running the following command.

Protractor –version
For running the protractor tests against the application under test, you would need webDriver manager. Now, you must update the webDriver manager to the latest version. For updating it, run the following command.
webdriver-manager update
Now you must be imagining how would you start the webdriver-manager. You can start it by running in the background by running the following command. It will then listen to all your protractor tests which have to be run against the angular JS application.
webdriver-manager start
Now to see if the webdriver manager plugin if it is properly running or not. Go to the URL: http://localhost:4444/wd/hub/static/resource/hub.htmland you will see the webdriver manager plugin running on it.
Now, we will see how to design the test cases in protractor. To start with designing o the test cases you need 2 files. One is the spec file and the other is the config file. The configuration file has the location for the protractor tests. Also remember, chrome is the default browser for a protractor. While the second file, the spec file has the logics and locators which would be used to interact with the application.
Now, let’s take a test case in which we have to go to URL: https://angularJS.org, and then you have to type your name in the textbox. After entering you will see your name as Hello Name!
Now, let us start with the steps which are required for making this test case and to execute it. In your folder, you will have 2 files. One is spec.JS and the other is conf.JS. The logic for spec.JS which will be there in it.
describe(‘Enter yourname, function() {it(‘should add a Name as your name, function() {browser.get(‘https://angularJS.org’); element(by.model(‘yourName’)).sendKeys(‘Name’);  var name= element(by.xpath(‘html/body/div[2]/div[1]/div[2]/div[2]/div/h1’));expect(name.getText()).toEqual(‘Hello Name!’);  });});
Now, if you see that describe comes from the Jasmine framework. It is basically a module and it can be a class or a function. We are giving this module name as “Enter Your Name”. So, for starting the function we start it with describe keyword. Just like a class can have many methods or a TestNG class can have so many test cases. Similarly, in the Jasmine framework, it starts a new test case.
browser.get(‘https://angularJS.org’);
This command is used for opening the browser with URL mentioned as https://angularJS.org. Now, you must identify the elements. So, you have to inspect the element just like you do in Selenium. You can use By.model for the elements who have ng-model as an attribute.
You can store Web elements in a variable. You can declare a variable using var keyword. Now, it is time to have some assertions. You get the text out of this web element and then compare it to the expected text.
Now, you are done with spec.JS and let us start with the conf.JS. You have to define the path of spec here so that tests can be identified easily.
Paste the following code in conf.JS
exports.config = {seleniumAddress: ‘http://localhost:4444/wd/hub’,  specs: [‘spec.JS’]};
Selenium address is the location where it can communicate with the selenium webdriver. Spcs tell the location of spec.JS
Now, for running the test, first navigate to the directory in which spec.JS and conf.JS are located. First thing to keep in mind that webdriver-manager should be started. If not started, you have to first start it with following command.
webdriver-manager start
Now, it’s time to run the configuration file. After starting the webdriver-manager plugin, run the config.JS file using protractor. Fire the following command.
protractor conf.JS
You have seen how many specs got passed and how many got failed.
Now let’s see how the failure is going to be reflected in the console. We make the assertion false.
Modify the code in spec.JS
describe(‘Enter your name, function() {it(‘should add a Name as your name, function() {browser.get(‘https://angularJS.org’); element(by.model(‘yourName’)).sendKeys(‘Name’);  var name= element(by.xpath(‘html/body/div[2]/div[1]/div[2]/div[2]/div/h1’));expect(name.getText()).toEqual(‘Hello!’);  });});
You will see F which means failed test case. You will get to know the complete description where the test case got failed.
Now, you must be imagining how would the reports be integrated with Jasmine. Let’s install the Jasmine reporter. Run the following command:
npm install –save-dev jasmine-reporters@^2.0.0      
If you want jasmine reporter to installed globally. For installing globally, run the following command.
npm install –g jasmine-reporters@^2.0.0
You have to now modify the conf.JS. You have to add Jasmine reporter in it. Add the following code in it.
exports.config = {seleniumAddress: ‘http://localhost:4444/wd/hub’,      capabilities: {          ‘browserName’: ‘Chrome’      },      specs: [‘spec.JS’],     framework: ‘jasmine2’ ,onPrepare: function() {          var jasmineReporters = require(‘C:/Users/User1/node_modules/jasmine-reporters’);jasmine.getEnv().addReporter(new jasmineReporters.JUnitXmlReporter(null, true, true)          );     }   };
Now, run the tests using protractor conf.JS. You will see the junitresult.xml in the folder path given in conf.JS.
Open the XML file and see the result of the test case. In this way, you can take the help of protractor to test angular JS websites.
How to test the AngularJS app using Cypress?
Cypress is very close to the application. It just has a very thin layer between production code and testing code. It is Javascript E2E testing framework.
It is an open-source AngularJS Testing framework Cypress has bundled various packages such as Mocha, Chai, and Sinon. The only supportive language with Cypress is Javascript. When you open the cypress application using command cypress open, the following application will open.
This application is divided into two parts. On the left side, you write commands. There are different keywords to it. VISIT is for opening the URL and GET is for getting a webelement. CLICK is for clicking on the webelement. Using ASSERT, we can add assertions to our test cases.
For installing Cypress, you should have node.JS installed in your machine. You can then use the npm installer to add dependencies of Cypress.
npmicypress -D
Now for opening the cypress test runner, run the following command.
npx cypress open
If you want your application and Cypress to run at the same time then you have to make some changes in your package.JSon.
“cypress”: “concurrently \”ng serve\” \”cypress open\””
Add these lines in package.JSon.
Now, run the following command
npm run cypress
When you add a new project in cypress then you will have below folder structure.
Fixtures have static data that has to be used by your tests. You can use them by cy.fixture() command.  In the integration folder, you will have your integration tests. The plugin helps you to tweak to your test cases. Just like plugins have a file named index.JS which have a method which will run before every spec file. In Support files, you can have your reusable code.
Now, it is time to create your first test in the integration folder. You name it as test1.spec.JS. You will see it in the Cypress test runner also. Cypress API is present under the global cy project. Now let us put some code in it.
describe(“Test1”, () => {
it(“should visit home page”, () => {
cy.visit(“http://localhost:4200/login”);
});
});
It makes use of description and it blocks from the mocha syntax. It makes the beginning of the test cases. Once you will run this test In the test explorer, on the right side, the execution starts.
When you will run Cypress for the first time, you will see that the cypress.JSon file will get generated. In this, you can store your configuration values. Now let’s store our base URL in cypress. JSON so that we don’t have to change the URL in every test case.
{
“baseUrl”:”http://localhost:4200″
}
It’s time to change the code in spec.JS also.
describe(“Test1”,()=>{
it(“shouldvisit home page”,()=>{
cy.visit(“/login”);
});
});
Now for getting webelement, you can make use of a cypress selector background in the test runner. It is present on the left side of the test runner. You can get the XPath from there.
Use this way to get the webelements.
cy.get(‘.btn-link’).click();
cy.url().should(‘include’, ‘/register’)
This assertion will check the check has registered keywords in it. Hence, we are done with the first test case in cypress.

Conclusion
Now, we have seen different ways of AngularJS Testing. Make use o
f these and test the application in the best possible ways. Optimize your code and have the best test integration practices so that the client can be satisfied with your test metrics. All the best.