Behat is a behavior-driven testing tool for applications developed using PHP. It's a well know tool in the PHP world. There are several benefits of Behat which encourage others to use it and there are some limitations on which Behat team is still working on:
Advantages or Benefits of Behat
- Open Source: Behat is an open source automation tool. So, being an open source tool, Behat is a publicly accessible and is free.
- Support Multiple OS: Behat scripts are not OS dependent. You can create your Behat script on any OS and; same script will execute on all the operating systems.
- Multi Browsers Support: Behat scripts are not dependent on any browsers. It's Mink which take cares of it. Mink simulate the interaction between the browser and the web application in our test.
- Easy to Understand: Behat forces you to use the Behaviour Driven Development (BDD) process for software development. Which makes it easy to understand by all team members. The test case writing is very easy and understandable. It works as a bridge between business and technical language, and this bridge is sustainable because of test cases written in a plain English or your native language.
- Multilingual Support: You are not limited to English, You can write Scenarios and Feature file in language of your choice and language which your client can understand.
- Less Hardware Resources: Behat is not a resource consuming library. It is lightweight and has same resource requirement like you have for PHP.
- Less Programming Knowledge Required: It allows the test script to be written without knowledge of any code, it allows the involvement of non-programmers and manual tester as well. Behat comes with in-build steps definitions which makes script writing more easier. You just need basic PHP knowledge for custom scripts writing.
- Support for Drupal: You can use Behat Drupal Extension, The Drupal Extension is an integration layer between Behat, Mink Extension, and Drupal. It provides step definitions for common testing scenarios specific to Drupal sites.
Disadvantages or Limitations of Behat
- No Direct Support: Behat does not have great community support. You will not find much on StackOverflow, their official website or Google. You need to fight with your problem yourself lots of time.
- Implementation Time: The real disadvantage with Behat is that it takes time to implement in process, and requires you to rethink and possibly restructure your development process. More time will also need to be spent with the developer and client to get the understanding needed to make sure the right problem is solved when features are built.
- Skills Requirement: Due to limited QA resources available in the market, you will find it typical to implement Behat in your process. Developers can not think from QA point of view and you will not find QA available in the market who are familiar with PHP or Behat. You need to provide them with special training or other option is you can let developer do the automation.
- Upgrade Issue: Behat core libraries are dependent on other PHP libraries also. Change in one of them or upgrade in Behat Library will lead to your scripts failure. Be very careful while updating version of libraries.
- Not Easy to Set up Test Environment: Behat users do not find it easy to set up a test environment compared to other tools. QA would requires developers help many times to setup environment or to understand issues during setup.
- PHP Only: Behat works with PHP only, It does not support Java, Python, C# or any other popular programming language.