Skip to content

Cypress testing #33

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

Open
wants to merge 32 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
fef39f0
feat(test): Add data-testid attributes for testing
bryanlewicki Apr 4, 2024
24884a3
feat(test): Integrate Cypress for e2e testing
bryanlewicki Apr 4, 2024
85e72b7
feat(test): Add e2e test file
bryanlewicki Apr 4, 2024
29174a5
Add the cypress e2e test file.
bryanlewicki Apr 8, 2024
6f7b23c
test: data-testid's were added
bryanlewicki Apr 15, 2024
3085338
test: tests optimized
bryanlewicki Apr 15, 2024
2afbb19
chore: cypress test command
cgawron Apr 15, 2024
8442965
test: test user json for fixture added
bryanlewicki Apr 15, 2024
6f6edf6
fix(test): Adjust test code for login window
bryanlewicki Apr 16, 2024
d1961bb
test: add data-testid elements to 3 components
bryanlewicki Apr 19, 2024
8e012d1
test: data-testid attributes added
bryanlewicki Apr 19, 2024
2fce225
fix(test): splittet chat tests to e2e file
bryanlewicki Apr 19, 2024
24b1624
test: added 3 ui tests
bryanlewicki Apr 19, 2024
5d2e70b
test(fix): test script works now with electron
bryanlewicki Apr 21, 2024
e1c161e
test(fix): Fixed data-testid for icons
bryanlewicki Apr 21, 2024
74b4a56
test: added 4 tests for the config menu
bryanlewicki Apr 22, 2024
3c999ee
test: Add 6 new tests for the config
bryanlewicki Apr 23, 2024
af1b64e
test: fix so all tests run instead of only one
bryanlewicki Apr 25, 2024
050f273
feat(test): intercept the api request to gravatar
bryanlewicki Apr 29, 2024
ae5540f
feat(test): tests the manual login example
bryanlewicki May 1, 2024
d632b22
feat(test): Add data-testid attributes for testing
bryanlewicki Apr 4, 2024
54a05c2
feat(test): Integrate Cypress for e2e testing
bryanlewicki Apr 4, 2024
e46e5f3
test: data-testid's were added
bryanlewicki Apr 15, 2024
8b7c669
chore: cypress test command
cgawron Apr 15, 2024
839fbe9
fix(test): Adjust test code for login window
bryanlewicki Apr 16, 2024
be08351
test: add data-testid elements to 3 components
bryanlewicki Apr 19, 2024
bad21ee
test: data-testid attributes added
bryanlewicki Apr 19, 2024
9bf4f43
test(fix): Fixed data-testid for icons
bryanlewicki Apr 21, 2024
045af07
feat(test): intercept the api request to gravatar
bryanlewicki Apr 29, 2024
7750bef
feat(test): tests the manual login example
bryanlewicki May 1, 2024
665b26b
fix: rebase conflicts fixed
bryanlewicki May 3, 2024
4f9be8f
Merge branch 'cypress_testing' of https://github.com/fhswf/openai-ui …
bryanlewicki May 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions cypress/e2e/loginTest.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
describe("Login Test", () => {
beforeEach(() => {
cy.visit("https://openai.ki.fh-swf.de");
});

it("Login", () => {
cy.get("button").contains("Cluster Login").click()
cy.get('input').eq(0).type("username_hier");
cy.get('input').eq(1).type("passwort_hier");
//cy.get("input").contains("Login Cluster").click();
// Der Code kann noch nicht einloggen, da hier keine Daten reingeschrieben werden
// Diese werden noch von einem Secret in Github kommen.
});
});
12 changes: 11 additions & 1 deletion cypress/e2e/uiTest.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ describe("User Interface", () => {
cy.wait('@getUser', { timeout: 15000 });
});

it("Check the headline", () => {
it.only("Check the headline", () => {
cy.getDataTestId("HeaderTitle").contains(
"K!mpuls"
);
Expand Down Expand Up @@ -80,7 +80,16 @@ describe("Dark Mode", () => {
cy.get("html").should("have.attr", "data-theme", "light");
});

it("Top Right Button", () => {
cy.get("html").should("have.attr", "data-theme", "light");
cy.getDataTestId("TopRightDarkModeBtn").click();
cy.get("html").should("have.attr", "data-theme", "dark");
cy.getDataTestId("TopRightDarkModeBtn").click();
cy.get("html").should("have.attr", "data-theme", "light");
});

it("In Settings", () => {
cy.wait(2000);
cy.getDataTestId("BottomLeftSideBar").find("i").eq(3).click();
cy.get("html").should("have.attr", "data-theme", "light");
cy.getDataTestId("OptionDarkModeSelect").select("dark");
Expand Down Expand Up @@ -112,6 +121,7 @@ describe("Config Menu", () => {
cy.visit("http://localhost:5173/");
cy.wait('@getUser');
cy.getDataTestId("OpenConfigBtn").click();
cy.getDataTestId("ChatTextArea").click().type("Cypress wrote this!").should("have.text", "Cypress wrote this!");
});

it("Dark Mode", () => {
Expand Down
Loading
Loading