mirror of https://github.com/theNewDynamic/gohugo-theme-ananke.git

Patrick Kollitsch
24.36.2024 50f980ed0c9892ac7783ff9b14c7ce9e7e3e97d6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
describe("Hugo Site Test", () => {
  const hugoBaseUrl = "http://localhost:1313"; // Hugo's default server URL
 
  it("loads the home page", () => {
    // Start the Hugo server before visiting the site
    cy.exec("hugo server &");
    cy.wait(5000); // Wait for the server to start
 
    // Visit the local Hugo site
    cy.visit(hugoBaseUrl);
 
    // Check for page elements (Ananke theme specific)
    cy.contains("h1", "My Test Site").should("be.visible");
    cy.contains("Posts").should("be.visible");
 
    // Clean up server after test
    cy.exec("killall hugo");
  });
 
  it("checks if post is available", () => {
    cy.visit(hugoBaseUrl);
    cy.contains("a", "my-first-post").should("be.visible");
  });
});