-
-
Notifications
You must be signed in to change notification settings - Fork 188
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
44 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
describe("Create station logbook", () => { | ||
beforeEach(() => { | ||
cy.login(); | ||
}); | ||
|
||
it("should load an empty list of station locations", () => { | ||
cy.visit("/index.php/logbooks"); | ||
|
||
// Check that the table is not present | ||
cy.get("#station_logbooks_table").should("not.exist"); | ||
}); | ||
|
||
it("should have a button to create a new station location", () => { | ||
cy.visit("/index.php/logbooks"); | ||
|
||
// Check that the button is present | ||
cy.get("a").contains("Create Station Logbook").should("exist").click(); | ||
|
||
cy.url().should("include", "/logbooks/create"); | ||
}); | ||
|
||
it("should create a new station location", () => { | ||
cy.visit("/index.php/logbooks/create"); | ||
|
||
// Define the station location name | ||
const stationLogbookName = "Home QTH"; | ||
|
||
// Type the station location name into the input field | ||
cy.get('input[name="stationLogbook_Name"]').type(stationLogbookName); | ||
|
||
// Click the save button | ||
cy.get('button[type="submit"]') | ||
.contains("Create Station Logbook") | ||
.click(); | ||
|
||
// Check if the station location was created successfully | ||
cy.url().should("include", "/logbooks"); | ||
|
||
// // Check if the station location is present in the table | ||
cy.get("#station_logbooks_table") | ||
.contains(stationLogbookName) | ||
.should("exist"); | ||
}); | ||
}); |