Skip to content

Commit ef800c4

Browse files
authored
Update screens.js empty table
Modify if conditional when screen search doesn't return values
1 parent d3ef24e commit ef800c4

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

pages/screens.js

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -495,15 +495,17 @@ export class Screens {
495495
cy.wait(3500);
496496
cy.xpath('//div[@id="screenIndex"]//div[@class="data-table"]').then((el) => {
497497
cy.log(el.text());
498-
if (el.text().includes("No Data Available")) {
499-
cy.get(Selectors.searchInputBox).first().clear().type(screenName, { delay: 1}).type(" ",{ delay: 600}).type("{backspace}").type(" ").type("{backspace}").should('have.value', screenName);
500-
}else{
501-
cy.get('[data-cy="screens-table-td-0-0"] span').then((row)=>{
502-
if(!(row.text()===screenName)){
503-
cy.get(Selectors.searchInputBox).first().clear().type(screenName, { delay: 1}).type(" ",{ delay: 600}).type("{backspace}").type(" ").type("{backspace}").should('have.value', screenName);
504-
}
505-
})
506-
}
498+
//if (el.text().includes("No Data Available")) { //This message doesn't display anymore
499+
cy.get('table tbody').then($tbody => {
500+
if ($tbody.is(':empty')) {
501+
cy.get(Selectors.searchInputBox).first().clear().type(screenName, { delay: 1}).type(" ",{ delay: 600}).type("{backspace}").type(" ").type("{backspace}").should('have.value', screenName);
502+
}else{
503+
cy.get('[data-cy="screens-table-td-0-0"] span').then((row)=>{
504+
if(!(row.text()===screenName)){
505+
cy.get(Selectors.searchInputBox).first().clear().type(screenName, { delay: 1}).type(" ",{ delay: 600}).type("{backspace}").type(" ").type("{backspace}").should('have.value', screenName);
506+
}
507+
})
508+
}
507509
});
508510
}
509511

0 commit comments

Comments
 (0)