2

I am not fully sure how to fully build Continuous Integration for Selenium project, so I would like to ask the following:

  1. Is it true that the only difference between a Maven project and a Java project is that in the former all the dependencies reside in POM file, whereas in later all the dependencies are located within a separate LIB folder?
  2. How POM is important for Maven project other than it stores dependencies? At first I thought that Maven and POM are only important for Selenium project to store dependencies, but I was asked that on an interview. Is there more to it than just storing dependencies?
  3. Why when you push your changes from the local GIT repository to main repository, it is not Continuous integration yet and you also need to do a job in Jenkins for that?

2 Answers 2

1

Maven is most used as build and dependency management tool. The pom.xml is its configuration file, which also contains the dependencies.

Apache Maven is a software project management and comprehension tool. Based on the concept of a project object model (POM), Maven can manage a project's build, reporting and documentation from a central piece of information.

https://maven.apache.org/

You do not need Maven, but it just makes building the application and (test-)reporting easier. You could do everything with plain Java technically.

Git is just a version control system, pushing code to a version control system does not integrate it. It just manages code merges, but not if it works integrated.

Continuous integration jobs monitor a version control system and when a code change occurs it retrieves the changes and builds the system. Afterwards you could run unit-tests or deploy it to a test-environment to run Selenium-tests against it. Its primary goal is to verify the code builds and no developers are blocked when pulling the latest code from version control. The second feature is to run the automated-tests to check the code did not break some functionality.

The total flow looks something like this:

  • Developer pushed code changes to a git-repository
  • Jenkins pulls the code changes
  • Jenkins fires a job that fires a Maven command which:
    • pulls the latest dependencies
    • builds the Java application
    • runs the unit-tests
  • Jenkins deploys to a test-environment (this step might not be optional, depending on how the Selenium-tests start the application)
  • Jenkins runs a (Maven) command to start the Selenium-tests against the test-environment
7
  • @NielsvanRejmersdal In Jenkins what is the difference between a Project and a Build?
    – Richardson
    Mar 16, 2017 at 13:56
  • 1
    A project is the configuration of a build. When you run a project that is called a single build. This is jenkins specific though. Mar 16, 2017 at 14:10
  • @NielsvanRejmersdal I see that a notion of "project" in Jenkins is different from notion of "project" in Java, but is one project in Jenkins is associated with one project in Java?
    – Richardson
    Mar 16, 2017 at 15:04
  • 1
    @Richardson No, they have no direct relation, but often you will have one or more Jenkins projects for you Java application project. So atleast they have will some sort of link, but nothing forced or assumed, the link will be version control. You will need to configure the git-repository in the Jenkins project to tell it where to get the code from. Mar 16, 2017 at 16:03
  • @NielsvanRejmersdal Now I see why I was wrong in asking why pushing changes to GIT is not CI yet. The reason is that for CI to take place the code needs to reach the server and with GIT alone there is no way it can reach the server, you need Jenkins for that Right?
    – Richardson
    Mar 16, 2017 at 16:36
1

Beside Jenkins, there are other CI tools. In this article - Jenkins vs other Open source continuous integration servers - you may find the quick review of the top Open source CI tools. And although the review in this post is made from the performance testing perspective, these tools are used for the integrating Selenium tests into the continuous integration and delivery process too.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.