Guest User

Untitled

a guest
Nov 23rd, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. // cypress
  2. cy.get('table tr')
  3. .each(function ($tr , index, $list){
  4. if($tr[0].children[2].innerHTML == criteria)
  5. {
  6. cy.wrap($tr[0].children[0].children[0].children[0].children[0]).click()
  7. }
  8. })
  9.  
  10. //testcafe
  11. const parents = Selector('table tr').child(2).withText(criteria).parent(0);
  12. const parentCount = await parents.count;
  13.  
  14. for(let i = 0; i < parentsCount; i++)
  15. await t.click(parents.nth(i).child(0).child(0).child(0).child(0));
  16.  
  17. // or
  18. const htmlCriteria = 'some html';
  19. const parents = Selector('table tr').filter((tr, idx) => {
  20. // add here any client-side logic that will be executed in the browser
  21. debugger; // if necessary
  22. return tr.children[2].innerHTML === htmlCriteria;
  23. }, { htmlCriteria });
Add Comment
Please, Sign In to add comment