-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/#93 front end tests #203
Conversation
Signed-off-by: Leander Tolksdorf <leander.tolksdorf@fu-berlin.de>
Signed-off-by: Leander Tolksdorf <leander.tolksdorf@fu-berlin.de>
Signed-off-by: Leander Tolksdorf <leander.tolksdorf@fu-berlin.de>
Passing run #532 ↗︎
Details:
This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding all those new tests :)
mockConnection = socket; | ||
}); | ||
|
||
describe("indicators", () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Either change the describe to "line indicators" or maybe even merge the two indicators as before. IMO they are so closeley related that we could even move the two describes into one test file. Would really like the first recommendation. the second is up to your preference :)
cy.get('[data-cy="line-indicators"]').should("be.visible"); | ||
}); | ||
|
||
it("updates min value", () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix failing test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's what i pointed out in the pr description. Unfortunately after many hours, I coudn't figure out how to fix it so I'm leaving it out for now.
cy.get('[data-cy="gnd-button"]').trigger("mouseover"); | ||
cy.get('[data-cy="gnd-button-tooltip"]').should("be.visible"); | ||
}); | ||
// Stub is not working in the e2e test, createEventDispatcher still |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you suggest we do about this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I didn't find a solution to this, I removed it just now and for next sprint we could consider using unit tests for such logic.
@@ -2,7 +2,7 @@ | |||
|
|||
describe("gndButton", () => { | |||
beforeEach(() => { | |||
cy.visit("http://localhost:5173/"); | |||
cy.visit("http://localhost:5173/", {}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we introduce {}
here?
cy.visit("http://localhost:5173/"); | ||
}); | ||
it("resets on off button when reset button is clicked", () => { | ||
cy.get('[data-cy="on-off-button"]').click(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't specifically need to click the on-off-button
, but I like that you introduce it that way :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what you meant, but to test if the reset button resets the on off button, I have to first toggle the on off button, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I just meant functionality-wise you would not actually need the extra step. When considering the label of the test it is even expected that you also click the button. My misunderstaning
@@ -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(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would like it if we also checked if the setting panel is open after clicking the settings-button
, because if the button click never opens it the test will still succeed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I can tell the interim step of checking if the panel is/was open is missing.
cy.get('[data-cy="preset-config-open-popup"]').should("be.visible");
Signed-off-by: Leander Tolksdorf <leander.tolksdorf@fu-berlin.de>
Signed-off-by: Leander Tolksdorf <leander.tolksdorf@fu-berlin.de>
Signed-off-by: Leander Tolksdorf <leander.tolksdorf@fu-berlin.de>
Signed-off-by: Leander Tolksdorf <leander.tolksdorf@fu-berlin.de>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All tests running green, LGTM
@@ -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(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I can tell the interim step of checking if the panel is/was open is missing.
cy.get('[data-cy="preset-config-open-popup"]').should("be.visible");
cy.visit("http://localhost:5173/"); | ||
}); | ||
it("resets on off button when reset button is clicked", () => { | ||
cy.get('[data-cy="on-off-button"]').click(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I just meant functionality-wise you would not actually need the extra step. When considering the label of the test it is even expected that you also click the button. My misunderstaning
Current test coverage:
When running cypress tests, the coverage report gets saved into
coverage
folder, we could include this in the CI output.I added more tests for frontend-only stuff like tooltips, but I'm really struggling with tests that involve signals from the backend. See file
cypress/e2e/2-indicators/line-indicators.cy.js
: I tried mocking the websocket connection to send a test sample array. And the message is received at the frontend. Problems are:1, 0, 0, ...
instead of an array buffer.