Skip to content

Commit

Permalink
Merge pull request #405 from ConvertKit/test-woocommerce-7.2
Browse files Browse the repository at this point in the history
Tests: Compatibility with WooCommerce 7.2
  • Loading branch information
n7studios authored Dec 15, 2022
2 parents d86743e + 885f104 commit da9efba
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 0 additions & 2 deletions tests/_support/Helper/Acceptance/WPClassicEditor.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ public function addVisualEditorShortcode($I, $shortcodeName, $shortcodeConfigura
switch ($targetEditor) {
case 'excerpt':
$I->scrollTo('#postexcerpt');
$I->click('#postexcerpt button.handlediv');
break;
default:
$I->scrollTo('h1.wp-heading-inline');
Expand Down Expand Up @@ -118,7 +117,6 @@ public function addTextEditorShortcode($I, $shortcodeProgrammaticName, $shortcod
switch ($targetEditor) {
case 'excerpt':
$I->scrollTo('#postexcerpt');
$I->click('#postexcerpt button.handlediv');
break;
default:
$I->scrollTo('h1.wp-heading-inline');
Expand Down
12 changes: 12 additions & 0 deletions tests/acceptance/integrations/WooCommerceProductFormCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ public function testAddNewProductUsingNoForm(AcceptanceTester $I)
// Navigate to Products > Add New.
$I->amOnAdminPage('post-new.php?post_type=product');

// Scroll to ConvertKit meta box.
$I->scrollTo('#wp-convertkit-meta-box');

// Change Form to None.
$I->fillSelect2Field($I, '#select2-wp-convertkit-form-container', 'None', 'aria-owns');

Expand Down Expand Up @@ -119,6 +122,9 @@ public function testAddNewProductUsingDefinedForm(AcceptanceTester $I)
// Navigate to Products > Add New.
$I->amOnAdminPage('post-new.php?post_type=product');

// Scroll to ConvertKit meta box.
$I->scrollTo('#wp-convertkit-meta-box');

// Change Form to Form setting in .env file.
$I->fillSelect2Field($I, '#select2-wp-convertkit-form-container', $_ENV['CONVERTKIT_API_FORM_NAME'], 'aria-owns');

Expand Down Expand Up @@ -148,6 +154,9 @@ public function testAddNewProductUsingFormShortcodeInVisualEditor(AcceptanceTest
// Add a Product using the Classic Editor.
$I->addClassicEditorPage($I, 'product', 'ConvertKit: Product: Form: Shortcode: Visual Editor');

// Scroll to ConvertKit meta box.
$I->scrollTo('#wp-convertkit-meta-box');

// Configure metabox's Form setting = None, ensuring we only test the shortcode in the Classic Editor.
$I->fillSelect2Field($I, '#select2-wp-convertkit-form-container', 'None', 'aria-owns');

Expand Down Expand Up @@ -195,6 +204,9 @@ public function testAddNewProductUsingFormShortcodeInTextEditor(AcceptanceTester
// Add a Product using the Classic Editor.
$I->addClassicEditorPage($I, 'product', 'ConvertKit: Product: Form: Shortcode: Text Editor');

// Scroll to ConvertKit meta box.
$I->scrollTo('#wp-convertkit-meta-box');

// Configure metabox's Form setting = None, ensuring we only test the shortcode in the Classic Editor.
$I->fillSelect2Field($I, '#select2-wp-convertkit-form-container', 'None', 'aria-owns');

Expand Down

0 comments on commit da9efba

Please sign in to comment.