alexstulov / yii2-codeception-tests

Configs of unit, functional, api and acceptance test suites.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Yii 2 Codeception Tests

Here placed ready to work configs of unit, functional, api and acceptance test suites.

Prepare application

Init project: `/path/to/php-bin/php /path/to/yii-application/init --env=Development --overwrite=All`

Install dependencies: composer install

Setup nginx:

server {
   	listen 80;
   	listen [::]:80;
   
   	root /var/www/yii-testing/frontend/web;
   
   	index index.php index-test.php;
   
   	server_name yii2testing;
   
   	location / {
   		try_files $uri $uri/ /index.php$is_args$args;
   	}
   
   	location ~ \.php$ {
   		include snippets/fastcgi-php.conf;
   		fastcgi_pass unix:/run/php/php7.0-fpm.sock;
   	}
   
   	location ~ /\.ht {
   		deny all;
   	}
   }

Acceptance tests instructions

Install [jre](https://www.java.com/en/download/linux_manual.jsp).

Download and install Selenium stand-alone sever.

Download and unpack Chrome driver.

Run Selenium: java -jar -Dwebdriver.gecko.driver=./chromedriver ./selenium-server-standalone-x.x.x.jar

Run web server in the app /web folder: php -S 127.0.0.1:8080

About

Configs of unit, functional, api and acceptance test suites.

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:PHP 94.2%Language:CSS 2.7%Language:Shell 2.2%Language:Batchfile 0.7%Language:Dockerfile 0.2%