[wp-trac] [WordPress Trac] #58777: E2E Tests: Resolve 404s in Cache-Control Headers Directive tests.

WordPress Trac noreply at wordpress.org
Tue Jul 11 00:19:00 UTC 2023


#58777: E2E Tests: Resolve 404s in Cache-Control Headers Directive tests.
------------------------------+-----------------------
 Reporter:  costdev           |      Owner:  (none)
     Type:  defect (bug)      |     Status:  new
 Priority:  normal            |  Milestone:  6.3
Component:  Build/Test Tools  |    Version:  trunk
 Severity:  normal            |   Keywords:  has-patch
  Focuses:                    |
------------------------------+-----------------------
 There are two 404s that can occur in [https://github.com/WordPress
 /wordpress-develop/blob/trunk/tests/e2e/specs/cache-control-headers-
 directives.test.js these tests].

 You can see that even in [https://github.com/WordPress/wordpress-
 develop/actions/runs/5513492905/jobs/10051704085#step:12:368 this
 successful run], the 404s occurred (the second one is in the next block).

 1. [https://github.com/WordPress/wordpress-
 develop/blob/trunk/tests/e2e/specs/cache-control-headers-
 directives.test.js#L16-L19 this block] attempts to publish the post.
 However, this seems to fail. When `await logout();` completes and an
 attempt is made to go to the published URL, a 404 is triggered. It seems
 that `publishPost` can be imported, and `await publishPost();` can be
 called between this line and `await logout();` to ensure the post is
 actually published. This is how it's done in [https://github.com/WordPress
 /wordpress-develop/blob/trunk/tests/e2e/specs/edit-posts.test.js#L24-L25
 another test in the suite].

 2. [https://github.com/WordPress/wordpress-
 develop/blob/trunk/tests/e2e/specs/cache-control-headers-
 directives.test.js#L32 this line] effectively attempts to navigate to
 `http://localhost:8889/wp-admin/wp-admin`, producing a 404. This seems to
 be resolved by using `await visitAdminPage( '/' );`.

 After implementing these changes, [https://github.com/WordPress/wordpress-
 develop/actions/runs/5514013854/jobs/10052793444?pr=4825#step:12:76 the
 E2E run of the PR] shows that the Cache-Control headers directives tests
 simply pass with no 404 output.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/58777>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list