Kavya nagendra
Kavya nagendra

Reputation: 93

Test NG and Circle CI configuration

I have recently built a selenium test project. Now i want to host it on circle CI. Can someone please provide me the step by step details with the configuration file. I already have a Github and circle CI account. Im new to this integration aspect.

Upvotes: 1

Views: 487

Answers (1)

Kavya nagendra
Kavya nagendra

Reputation: 93

#
# Check https://circleci.com/docs/2.0/language-java/ for more details
#
version: 2
jobs:
  build:
    docker:
      - image: circleci/openjdk:8-jdk-stretch-browsers

    environment:
      # Customize the JVM maximum heap limit
      MAVEN_OPTS: -Xmx3200m

    steps:
      - checkout
      - run: mkdir test-reports
      - run:
          name: Download Selenium
          command: |
            curl -O http://selenium-release.storage.googleapis.com/3.5/selenium-server-standalone-3.5.3.jar
      - run:
          name: Start Selenium
          command: |
            java -jar selenium-server-standalone-3.5.3.jar -log test-reports/selenium.log
          background: true

      - run: mvn dependency:go-offline

      - save_cache:
          paths:
            - ~/.m2
          key: v1-dependencies-{{ checksum "pom.xml" }}

      # run tests!
      - run: mvn clean integration-test

      - run:
          name: Save test results
          command: |
            mkdir -p ~/testng/results/
            find . -type f -regex "./test-output/testng-results.xml" -exec cp {} ~/testng/results/ \;
          when: always
      - store_test_results:
          path: ~/testng/results/
      - store_artifacts:
          path: ~/testng/results/
      - store_artifacts:
          path:  testng/results/

After a lot of digging the internet I was finally able to create my own config file. I searched crazily but I could'nt anthying for testng. I started building from scratch. Hopefully this helps someone in the future.

Upvotes: 1

Related Questions