Skip to content
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

P2022 2047 projects page tests #128

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
31 changes: 31 additions & 0 deletions cypress/integration/tests.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
describe("tests group #1", () => {
beforeEach(() => {
cy.visit("http://localhost:3000//projects");
localStorage.setItem("USE_MOCK", "true");
cy.get("input[name=login]").type("AK");
cy.get("input[name=password]").type("Patronage22!{enter}");
});

it('test #1 Kliknięcie "New project" na liście projektów powinno wyświetlić dialog z pytaniem o nazwę projekt', () => {
cy.findByText("Nowy Projekt").click();
cy.get("div[role=dialog]")
.should("be.visible")
.should("contain", "Podaj nazwę projektu");
});

it('test #2 Wpisanie nazwy projektu w dialogu powinno uaktywnić przycisk "Create", a po jego kliknięciu dialog powinien zniknąć.', () => {
cy.findByText("Nowy Projekt").click();
cy.get("button[disabled]");
cy.get("#styled-text-input").type("nazwa");
cy.findByText("Utwórz").click();
cy.get("div[role=dialog]").should("not.exist");
});

it("test #3 Usunięcie projektu - wybranie projektu z listy, sprawdzenie czy wyświetla się dialog i potwierdzenie usunięcia - powinno zamknąć dialog.", () => {
cy.get("#three-dots-menu-button").first().click();
cy.findByText("Delete project").click();
cy.get("div[role=dialog]").should("be.visible");
cy.get("button").contains("Tak").click();
cy.get("div[role=dialog]").should("not.exist");
});
});
Loading