通过箭头操作符调用函数

时间:2017-10-26 04:19:49

标签: php codeception

我有这段代码,我不太清楚$ ext-> click()是如何工作的。如果我使用$ I->点击($ ext)应该是相同的,如果不是,为什么? $ ext存储$ elements数组的0位置。这就是$ ext里面http://take.ms/pmoAj

的内容
$I = new AcceptanceTester($scenario);
$I->wantTo('get the index');
$I->am('Tester');
$I->wantTo('Add a new contact');
$I->lookForwardTo('Create a new contact in Alegra');

 //Tester

 $I->amGoingTo('Login into my account');
 $I->amOnPage('/user/login');
 $I->see('ingresa');
 $I->fillfield('#email','salva@fake.com');
 $I->fillfield('#password','1464564');
 $I->click('#submit');
 $I->see('Inicio');
 $I->amOnPage('/invoice');
 $I->waitForElement('#gridInvoices .action-icons');
  $index = $I->grabMultiple('#gridInvoices .action-icons img:nth-
  child(6)','class');
 $numero = count($index);
 $buscar = array_search('voidInvoice',$index);

if($buscar == false){
   trigger_error('No hay botones del tipo anular facturas');
 }else{
   $elements = $I->getElements('#gridInvoices #gridview-1047-table tbody tr 
  .action-icons img:nth-child(6)');
   $ext = $elements[$buscar];
   $I->click($ext);
    $I->wait(10);
}

0 个答案:

没有答案