Answer the question
In order to leave comments, you need to log in
How to click on td content in codeception?
How to click on the contents of a cell inside a table using codeception.
The content of the table is as follows.
<table class="table table-striped table-hover table-bordered table-with-last-trtd" id="models_table">
<thead>
...
</thead>
<tbody>
<tr data-key="2" rel="tr_test_rel">
<td class="td-name">Test Name</td>
<td class="td-id_category_place">1</td>
<td style="" class="td-actions">
<a title="Обновитьid_1" href="?r=base/update&modul=places&id=2" class="edit">
<i class="fa fa-pencil fa-2x"></i></a>
<a data-pjax="0" data-confirm="Уверены в удалении?" data-path="?gggg=121" data-method="post" title="Удалить" href="/!admin/index.php?r=base%2Fdelete&id=2&modul=places" class="delete">
<i class="fa fa-times-circle-o fa-2x"></i></a>
<a data-add="fa-eye-slash" data-remove="fa-eye" title="Видимость раздела" href="?r=base/visible&id=2&modul=places" class="action has2status">
<span class="fa fa-eye fa-2x"></span></a></td></tr>
...
</tbody>
</table>
Answer the question
In order to leave comments, you need to log in
Is the corresponding method click?
I know it exists and all previous tests have been written using this method.
I'll bring some clarity
<?php
$I = new AcceptanceTester($scenario);
$I->wantTo('Click on td');
$I->amOnPage('/?r=base/index&modul=devices');
$I->seeResponseCodeIs(200);
$I->click('...');
$I->seeElement('.fa-eye-slash')
?>
$('body').on('click', '.has2status', function(){
...
});
$I->click('.has2status');
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question