-
Notifications
You must be signed in to change notification settings - Fork 73
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
feat: setup Playwright e2e test including vFolder create/delete test #2647
Conversation
Your org requires the Graphite merge queue for merging into mainAdd the label “flow:merge-queue” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “flow:hotfix” to add to the merge queue as a hot fix. You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link. |
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Coverage report for
|
St.❔ |
Category | Percentage | Covered / Total |
---|---|---|---|
🔴 | Statements | 3.7% | 215/5807 |
🔴 | Branches | 4.05% | 159/3926 |
🔴 | Functions | 2.24% | 43/1920 |
🔴 | Lines | 3.59% | 204/5688 |
Test suite run success
71 tests passing in 7 suites.
Report generated by 🧪jest coverage report action from 7f61052
e4799e3
to
36eb42b
Compare
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.
Is the command to execute test “npx playwright test” instead of “pnpm exec playwright test”?
@@ -0,0 +1,47 @@ | |||
import { test, expect } from "@playwright/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.
Parsing error: ESLint was configured to run on <tsconfigRootDir>/e2e/agent.test.ts using
I get the above error in all test files
In the tsconfig.json file, it looks like the e2e folder should be included in the include
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 can see this error only in VSCode, right? This doesn't affect the running e2e test. If you can resolve this issue, please make a PR.
e2e/test-util.ts
Outdated
} | ||
|
||
export async function loginAsAdmin(page: Page) { | ||
await login(page, "[email protected]", "wJalrXUt", "http://127.0.0.1:8090"); |
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.
Wouldn't it be better to separate the endpoint or Id into a variable?
It would be inconvenient when setting the endpoint as test server.
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.
Yes, it's better to manage a web server endpoint and web UI endpoint as well. But for now, it's better to keep now , and handle it later when we set up multiple Playwright configurations.
await page.goto(url.toString()); | ||
} | ||
|
||
export async function createVFolderAndVerify(page: Page, folderName: string) { |
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 does this function exist in test-util.ts
and not in VFolder.test.ts
?
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.
When we write some test code which include a create vfolder such as model serving, this function clould be helpful. It's like a login function.
e2e/vfolder.test.ts
Outdated
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.
vfolder test fails.
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.
Could you let me know about the details of the failed 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.
This error occurs. I think Playwright can't seem to find the add button. Is this error only happening to me?
"Error: locator.click: Test timeout of 30000ms exceeded.
Call log:
- waiting for getByRole('button', { name: 'plus Add' })"
36eb42b
to
ea2fa94
Compare
fe6a669
to
e81d867
Compare
Merge activity
|
…2647) > [!NOTE] > This PR is newly written referring to #2115 ### TL;DR Added end-to-end testing setup using Playwright ### What changed? - Installed Playwright as a dev dependency - Added Playwright configuration file (playwright.config.ts) - Created initial end-to-end tests for login functionality and virtual folder operations - Updated .gitignore to exclude Playwright-related files and directories - Added a data-testid attribute to the user dropdown button for easier test selection ### How to test? 1. Install dependencies: `pnpm install` 2. Run the application locally 3. Execute the tests: `npx playwright test` 4. View the test results in the console or generated HTML report ### Why make this change? Implementing end-to-end tests helps ensure the application's critical paths function correctly from a user's perspective. This addition will improve the overall quality and reliability of the project by catching potential issues early in the development process and providing confidence during future changes or refactoring.
e81d867
to
7f61052
Compare
Note
This PR is newly written referring to #2115
TL;DR
Added end-to-end testing setup using Playwright
What changed?
How to test?
pnpm install
npx playwright test
Why make this change?
Implementing end-to-end tests helps ensure the application's critical paths function correctly from a user's perspective. This addition will improve the overall quality and reliability of the project by catching potential issues early in the development process and providing confidence during future changes or refactoring.