dtgvl48608 2015-08-04 20:48
浏览 27
已采纳

来自Web界面的Codeception运行测试

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条回答 默认 最新

  • dongzun9958 2015-08-05 16:26
    关注

    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
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog