Skip to content

E2E Tests: Update link/unlink tests for markup changes in WP 7.1 #1390

Description

@peterwilsoncc

Describe the bug

The HTML for the notices component has changed in WordPress 7.1 so the actions are no longer descendants of the .components-notice__content element.

This is breaking the linking and unlinking tests that use the selector .components-notice__content .components-notice__action:eq(0). The selector should be updated to .components-notice .components-notice__actions .components-notice__action:eq(0)

Steps to Reproduce

  1. Replace cypress test suite module with code from Update commands for recent versions of WordPress. cypress-wp-utils#154
  2. Start wp-env against version 7.1 or trunk
  3. Run npm run cypress:run -- --spec tests/cypress/e2e/link-unlink.test.js
  4. Observe failure

Screenshots, screen recording, code snippet

Running:  link-unlink.test.js                                                             (1 of 1)


  Linking and unlinking tests
    1) Should show the unlinking option for linked posts
    2) Should show the linking option for unlinked posts


  0 passing (3m)
  2 failing

  1) Linking and unlinking tests
       Should show the unlinking option for linked posts:
     AssertionError: Timed out retrying after 20000ms: Expected to find element: `.components-notice__content .components-notice__action:eq(0)`, but never found it.
      at Context.eval (webpack:///./e2e/link-unlink.test.js:34:6)
      at getRet (http://localhost/__cypress/runner/cypress_runner.js:122690:20)
      at tryCatcher (http://localhost/__cypress/runner/cypress_runner.js:1777:23)
      at Promise.attempt.Promise.try (http://localhost/__cypress/runner/cypress_runner.js:4285:29)
      at Context.thenFn (http://localhost/__cypress/runner/cypress_runner.js:122701:66)
      at Context.then (http://localhost/__cypress/runner/cypress_runner.js:122952:21)
      at wrapped (http://localhost/__cypress/runner/cypress_runner.js:146050:19)

  2) Linking and unlinking tests
       Should show the linking option for unlinked posts:
     AssertionError: Timed out retrying after 20000ms: Expected to find element: `.components-notice__content .components-notice__action:eq(0)`, but never found it.
      at Context.eval (webpack:///./e2e/link-unlink.test.js:66:6)
      at getRet (http://localhost/__cypress/runner/cypress_runner.js:122690:20)
      at tryCatcher (http://localhost/__cypress/runner/cypress_runner.js:1777:23)
      at Promise.attempt.Promise.try (http://localhost/__cypress/runner/cypress_runner.js:4285:29)
      at Context.thenFn (http://localhost/__cypress/runner/cypress_runner.js:122701:66)
      at Context.then (http://localhost/__cypress/runner/cypress_runner.js:122952:21)
      at wrapped (http://localhost/__cypress/runner/cypress_runner.js:146050:19)

Environment information

N/A

WordPress information

WordPress Information

### wp-core ###

version: 7.1-RC4-63322
site_language: en_US
user_language: en_US
timezone: +00:00
permalink: /blog/%year%/%monthnum%/%day%/%postname%/
https_status: false
multisite: true
user_registration: false
blog_public: 1
default_comment_status: open
environment_type: local
site_id: 1
site_count: 3
network_count: 1
user_count: 5
dotorg_communication: true

### wp-dropins (1) ###

db.php: true

### wp-active-theme ###

name: Twenty Twenty-Five (twentytwentyfive)
version: 1.5
author: the WordPress team
author_website: https://wordpress.org
parent_theme: none
theme_features: core-block-patterns, post-thumbnails, responsive-embeds, editor-styles, html5, automatic-feed-links, widgets-block-editor, block-templates, post-formats, editor-style
theme_path: /vagrant/wp-build/wp-content/themes/twentytwentyfive

### wp-themes-inactive (14) ###

Twenty Eleven: version: 5.2, author: the WordPress team
Twenty Fifteen: version: 4.3, author: the WordPress team
Twenty Fourteen: version: 4.6, author: the WordPress team
Twenty Nineteen: version: 3.4, author: the WordPress team
Twenty Seventeen: version: 4.2, author: the WordPress team
Twenty Sixteen: version: 3.9, author: the WordPress team
Twenty Ten: version: 4.7, author: the WordPress team
Twenty Thirteen: version: 4.7, author: the WordPress team
Twenty Twelve: version: 4.9, author: the WordPress team
Twenty Twenty: version: 3.2, author: the WordPress team
Twenty Twenty-Four: version: 1.6, author: the WordPress team
Twenty Twenty-One: version: 2.9, author: the WordPress team
Twenty Twenty-Three: version: 1.7, author: the WordPress team
Twenty Twenty-Two: version: 2.2, author: the WordPress team

### wp-mu-plugins (14) ###

allow-cpts.php: author: (undefined), version: (undefined)
debug-info.php: author: (undefined), version: (undefined)
delete_data_prepares.php: author: (undefined), version: (undefined)
is-large-network.php: author: (undefined), version: (undefined)
no-auto-update.php: author: (undefined), version: (undefined)
nope-post-abstraction-dumps.php: author: (undefined), version: (undefined)
nope-push-nope-pull.php: author: (undefined), version: (undefined)
show-stable-dist.php: author: (undefined), version: (undefined)
snippet-auto-unlink.php: author: (undefined), version: (undefined)
snippet-modify-content.php: author: (undefined), version: (undefined)
toggle-auto-distribute.php: author: (undefined), version: (undefined)
unsafe-app-passwords.php: author: (undefined), version: (undefined)
_admin_bar_distributor_version.php: author: (undefined), version: (undefined)
_qm-mappings.php: author: (undefined), version: (undefined)

### wp-plugins-active (3) ###

Distributor: version: 2.3.0, author: 10up Inc.
Query Monitor: version: 4.0.6, author: John Blackbourn (latest version: 4.0.7)
User Switching: version: 1.12.0, author: John Blackbourn (latest version: 1.12.1)

### wp-plugins-inactive (5) ###

Advanced Custom Fields PRO: version: 6.4.2, author: WP Engine
Classic Editor: version: 1.7.0, author: WordPress Contributors
Distributor: version: 1.9.1, author: 10up Inc.
Distributor - Auto Distribute: version: 0.2.2, author: 10up
Distributor E2E Test Plugin: author: (undefined), version: (undefined)

### wp-media ###

image_editor: WP_Image_Editor_GD
imagick_module_version: Not available
imagemagick_version: Not available
imagick_version: Not available
file_uploads: 1
post_max_size: 1024M
upload_max_filesize: 1024M
max_effective_size: 1 GB
max_file_uploads: 20
image_format_transforms: image/heic → image/jpeg, image/heif → image/jpeg, image/heic-sequence → image/jpeg, image/heif-sequence → image/jpeg
gd_version: 2.3.3
gd_formats: GIF, JPEG, PNG, WebP, BMP, AVIF, XPM
ghostscript_version: not available

### wp-server ###

server_architecture: Linux 6.8.0-86-generic aarch64
httpd_software: nginx/1.24.0
php_version: 8.3.30 64bit
php_sapi: fpm-fcgi
max_input_variables: 1000
time_limit: 900
memory_limit: 512M
max_input_time: 900
upload_max_filesize: 1024M
php_post_max_size: 1024M
curl_version: 8.5.0 OpenSSL/3.0.13
suhosin: false
imagick_availability: false
opcode_cache: true
opcode_cache_memory_usage: 48989208 of 63404216
opcode_cache_interned_strings_usage: 74.13% of 8388608 (2170176 free)
opcode_cache_hit_rate: 98.07
opcode_cache_full: false
pretty_permalinks: true
static_robotstxt_file: false
current: 2026-08-18T03:36:28+00:00
utc-time: Tuesday, 18-Aug-26 03:36:28 UTC
server-time: 2026-08-18T03:36:26+00:00

### wp-database ###

extension: mysqli
server_version: 8.0.44-0ubuntu0.24.04.2
client_version: mysqlnd 8.3.30
max_allowed_packet: 16777216
max_connections: 151

### wp-constants ###

WP_HOME: undefined
WP_SITEURL: undefined
WP_CONTENT_DIR: /vagrant/content
WP_PLUGIN_DIR: /vagrant/content/plugins
WP_MEMORY_LIMIT: 64M
WP_MAX_MEMORY_LIMIT: 512M
WP_DEBUG: true
WP_DEBUG_DISPLAY: false
WP_DEBUG_LOG: /vagrant/content/debug.log
SCRIPT_DEBUG: true
WP_CACHE: false
CONCATENATE_SCRIPTS: undefined
COMPRESS_SCRIPTS: undefined
COMPRESS_CSS: undefined
WP_ENVIRONMENT_TYPE: local
WP_DEVELOPMENT_MODE: undefined
DB_CHARSET: utf8
DB_COLLATE: undefined
EMPTY_TRASH_DAYS: 30

### wp-filesystem ###

wordpress: writable
wp-content: writable
uploads: writable
plugins: writable
themes: writable
fonts: does not exist
mu-plugins: writable

### distributor ###

0: 2.3.0
1: 
	Override Author Byline: Yes
	Media Handling: Featured image only
2: 
	10 Dist MS2: 
- Blog ID: 2
- URL: http://ms-distributor.local/two
- Registered: 2026-07-14 03:50:08
- Last updated: 2026-07-14 03:56:33
	10 Dist MS3: 
- Blog ID: 3
- URL: http://ms-distributor.local/three
- Registered: 2026-07-14 03:50:08
- Last updated: 2026-07-14 03:58:09
3: 
	XU: 
- URL: http://xu-distributor.local/wp-json
- Version: 2.3.0
- Status: valid
- Auth method: Username / Password
- Username: admin
- Roles Allowed to Push: administrator, editor
- Additional data: {"errors":[], "can_post":["post", "page"], "can_get":["post", "page"], "endpoint_suggestion":false, "is_authenticated":"yes"}

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions