-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
API e2e tests using Cypress. Github Action workflow.
- Loading branch information
1 parent
3048184
commit 08519b4
Showing
7 changed files
with
965 additions
and
14 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,17 @@ | ||
name: Cypress Tests | ||
|
||
on: push | ||
|
||
jobs: | ||
cypress-run: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
# Install npm dependencies, cache them correctly | ||
# and run all Cypress tests | ||
- name: Cypress run | ||
uses: cypress-io/github-action@v6 | ||
with: | ||
build: yarn build | ||
start: yarn start |
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
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,10 @@ | ||
import { defineConfig } from "cypress"; | ||
|
||
export default defineConfig({ | ||
e2e: { | ||
supportFile: false, | ||
setupNodeEvents(on, config) { | ||
// implement node event listeners here | ||
}, | ||
}, | ||
}); |
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,10 @@ | ||
describe("Test Entity Info API endpoint", () => { | ||
it("passes", () => { | ||
cy.request("http://localhost:3000/api/entity-info?id=rec2SisdBnuMAZZJb").as( | ||
"entityInfo" | ||
); | ||
cy.get("@entityInfo").should((response) => { | ||
expect(response.body).to.have.property("name"); | ||
}); | ||
}); | ||
}); |
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,8 @@ | ||
describe("Test Power Stations API endpoint", () => { | ||
it("passes", () => { | ||
cy.request("http://localhost:3000/api/power-stations").as("powerStations"); | ||
cy.get("@powerStations").should((response) => { | ||
expect(response.body).to.have.property("powerStations"); | ||
}); | ||
}); | ||
}); |
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
Oops, something went wrong.