-
Notifications
You must be signed in to change notification settings - Fork 62
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
Add testing setup #2177
base: develop
Are you sure you want to change the base?
Add testing setup #2177
Conversation
This fixes the issue with Chromium connecting to the Docker container via the WebSocket.
This is the minimum supported GravityView version
Ref: https://playwright.dev/docs/api/class-page#page-wait-for-navigation Also, the use of "networkidle" is discouraged.
This is an attempt to fix the "Error: Error establishing a database connection" issue since we can't override WP-ENV's Docker setup and add a `healthcheck` (or can we? :)).
3s may not be enough as it's possible that Foundation is fetching updates/etc. on first load.
@Mwalek, it runs 10 tests—this approach needs adjustment. Also, I’d rather not add a global command specific to some environment. We can use CCI's config.yml for that.
@Mwalek, I added some code to retry the Please update all tests to not use the |
1) Playwright's config is no longer concerned w/authentication 2) New state fiel is created if does not exist, existing one is validated and recreated if invalid 3) gotoAndEnsureLoggedIn() helper can be dropped
@@ -13,7 +12,7 @@ test("Verify Allow Rest Access Checked", async ({ page }, testInfo) => { | |||
let currentUrl, params, viewId, apiUrl, response; | |||
|
|||
await test.step("Log in and navigate to the appropriate page", async () => { |
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.
@Mwalek, we don't really need to describe this step here and elsewhere. Just do page.goto('/wp-admin/edit.php?post_type=gravityview');
.
@@ -15,7 +14,7 @@ test("Verify Prevent Direct Access", async ({ browser }, testInfo) => { | |||
const page = await loggedInContext.newPage(); | |||
|
|||
await test.step("Log in and create the View", async () => { |
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.
@Mwalek, Log in and create the View
> Create the View
Usage: USE_LOCAL_BROWSER=1 npm run tests:e2e:run This requires Playwright to be globally installed (npx playwright install).
💾 Build file (f33a0c4).