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

Add testing setup #2177

Open
wants to merge 256 commits into
base: develop
Choose a base branch
from
Open

Add testing setup #2177

wants to merge 256 commits into from

Conversation

zackkatz
Copy link
Member

@zackkatz zackkatz commented Oct 23, 2024

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.
@mrcasual
Copy link
Collaborator

mrcasual commented Feb 18, 2025

@Mwalek, I added some code to retry the tests:e2e:setup command in case it fails, so this should solve the problem with the database not being immediately accessible.

Please update all tests to not use the gotoAndEnsureLoggedIn helper method and also get rid of all mentions of baseURL/baseUrl. The latter is set automatically on the page object.

@@ -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 () => {
Copy link
Collaborator

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 () => {
Copy link
Collaborator

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

Mwalek and others added 5 commits February 20, 2025 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants