Skip to content

Commit

Permalink
add station logbook create tests
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickrb committed Apr 8, 2024
1 parent ec8f4b4 commit 6c06956
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions cypress/e2e/5-station-logbook.cy.js
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");
});
});

0 comments on commit 6c06956

Please sign in to comment.