2

I need to run codeception's test from web interface. Have no idea how to do it and cant search it in google. Or it work for console only?

2 Answers 2

2

Codeception is designed to be run from the command line, but if you want to initiate tests from within your web browser instead, you might be interested in Webception which is a web-based front end to Codeception.

See https://github.com/jayhealey/Webception

Webception is a deployable web-application that allows you to run all your Codeception tests in the browser.

You can access multiple test suites and decide which tests to include in a run. It allows you start, stop and restart the process whilst watching the test results in the Console.

Webception demo

Sign up to request clarification or add additional context in comments.

Comments

1

I need to run codeception's test from web interface.

I am assuming by web interface you mean, running acceptance tests on web browser like firefox, chrome etc.

If thats the case, then follow the steps from this page http://codeception.com/docs/03-AcceptanceTests

Scroll down to the section: Selenium-WebDriver

  1. First create/generate a basic cept or cest test inside your acceptance directory

    ./vendor/bin/codecept generate:cept acceptance your-test-name
    
  2. Edit the acceptance.suite.yml:

    modules:
        enabled:
            - WebDriver
        config:
            WebDriver:
                url: 'http://www.yoursite.com'
                browser: 'firefox'
    
  3. If you don't have the selenium server yet, get it from http://www.seleniumhq.org/download/. (Grab the Selenium Standalone Server - current version is 2.47.0). We need the selenium server running to communicate with the browser (web interface) using the webdriver. To start the server, run the following command in a terminal window ( * replace it with the version you downloaded )

     java -jar /path/to/selenium-server-standalone-*.jar 
    
  4. Run the test on a separate terminal

    ./vendor/bin/codecept run acceptance --steps
    

This should start the test in firefox browser. If you don't have firefox browser, please download it. If you like to use chrome instead, make sure to first get the correct chromedriver for your os, and then pass the path to chromedriver when you start the selenium server

java -jar /path/to/selenium-server-standalone-*.jar -Dwebdriver.chrome.driver=/path/to/chromedriver

3 Comments

Thank for answer. But I told about something like control panel for tests. I need to create some html form where i can set options for test case and button "start" for running tests.
Yea, it's closer but i need to web form. i.imgur.com/Ry4Qwcp.png I know how to make log's output, but i dont know how to hide "php codecept.phar run acceptance --steps" under button "run"?
Connect the 'run' button to <? exec('php codecept.phar run acceptance --steps') ?>. php.net/manual/en/function.exec.php

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.