#Codeception on Docker
##Setup
- Install Docker
- Run Docker (required all time after restart!!!)
$ docker-compose up --build -d
- Install dependencies
docker exec automation-php composer install
- Generated new methods created in Helper folder (for example in file Acceptance.php), run build
$ docker exec automation-php vendor/bin/codecept build
- Install Mobile Emulator (required one time) MobileEmulation
$ docker exec automation-php composer require --dev elstc/codeception-mobileemulation
- Install Email Notifier (required one time) Email Notifier
$ docker exec automation-php composer require codeception/notifier --dev
- Install phpmailer/phpmailer phpmailer/phpmailer
$ docker exec automation-php composer require edneto/notifications
##Run autotests using Codeception
###Create new test (for example test name: A1_nameCest in folder adv1) In order to create a new test (for example test name: A1_nameCest in folder adv1) run the following command:
docker exec automation-php vendor/bin/codecept generate:cest adv1 A1_name
###Create new test (for example test name: A1_nameCest in folder HSS) In order to create a new test (for example test name: A1_nameCest in folder HSS) run the following command:
docker exec automation-php vendor/bin/codecept generate:cest hss A1_name
###Run tests To run all available tests:
docker exec automation-php vendor/bin/codecept run
To run all tests (for example from folder ADV1):
docker exec automation-php vendor/bin/codecept run adv1
To run specific test (for example test name: A1_nameCest) :
docker exec automation-php vendor/bin/codecept run adv1 A1_nameCest
To run specific test with steps (for example test name: A1_nameCest):
docker exec automation-php vendor/bin/codecept run adv1 A1_nameCest --steps
To run specific test with generated report (for example test name: A1_nameCest):
docker exec automation-php vendor/bin/codecept run adv1 A1_nameCest --xml --html
-
For Mac
- Starting
Finder
. - Use
Connect to Server
. - Input
vnc://localhost:5959
toServer Address
. - Input
secret
toPassword
.
- Starting
-
Run adv1 tests
- Execute
docker exec automation-php vendor/bin/codecept run adv1
- Execute
_output
folder - If test fail - generated screenshot and html file in folder tests/-output/
_support
Support Folders:
_generated - To make your IDE see all of the methods, you should run use the codecept build command
Helper - folder contains files with methods, you can add new methods here, after build command you can see methods
Page - folder contains files with const, page properties
TEST FOLDERS:
ADV1 - test folder for 1 advertisement from lineup
ADV2 - test folder for 2 advertisement from lineup
ADV3 - test folder for 3 advertisement from lineup
ADV4 - test folder for 4 advertisement from lineup
ADV5 - test folder for 5 advertisement from lineup
HSS - test folder for main page
MOBILE - test for mobile emulator
adv1.suite.yml - setting for running test from folder AV1
If you created new test folder you should create suite.yml with same name!
vendor
folder with library