Skip to content

Commit

Permalink
added-more-cypress-refactors-&-fixed-previous-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
FahadDarw committed Jan 10, 2024
1 parent a0a0a0c commit bb76fde
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default class projectList extends BasePage {

static getNthProjectDeliveryOfficer(n = 0) {
this.checkProjectListPage()
return cy.get(`[id="delivery-officer-${n}"]`)
return cy.get(`[id="assigned-to-${n}"]`)
}

static filterProjectList(titleFilter) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,26 +78,15 @@ Cypress.Commands.add('generateProjectTempBtn', () => {
})

Cypress.Commands.add('enterDate', (idSelector, day, month, year) => {
cy.get(`[id*="${idSelector}-day"]`).as('day')
cy.get(`[id*="${idSelector}-month"]`).as('month')
cy.get(`[id*="${idSelector}-year"]`).as('year')

cy.get(`@day`).then((dayLoc) => {
dayLoc.should('be.visible')
dayLoc.clear()
dayLoc.type(day)
})
cy.get(`@month`).then((monthLoc) => {
monthLoc.should('be.visible')
monthLoc.clear()
monthLoc.type(month)
})
cy.get(`@year`).then((yearLoc) => {
yearLoc.should('be.visible')
yearLoc.clear()
yearLoc.type(year)
})
})
cy.get(`[id*="${idSelector}-day"]`).as('day');
cy.get(`[id*="${idSelector}-month"]`).as('month');
cy.get(`[id*="${idSelector}-year"]`).as('year');

cy.get('@day').should('be.visible').invoke('val', '').type(day);
cy.get('@month').should('be.visible').invoke('val', '').type(month);
cy.get('@year').should('be.visible').invoke('val', '').type(year);
});


// No Radio Btn
Cypress.Commands.add('NoRadioBtn', () => {
Expand Down

0 comments on commit bb76fde

Please sign in to comment.