Test dartlang packages on Chrome using Travis

After giving up using content_shell in travis to test my packages, I was using firefox as it was available and good for basic browser testing. However it did hang on some extensive indexeddb testing or missing some feature like WebSql. And testing my components on a browser was needed

Thanks to Alexandre Ardhuin in issue https://github.com/travis-ci/travis-ci/issues/6683, I was able to setup a solution available here:

https://github.com/tekartik/chrome_travis.dart

Assuming you are familiar with Dart and Travis integration

Include chrome_travis.dart as a development dependencies in your pubspec.yaml file

dev_dependencies:
  test: any
  chrome_travis:
    git: git://github.com/tekartik/chrome_travis.dart

Create the following `.travis.yml` file

language: dart
sudo: required
dist: trusty
dart:
  - stable
  - dev
before_script:
  - source $(pub run chrome_travis:env_rc)
script:
  - pub run test -p vm -p chrome

Configure your project to run in https://travis-ci.org

The project uses the solution itself. You can find another example here: https://github.com/alextekartik/travis-test.dart

Popular posts from this blog

Simple Samba setup on Lubuntu

Soving AccessDenied on Google Cloud Storage domain mapping

Deploying a static website efficiently on Google Cloud Storage