You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For Cypress tests create a function that can search in any table given a column name or other parameter, matches the row where that value is passed, and return other parameters in that row.
Example snippet:
// WIP To be improved
// It should return value given a coluname and another row parameter.
// It should be possible find multiple columnames and rowvalues.
// Cypress.Commands.add('searchInTable', (columnName, textToMatch) => {
// cy.get("table > thead > tr > th")
// .each(($e1, index, $) => { //iterating through array of elements
// const StoreText = $e1.text().trim(); //storing iterated element in text
// if (StoreText.includes(columnName)) {
// //If text found, iteration stops and checks textToMatch is present
// cy.get('tbody tr td')
// .eq(index)
// .then(($td) => {
// const Assigneetext = $td.text().trim();
// // cy.wrap(`Column "${columnName}" value is ` + Assigneetext, { timeout: 25000 }).should('contain', textToMatch);
// cy.wrap(`Column "${columnName}" value is ` + Assigneetext, { timeout: 25000 }).should('contain', textToMatch);
// });
// }
// })
// })
The text was updated successfully, but these errors were encountered:
Task
For Cypress tests create a function that can search in any table given a column name or other parameter, matches the row where that value is passed, and return other parameters in that row.
Example snippet:
The text was updated successfully, but these errors were encountered: