I have a table with 6 columns and variable rows. Now i want cypress to test the delete button. so i create a testitem in my table in the test before and want my program to delete this testitem.
How can i search in a table in column 2, filter the row and click on the button in column 6 with cypress?
I read the docu and guide on cypress.io but i have not find any solutions.
<div class="row">
<div class="top-buffer"></div>
<div class="panel panel-primary">
<div class="panel-heading panel-head">Article</div>
<div class="panel-body">
<div class="btn-group">
<a asp-action="Edit" asp-route-id="@Guid.Empty" class="btn btn-primary"><i class="" glyphicon glyphicon-plus"></i>NEW</a>
</div>
<div class="top-buffer"></div>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>1</th>
<th>2</th>
<th>3</th>
<th>4</th>
<th>5</th>
</tr>
</thead>
<tbody>
@foreach (var att in Model)
{
<tr>
<td>@Html.DisplayFor(modelItem => att.1)</td>
<td>@Html.DisplayFor(modelItem => att.2)</td>
<td>@Html.DisplayFor(modelItem => att.3)</td>
<td>@Html.DisplayFor(modelItem => att.4)</td>
<td>@Html.DisplayFor(modelItem => att.5)</td>
<td>
<a asp-action="Edit" asp-route-id="@att.Id" class="btn btn-info"><i class="glyphicon glyphicon-pencil"></i>EDIT</a>
<a asp-action="DeleteCategory" asp-route-id="@att.Id" class="btn btn-danger"><i class="glyphicon glyphicon-trash"></i>DELETE</a>
</td>
</tr>
}
</tbody>
</table>
</div>
</div>
</div>