This article is to illustrate the main two points, one is to introduce the automated test framework JBehave, the second is to introduce how to pull the project on GitHub, compiled into the myeclipse environment of the project, and eventually import MyEclipse run.
What is JBehave?
JBehave is an open source automated testing framework based on the BDD framework . Provides a BDD layer extension for Web integration.
JBehave features :
- JBehave is a pure Java implementation , you can use the Java Rich API for their own use;
- With text-basedstory, it can be defined and executed, more flexible and easy to expand;
- Based on the annotation (Annotation) Run configuration information, specify the story to a steps class file;
- Support for dependency injection ;
- There are many different ways to render HTML, XML, txt , etc.
- Support a variety of IDE editing environment;
- Support Ant, Maven integration;
- You can run the story test using junit or any annotation-based test framework .
JBehave Web Features:
- JBehave Queue: Allow stories to run asynchronously
- Web Runner: Allow stories to run synchronously
- Selenium Integration: Support for Web page Automation testing with Selenium
5 great steps to build a JBehave application:
- Write Story
- Map Steps to Java
- Configure Stories
- Run Stories
- View Reports
From the understanding of BDD to JBehave, always thinking is like learning Prefuse, you can first set up the environment, and then run some demo, so more intuitive, but also more convenient to debug learning. But it didn't go well (objectively, fortunately, it took two or three nights), and while GitHub was on its way, it didn't pull projects from GitHub, especially MAVEN projects, and run. So the first thing to think about is to try to pull some of the available project on GitHub, and to write these steps out, mainly because I was searching the internet for a round, or a few words, or about him, and didn't write detailed steps specifically for the problem, so I'm going to take a note here. Leave the footprints of your own past. The following is a brief summary of the process.
1. Known
Installation: Myeclipse8.6
JDK1.6
2.Git Plugins and Maven:
2.1 Download Good git plugin
Import git project plug-in into MyEclipse (unzip after download, will features, plugins folder and Artifacts.jar, Content.jar as for myeclipse\dropins\egit\ directory, restart can)
After the installation is successful, the option is made.
2.2 Installing the configuration Maven
Download maven and configure the environment variables, and copy the settings.xml files to user/administrator/.m2. Verify that the installation is successful by maven-version:
3. Select the appropriate GitHub project pull down
3.1 Opening MyEclipse
File->import->projects from Git, click Next, and then click Clone to enter a link to the GIT project in the popup dialog box
3.2 How do I get a link to a git project?
Check the git you need Item, go to the Details page, click on the button on the right, the item corresponding link will be copied.
Paste this link into the URI of the 3.1 Open dialog box, as shown in:
Then go all the way next, until finish, and finally you'll find that the project was pull into the git installation directory.
4. Generating MyEclipse project files by executing commands
Through the DOS command window, go to the project directory, execute MVN eclipse:eclipse, wait for the command to complete, you can import the project into MyEclipse.
At this point, the successful implementation of the GitHub code pull down, and the perfect import myeclipse in case of running.
Developers see Test run JBehave project in GitHub