Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/coding-standards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
# Defines the WordPress and PHP Versions matrix to run tests on.
strategy:
matrix:
wp-versions: [ 'latest' ] #[ '6.1.1', 'latest' ]
wp-versions: [ '7.1-beta4' ] #[ '6.1.1', 'latest' ]
php-versions: [ '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4' ] #[ '7.3', '7.4', '8.0', '8.1' ]

# Steps to install, configure and run tests
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
strategy:
fail-fast: false
matrix:
wp-version: [ 'latest' ]
wp-version: [ '7.1-beta4' ]
php-version: [ '8.1', '8.2', '8.3', '8.4' ]
test-group:
- 'EndToEnd/broadcasts/blocks-shortcodes'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -462,8 +462,8 @@ public function testFormEntriesTableDeleteBulkAction(EndToEndTester $I)
$I->waitForElementNotVisible('input#convertkit_form_entries_per_page');

// Select the first two entries.
$I->checkOption('tbody#the-list tr:first-child th.check-column input[type="checkbox"]');
$I->checkOption('tbody#the-list tr:nth-child(2) th.check-column input[type="checkbox"]');
$I->checkOption('tbody#the-list tr:first-child .check-column input[type="checkbox"]');
$I->checkOption('tbody#the-list tr:nth-child(2) .check-column input[type="checkbox"]');

// Click Delete.
$I->selectOption('#bulk-action-selector-top', 'Delete');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function testSetupWizardDoesNotDisplayWhenConfigured(EndToEndTester $I)
$I->waitForElementVisible('table.plugins tr[data-slug=convertkit].active');

// Click Setup Wizard link underneath the Plugin in the WP_List_Table.
$I->click('tr[data-slug="convertkit"] td div.row-actions span.setup_wizard a');
$I->click('tr[data-slug="convertkit"] .row-actions span.setup_wizard a');
}

/**
Expand Down Expand Up @@ -665,7 +665,7 @@ public function testSetupWizardLinkOnPluginsScreen(EndToEndTester $I)
$I->waitForElementVisible('body.plugins-php');

// Click Setup Wizard link underneath the Plugin in the WP_List_Table.
$I->click('tr[data-slug="convertkit"] td div.row-actions span.setup_wizard a');
$I->click('tr[data-slug="convertkit"] .row-actions span.setup_wizard a');

// Confirm expected setup wizard screen is displayed.
$this->_seeExpectedSetupWizardScreen(
Expand Down
10 changes: 10 additions & 0 deletions tests/Support/Helper/Divi5Theme.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,19 @@ public function createDivi5Page($I, $title)
// Edit Page.
$I->amOnPage('/wp-admin/post.php?post=' . $pageID . '&action=edit');

// Switch to the Gutenberg IFrame.
if ($I->isGutenbergIFrameEditorEnabled()) {
$I->switchToGutenbergIFrameEditor($I);
}

// Click "Use The Divi Builder" button.
$I->click('#et-switch-to-divi');

// Switch back to main window.
if ($I->isGutenbergIFrameEditorEnabled()) {
$I->switchToIFrame();
}

// Wait for Divi Builder to load.
$I->waitForElementVisible('body.et_pb_pagebuilder_layout');
}
Expand Down
4 changes: 2 additions & 2 deletions tests/Support/Helper/ThirdPartyPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function activateThirdPartyPlugin($I, $name, $wizardExpectsToDisplay = tr

default:
// Activate the Plugin.
$I->checkOption('//*[@data-slug="' . $name . '"]/th/input');
$I->checkOption('//*[@data-slug="' . $name . '"]//input[@type="checkbox"]');
$I->selectOption('action', 'activate-selected');
$I->click('#doaction');
break;
Expand Down Expand Up @@ -114,7 +114,7 @@ public function deactivateThirdPartyPlugin($I, $name)

default:
// Deactivate the Plugin.
$I->checkOption('//*[@data-slug="' . $name . '"]/th/input');
$I->checkOption('//*[@data-slug="' . $name . '"]//input[@type="checkbox"]');
$I->selectOption('action', 'deactivate-selected');
$I->click('#doaction');
break;
Expand Down
18 changes: 15 additions & 3 deletions tests/Support/Helper/WPGutenberg.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,15 @@ public function isGutenbergIFrameEditorEnabled()
*/
public function switchToGutenbergIFrameEditor($I)
{
// Don't switch if the iframe doesn't exist e.g. Divi is active, which prevents
// the iframe block editor in WordPress 7.0+ from being used.
if ( ! $I->tryToSeeElement('iframe[name="editor-canvas"]')) {
// Wait for the iframe to mount. In WordPress 7.1+ the editor iframe
// can take longer to appear in the DOM than a tryToSeeElement()
// check, causing the switch to be silently skipped. Catch the timeout
// so that environments which intentionally have no iframe (e.g. Divi
// is active, which prevents the iframe block editor from being used)
// still fall through to the non-iframe path.
try {
$I->waitForElement('iframe[name="editor-canvas"]', 10);
} catch (\Facebook\WebDriver\Exception\TimeoutException $e) {
return;
}

Expand Down Expand Up @@ -227,6 +233,12 @@ public function addGutenbergParagraphBlock($I, $text)
$I->click('.wp-block-post-content');
$I->fillField('.wp-block-post-content p[data-empty="true"]', $text);

// Wait for Gutenberg to finish committing the typed text to the DOM.
// fillField returns as soon as the keystrokes have been dispatched, but
// Gutenberg (particularly under the iframed editor enforced in WP 7.1)
// processes input asynchronously.
$I->waitForText(substr($text, -min(30, strlen($text))), 5, '.wp-block-post-content');

// Switch back to main window.
if ($this->isGutenbergIFrameEditorEnabled()) {
$I->switchToIFrame();
Expand Down
Loading