Skip to content

test: automatic CRUD forms#49

Merged
kguzek merged 30 commits into
mainfrom
test/crud-forms
Oct 26, 2025
Merged

test: automatic CRUD forms#49
kguzek merged 30 commits into
mainfrom
test/crud-forms

Conversation

@kguzek

@kguzek kguzek commented Jul 25, 2025

Copy link
Copy Markdown
Member

Testy do tworzenia, edytownia, usuwania i wyświetlania zasobów -- jednostkowe dla artykułów i integracyjne dla organizacji studenckich

są też szybkie testy integracyjne dla logowania i wylogowywania (logowanie nie działa na webkicie więc dlatego testy są tylko dla chrome i firefoxa XD)


Important

Add unit and e2e tests for CRUD operations and authentication, configure Playwright, and update CI workflow.

  • Tests:
    • Add unit tests for guide article creation in guide-articles-create-page.test.tsx.
    • Add e2e tests for authentication flow in auth-flow.spec.ts and student organizations CRUD in student-organizations.spec.ts.
    • Add helper functions for e2e tests in helpers.ts.
  • Configuration:
    • Update .github/workflows/ci.yml to run Playwright tests and upload reports.
    • Add Playwright configuration in playwright.config.ts.
    • Update vitest.config.mts to exclude e2e tests from Vitest.
  • Misc:
    • Add @playwright/test and dotenv to package.json devDependencies.
    • Extract LoginForm to form.tsx and update page.tsx to use it.

This description was created by Ellipsis for 49b7781. You can customize this summary. It will automatically update as commits are pushed.

@kguzek kguzek self-assigned this Jul 25, 2025
@kguzek kguzek added the enhancement New feature or request label Jul 25, 2025
@pull-request-size pull-request-size Bot added size/L and removed size/M labels Jul 25, 2025
Comment thread playwright.config.ts Outdated
Comment thread playwright.config.ts Outdated
@kguzek
kguzek force-pushed the test/crud-forms branch from 5b53594 to 08bef0d Compare July 25, 2025 22:38
Comment thread src/tests/e2e/resources/student-organizations.spec.ts Outdated
Comment thread src/tests/e2e/resources/student-organizations.spec.ts Outdated
@kguzek
kguzek force-pushed the test/crud-forms branch from 08bef0d to 09a9702 Compare July 25, 2025 23:42
@kguzek
kguzek force-pushed the test/crud-forms branch 2 times, most recently from 38a1955 to 944a880 Compare July 26, 2025 00:25
Rei-x
Rei-x previously approved these changes Aug 20, 2025

@Rei-x Rei-x left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bardzo rozległe testy, fajnie, że się tak postarałeś - najbardziej zwróć uwagę, żeby nie testować implementacji tylko rzeczy widoczne dla użytkownika

Comment thread .github/workflows/ci.yml Outdated
Comment on lines +12 to +14
env:
TEST_USER_EMAIL: ${{ secrets.TEST_USER_EMAIL }}
TEST_USER_PASSWORD: ${{ secrets.TEST_USER_PASSWORD }}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ja akurat wolę mieć unikalne credentiale na każdy test - zwłaszcza jeśli testujesz tutaj produkcyjne api bo możesz mieć kolizje jak dwa testy się odpalą na raz

Comment thread .github/workflows/ci.yml Outdated
Comment thread .github/workflows/ci.yml Outdated
Comment thread src/app/guide_articles/create/guide-articles-create-page.test.tsx Outdated
Comment thread src/tests/e2e/resources/student-organizations.spec.ts Outdated
Comment thread src/tests/e2e/resources/student-organizations.spec.ts Outdated
Comment thread src/tests/e2e/helpers.ts Outdated
Comment thread src/tests/e2e/helpers.ts
resource: Resource,
options: SortOrFilter,
): Promise<void>;
export async function setAbstractResourceListFilters(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spoko helpery (ale widzę, że typescript wjechał mocno) 😭

ogólnie do takich abstrakcji zalecam Page Object Model - to jest standardowa praktyka w playwrighcie:
https://playwright.dev/docs/pom

Comment thread src/tests/mocks/constants.ts Outdated
Comment thread playwright.config.ts Outdated
Comment thread src/tests/e2e/resources/student-organizations.spec.ts Outdated
Comment thread src/tests/e2e/resources/student-organizations.spec.ts Outdated
Comment thread src/tests/e2e/resources/student-organizations.spec.ts Outdated
@kguzek
kguzek force-pushed the test/crud-forms branch 4 times, most recently from 2165a34 to 1c8d5bb Compare August 25, 2025 02:29
kguzek added a commit that referenced this pull request Aug 25, 2025
+ accessible labels for buttons without text
+ modularize github actions
+ update types to more closely reflect API responses
+ add more information on bad responses
@kguzek
kguzek force-pushed the test/crud-forms branch 2 times, most recently from b740716 to 431d6f6 Compare August 25, 2025 04:56
@kguzek kguzek changed the title CRUD forms tests test: automatic CRUD forms Sep 9, 2025
kguzek added a commit that referenced this pull request Sep 13, 2025
+ accessible labels for buttons without text
+ modularize github actions
+ update types to more closely reflect API responses
+ add more information on bad responses
@kguzek
kguzek force-pushed the feat/automatic-crud branch from 55c3dca to 161cbcb Compare September 13, 2025 00:12
kguzek added a commit that referenced this pull request Sep 13, 2025
+ accessible labels for buttons without text
+ modularize github actions
+ update types to more closely reflect API responses
+ add more information on bad responses
@kguzek
kguzek force-pushed the feat/automatic-crud branch from 161cbcb to 3790729 Compare September 13, 2025 00:16
react testing library cannot access minimal tiptap's RTE as it is not a semantic textarea element. this should be tested using e2e tests
Comment thread .github/workflows/ci.yml Fixed
@kguzek
kguzek force-pushed the test/crud-forms branch 4 times, most recently from 3c841de to d3cc8a4 Compare October 26, 2025 21:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request size/XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants