lundi 5 août 2019

How to test a mamp like setup on circleci

I have a Codeigniter install and developed locally with MAMP Pro. I have included behat tests which have working ok locally. I am trying to get a circleci config that will work like my local setup works.

My behat.yml file is as follows:

default:
    extensions:
        Behat\MinkExtension:
            base_url: "http://www.usetiltdev.com/"
            sessions:
                default:
                    goutte: ~

And my circleci config file:

version: 2

jobs:
  build:
    docker:
      - image: circleci/php:7.2-apache-browsers

    working_directory: ~/app

    steps:
      - checkout

      #install php extensions needed
      - run: sudo apt install -y libpng-dev
      - run: sudo docker-php-ext-install gd

      #config apache
      - run: sudo chmod 777 /etc/apache2/sites-enabled
      - run: ls -la
      - run: ls -la /etc/apache2/sites-enabled
      - run: sudo cp design/environment/circleci/site_test.conf /etc/apache2/sites-available/usetiltdev.conf
      - run: sudo a2ensite usetiltdev
      - run: sudo service apache2 restart
      - run: echo 127.0.0.1 usetiltdev.com | sudo tee -a /etc/hosts
      - run: echo 127.0.0.1 www.usetiltdev.com | sudo tee -a /etc/hosts
      - run: cat /etc/hosts

      #install composer dependecies
      - run: composer install

      # run tests!
      - run: vendor/bin/behat

Lastly here is an example of the test that works locally but not on circleci:

When I am on "/contact/"
And I fill in "name" with "Joe Bloggs"
    // I get the following error
    Form field with id|name|label|value|placeholder "name" not found. (Behat\Mink\Exception\ElementNotFoundException)

Aucun commentaire:

Enregistrer un commentaire