add station logbook create tests

pull/3066/head
Patrick Burns 2024-04-07 20:29:50 -05:00
rodzic ec8f4b4e5d
commit 6c06956e9a
1 zmienionych plików z 44 dodań i 0 usunięć

Wyświetl plik

@ -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");
});
});