Skip to content
This repository was archived by the owner on Jul 4, 2022. It is now read-only.

Commit adcef70

Browse files
authored
Merge pull request #42 from 3n3a-school/add-edit-test
add edit loan cypress test
2 parents 9138a44 + 66c6ddd commit adcef70

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

test/cypress/integration/index.spec.js

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,19 @@ describe('Integration Test', () => {
1414
cy.get("#loan_phone").type("+411234202030")
1515
cy.get("#loan_rate_count").type("7")
1616
cy.get("#loan_credit_package").select("8")
17-
// const today = new Date();
18-
// const paybackDate = new Date(
19-
// today.getFullYear(), today.getMonth(),
20-
// today.getDay() + (cy.get("#loan_rate_count").value * 15))
21-
22-
// cy.get("#loan_rate_payback_date").should("have.value", paybackDate)
17+
cy.get("body > div > main > form > div").should('be.visible')
2318
cy.get("button[type=submit]").click()
2419
cy.visit(URL)
2520
cy.get("body > div > main > table > tbody").children().should("have.length", 1)
2621
})
22+
23+
it('should edit a loan', () => {
24+
cy.visit(URL)
25+
26+
cy.get("body > div > main > table > tbody > tr > td:nth-child(8) > span:nth-child(2) > a").click()
27+
cy.get("#loan_email").clear().type("max.muster@suva.ch")
28+
cy.get("button[type=submit]").click()
29+
cy.visit(URL)
30+
cy.get("body > div > main > table > tbody > tr > td:nth-child(2)").should("have.text", "max.muster@suva.ch")
31+
})
2732
})

0 commit comments

Comments
 (0)