-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(EditLocationE2E): add e2e tests for view,edit,delete location us…
…erflows
- Loading branch information
Showing
5 changed files
with
75 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
{ | ||
"baseUrl": "http://localhost:3000" | ||
"baseUrl": "http://localhost:3000", | ||
"projectId": "83ffh1" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,68 @@ | ||
describe("User edit or remove location", () => {}); | ||
describe("User view, edit, remove location", () => { | ||
beforeEach(() => { | ||
cy.visit(""); | ||
}); | ||
|
||
it("views and deletes location", () => { | ||
cy.contains("Load mockData").click(); | ||
cy.get("#0 .ant-card-head-title").should( | ||
"have.text", | ||
"Charite Virchow Klinikum" | ||
); | ||
cy.get("[data-icon=delete]:first").click(); | ||
cy.contains("Charite Virchow Klinikum").should("not.exist"); | ||
}); | ||
|
||
it("deletes all locations", () => { | ||
cy.contains("RemoveAll") | ||
.wait(500) | ||
.click(); | ||
cy.contains("Latitude").should("not.exist"); | ||
}); | ||
|
||
it("displays error for empty fields", () => { | ||
cy.get("[data-icon=edit]") | ||
.eq(1) | ||
.click(); | ||
cy.get("#1 input#name").clear(); | ||
cy.contains("Please enter name").should("exist"); | ||
cy.get("#1 input#lat").clear(); | ||
cy.contains("Please add latitude!").should("exist"); | ||
cy.get("#1 input#lon").clear(); | ||
cy.contains("Please add longitude!").should("exist"); | ||
}); | ||
|
||
it("displays error for invalid input", () => { | ||
cy.get("[data-icon=edit]:first").click(); | ||
cy.get("#0 input#name") | ||
.clear() | ||
.type("!#$%"); | ||
cy.contains("Invalid name").should("exist"); | ||
cy.get("#0 input#lat") | ||
.clear() | ||
.type("49"); | ||
cy.contains("Invalid latitude format").should("exist"); | ||
cy.get("#0 input#lon") | ||
.clear() | ||
.type("243.6"); | ||
cy.contains("Invalid longitude format").should("exist"); | ||
}); | ||
|
||
it("edits a (valid) location", () => { | ||
cy.get("[data-icon=edit]:first").click(); | ||
cy.get("#0 input#name") | ||
.clear() | ||
.type("cypLoc"); | ||
cy.get("#0 input#lat") | ||
.clear() | ||
.type("49.9999"); | ||
cy.get("#0 input#lon") | ||
.clear() | ||
.type("11.9999"); | ||
cy.get("[data-icon=check]:first").click({ force: true }); | ||
cy.get("#0").should( | ||
"have.text", | ||
"cypLocLatitude: 49.9999Longitude: 11.9999" | ||
); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters