如何在CircleCI上测试类似设置的Mamp

时间:2019-08-05 10:53:45

标签: testing behat circleci

我安装了Codeigniter,并使用MAMP Pro在本地开发。我包括了可以在本地正常运行的behat测试。我正在尝试获得一个CircleCI配置,该配置将像本地设置一样工作。

我的behat.yml文件如下:

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

还有我的circleci配置文件:

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

最后,这是一个在本地运行但不在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)

我已经交叉发布了此to the CircleCI forum

0 个答案:

没有答案
相关问题