Skip to content

Commit

Permalink
Merge branch 'dev' into feature/#196-signal-head-webgl
Browse files Browse the repository at this point in the history
  • Loading branch information
motschel123 authored Feb 2, 2023
2 parents 2164b86 + ea1cb4d commit 0691509
Show file tree
Hide file tree
Showing 28 changed files with 10,465 additions and 3,136 deletions.
4 changes: 4 additions & 0 deletions Apps/frontend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,7 @@ dist-ssr
/cypress/fixtures/
/cypress/screenshots/
/cypress/videos/

# Code coverage report
coverage
.nyc_output
8 changes: 5 additions & 3 deletions Apps/frontend/cypress.config.js
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;
},
},
});
11 changes: 11 additions & 0 deletions Apps/frontend/cypress/e2e/2-control-panel/preset-config.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ describe("everything visible on front page", () => {
cy.get('[data-cy="settings-button"]').should("be.visible");
});

it("shows tooltip on hover", () => {
cy.get('[data-cy="settings-button"]').trigger("mouseover");
cy.get('[data-cy="settings-button-tooltip"]').should("be.visible");
});

it("is clickable", () => {
cy.get('[data-cy="settings-button"]').click();
cy.get('[data-cy="preset-config-open-popup"]').should("be.visible");
Expand All @@ -17,4 +22,10 @@ describe("everything visible on front page", () => {
cy.get('[data-cy="selected-preset"]').should("be.visible");
cy.get('[data-cy="store-channel-config"]').should("be.visible");
});

it("closes popup on click outside", () => {
cy.get('[data-cy="settings-button"]').click();
cy.get('[data-cy="oscilloscope"]').click();
cy.get('[data-cy="preset-config-open-popup"]').should("not.be.visible");
});
});
34 changes: 32 additions & 2 deletions Apps/frontend/cypress/e2e/2-indicators/indicators.cy.js
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]);
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,9 @@ describe("distributeButton", () => {
it("is clickable", () => {
cy.get('[data-cy="distribute-button"]').click();
});

it("shows tooltip on hover", () => {
cy.get('[data-cy="distribute-button"]').trigger("mouseover");
cy.get('[data-cy="distribute-button-tooltip"]').should("be.visible");
});
});
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");
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,9 @@ describe("gndButton", () => {
it("is clickable", () => {
cy.get('[data-cy="gnd-button"]').click();
});

it("shows tooltip on hover", () => {
cy.get('[data-cy="gnd-button"]').trigger("mouseover");
cy.get('[data-cy="gnd-button-tooltip"]').should("be.visible");
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,9 @@ describe("onOffButton", () => {
cy.get('[data-cy="on-off-button"]').click();
cy.get('[data-cy="on-off-button"]').should("have.class", "icon--off");
});

it("shows tooltip on hover", () => {
cy.get('[data-cy="on-off-button"]').trigger("mouseover");
cy.get('[data-cy="on-off-button-tooltip"]').should("be.visible");
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,9 @@ describe("resetButton", () => {
it("is clickable", () => {
cy.get('[data-cy="reset-button"]').click();
});

it("shows tooltip on hover", () => {
cy.get('[data-cy="reset-button"]').trigger("mouseover");
cy.get('[data-cy="reset-button-tooltip"]').should("be.visible");
});
});
1 change: 1 addition & 0 deletions Apps/frontend/cypress/support/e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

// Import commands.js using ES2015 syntax:
import "./commands";
import "@cypress/code-coverage/support";

// Alternatively you can use CommonJS syntax:
// require('./commands')
Loading

0 comments on commit 0691509

Please sign in to comment.