【问题标题】:how to do the test on forms PHUNIT + Selenium + code igniter如何对表单 PHPUNIT + Selenium + codeigniter 进行测试
【发布时间】:2014-12-28 09:35:26
【问题描述】:

我开始设计软件测试并使用seleniumphpunit,然后我有以下情况

  1. 我需要为code igniter 开发测试
  2. 我们需要使用代码点火器上的数据设置会话
  3. 我有 2 个表格,第一个捕获数据字段,然后我用它生成第二个
  4. 我使用以下函数来捕获第一种形式的输入,然后生成第二种形式
class HistorialPeajesFecha  extends  ConsultasWebController
{
   ...
   public function seleccioneFecha()
   {
      $this->idVehiculo =  $this->input->post('placa');
      // I need to generate info with the system session with codeigniter 
      //how I do the setup the session to do the test
      $this->session = $this->session->userdata('myproject');
      $idUsuario = $this->session['id_usuario'];
      $results = $this->factura->listarHistorialPagos( $idVehiculo, $idUsuario  );
      $data = array(
        'idVehiculo' => $this->idVehiculo,
        'attributesForm' => array('id' => 'form_seleccion_fecha'),
        'other' => $results
      );
      $this->load->view( 'consultasWeb/templateHeaderView');
      $this->load->view( 'consultasWeb/templateMenuView', $data );
      $this->load->view( 'consultasWeb/historialFecha/seleccioneFechaView', $data );
   }
   ...
}

我的问题是,我如何设计测试来检查输出视图('consultasWeb/historialFecha/seleccioneFechaView')与第一种形式的输入?

URL 1 FORM : localhost/myproject/index.php/consultasWeb/historialFecha/

URL 2 FROM : localhost/myproject/index.php/consultasWeb/historialFecha/seleccioneFechaView

【问题讨论】:

    标签: php selenium phpunit integration-testing


    【解决方案1】:

    对于代码中的phpunit,您可以下载composer并安装 http://kenjis.github.io/ci-phpunit-test/

    【讨论】:

      猜你喜欢
      • 2011-06-06
      • 1970-01-01
      • 2011-09-21
      • 2011-01-07
      • 2019-05-05
      • 1970-01-01
      • 2023-03-06
      • 2013-09-13
      • 2021-06-03
      相关资源
      最近更新 更多