Chuan Chuan Law

Software Testing and Automation Blog

Pact – Asserting The Function To Test from App Level

In your consumer test class, instead of calling the “subject.methodToTest()”, For example: describe MethodToTest{ before do         AppleServiceClient.base_uri ‘localhost:1234’     end   subject { }   describe “get_an_apple” do     before do         apple_service.given(“an apple exists”).         upon_receiving(“a request for an apple”).         with(method: […]

How To Setup Pact Broker

Setting up Dockerized Pact Broker The easiest and fastest way to do this is via Dockerized Pact Broker. By following Step 1 to Step 4 in this document, you will be able to have a Dockerized Pact Broker linking to a Dockerized PSQL in your localhost within minutes! All you then need is to publish the JSON […]

Hello from New York!

G’day! I haven’t been blogging for a while. This is because I have been busy settling in the Big Apple! It was a big move and I have been very blessed to have the opportunity to explore the other side of the world. I look forward to continue sharing what I have learned here.  

Solving Peer Not Authenticated Issue for Maven repository on AWS

Below the problem I got while migrating the Jenkins slave jobs over to AWS:     The way I solve it is to get a copy of compiled dependencies on the AWS instance and build a AMI image out of it. So, the AWS instance will already have a copy of all needed dependencies, and […]

Getting Your Tests Into CI – Jenkins

Test automation is not complete without CI –  getting it running automatically on a build box. I will show how to get a Selenium test suite running on Jenkins which I have been using personally. I will assume you have already got Jenkins installed: 1. Click on New Item. Give the item a name and […]

Accessing Oracle Database From Test Suite

Good test suites need to be able to access direct the database. Below is how I do it with my test suite in Groovy in Gradle framework accessing a Oracle database: (1) Connect the database in your code class TestDB { static void main(String[] args) { def sql = Sql.newInstance(‘’, ‘username’, ‘password’, ‘oracle.jdbc.driver.OracleDriver’)   (2) […]

How To Replace Selenium With Integration Test

The trend and best practice in test automation is to move away from writing lots of functional test in Selenium. So, we want to try to replace high level Selenium test with Integration and Unit tests as much as possible. Pros of Integration test: Easier to write in comparison to Unit test (no need mocking) […]

Extending PACT Framework – Global Data Setup & Data Cleanup

In every testing framework we do data setup and clean up. Below is how I do it with Gradle framework: Global Data Setup Pact framework provides very good random test data generation with PactBodyBuilder. However, in some cases where our API involves data creation, we will need to remember the data we created, so we can […]

Getting Selenium Test Running On Gradle Framework

Gradle + Selenium is probably not a popular framework yet when I was developing it as I find it difficult to look for relevant resources online. There were bits and pieces of information here and there which I then glue then up together. My build.gradle contains the following implementations: (1) Add cucumberRuntime under Configurations configurations […]

Some Workarounds In PACT Test

Writing PACT test might be quite a challenge in the beginning, as it is a new tool, and we might not be able to find much information in the web yet. Personally, I find the PACT Google Support Group is very helpful when I encounter issues. Otherwise, sometimes I do some trial and error to […]

« Older posts

© 2016 Chuan Chuan Law

Theme by Anders NorenUp ↑