generated from amosproj/amos202Xss0Y-projname
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add cypress code coverage plugin Signed-off-by: Leander Tolksdorf <[email protected]> * git ignore code coverage report Signed-off-by: Leander Tolksdorf <[email protected]> * add general buttons test Signed-off-by: Leander Tolksdorf <[email protected]> * add tests Signed-off-by: Leander Tolksdorf <[email protected]> * merge indicator tests into one file, remove mock socket test Signed-off-by: Leander Tolksdorf <[email protected]> * make line breaks after tests consistent Signed-off-by: Leander Tolksdorf <[email protected]> * remove broken test for gnd-button Signed-off-by: Leander Tolksdorf <[email protected]> * remove empty config from cy.visit Signed-off-by: Leander Tolksdorf <[email protected]> --------- Signed-off-by: Leander Tolksdorf <[email protected]> Co-authored-by: Leander Tolksdorf <[email protected]>
- Loading branch information
1 parent
fa566a8
commit f2bc6dd
Showing
20 changed files
with
10,463 additions
and
3,136 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 |
---|---|---|
|
@@ -25,3 +25,7 @@ dist-ssr | |
/cypress/fixtures/ | ||
/cypress/screenshots/ | ||
/cypress/videos/ | ||
|
||
# Code coverage report | ||
coverage | ||
.nyc_output |
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 |
---|---|---|
@@ -1,9 +1,11 @@ | ||
import { defineConfig } from "cypress"; | ||
import codeCoverage from "@cypress/code-coverage/task.js"; | ||
|
||
export default defineConfig({ | ||
e2e: { | ||
// setupNodeEvents(on, config) { | ||
// // implement node event listeners here | ||
// }, | ||
setupNodeEvents(on, config) { | ||
codeCoverage(on, config); | ||
return config; | ||
}, | ||
}, | ||
}); |
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 |
---|---|---|
@@ -1,9 +1,39 @@ | ||
describe("indicators", () => { | ||
describe("LineIndicators", () => { | ||
beforeEach(() => { | ||
cy.visit("http://localhost:5173/"); | ||
}); | ||
|
||
it("is visible", () => { | ||
cy.get('[data-cy="indicators"]').should("be.visible"); | ||
cy.get('[data-cy="line-indicators"]').should("be.visible"); | ||
}); | ||
}); | ||
|
||
describe("TextIndicators", () => { | ||
beforeEach(() => { | ||
cy.visit("http://localhost:5173/"); | ||
}); | ||
|
||
it("are visible", () => { | ||
cy.get('[data-cy="text-indicators"]').should("be.visible"); | ||
}); | ||
|
||
it("have correct colors", () => { | ||
let expectedColors = [ | ||
"rgb(230, 0, 73)", | ||
"rgb(11, 180, 255)", | ||
"rgb(80, 233, 145)", | ||
"rgb(230, 216, 0)", | ||
"rgb(155, 25, 245)", | ||
"rgb(255, 163, 0)", | ||
"rgb(220, 10, 180)", | ||
"rgb(179, 212, 255)", | ||
"rgb(0, 191, 160)", | ||
"rgb(128, 143, 128)", | ||
]; | ||
cy.get('[data-cy="text-indicators"]') | ||
.find("tr") | ||
.each((tr, i) => { | ||
cy.wrap(tr).should("have.css", "color").and("equal", expectedColors[i]); | ||
}); | ||
}); | ||
}); |
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
13 changes: 13 additions & 0 deletions
13
Apps/frontend/cypress/e2e/3-control-panel-top/general-buttons.cy.js
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,13 @@ | ||
/// <reference types="cypress" /> | ||
|
||
describe("GeneralButtons", () => { | ||
beforeEach(() => { | ||
cy.visit("http://localhost:5173/"); | ||
}); | ||
|
||
it("resets on off button when reset button is clicked", () => { | ||
cy.get('[data-cy="on-off-button"]').click(); | ||
cy.get('[data-cy="reset-button"]').click(); | ||
cy.get('[data-cy="on-off-button"]').should("have.class", "icon--on"); | ||
}); | ||
}); |
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
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
Oops, something went wrong.