Well this time another pipelines from Atlassian so-called Bitbucket. Mostly like the other pipelines integration, the steps are such easy. I made 2 demo projects to run with Bitbucket pipelines, one is using REST helper, the other is using WDIO helper.
Most interesting thing is the pipeline file. The bitbucket uses yml file called bitbucket-pipelines.yml
- CodeceptJS with REST helper is much more easier, you don’t need to install selenium thingy, basically, you just need a node image and you can start the tests -> https://bitbucket.org/peterNgTr/codeceptjs-rest-demo/src/master/bitbucket-pipelines.yml
# This is a sample build configuration for JavaScript.
# Check our guides at https://confluence.atlassian.com/x/14UWN for more examples.
# Only use spaces to indent your .yml configuration.
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
image: node:12.0.0
pipelines:
default:
- step:
caches:
- node
script: # Modify the commands below to build your repository.
- npm install
- npm test
- CodeceptJS with WDIO helper, not super hard, but this one you need an image with has preinstalled Java and Node, you can build your own image, in this demo, I use this image (https://hub.docker.com/r/timbru31/java-node/). In additional, you may need to install Chrome or FF, and selenium, yeah, we use wdio plugin (https://codecept.io/plugins/#wdio) to start or close it, then it somehow eases your pain. Okay, here is the config -> https://bitbucket.org/peterNgTr/codeceptjs-wdio-services/src/master/bitbucket-pipelines.yml
# This is a sample build configuration for JavaScript.
# Check our guides at https://confluence.atlassian.com/x/14UWN for more examples.
# Only use spaces to indent your .yml configuration.
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
image: timbru31/java-node
pipelines:
default:
- step:
caches:
- node
script: # Modify the commands below to build your repository.
- apt-get update
# Install latest chrome dev package, which installs the necessary libs to
# make the bundled version of Chromium that Puppeteer installs work.
- apt-get install -y wget --no-install-recommends
- wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
- sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
- apt-get update
- apt-get install -y google-chrome-unstable --no-install-recommends
- rm -rf /var/lib/apt/lists/*
- wget --quiet https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh -O /usr/sbin/wait-for-it.sh
- chmod +x /usr/sbin/wait-for-it.sh
- npm install
- npx codeceptjs run --grep displayed
What’s next? Enjoy your pipelines.