diff --git a/.github/workflows/coding-standards.yml b/.github/workflows/coding-standards.yml
index 59afff12e..c3c0af7d3 100644
--- a/.github/workflows/coding-standards.yml
+++ b/.github/workflows/coding-standards.yml
@@ -120,6 +120,7 @@ jobs:
# Run Coding Standards on Tests.
- name: Run Coding Standards on Tests
working-directory: ${{ env.PLUGIN_DIR }}
+ if: ${{ matrix.php-versions == '8.1' || matrix.php-versions == '8.2' || matrix.php-versions == '8.3' || matrix.php-versions == '8.4' }}
run: php vendor/bin/phpcs -q --standard=phpcs.tests.xml --report=checkstyle ./tests | cs2pr
# Run WordPress Coding Standards on Plugin.
diff --git a/tests/EndToEnd/broadcasts/blocks-shortcodes/PageBlockBroadcastsCest.php b/tests/EndToEnd/broadcasts/blocks-shortcodes/PageBlockBroadcastsCest.php
index 39e8bcd79..284188641 100644
--- a/tests/EndToEnd/broadcasts/blocks-shortcodes/PageBlockBroadcastsCest.php
+++ b/tests/EndToEnd/broadcasts/blocks-shortcodes/PageBlockBroadcastsCest.php
@@ -35,15 +35,22 @@ public function _before(EndToEndTester $I)
public function testBroadcastsBlockWhenNoCredentials(EndToEndTester $I)
{
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Broadcasts: Block: No Credentials');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Broadcasts: Block: No Credentials'
+ );
// Add block to Page.
- $I->addGutenbergBlock($I, 'Kit Broadcasts', 'convertkit-broadcasts');
+ $I->addGutenbergBlock(
+ $I,
+ blockName: 'Kit Broadcasts',
+ blockProgrammaticName: 'convertkit-broadcasts'
+ );
// Test that the popup window works.
$I->testBlockNoCredentialsPopupWindow(
$I,
- 'convertkit-broadcasts'
+ blockName: 'convertkit-broadcasts'
);
// Publish and view the Page on the frontend site.
@@ -72,13 +79,23 @@ public function testBroadcastsBlockWithNoBroadcasts(EndToEndTester $I)
$I->setupKitPluginResourcesNoData($I);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Broadcasts: No Broadcasts');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Broadcasts: No Broadcasts'
+ );
// Add block to Page.
- $I->addGutenbergBlock($I, 'Kit Broadcasts', 'convertkit-broadcasts');
+ $I->addGutenbergBlock(
+ $I,
+ blockName: 'Kit Broadcasts',
+ blockProgrammaticName: 'convertkit-broadcasts'
+ );
// Confirm that the Broadcasts block displays instructions to the user on how to add a Broadcast in Kit.
- $I->seeBlockHasNoContentMessage($I, 'No broadcasts exist in Kit.');
+ $I->seeBlockHasNoContentMessage(
+ $I,
+ message: 'No broadcasts exist in Kit.'
+ );
// Click the link to confirm it loads Kit.
$I->clickLinkInBlockAndAssertKitLoginScreen($I, 'Click here to send your first broadcast.');
@@ -104,10 +121,17 @@ public function testBroadcastsBlockRefreshButton(EndToEndTester $I)
$I->setupKitPluginResourcesNoData($I);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Broadcasts: Refresh Button');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Broadcasts: Refresh Button'
+ );
// Add block to Page.
- $I->addGutenbergBlock($I, 'Kit Broadcasts', 'convertkit-broadcasts');
+ $I->addGutenbergBlock(
+ $I,
+ blockName: 'Kit Broadcasts',
+ blockProgrammaticName: 'convertkit-broadcasts'
+ );
// Setup Plugin with a valid API Key and resources, as if the user performed the necessary steps to authenticate
// and created a broadcast.
@@ -143,10 +167,17 @@ public function testBroadcastsBlockWithDefaultParameters(EndToEndTester $I)
$I->setupKitPluginResources($I);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Broadcasts: Default Params');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Broadcasts: Default Params'
+ );
// Add block to Page.
- $I->addGutenbergBlock($I, 'Kit Broadcasts', 'convertkit-broadcasts');
+ $I->addGutenbergBlock(
+ $I,
+ blockName: 'Kit Broadcasts',
+ blockProgrammaticName: 'convertkit-broadcasts'
+ );
// Publish and view the Page on the frontend site.
$I->publishAndViewGutenbergPage($I);
@@ -183,14 +214,17 @@ public function testBroadcastsBlockWithDisplayGridParameter(EndToEndTester $I)
$I->setupKitPluginResources($I);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Broadcasts: Display as Grid');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Broadcasts: Display as Grid'
+ );
// Add block to Page, setting the date format.
$I->addGutenbergBlock(
$I,
- 'Kit Broadcasts',
- 'convertkit-broadcasts',
- [
+ blockName: 'Kit Broadcasts',
+ blockProgrammaticName: 'convertkit-broadcasts',
+ blockConfiguration: [
'#inspector-toggle-control-0' => [ 'toggle', true ],
]
);
@@ -222,14 +256,17 @@ public function testBroadcastsBlockWithDateFormatParameter(EndToEndTester $I)
$I->setupKitPluginResources($I);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Broadcasts: Date Format Param');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Broadcasts: Date Format Param'
+ );
// Add block to Page, setting the date format.
$I->addGutenbergBlock(
$I,
- 'Kit Broadcasts',
- 'convertkit-broadcasts',
- [
+ blockName: 'Kit Broadcasts',
+ blockProgrammaticName: 'convertkit-broadcasts',
+ blockConfiguration: [
'date_format' => [ 'select', 'Y-m-d' ],
]
);
@@ -269,14 +306,17 @@ public function testBroadcastsBlockWithDisplayImageParameter(EndToEndTester $I)
$I->setupKitPluginResources($I);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Broadcasts: Display image');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Broadcasts: Display image'
+ );
// Add block to Page, setting the date format.
$I->addGutenbergBlock(
$I,
- 'Kit Broadcasts',
- 'convertkit-broadcasts',
- [
+ blockName: 'Kit Broadcasts',
+ blockProgrammaticName: 'convertkit-broadcasts',
+ blockConfiguration: [
'#inspector-toggle-control-0' => [ 'toggle', true ],
'#inspector-toggle-control-1' => [ 'toggle', true ],
]
@@ -310,14 +350,17 @@ public function testBroadcastsBlockWithDisplayDescriptionParameter(EndToEndTeste
$I->setupKitPluginResources($I);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Broadcasts: Display description');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Broadcasts: Display description'
+ );
// Add block to Page, setting the date format.
$I->addGutenbergBlock(
$I,
- 'Kit Broadcasts',
- 'convertkit-broadcasts',
- [
+ blockName: 'Kit Broadcasts',
+ blockProgrammaticName: 'convertkit-broadcasts',
+ blockConfiguration: [
'#inspector-toggle-control-2' => [ 'toggle', true ],
]
);
@@ -349,14 +392,17 @@ public function testBroadcastsBlockWithDisplayReadMoreLinkParameter(EndToEndTest
$I->setupKitPluginResources($I);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Broadcasts: Display read more link');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Broadcasts: Display read more link'
+ );
// Add block to Page, setting the date format.
$I->addGutenbergBlock(
$I,
- 'Kit Broadcasts',
- 'convertkit-broadcasts',
- [
+ blockName: 'Kit Broadcasts',
+ blockProgrammaticName: 'convertkit-broadcasts',
+ blockConfiguration: [
'#inspector-toggle-control-3' => [ 'toggle', true ],
'read_more_label' => [ 'input', 'Continue reading' ],
]
@@ -389,14 +435,17 @@ public function testBroadcastsBlockWithLimitParameter(EndToEndTester $I)
$I->setupKitPluginResources($I);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Broadcasts: Limit Param');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Broadcasts: Limit Param'
+ );
// Add block to Page, setting the limit.
$I->addGutenbergBlock(
$I,
- 'Kit Broadcasts',
- 'convertkit-broadcasts',
- [
+ blockName: 'Kit Broadcasts',
+ blockProgrammaticName: 'convertkit-broadcasts',
+ blockConfiguration: [
'limit' => [ 'input', '2', 'Pagination' ], // Click the Pagination tab first before starting to complete fields.
]
);
@@ -433,10 +482,17 @@ public function testBroadcastsBlockWithBlankLimitParameter(EndToEndTester $I)
$I->setupKitPluginResources($I);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Broadcasts: Blank Limit Param');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Broadcasts: Blank Limit Param'
+ );
// Add block to Page.
- $I->addGutenbergBlock($I, 'Kit Broadcasts', 'convertkit-broadcasts');
+ $I->addGutenbergBlock(
+ $I,
+ blockName: 'Kit Broadcasts',
+ blockProgrammaticName: 'convertkit-broadcasts'
+ );
// When the sidebar appears, blank the limit parameter as the user might, by pressing the backspace key twice.
$I->waitForElementVisible('.interface-interface-skeleton__sidebar[aria-label="Editor settings"]');
@@ -479,14 +535,17 @@ public function testBroadcastsBlockWithPaginationEnabled(EndToEndTester $I)
$I->setupKitPluginResources($I);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Broadcasts: Pagination');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Broadcasts: Pagination'
+ );
// Add block to Page, setting the limit.
$I->addGutenbergBlock(
$I,
- 'Kit Broadcasts',
- 'convertkit-broadcasts',
- [
+ blockName: 'Kit Broadcasts',
+ blockProgrammaticName: 'convertkit-broadcasts',
+ blockConfiguration: [
'limit' => [ 'input', '2', 'Pagination' ], // Click the Pagination tab first before starting to complete fields.
'#inspector-toggle-control-4' => [ 'toggle', true ],
]
@@ -513,14 +572,17 @@ public function testBroadcastsBlockWithPaginationLabelParameters(EndToEndTester
$I->setupKitPluginResources($I);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Broadcasts: Pagination Labels');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Broadcasts: Pagination Labels'
+ );
// Add block to Page, setting the limit.
$I->addGutenbergBlock(
$I,
- 'Kit Broadcasts',
- 'convertkit-broadcasts',
- [
+ blockName: 'Kit Broadcasts',
+ blockProgrammaticName: 'convertkit-broadcasts',
+ blockConfiguration: [
'limit' => [ 'input', '2', 'Pagination' ], // Click the Pagination tab first before starting to complete fields.
'#inspector-toggle-control-4' => [ 'toggle', true ],
'paginate_label_prev' => [ 'input', 'Newer' ],
@@ -549,14 +611,17 @@ public function testBroadcastsBlockWithBlankPaginationLabelParameters(EndToEndTe
$I->setupKitPluginResources($I);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Broadcasts: Blank Pagination Labels');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Broadcasts: Blank Pagination Labels'
+ );
// Add block to Page, setting the limit.
$I->addGutenbergBlock(
$I,
- 'Kit Broadcasts',
- 'convertkit-broadcasts',
- [
+ blockName: 'Kit Broadcasts',
+ blockProgrammaticName: 'convertkit-broadcasts',
+ blockConfiguration: [
'limit' => [ 'input', '2', 'Pagination' ], // Click the Pagination tab first before starting to complete fields.
'#inspector-toggle-control-4' => [ 'toggle', true ],
'paginate_label_prev' => [ 'input', '' ],
diff --git a/tests/EndToEnd/broadcasts/blocks-shortcodes/PageShortcodeBroadcastsCest.php b/tests/EndToEnd/broadcasts/blocks-shortcodes/PageShortcodeBroadcastsCest.php
index 1301139f9..9405a6b0d 100644
--- a/tests/EndToEnd/broadcasts/blocks-shortcodes/PageShortcodeBroadcastsCest.php
+++ b/tests/EndToEnd/broadcasts/blocks-shortcodes/PageShortcodeBroadcastsCest.php
@@ -36,14 +36,16 @@ public function _before(EndToEndTester $I)
public function testBroadcastsShortcodeInVisualEditorWithDefaultParameters(EndToEndTester $I)
{
// Add a Page using the Classic Editor.
- $I->addClassicEditorPage($I, 'page', 'Kit: Page: Broadcasts: Shortcode: Visual Editor');
+ $I->addClassicEditorPage(
+ $I,
+ title: 'Kit: Page: Broadcasts: Shortcode: Visual Editor'
+ );
// Add shortcode to Page.
$I->addVisualEditorShortcode(
$I,
- 'Kit Broadcasts',
- false,
- '[convertkit_broadcasts display_grid="0" date_format="F j, Y" display_image="0" display_description="0" display_read_more="0" read_more_label="Read more" limit="10" paginate="0" paginate_label_prev="Previous" paginate_label_next="Next"]'
+ shortcodeName: 'Kit Broadcasts',
+ expectedShortcodeOutput: '[convertkit_broadcasts display_grid="0" date_format="F j, Y" display_image="0" display_description="0" display_read_more="0" read_more_label="Read more" limit="10" paginate="0" paginate_label_prev="Previous" paginate_label_next="Next"]'
);
// Publish and view the Page on the frontend site.
@@ -77,16 +79,19 @@ public function testBroadcastsShortcodeInVisualEditorWithDefaultParameters(EndTo
public function testBroadcastsShortcodeInVisualEditorWithDisplayGridParameter(EndToEndTester $I)
{
// Add a Page using the Classic Editor.
- $I->addClassicEditorPage($I, 'page', 'Kit: Page: Broadcasts: Shortcode: Visual Editor: Display as Grid');
+ $I->addClassicEditorPage(
+ $I,
+ title: 'Kit: Page: Broadcasts: Shortcode: Visual Editor: Display as Grid'
+ );
// Add shortcode to Page.
$I->addVisualEditorShortcode(
$I,
- 'Kit Broadcasts',
- [
+ shortcodeName: 'Kit Broadcasts',
+ shortcodeConfiguration: [
'display_grid' => [ 'toggle', 'Yes' ],
],
- '[convertkit_broadcasts display_grid="1" date_format="F j, Y" display_image="0" display_description="0" display_read_more="0" read_more_label="Read more" limit="10" paginate="0" paginate_label_prev="Previous" paginate_label_next="Next"]'
+ expectedShortcodeOutput: '[convertkit_broadcasts display_grid="1" date_format="F j, Y" display_image="0" display_description="0" display_read_more="0" read_more_label="Read more" limit="10" paginate="0" paginate_label_prev="Previous" paginate_label_next="Next"]'
);
// Publish and view the Page on the frontend site.
@@ -113,16 +118,19 @@ public function testBroadcastsShortcodeInVisualEditorWithDisplayGridParameter(En
public function testBroadcastsShortcodeInVisualEditorWithDateFormatParameter(EndToEndTester $I)
{
// Add a Page using the Classic Editor.
- $I->addClassicEditorPage($I, 'page', 'Kit: Page: Broadcasts: Shortcode: Visual Editor: Date Format');
+ $I->addClassicEditorPage(
+ $I,
+ title: 'Kit: Page: Broadcasts: Shortcode: Visual Editor: Date Format'
+ );
// Add shortcode to Page.
$I->addVisualEditorShortcode(
$I,
- 'Kit Broadcasts',
- [
+ shortcodeName: 'Kit Broadcasts',
+ shortcodeConfiguration: [
'date_format' => [ 'select', date('Y-m-d') ],
],
- '[convertkit_broadcasts display_grid="0" date_format="Y-m-d" display_image="0" display_description="0" display_read_more="0" read_more_label="Read more" limit="10" paginate="0" paginate_label_prev="Previous" paginate_label_next="Next"]'
+ expectedShortcodeOutput: '[convertkit_broadcasts display_grid="0" date_format="Y-m-d" display_image="0" display_description="0" display_read_more="0" read_more_label="Read more" limit="10" paginate="0" paginate_label_prev="Previous" paginate_label_next="Next"]'
);
// Publish and view the Page on the frontend site.
@@ -156,16 +164,19 @@ public function testBroadcastsShortcodeInVisualEditorWithDateFormatParameter(End
public function testBroadcastsShortcodeInVisualEditorWithDisplayImageParameter(EndToEndTester $I)
{
// Add a Page using the Classic Editor.
- $I->addClassicEditorPage($I, 'page', 'Kit: Page: Broadcasts: Shortcode: Visual Editor: Display image');
+ $I->addClassicEditorPage(
+ $I,
+ title: 'Kit: Page: Broadcasts: Shortcode: Visual Editor: Display image'
+ );
// Add shortcode to Page.
$I->addVisualEditorShortcode(
$I,
- 'Kit Broadcasts',
- [
+ shortcodeName: 'Kit Broadcasts',
+ shortcodeConfiguration: [
'display_image' => [ 'toggle', 'Yes' ],
],
- '[convertkit_broadcasts display_grid="0" date_format="F j, Y" display_image="1" display_description="0" display_read_more="0" read_more_label="Read more" limit="10" paginate="0" paginate_label_prev="Previous" paginate_label_next="Next"]'
+ expectedShortcodeOutput: '[convertkit_broadcasts display_grid="0" date_format="F j, Y" display_image="1" display_description="0" display_read_more="0" read_more_label="Read more" limit="10" paginate="0" paginate_label_prev="Previous" paginate_label_next="Next"]'
);
// Publish and view the Page on the frontend site.
@@ -191,16 +202,19 @@ public function testBroadcastsShortcodeInVisualEditorWithDisplayImageParameter(E
public function testBroadcastsShortcodeInVisualEditorWithDisplayDescriptionParameter(EndToEndTester $I)
{
// Add a Page using the Classic Editor.
- $I->addClassicEditorPage($I, 'page', 'Kit: Page: Broadcasts: Shortcode: Visual Editor: Display description');
+ $I->addClassicEditorPage(
+ $I,
+ title: 'Kit: Page: Broadcasts: Shortcode: Visual Editor: Display description'
+ );
// Add shortcode to Page.
$I->addVisualEditorShortcode(
$I,
- 'Kit Broadcasts',
- [
+ shortcodeName: 'Kit Broadcasts',
+ shortcodeConfiguration: [
'display_description' => [ 'toggle', 'Yes' ],
],
- '[convertkit_broadcasts display_grid="0" date_format="F j, Y" display_image="0" display_description="1" display_read_more="0" read_more_label="Read more" limit="10" paginate="0" paginate_label_prev="Previous" paginate_label_next="Next"]'
+ expectedShortcodeOutput: '[convertkit_broadcasts display_grid="0" date_format="F j, Y" display_image="0" display_description="1" display_read_more="0" read_more_label="Read more" limit="10" paginate="0" paginate_label_prev="Previous" paginate_label_next="Next"]'
);
// Publish and view the Page on the frontend site.
@@ -226,17 +240,20 @@ public function testBroadcastsShortcodeInVisualEditorWithDisplayDescriptionParam
public function testBroadcastsShortcodeInVisualEditorWithDisplayReadMoreLinkParameter(EndToEndTester $I)
{
// Add a Page using the Classic Editor.
- $I->addClassicEditorPage($I, 'page', 'Kit: Page: Broadcasts: Shortcode: Visual Editor: Display read more link');
+ $I->addClassicEditorPage(
+ $I,
+ title: 'Kit: Page: Broadcasts: Shortcode: Visual Editor: Display read more link'
+ );
// Add shortcode to Page.
$I->addVisualEditorShortcode(
$I,
- 'Kit Broadcasts',
- [
+ shortcodeName: 'Kit Broadcasts',
+ shortcodeConfiguration: [
'display_read_more' => [ 'toggle', 'Yes' ],
'read_more_label' => [ 'input', 'Continue reading' ],
],
- '[convertkit_broadcasts display_grid="0" date_format="F j, Y" display_image="0" display_description="0" display_read_more="1" read_more_label="Continue reading" limit="10" paginate="0" paginate_label_prev="Previous" paginate_label_next="Next"]'
+ expectedShortcodeOutput: '[convertkit_broadcasts display_grid="0" date_format="F j, Y" display_image="0" display_description="0" display_read_more="1" read_more_label="Continue reading" limit="10" paginate="0" paginate_label_prev="Previous" paginate_label_next="Next"]'
);
// Publish and view the Page on the frontend site.
@@ -263,16 +280,19 @@ public function testBroadcastsShortcodeInVisualEditorWithDisplayReadMoreLinkPara
public function testBroadcastsShortcodeInVisualEditorWithLimitParameter(EndToEndTester $I)
{
// Add a Page using the Classic Editor.
- $I->addClassicEditorPage($I, 'page', 'Kit: Page: Broadcasts: Shortcode: Visual Editor: Limit');
+ $I->addClassicEditorPage(
+ $I,
+ title: 'Kit: Page: Broadcasts: Shortcode: Visual Editor: Limit'
+ );
// Add shortcode to Page.
$I->addVisualEditorShortcode(
$I,
- 'Kit Broadcasts',
- [
+ shortcodeName: 'Kit Broadcasts',
+ shortcodeConfiguration: [
'limit' => [ 'input', '2', 'Pagination' ], // Click the Pagination tab first before starting to complete fields.
],
- '[convertkit_broadcasts display_grid="0" date_format="F j, Y" display_image="0" display_description="0" display_read_more="0" read_more_label="Read more" limit="2" paginate="0" paginate_label_prev="Previous" paginate_label_next="Next"]'
+ expectedShortcodeOutput: '[convertkit_broadcasts display_grid="0" date_format="F j, Y" display_image="0" display_description="0" display_read_more="0" read_more_label="Read more" limit="2" paginate="0" paginate_label_prev="Previous" paginate_label_next="Next"]'
);
// Publish and view the Page on the frontend site.
@@ -304,24 +324,31 @@ public function testBroadcastsShortcodeInVisualEditorWithLimitParameter(EndToEnd
public function testBroadcastsShortcodeInVisualEditorWithPaginationEnabled(EndToEndTester $I)
{
// Add a Page using the Classic Editor.
- $I->addClassicEditorPage($I, 'page', 'Kit: Page: Broadcasts: Shortcode: Visual Editor: Pagination');
+ $I->addClassicEditorPage(
+ $I,
+ title: 'Kit: Page: Broadcasts: Shortcode: Visual Editor: Pagination'
+ );
// Add shortcode to Page.
$I->addVisualEditorShortcode(
$I,
- 'Kit Broadcasts',
- [
+ shortcodeName: 'Kit Broadcasts',
+ shortcodeConfiguration: [
'limit' => [ 'input', '2', 'Pagination' ], // Click the Pagination tab first before starting to complete fields.
'paginate' => [ 'toggle', 'Yes' ],
],
- '[convertkit_broadcasts display_grid="0" date_format="F j, Y" display_image="0" display_description="0" display_read_more="0" read_more_label="Read more" limit="2" paginate="1" paginate_label_prev="Previous" paginate_label_next="Next"]'
+ expectedShortcodeOutput: '[convertkit_broadcasts display_grid="0" date_format="F j, Y" display_image="0" display_description="0" display_read_more="0" read_more_label="Read more" limit="2" paginate="1" paginate_label_prev="Previous" paginate_label_next="Next"]'
);
// Publish and view the Page on the frontend site.
$I->publishAndViewClassicEditorPage($I);
// Test pagination.
- $I->testBroadcastsPagination($I, 'Previous', 'Next');
+ $I->testBroadcastsPagination(
+ $I,
+ previousLabel: 'Previous',
+ nextLabel: 'Next'
+ );
}
/**
@@ -335,26 +362,33 @@ public function testBroadcastsShortcodeInVisualEditorWithPaginationEnabled(EndTo
public function testBroadcastsShortcodeInVisualEditorWithPaginationLabelParameters(EndToEndTester $I)
{
// Add a Page using the Classic Editor.
- $I->addClassicEditorPage($I, 'page', 'Kit: Page: Broadcasts: Shortcode: Visual Editor: Pagination Labels');
+ $I->addClassicEditorPage(
+ $I,
+ title: 'Kit: Page: Broadcasts: Shortcode: Visual Editor: Pagination Labels'
+ );
// Add shortcode to Page.
$I->addVisualEditorShortcode(
$I,
- 'Kit Broadcasts',
- [
+ shortcodeName: 'Kit Broadcasts',
+ shortcodeConfiguration: [
'limit' => [ 'input', '2', 'Pagination' ], // Click the Pagination tab first before starting to complete fields.
'paginate' => [ 'toggle', 'Yes' ],
'paginate_label_prev' => [ 'input', 'Newer' ],
'paginate_label_next' => [ 'input', 'Older' ],
],
- '[convertkit_broadcasts display_grid="0" date_format="F j, Y" display_image="0" display_description="0" display_read_more="0" read_more_label="Read more" limit="2" paginate="1" paginate_label_prev="Newer" paginate_label_next="Older"]'
+ expectedShortcodeOutput: '[convertkit_broadcasts display_grid="0" date_format="F j, Y" display_image="0" display_description="0" display_read_more="0" read_more_label="Read more" limit="2" paginate="1" paginate_label_prev="Newer" paginate_label_next="Older"]'
);
// Publish and view the Page on the frontend site.
$I->publishAndViewClassicEditorPage($I);
// Test pagination.
- $I->testBroadcastsPagination($I, 'Older', 'Newer');
+ $I->testBroadcastsPagination(
+ $I,
+ previousLabel: 'Older',
+ nextLabel: 'Newer'
+ );
}
/**
@@ -368,26 +402,33 @@ public function testBroadcastsShortcodeInVisualEditorWithPaginationLabelParamete
public function testBroadcastsShortcodeInVisualEditorWithBlankPaginationLabelParameters(EndToEndTester $I)
{
// Add a Page using the Classic Editor.
- $I->addClassicEditorPage($I, 'page', 'Kit: Page: Broadcasts: Shortcode: Visual Editor: Blank Pagination Labels');
+ $I->addClassicEditorPage(
+ $I,
+ title: 'Kit: Page: Broadcasts: Shortcode: Visual Editor: Blank Pagination Labels'
+ );
// Add shortcode to Page.
$I->addVisualEditorShortcode(
$I,
- 'Kit Broadcasts',
- [
+ shortcodeName: 'Kit Broadcasts',
+ shortcodeConfiguration: [
'limit' => [ 'input', '2', 'Pagination' ], // Click the Pagination tab first before starting to complete fields.
'paginate' => [ 'toggle', 'Yes' ],
'paginate_label_prev' => [ 'input', '' ],
'paginate_label_next' => [ 'input', '' ],
],
- '[convertkit_broadcasts display_grid="0" date_format="F j, Y" display_image="0" display_description="0" display_read_more="0" read_more_label="Read more" limit="2" paginate="1"]'
+ expectedShortcodeOutput: '[convertkit_broadcasts display_grid="0" date_format="F j, Y" display_image="0" display_description="0" display_read_more="0" read_more_label="Read more" limit="2" paginate="1"]'
);
// Publish and view the Page on the frontend site.
$I->publishAndViewClassicEditorPage($I);
// Test pagination.
- $I->testBroadcastsPagination($I, 'Previous', 'Next');
+ $I->testBroadcastsPagination(
+ $I,
+ previousLabel: 'Previous',
+ nextLabel: 'Next'
+ );
}
/**
@@ -441,7 +482,11 @@ public function testBroadcastsShortcodeInVisualEditorWithHexColorParameters(EndT
$I->seeInSource('testBroadcastsPagination($I, 'Older', 'Newer');
+ $I->testBroadcastsPagination(
+ $I,
+ previousLabel: 'Older',
+ nextLabel: 'Newer'
+ );
// Confirm that link styles are still applied to refreshed data.
$I->seeInSource('addClassicEditorPage($I, 'page', 'Kit: Page: Broadcasts: Shortcode: Text Editor');
+ $I->addClassicEditorPage(
+ $I,
+ title: 'Kit: Page: Broadcasts: Shortcode: Text Editor'
+ );
// Add shortcode to Page.
$I->addTextEditorShortcode(
$I,
- 'convertkit-broadcasts',
- false,
- '[convertkit_broadcasts display_grid="0" date_format="F j, Y" display_image="0" display_description="0" display_read_more="0" read_more_label="Read more" limit="10" paginate="0" paginate_label_prev="Previous" paginate_label_next="Next"]'
+ shortcodeProgrammaticName: 'convertkit-broadcasts',
+ expectedShortcodeOutput: '[convertkit_broadcasts display_grid="0" date_format="F j, Y" display_image="0" display_description="0" display_read_more="0" read_more_label="Read more" limit="10" paginate="0" paginate_label_prev="Previous" paginate_label_next="Next"]'
);
// Publish and view the Page on the frontend site.
@@ -497,16 +544,19 @@ public function testBroadcastsShortcodeInTextEditorWithDefaultParameters(EndToEn
public function testBroadcastsShortcodeInTextEditorWithDisplayGridParameter(EndToEndTester $I)
{
// Add a Page using the Classic Editor.
- $I->addClassicEditorPage($I, 'page', 'Kit: Page: Broadcasts: Shortcode: Text Editor: Display as Grid');
+ $I->addClassicEditorPage(
+ $I,
+ title: 'Kit: Page: Broadcasts: Shortcode: Text Editor: Display as Grid'
+ );
// Add shortcode to Page.
$I->addTextEditorShortcode(
$I,
- 'convertkit-broadcasts',
- [
+ shortcodeProgrammaticName: 'convertkit-broadcasts',
+ shortcodeConfiguration: [
'display_grid' => [ 'toggle', 'Yes' ],
],
- '[convertkit_broadcasts display_grid="1" date_format="F j, Y" display_image="0" display_description="0" display_read_more="0" read_more_label="Read more" limit="10" paginate="0" paginate_label_prev="Previous" paginate_label_next="Next"]'
+ expectedShortcodeOutput: '[convertkit_broadcasts display_grid="1" date_format="F j, Y" display_image="0" display_description="0" display_read_more="0" read_more_label="Read more" limit="10" paginate="0" paginate_label_prev="Previous" paginate_label_next="Next"]'
);
// Publish and view the Page on the frontend site.
@@ -533,16 +583,19 @@ public function testBroadcastsShortcodeInTextEditorWithDisplayGridParameter(EndT
public function testBroadcastsShortcodeInTextEditorWithDateFormatParameter(EndToEndTester $I)
{
// Add a Page using the Classic Editor.
- $I->addClassicEditorPage($I, 'page', 'Kit: Page: Broadcasts: Shortcode: Text Editor: Date Format');
+ $I->addClassicEditorPage(
+ $I,
+ title: 'Kit: Page: Broadcasts: Shortcode: Text Editor: Date Format'
+ );
// Add shortcode to Page, setting the Form setting to the value specified in the .env file.
$I->addTextEditorShortcode(
$I,
- 'convertkit-broadcasts',
- [
+ shortcodeProgrammaticName: 'convertkit-broadcasts',
+ shortcodeConfiguration: [
'date_format' => [ 'select', date('Y-m-d') ],
],
- '[convertkit_broadcasts display_grid="0" date_format="Y-m-d" display_image="0" display_description="0" display_read_more="0" read_more_label="Read more" limit="10" paginate="0" paginate_label_prev="Previous" paginate_label_next="Next"]'
+ expectedShortcodeOutput: '[convertkit_broadcasts display_grid="0" date_format="Y-m-d" display_image="0" display_description="0" display_read_more="0" read_more_label="Read more" limit="10" paginate="0" paginate_label_prev="Previous" paginate_label_next="Next"]'
);
// Publish and view the Page on the frontend site.
@@ -571,16 +624,19 @@ public function testBroadcastsShortcodeInTextEditorWithDateFormatParameter(EndTo
public function testBroadcastsShortcodeInTextEditorWithDisplayImageParameter(EndToEndTester $I)
{
// Add a Page using the Classic Editor.
- $I->addClassicEditorPage($I, 'page', 'Kit: Page: Broadcasts: Shortcode: Text Editor: Display image');
+ $I->addClassicEditorPage(
+ $I,
+ title: 'Kit: Page: Broadcasts: Shortcode: Text Editor: Display image'
+ );
// Add shortcode to Page.
$I->addTextEditorShortcode(
$I,
- 'convertkit-broadcasts',
- [
+ shortcodeProgrammaticName: 'convertkit-broadcasts',
+ shortcodeConfiguration: [
'display_image' => [ 'toggle', 'Yes' ],
],
- '[convertkit_broadcasts display_grid="0" date_format="F j, Y" display_image="1" display_description="0" display_read_more="0" read_more_label="Read more" limit="10" paginate="0" paginate_label_prev="Previous" paginate_label_next="Next"]'
+ expectedShortcodeOutput: '[convertkit_broadcasts display_grid="0" date_format="F j, Y" display_image="1" display_description="0" display_read_more="0" read_more_label="Read more" limit="10" paginate="0" paginate_label_prev="Previous" paginate_label_next="Next"]'
);
// Publish and view the Page on the frontend site.
@@ -607,16 +663,19 @@ public function testBroadcastsShortcodeInTextEditorWithDisplayImageParameter(End
public function testBroadcastsShortcodeInTextEditorWithDisplayDescriptionParameter(EndToEndTester $I)
{
// Add a Page using the Classic Editor.
- $I->addClassicEditorPage($I, 'page', 'Kit: Page: Broadcasts: Shortcode: Text Editor: Display description');
+ $I->addClassicEditorPage(
+ $I,
+ title: 'Kit: Page: Broadcasts: Shortcode: Text Editor: Display description'
+ );
// Add shortcode to Page.
$I->addTextEditorShortcode(
$I,
- 'convertkit-broadcasts',
- [
+ shortcodeProgrammaticName: 'convertkit-broadcasts',
+ shortcodeConfiguration: [
'display_description' => [ 'toggle', 'Yes' ],
],
- '[convertkit_broadcasts display_grid="0" date_format="F j, Y" display_image="0" display_description="1" display_read_more="0" read_more_label="Read more" limit="10" paginate="0" paginate_label_prev="Previous" paginate_label_next="Next"]'
+ expectedShortcodeOutput: '[convertkit_broadcasts display_grid="0" date_format="F j, Y" display_image="0" display_description="1" display_read_more="0" read_more_label="Read more" limit="10" paginate="0" paginate_label_prev="Previous" paginate_label_next="Next"]'
);
// Publish and view the Page on the frontend site.
@@ -643,17 +702,20 @@ public function testBroadcastsShortcodeInTextEditorWithDisplayDescriptionParamet
public function testBroadcastsShortcodeInTextEditorWithDisplayReadMoreLinkParameter(EndToEndTester $I)
{
// Add a Page using the Classic Editor.
- $I->addClassicEditorPage($I, 'page', 'Kit: Page: Broadcasts: Shortcode: Text Editor: Display read more link');
+ $I->addClassicEditorPage(
+ $I,
+ title: 'Kit: Page: Broadcasts: Shortcode: Text Editor: Display read more link'
+ );
// Add shortcode to Page.
$I->addTextEditorShortcode(
$I,
- 'convertkit-broadcasts',
- [
+ shortcodeProgrammaticName: 'convertkit-broadcasts',
+ shortcodeConfiguration: [
'display_read_more' => [ 'toggle', 'Yes' ],
'read_more_label' => [ 'input', 'Continue reading' ],
],
- '[convertkit_broadcasts display_grid="0" date_format="F j, Y" display_image="0" display_description="0" display_read_more="1" read_more_label="Continue reading" limit="10" paginate="0" paginate_label_prev="Previous" paginate_label_next="Next"]'
+ expectedShortcodeOutput: '[convertkit_broadcasts display_grid="0" date_format="F j, Y" display_image="0" display_description="0" display_read_more="1" read_more_label="Continue reading" limit="10" paginate="0" paginate_label_prev="Previous" paginate_label_next="Next"]'
);
// Publish and view the Page on the frontend site.
@@ -680,16 +742,19 @@ public function testBroadcastsShortcodeInTextEditorWithDisplayReadMoreLinkParame
public function testBroadcastsShortcodeInTextEditorWithLimitParameter(EndToEndTester $I)
{
// Add a Page using the Classic Editor.
- $I->addClassicEditorPage($I, 'page', 'Kit: Page: Broadcasts: Shortcode: Text Editor: Limit');
+ $I->addClassicEditorPage(
+ $I,
+ title: 'Kit: Page: Broadcasts: Shortcode: Text Editor: Limit'
+ );
// Add shortcode to Page, setting the Form setting to the value specified in the .env file.
$I->addTextEditorShortcode(
$I,
- 'convertkit-broadcasts',
- [
+ shortcodeProgrammaticName: 'convertkit-broadcasts',
+ shortcodeConfiguration: [
'limit' => [ 'input', '2', 'Pagination' ], // Click the Pagination tab first before starting to complete fields.
],
- '[convertkit_broadcasts display_grid="0" date_format="F j, Y" display_image="0" display_description="0" display_read_more="0" read_more_label="Read more" limit="2" paginate="0" paginate_label_prev="Previous" paginate_label_next="Next"]'
+ expectedShortcodeOutput: '[convertkit_broadcasts display_grid="0" date_format="F j, Y" display_image="0" display_description="0" display_read_more="0" read_more_label="Read more" limit="2" paginate="0" paginate_label_prev="Previous" paginate_label_next="Next"]'
);
// Publish and view the Page on the frontend site.
@@ -718,24 +783,31 @@ public function testBroadcastsShortcodeInTextEditorWithLimitParameter(EndToEndTe
public function testBroadcastsShortcodeInTextEditorWithPaginationEnabled(EndToEndTester $I)
{
// Add a Page using the Classic Editor.
- $I->addClassicEditorPage($I, 'page', 'Kit: Page: Broadcasts: Shortcode: Text Editor: Pagination');
+ $I->addClassicEditorPage(
+ $I,
+ title: 'Kit: Page: Broadcasts: Shortcode: Text Editor: Pagination'
+ );
// Add shortcode to Page, setting the Form setting to the value specified in the .env file.
$I->addTextEditorShortcode(
$I,
- 'convertkit-broadcasts',
- [
+ shortcodeProgrammaticName: 'convertkit-broadcasts',
+ shortcodeConfiguration: [
'limit' => [ 'input', '2', 'Pagination' ], // Click the Pagination tab first before starting to complete fields.
'paginate' => [ 'toggle', 'Yes' ],
],
- '[convertkit_broadcasts display_grid="0" date_format="F j, Y" display_image="0" display_description="0" display_read_more="0" read_more_label="Read more" limit="2" paginate="1" paginate_label_prev="Previous" paginate_label_next="Next"]'
+ expectedShortcodeOutput: '[convertkit_broadcasts display_grid="0" date_format="F j, Y" display_image="0" display_description="0" display_read_more="0" read_more_label="Read more" limit="2" paginate="1" paginate_label_prev="Previous" paginate_label_next="Next"]'
);
// Publish and view the Page on the frontend site.
$I->publishAndViewClassicEditorPage($I);
// Test pagination.
- $I->testBroadcastsPagination($I, 'Previous', 'Next');
+ $I->testBroadcastsPagination(
+ $I,
+ previousLabel: 'Previous',
+ nextLabel: 'Next'
+ );
}
/**
@@ -749,26 +821,33 @@ public function testBroadcastsShortcodeInTextEditorWithPaginationEnabled(EndToEn
public function testBroadcastsShortcodeInTextEditorWithPaginationLabelParameters(EndToEndTester $I)
{
// Add a Page using the Classic Editor.
- $I->addClassicEditorPage($I, 'page', 'Kit: Page: Broadcasts: Shortcode: Text Editor: Pagination Labels');
+ $I->addClassicEditorPage(
+ $I,
+ title: 'Kit: Page: Broadcasts: Shortcode: Text Editor: Pagination Labels'
+ );
// Add shortcode to Page, setting the Form setting to the value specified in the .env file.
$I->addTextEditorShortcode(
$I,
- 'convertkit-broadcasts',
- [
+ shortcodeProgrammaticName: 'convertkit-broadcasts',
+ shortcodeConfiguration: [
'limit' => [ 'input', '2', 'Pagination' ], // Click the Pagination tab first before starting to complete fields.
'paginate' => [ 'toggle', 'Yes' ],
'paginate_label_prev' => [ 'input', 'Newer' ],
'paginate_label_next' => [ 'input', 'Older' ],
],
- '[convertkit_broadcasts display_grid="0" date_format="F j, Y" display_image="0" display_description="0" display_read_more="0" read_more_label="Read more" limit="2" paginate="1" paginate_label_prev="Newer" paginate_label_next="Older"]'
+ expectedShortcodeOutput: '[convertkit_broadcasts display_grid="0" date_format="F j, Y" display_image="0" display_description="0" display_read_more="0" read_more_label="Read more" limit="2" paginate="1" paginate_label_prev="Newer" paginate_label_next="Older"]'
);
// Publish and view the Page on the frontend site.
$I->publishAndViewClassicEditorPage($I);
// Test pagination.
- $I->testBroadcastsPagination($I, 'Older', 'Newer');
+ $I->testBroadcastsPagination(
+ $I,
+ previousLabel: 'Older',
+ nextLabel: 'Newer'
+ );
}
/**
@@ -782,7 +861,10 @@ public function testBroadcastsShortcodeInTextEditorWithPaginationLabelParameters
public function testBroadcastsShortcodeWhenSwitchingEditors(EndToEndTester $I)
{
// Add a Page using the Classic Editor.
- $I->addClassicEditorPage($I, 'page', 'Kit: Page: Broadcasts: Shortcode: Editor Switching');
+ $I->addClassicEditorPage(
+ $I,
+ title: 'Kit: Page: Broadcasts: Shortcode: Editor Switching'
+ );
// Open Text Editor modal.
$I->openTextEditorShortcodeModal($I, 'convertkit-broadcasts', 'content');
@@ -794,12 +876,12 @@ public function testBroadcastsShortcodeWhenSwitchingEditors(EndToEndTester $I)
// still works, inserting the shortcode into the Visual Editor.
$I->addVisualEditorShortcode(
$I,
- 'Kit Broadcasts',
- [
+ shortcodeName: 'Kit Broadcasts',
+ shortcodeConfiguration: [
'limit' => [ 'input', '2', 'Pagination' ], // Click the Pagination tab first before starting to complete fields.
'paginate' => [ 'toggle', 'Yes' ],
],
- '[convertkit_broadcasts display_grid="0" date_format="F j, Y" display_image="0" display_description="0" display_read_more="0" read_more_label="Read more" limit="2" paginate="1" paginate_label_prev="Previous" paginate_label_next="Next"]'
+ expectedShortcodeOutput: '[convertkit_broadcasts display_grid="0" date_format="F j, Y" display_image="0" display_description="0" display_read_more="0" read_more_label="Read more" limit="2" paginate="1" paginate_label_prev="Previous" paginate_label_next="Next"]'
);
// Publish and view the Page on the frontend site.
@@ -838,7 +920,11 @@ public function testBroadcastsShortcodeParameterEscaping(EndToEndTester $I)
$I->dontSeeInSource('style="color:red" onmouseover="alert(1)""');
// Test pagination.
- $I->testBroadcastsPagination($I, 'Previous', 'Next');
+ $I->testBroadcastsPagination(
+ $I,
+ previousLabel: 'Previous',
+ nextLabel: 'Next'
+ );
// Confirm that the output is still escaped.
$I->seeInSource('style="color:red" onmouseover="alert(1)""');
diff --git a/tests/EndToEnd/broadcasts/blocks-shortcodes/WidgetBroadcastsCest.php b/tests/EndToEnd/broadcasts/blocks-shortcodes/WidgetBroadcastsCest.php
index 6a5d132d8..f7edb8a86 100644
--- a/tests/EndToEnd/broadcasts/blocks-shortcodes/WidgetBroadcastsCest.php
+++ b/tests/EndToEnd/broadcasts/blocks-shortcodes/WidgetBroadcastsCest.php
@@ -52,7 +52,11 @@ public function _before(EndToEndTester $I)
public function testBroadcastsBlockWidgetWithDefaultParameters(EndToEndTester $I)
{
// Add block widget.
- $I->addBlockWidget($I, 'Kit Broadcasts', 'convertkit-broadcasts');
+ $I->addBlockWidget(
+ $I,
+ blockName: 'Kit Broadcasts',
+ blockProgrammaticName: 'convertkit-broadcasts'
+ );
// View the home page.
$I->amOnPage('/');
@@ -79,9 +83,9 @@ public function testBroadcastsBlockWidgetWithDateFormatParameter(EndToEndTester
// Add block widget.
$I->addBlockWidget(
$I,
- 'Kit Broadcasts',
- 'convertkit-broadcasts',
- [
+ blockName: 'Kit Broadcasts',
+ blockProgrammaticName: 'convertkit-broadcasts',
+ blockConfiguration: [
'date_format' => [ 'select', 'Y-m-d' ],
]
);
@@ -111,9 +115,9 @@ public function testBroadcastsBlockWidgetWithLimitParameter(EndToEndTester $I)
// Add block widget.
$I->addBlockWidget(
$I,
- 'Kit Broadcasts',
- 'convertkit-broadcasts',
- [
+ blockName: 'Kit Broadcasts',
+ blockProgrammaticName: 'convertkit-broadcasts',
+ blockConfiguration: [
'limit' => [ 'input', '2', 'Pagination' ], // Click the Pagination tab first before starting to complete fields.
]
);
@@ -140,9 +144,9 @@ public function testBroadcastsBlockWidgetWithPaginationEnabled(EndToEndTester $I
// Add block widget.
$I->addBlockWidget(
$I,
- 'Kit Broadcasts',
- 'convertkit-broadcasts',
- [
+ blockName: 'Kit Broadcasts',
+ blockProgrammaticName: 'convertkit-broadcasts',
+ blockConfiguration: [
'#inspector-toggle-control-4' => [ 'toggle', true, 'Pagination' ], // Click the Pagination tab first before starting to complete fields.
'limit' => [ 'input', '2' ],
]
@@ -167,9 +171,9 @@ public function testBroadcastsBlockWithPaginationLabelParameters(EndToEndTester
// Add block widget.
$I->addBlockWidget(
$I,
- 'Kit Broadcasts',
- 'convertkit-broadcasts',
- [
+ blockName: 'Kit Broadcasts',
+ blockProgrammaticName: 'convertkit-broadcasts',
+ blockConfiguration: [
'#inspector-toggle-control-4' => [ 'toggle', true, 'Pagination' ], // Click the Pagination tab first before starting to complete fields.
'limit' => [ 'input', '2' ],
'paginate_label_prev' => [ 'input', 'Newer' ],
@@ -181,7 +185,11 @@ public function testBroadcastsBlockWithPaginationLabelParameters(EndToEndTester
$I->amOnPage('/');
// Test pagination.
- $I->testBroadcastsPagination($I, 'Older', 'Newer');
+ $I->testBroadcastsPagination(
+ $I,
+ previousLabel: 'Older',
+ nextLabel: 'Newer'
+ );
}
/**
@@ -196,9 +204,9 @@ public function testBroadcastsBlockWithBlankPaginationLabelParameters(EndToEndTe
// Add block widget.
$I->addBlockWidget(
$I,
- 'Kit Broadcasts',
- 'convertkit-broadcasts',
- [
+ blockName: 'Kit Broadcasts',
+ blockProgrammaticName: 'convertkit-broadcasts',
+ blockConfiguration: [
'#inspector-toggle-control-4' => [ 'toggle', true, 'Pagination' ], // Click the Pagination tab first before starting to complete fields.
'limit' => [ 'input', '2' ],
'paginate_label_prev' => [ 'input', '' ],
@@ -210,7 +218,11 @@ public function testBroadcastsBlockWithBlankPaginationLabelParameters(EndToEndTe
$I->amOnPage('/');
// Test pagination.
- $I->testBroadcastsPagination($I, 'Previous', 'Next');
+ $I->testBroadcastsPagination(
+ $I,
+ previousLabel: 'Previous',
+ nextLabel: 'Next'
+ );
}
/**
diff --git a/tests/EndToEnd/broadcasts/import-export/BroadcastsExportPostCest.php b/tests/EndToEnd/broadcasts/import-export/BroadcastsExportPostCest.php
index 847d15321..a276f5f2e 100644
--- a/tests/EndToEnd/broadcasts/import-export/BroadcastsExportPostCest.php
+++ b/tests/EndToEnd/broadcasts/import-export/BroadcastsExportPostCest.php
@@ -37,7 +37,11 @@ public function _before(EndToEndTester $I)
public function testCreateBroadcastNotDisplayedWhenDisabledInPlugin(EndToEndTester $I)
{
// Add a Post using the Gutenberg editor.
- $I->addGutenbergPage($I, 'post', 'Kit: Post: Broadcast: Export: Disabled in Plugin');
+ $I->addGutenbergPage(
+ $I,
+ postType: 'post',
+ title: 'Kit: Post: Broadcast: Export: Disabled in Plugin'
+ );
// Click the Publish button.
$I->click('.editor-post-publish-button__button');
@@ -71,7 +75,11 @@ public function testCreateBroadcastNotDisplayedOnPages(EndToEndTester $I)
);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Broadcast: Export: Disabled in Plugin');
+ $I->addGutenbergPage(
+ $I,
+ postType: 'page',
+ title: 'Kit: Page: Broadcast: Export: Disabled in Plugin'
+ );
// Click the Publish button.
$I->click('.editor-post-publish-button__button');
@@ -106,7 +114,11 @@ public function testCreateBroadcastWhenDisabledInPost(EndToEndTester $I)
);
// Add a Post using the Gutenberg editor.
- $I->addGutenbergPage($I, 'post', 'Kit: Post: Broadcast: Export: Disabled in Post');
+ $I->addGutenbergPage(
+ $I,
+ postType: 'post',
+ title: 'Kit: Post: Broadcast: Export: Disabled in Post'
+ );
// Publish Post.
$I->publishGutenbergPage($I);
@@ -143,7 +155,11 @@ public function testCreateBroadcastWhenEnabledInPost(EndToEndTester $I)
);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'post', 'Kit: Page: Broadcast: Export: Enabled in Post');
+ $I->addGutenbergPage(
+ $I,
+ postType: 'post',
+ title: 'Kit: Page: Broadcast: Export: Enabled in Post'
+ );
// Click the Publish button.
$I->click('.editor-post-publish-button__button');
diff --git a/tests/EndToEnd/broadcasts/import-export/BroadcastsExportPostClassicEditorCest.php b/tests/EndToEnd/broadcasts/import-export/BroadcastsExportPostClassicEditorCest.php
index 4b1da1db9..b7f31764b 100644
--- a/tests/EndToEnd/broadcasts/import-export/BroadcastsExportPostClassicEditorCest.php
+++ b/tests/EndToEnd/broadcasts/import-export/BroadcastsExportPostClassicEditorCest.php
@@ -92,7 +92,11 @@ public function testCreateBroadcastNotDisplayedWhenPostPreviouslyPublished(EndTo
);
// Create a Post.
- $I->addClassicEditorPage($I, 'post', 'Kit: Broadcasts: Export: Previously published');
+ $I->addClassicEditorPage(
+ $I,
+ postType: 'post',
+ title: 'Kit: Broadcasts: Export: Previously published'
+ );
// Scroll to Publish meta box, so its buttons are not hidden.
$I->scrollTo('#submitdiv');
@@ -127,7 +131,11 @@ public function testCreateBroadcastWhenDisabledInPost(EndToEndTester $I)
);
// Create a Post.
- $I->addClassicEditorPage($I, 'post', 'Kit: Broadcasts: Export: Disabled in Post');
+ $I->addClassicEditorPage(
+ $I,
+ postType: 'post',
+ title: 'Kit: Broadcasts: Export: Disabled in Post'
+ );
// Scroll to Publish meta box, so its buttons are not hidden.
$I->scrollTo('#submitdiv');
@@ -170,7 +178,11 @@ public function testCreateBroadcastWhenEnabledInPost(EndToEndTester $I)
);
// Create a Post.
- $I->addClassicEditorPage($I, 'post', 'Kit: Broadcasts: Export: Enabled in Post');
+ $I->addClassicEditorPage(
+ $I,
+ postType: 'post',
+ title: 'Kit: Broadcasts: Export: Enabled in Post'
+ );
// Enable the Create Broadcast option.
$I->checkOption('#convertkit_action_broadcast_export');
diff --git a/tests/EndToEnd/forms/blocks-shortcodes/PageBlockFormCest.php b/tests/EndToEnd/forms/blocks-shortcodes/PageBlockFormCest.php
index 4f4c51599..639ac253e 100644
--- a/tests/EndToEnd/forms/blocks-shortcodes/PageBlockFormCest.php
+++ b/tests/EndToEnd/forms/blocks-shortcodes/PageBlockFormCest.php
@@ -37,7 +37,10 @@ public function testFormBlockWithValidFormParameter(EndToEndTester $I)
$I->setupKitPluginResources($I);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Form: Block: Valid Form Param');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Form: Block: Valid Form Param'
+ );
// Configure metabox's Form setting = None, ensuring we only test the block in Gutenberg.
$I->configureMetaboxSettings(
@@ -51,9 +54,9 @@ public function testFormBlockWithValidFormParameter(EndToEndTester $I)
// Add block to Page, setting the Form setting to the value specified in the .env file.
$I->addGutenbergBlock(
$I,
- 'Kit Form',
- 'convertkit-form',
- [
+ blockName: 'Kit Form',
+ blockProgrammaticName: 'convertkit-form',
+ blockConfiguration: [
'form' => [ 'select', $_ENV['CONVERTKIT_API_FORM_NAME'] ],
]
);
@@ -89,7 +92,10 @@ public function testFormBlockWithValidLegacyFormParameter(EndToEndTester $I)
$I->setupKitPluginResources($I);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Legacy Form: Block: Valid Form Param');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Legacy Form: Block: Valid Form Param'
+ );
// Configure metabox's Form setting = None, ensuring we only test the block in Gutenberg.
$I->configureMetaboxSettings(
@@ -103,9 +109,9 @@ public function testFormBlockWithValidLegacyFormParameter(EndToEndTester $I)
// Add block to Page, setting the Form setting to the value specified in the .env file.
$I->addGutenbergBlock(
$I,
- 'Kit Form',
- 'convertkit-form',
- [
+ blockName: 'Kit Form',
+ blockProgrammaticName: 'convertkit-form',
+ blockConfiguration: [
'form' => [ 'select', $_ENV['CONVERTKIT_API_LEGACY_FORM_NAME'] ],
]
);
@@ -132,7 +138,10 @@ public function testFormBlockWithValidModalFormParameter(EndToEndTester $I)
$I->setupKitPluginResources($I);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Form: Block: Valid Modal Form Param');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Form: Block: Valid Modal Form Param'
+ );
// Configure metabox's Form setting = None, ensuring we only test the block in Gutenberg.
$I->configureMetaboxSettings(
@@ -146,9 +155,9 @@ public function testFormBlockWithValidModalFormParameter(EndToEndTester $I)
// Add block to Page, setting the Form setting to the value specified in the .env file.
$I->addGutenbergBlock(
$I,
- 'Kit Form',
- 'convertkit-form',
- [
+ blockName: 'Kit Form',
+ blockProgrammaticName: 'convertkit-form',
+ blockConfiguration: [
'form' => [ 'select', $_ENV['CONVERTKIT_API_FORM_FORMAT_MODAL_NAME'] ],
]
);
@@ -180,7 +189,10 @@ public function testFormBlocksWithValidModalFormParameter(EndToEndTester $I)
$I->setupKitPluginResources($I);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Form: Block: Valid Modal Form Param');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Form: Block: Valid Modal Form Param'
+ );
// Configure metabox's Form setting = None, ensuring we only test the block in Gutenberg.
$I->configureMetaboxSettings(
@@ -194,9 +206,9 @@ public function testFormBlocksWithValidModalFormParameter(EndToEndTester $I)
// Add block to Page, setting the Form setting to the value specified in the .env file.
$I->addGutenbergBlock(
$I,
- 'Kit Form',
- 'convertkit-form',
- [
+ blockName: 'Kit Form',
+ blockProgrammaticName: 'convertkit-form',
+ blockConfiguration: [
'form' => [ 'select', $_ENV['CONVERTKIT_API_FORM_FORMAT_MODAL_NAME'] ],
]
);
@@ -208,9 +220,9 @@ public function testFormBlocksWithValidModalFormParameter(EndToEndTester $I)
// Add the block a second time for the same form, so we can test that only one script / form is output.
$I->addGutenbergBlock(
$I,
- 'Kit Form',
- 'convertkit-form',
- [
+ blockName: 'Kit Form',
+ blockProgrammaticName: 'convertkit-form',
+ blockConfiguration: [
'form' => [ 'select', $_ENV['CONVERTKIT_API_FORM_FORMAT_MODAL_NAME'] ],
]
);
@@ -238,7 +250,10 @@ public function testFormBlockWithValidSlideInFormParameter(EndToEndTester $I)
$I->setupKitPluginResources($I);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Form: Block: Valid Slide In Form Param');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Form: Block: Valid Slide In Form Param'
+ );
// Configure metabox's Form setting = None, ensuring we only test the block in Gutenberg.
$I->configureMetaboxSettings(
@@ -252,9 +267,9 @@ public function testFormBlockWithValidSlideInFormParameter(EndToEndTester $I)
// Add block to Page, setting the Form setting to the value specified in the .env file.
$I->addGutenbergBlock(
$I,
- 'Kit Form',
- 'convertkit-form',
- [
+ blockName: 'Kit Form',
+ blockProgrammaticName: 'convertkit-form',
+ blockConfiguration: [
'form' => [ 'select', $_ENV['CONVERTKIT_API_FORM_FORMAT_SLIDE_IN_NAME'] ],
]
);
@@ -286,7 +301,10 @@ public function testFormBlocksWithValidSlideInFormParameter(EndToEndTester $I)
$I->setupKitPluginResources($I);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Form: Block: Valid Slide In Form Param');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Form: Block: Valid Slide In Form Param'
+ );
// Configure metabox's Form setting = None, ensuring we only test the block in Gutenberg.
$I->configureMetaboxSettings(
@@ -300,9 +318,9 @@ public function testFormBlocksWithValidSlideInFormParameter(EndToEndTester $I)
// Add block to Page, setting the Form setting to the value specified in the .env file.
$I->addGutenbergBlock(
$I,
- 'Kit Form',
- 'convertkit-form',
- [
+ blockName: 'Kit Form',
+ blockProgrammaticName: 'convertkit-form',
+ blockConfiguration: [
'form' => [ 'select', $_ENV['CONVERTKIT_API_FORM_FORMAT_SLIDE_IN_NAME'] ],
]
);
@@ -314,9 +332,9 @@ public function testFormBlocksWithValidSlideInFormParameter(EndToEndTester $I)
// Add the block a second time for the same form, so we can test that only one script / form is output.
$I->addGutenbergBlock(
$I,
- 'Kit Form',
- 'convertkit-form',
- [
+ blockName: 'Kit Form',
+ blockProgrammaticName: 'convertkit-form',
+ blockConfiguration: [
'form' => [ 'select', $_ENV['CONVERTKIT_API_FORM_FORMAT_SLIDE_IN_NAME'] ],
]
);
@@ -344,7 +362,10 @@ public function testFormBlockWithValidStickyBarFormParameter(EndToEndTester $I)
$I->setupKitPluginResources($I);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Form: Block: Valid Sticky Bar Form Param');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Form: Block: Valid Sticky Bar Form Param'
+ );
// Configure metabox's Form setting = None, ensuring we only test the block in Gutenberg.
$I->configureMetaboxSettings(
@@ -358,9 +379,9 @@ public function testFormBlockWithValidStickyBarFormParameter(EndToEndTester $I)
// Add block to Page, setting the Form setting to the value specified in the .env file.
$I->addGutenbergBlock(
$I,
- 'Kit Form',
- 'convertkit-form',
- [
+ blockName: 'Kit Form',
+ blockProgrammaticName: 'convertkit-form',
+ blockConfiguration: [
'form' => [ 'select', $_ENV['CONVERTKIT_API_FORM_FORMAT_STICKY_BAR_NAME'] ],
]
);
@@ -392,7 +413,10 @@ public function testFormBlocksWithValidStickyBarFormParameter(EndToEndTester $I)
$I->setupKitPluginResources($I);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Form: Block: Valid Sticky Bar Form Param');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Form: Block: Valid Sticky Bar Form Param'
+ );
// Configure metabox's Form setting = None, ensuring we only test the block in Gutenberg.
$I->configureMetaboxSettings(
@@ -406,9 +430,9 @@ public function testFormBlocksWithValidStickyBarFormParameter(EndToEndTester $I)
// Add block to Page, setting the Form setting to the value specified in the .env file.
$I->addGutenbergBlock(
$I,
- 'Kit Form',
- 'convertkit-form',
- [
+ blockName: 'Kit Form',
+ blockProgrammaticName: 'convertkit-form',
+ blockConfiguration: [
'form' => [ 'select', $_ENV['CONVERTKIT_API_FORM_FORMAT_STICKY_BAR_NAME'] ],
]
);
@@ -420,9 +444,9 @@ public function testFormBlocksWithValidStickyBarFormParameter(EndToEndTester $I)
// Add the block a second time for the same form, so we can test that only one script / form is output.
$I->addGutenbergBlock(
$I,
- 'Kit Form',
- 'convertkit-form',
- [
+ blockName: 'Kit Form',
+ blockProgrammaticName: 'convertkit-form',
+ blockConfiguration: [
'form' => [ 'select', $_ENV['CONVERTKIT_API_FORM_FORMAT_STICKY_BAR_NAME'] ],
]
);
@@ -449,7 +473,10 @@ public function testFormBlockWithNoFormParameter(EndToEndTester $I)
$I->setupKitPluginResources($I);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Form: Block: Valid Sticky Bar Form Param');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Form: Block: No Form Param'
+ );
// Configure metabox's Form setting = None, ensuring we only test the block in Gutenberg.
$I->configureMetaboxSettings(
@@ -461,7 +488,11 @@ public function testFormBlockWithNoFormParameter(EndToEndTester $I)
);
// Add block to Page.
- $I->addGutenbergBlock($I, 'Kit Form', 'convertkit-form');
+ $I->addGutenbergBlock(
+ $I,
+ blockName: 'Kit Form',
+ blockProgrammaticName: 'convertkit-form'
+ );
// Confirm that the Form block displays instructions to the user on how to select a Form.
$I->seeBlockHasNoContentMessage($I, 'Select a Form using the Form option in the Gutenberg sidebar.');
@@ -485,16 +516,23 @@ public function testFormBlockWithNoFormParameter(EndToEndTester $I)
public function testFormBlockWhenNoCredentials(EndToEndTester $I)
{
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Form: Block: No Credentials');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Form: Block: No Credentials'
+ );
// Add block to Page.
- $I->addGutenbergBlock($I, 'Kit Form', 'convertkit-form');
+ $I->addGutenbergBlock(
+ $I,
+ blockName: 'Kit Form',
+ blockProgrammaticName: 'convertkit-form'
+ );
// Test that the popup window works.
$I->testBlockNoCredentialsPopupWindow(
$I,
- 'convertkit-form',
- 'Select a Form using the Form option in the Gutenberg sidebar.'
+ blockName: 'convertkit-form',
+ expectedMessage: 'Select a Form using the Form option in the Gutenberg sidebar.'
);
// Save page to avoid alert box when _passed() runs to deactivate the Plugin.
@@ -516,10 +554,17 @@ public function testFormBlockWhenNoForms(EndToEndTester $I)
$I->setupKitPluginResourcesNoData($I);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Form: Block: No Forms');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Form: Block: No Forms'
+ );
// Add block to Page.
- $I->addGutenbergBlock($I, 'Kit Form', 'convertkit-form');
+ $I->addGutenbergBlock(
+ $I,
+ blockName: 'Kit Form',
+ blockProgrammaticName: 'convertkit-form'
+ );
// Confirm that the Form block displays instructions to the user on how to add a Form in Kit.
$I->seeBlockHasNoContentMessage($I, 'No forms exist in Kit.');
@@ -545,10 +590,17 @@ public function testFormBlockRefreshButton(EndToEndTester $I)
$I->setupKitPluginResourcesNoData($I);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Forms: Refresh Button');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Forms: Refresh Button'
+ );
// Add block to Page.
- $I->addGutenbergBlock($I, 'Kit Form', 'convertkit-form');
+ $I->addGutenbergBlock(
+ $I,
+ blockName: 'Kit Form',
+ blockProgrammaticName: 'convertkit-form'
+ );
// Setup Plugin with a valid API Key and resources, as if the user performed the necessary steps to authenticate
// and create a form.
@@ -583,7 +635,10 @@ public function testFormBlockWithAutoptimizePlugin(EndToEndTester $I)
$I->activateThirdPartyPlugin($I, 'autoptimize');
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Form: Block: Autoptimize');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Form: Block: Autoptimize'
+ );
// Configure metabox's Form setting = None, ensuring we only test the block in Gutenberg.
$I->configureMetaboxSettings(
@@ -597,9 +652,9 @@ public function testFormBlockWithAutoptimizePlugin(EndToEndTester $I)
// Add block to Page, setting the Form setting to the value specified in the .env file.
$I->addGutenbergBlock(
$I,
- 'Kit Form',
- 'convertkit-form',
- [
+ blockName: 'Kit Form',
+ blockProgrammaticName: 'convertkit-form',
+ blockConfiguration: [
'form' => [ 'select', $_ENV['CONVERTKIT_API_FORM_NAME'] ],
]
);
@@ -639,7 +694,10 @@ public function testFormBlockWithJetpackBoostPlugin(EndToEndTester $I)
$I->click('#inspector-toggle-control-1');
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Form: Block: Jetpack Boost');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Form: Block: Jetpack Boost'
+ );
// Configure metabox's Form setting = None, ensuring we only test the block in Gutenberg.
$I->configureMetaboxSettings(
@@ -653,9 +711,9 @@ public function testFormBlockWithJetpackBoostPlugin(EndToEndTester $I)
// Add block to Page, setting the Form setting to the value specified in the .env file.
$I->addGutenbergBlock(
$I,
- 'Kit Form',
- 'convertkit-form',
- [
+ blockName: 'Kit Form',
+ blockProgrammaticName: 'convertkit-form',
+ blockConfiguration: [
'form' => [ 'select', $_ENV['CONVERTKIT_API_FORM_NAME'] ],
]
);
@@ -694,7 +752,10 @@ public function testFormBlockWithSitegroundSpeedOptimizerPlugin(EndToEndTester $
$I->haveOptionInDatabase('siteground_optimizer_combine_javascript', '1');
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Form: Block: Siteground Speed Optimizer');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Form: Block: Siteground Speed Optimizer'
+ );
// Configure metabox's Form setting = None, ensuring we only test the block in Gutenberg.
$I->configureMetaboxSettings(
@@ -708,9 +769,9 @@ public function testFormBlockWithSitegroundSpeedOptimizerPlugin(EndToEndTester $
// Add block to Page, setting the Form setting to the value specified in the .env file.
$I->addGutenbergBlock(
$I,
- 'Kit Form',
- 'convertkit-form',
- [
+ blockName: 'Kit Form',
+ blockProgrammaticName: 'convertkit-form',
+ blockConfiguration: [
'form' => [ 'select', $_ENV['CONVERTKIT_API_FORM_NAME'] ],
]
);
@@ -748,7 +809,10 @@ public function testFormBlockWithLiteSpeedCachePlugin(EndToEndTester $I)
$I->enableLiteSpeedCacheLoadJSDeferred($I);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Form: Block: LiteSpeed Cache');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Form: Block: LiteSpeed Cache'
+ );
// Configure metabox's Form setting = None, ensuring we only test the block in Gutenberg.
$I->configureMetaboxSettings(
@@ -762,9 +826,9 @@ public function testFormBlockWithLiteSpeedCachePlugin(EndToEndTester $I)
// Add block to Page, setting the Form setting to the value specified in the .env file.
$I->addGutenbergBlock(
$I,
- 'Kit Form',
- 'convertkit-form',
- [
+ blockName: 'Kit Form',
+ blockProgrammaticName: 'convertkit-form',
+ blockConfiguration: [
'form' => [ 'select', $_ENV['CONVERTKIT_API_FORM_NAME'] ],
]
);
@@ -811,7 +875,10 @@ public function testFormBlockWithPerfmattersPlugin(EndToEndTester $I)
);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Form: Block: Perfmatters');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Form: Block: Perfmatters'
+ );
// Configure metabox's Form setting = None, ensuring we only test the block in Gutenberg.
$I->configureMetaboxSettings(
@@ -825,9 +892,9 @@ public function testFormBlockWithPerfmattersPlugin(EndToEndTester $I)
// Add block to Page, setting the Form setting to the value specified in the .env file.
$I->addGutenbergBlock(
$I,
- 'Kit Form',
- 'convertkit-form',
- [
+ blockName: 'Kit Form',
+ blockProgrammaticName: 'convertkit-form',
+ blockConfiguration: [
'form' => [ 'select', $_ENV['CONVERTKIT_API_FORM_NAME'] ],
]
);
@@ -865,7 +932,10 @@ public function testFormBlockWithWPRocketPluginDelayJS(EndToEndTester $I)
$I->enableWPRocketDelayJS($I);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Form: Block: WP Rocket');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Form: Block: WP Rocket'
+ );
// Configure metabox's Form setting = None, ensuring we only test the block in Gutenberg.
$I->configureMetaboxSettings(
@@ -879,9 +949,9 @@ public function testFormBlockWithWPRocketPluginDelayJS(EndToEndTester $I)
// Add block to Page, setting the Form setting to the value specified in the .env file.
$I->addGutenbergBlock(
$I,
- 'Kit Form',
- 'convertkit-form',
- [
+ blockName: 'Kit Form',
+ blockProgrammaticName: 'convertkit-form',
+ blockConfiguration: [
'form' => [ 'select', $_ENV['CONVERTKIT_API_FORM_NAME'] ],
]
);
@@ -926,7 +996,10 @@ public function testFormBlockWithWPRocketPluginMinifyJS(EndToEndTester $I)
$I->enableWPRocketMinifyConcatenateJSAndCSS($I);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Form: Block: WP Rocket');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Form: Block: WP Rocket'
+ );
// Configure metabox's Form setting = None, ensuring we only test the block in Gutenberg.
$I->configureMetaboxSettings(
@@ -940,9 +1013,9 @@ public function testFormBlockWithWPRocketPluginMinifyJS(EndToEndTester $I)
// Add block to Page, setting the Form setting to the value specified in the .env file.
$I->addGutenbergBlock(
$I,
- 'Kit Form',
- 'convertkit-form',
- [
+ blockName: 'Kit Form',
+ blockProgrammaticName: 'convertkit-form',
+ blockConfiguration: [
'form' => [ 'select', $_ENV['CONVERTKIT_API_FORM_NAME'] ],
]
);
diff --git a/tests/EndToEnd/forms/blocks-shortcodes/PageBlockFormTriggerCest.php b/tests/EndToEnd/forms/blocks-shortcodes/PageBlockFormTriggerCest.php
index a77665fcb..9b94cee1d 100644
--- a/tests/EndToEnd/forms/blocks-shortcodes/PageBlockFormTriggerCest.php
+++ b/tests/EndToEnd/forms/blocks-shortcodes/PageBlockFormTriggerCest.php
@@ -37,7 +37,10 @@ public function testFormTriggerBlockWithValidFormParameter(EndToEndTester $I)
$I->setupKitPluginResources($I);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Form Trigger: Valid Form Param');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Form Trigger: Valid Form Param'
+ );
// Configure metabox's Form setting = None, ensuring we only test the block in Gutenberg.
$I->configureMetaboxSettings(
@@ -51,9 +54,9 @@ public function testFormTriggerBlockWithValidFormParameter(EndToEndTester $I)
// Add block to Page, setting the Form setting to the value specified in the .env file.
$I->addGutenbergBlock(
$I,
- 'Kit Form Trigger',
- 'convertkit-formtrigger',
- [
+ blockName: 'Kit Form Trigger',
+ blockProgrammaticName: 'convertkit-formtrigger',
+ blockConfiguration: [
'form' => [ 'select', $_ENV['CONVERTKIT_API_FORM_FORMAT_MODAL_NAME'] ],
]
);
@@ -79,7 +82,10 @@ public function testFormTriggerBlocksWithValidFormParameter(EndToEndTester $I)
$I->setupKitPluginResources($I);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Form Trigger: Valid Form Param, Multiple Blocks');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Form Trigger: Valid Form Param, Multiple Blocks'
+ );
// Configure metabox's Form setting = None, ensuring we only test the block in Gutenberg.
$I->configureMetaboxSettings(
@@ -93,9 +99,9 @@ public function testFormTriggerBlocksWithValidFormParameter(EndToEndTester $I)
// Add block to Page, setting the Form setting to the value specified in the .env file.
$I->addGutenbergBlock(
$I,
- 'Kit Form Trigger',
- 'convertkit-formtrigger',
- [
+ blockName: 'Kit Form Trigger',
+ blockProgrammaticName: 'convertkit-formtrigger',
+ blockConfiguration: [
'form' => [ 'select', $_ENV['CONVERTKIT_API_FORM_FORMAT_MODAL_NAME'] ],
]
);
@@ -135,7 +141,10 @@ public function testFormTriggerBlockWithNoFormParameter(EndToEndTester $I)
$I->setupKitPluginResources($I);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Form Trigger: No Form Param');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Form Trigger: No Form Param'
+ );
// Configure metabox's Form setting = None, ensuring we only test the block in Gutenberg.
$I->configureMetaboxSettings(
@@ -147,7 +156,11 @@ public function testFormTriggerBlockWithNoFormParameter(EndToEndTester $I)
);
// Add block to Page.
- $I->addGutenbergBlock($I, 'Kit Form Trigger', 'convertkit-formtrigger');
+ $I->addGutenbergBlock(
+ $I,
+ blockName: 'Kit Form Trigger',
+ blockProgrammaticName: 'convertkit-formtrigger'
+ );
// Confirm that the Form block displays instructions to the user on how to select a Form.
$I->seeBlockHasNoContentMessage($I, 'Select a Form using the Form option in the Gutenberg sidebar.');
@@ -173,14 +186,17 @@ public function testFormTriggerBlockWithTextParameter(EndToEndTester $I)
$I->setupKitPluginResources($I);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Form Trigger: Text Param');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Form Trigger: Text Param'
+ );
// Add block to Page, setting the date format.
$I->addGutenbergBlock(
$I,
- 'Kit Form Trigger',
- 'convertkit-formtrigger',
- [
+ blockName: 'Kit Form Trigger',
+ blockProgrammaticName: 'convertkit-formtrigger',
+ blockConfiguration: [
'form' => [ 'select', $_ENV['CONVERTKIT_API_FORM_FORMAT_MODAL_NAME'] ],
'text' => [ 'text', 'Sign up' ],
]
@@ -207,14 +223,17 @@ public function testFormTriggerBlockWithBlankTextParameter(EndToEndTester $I)
$I->setupKitPluginResources($I);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Form Trigger: Blank Text Param');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Form Trigger: Blank Text Param'
+ );
// Add block to Page, setting the date format.
$I->addGutenbergBlock(
$I,
- 'Kit Form Trigger',
- 'convertkit-formtrigger',
- [
+ blockName: 'Kit Form Trigger',
+ blockProgrammaticName: 'convertkit-formtrigger',
+ blockConfiguration: [
'form' => [ 'select', $_ENV['CONVERTKIT_API_FORM_FORMAT_MODAL_NAME'] ],
'text' => [ 'text', '' ],
]
@@ -362,16 +381,23 @@ public function testFormTriggerBlockParameterEscaping(EndToEndTester $I)
public function testFormTriggerBlockWhenNoCredentials(EndToEndTester $I)
{
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Form Trigger: Block: No Credentials');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Form Trigger: Block: No Credentials'
+ );
// Add block to Page.
- $I->addGutenbergBlock($I, 'Kit Form Trigger', 'convertkit-formtrigger');
+ $I->addGutenbergBlock(
+ $I,
+ blockName: 'Kit Form Trigger',
+ blockProgrammaticName: 'convertkit-formtrigger'
+ );
// Test that the popup window works.
$I->testBlockNoCredentialsPopupWindow(
$I,
- 'convertkit-formtrigger',
- 'Select a Form using the Form option in the Gutenberg sidebar.'
+ blockName: 'convertkit-formtrigger',
+ expectedMessage: 'Select a Form using the Form option in the Gutenberg sidebar.'
);
// Save page to avoid alert box when _passed() runs to deactivate the Plugin.
@@ -393,10 +419,17 @@ public function testFormTriggerBlockWhenNoForms(EndToEndTester $I)
$I->setupKitPluginResourcesNoData($I);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Form Trigger: Block: No Forms');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Form Trigger: Block: No Forms'
+ );
// Add block to Page.
- $I->addGutenbergBlock($I, 'Kit Form Trigger', 'convertkit-formtrigger');
+ $I->addGutenbergBlock(
+ $I,
+ blockName: 'Kit Form Trigger',
+ blockProgrammaticName: 'convertkit-formtrigger'
+ );
// Confirm that the Form block displays instructions to the user on how to add a Form in Kit.
$I->seeBlockHasNoContentMessage($I, 'No modal, sticky bar or slide in forms exist in Kit.');
@@ -422,10 +455,17 @@ public function testFormTriggerBlockRefreshButton(EndToEndTester $I)
$I->setupKitPluginResourcesNoData($I);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Form Trigger: Refresh Button');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Form Trigger: Refresh Button'
+ );
// Add block to Page.
- $I->addGutenbergBlock($I, 'Kit Form Trigger', 'convertkit-formtrigger');
+ $I->addGutenbergBlock(
+ $I,
+ blockName: 'Kit Form Trigger',
+ blockProgrammaticName: 'convertkit-formtrigger'
+ );
// Setup Plugin with a valid API Key and resources, as if the user performed the necessary steps to authenticate
// and create a form.
diff --git a/tests/EndToEnd/forms/blocks-shortcodes/PageBlockFormatterFormTriggerCest.php b/tests/EndToEnd/forms/blocks-shortcodes/PageBlockFormatterFormTriggerCest.php
index 0b9ede8fc..f5f57ab9e 100644
--- a/tests/EndToEnd/forms/blocks-shortcodes/PageBlockFormatterFormTriggerCest.php
+++ b/tests/EndToEnd/forms/blocks-shortcodes/PageBlockFormatterFormTriggerCest.php
@@ -37,7 +37,10 @@ public function testFormTriggerFormatterWithModalForm(EndToEndTester $I)
$I->setupKitPluginResources($I);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Form Trigger Formatter: Modal Form');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Form Trigger Formatter: Modal Form'
+ );
// Configure metabox's Form setting = None, ensuring we only test the block in Gutenberg.
$I->configureMetaboxSettings(
@@ -57,9 +60,9 @@ public function testFormTriggerFormatterWithModalForm(EndToEndTester $I)
// Apply formatter to link the selected text.
$I->applyGutenbergFormatter(
$I,
- 'Kit Form Trigger',
- 'convertkit-form-link',
- [
+ formatterName: 'Kit Form Trigger',
+ formatterProgrammaticName: 'convertkit-form-link',
+ formatterConfiguration: [
// Form.
'data-id' => [ 'select', $_ENV['CONVERTKIT_API_FORM_FORMAT_MODAL_NAME'] ],
]
@@ -69,7 +72,11 @@ public function testFormTriggerFormatterWithModalForm(EndToEndTester $I)
$I->publishAndViewGutenbergPage($I);
// Confirm that the link displays and works when clicked.
- $I->seeFormTriggerLinkOutput($I, $_ENV['CONVERTKIT_API_FORM_FORMAT_MODAL_URL'], 'Subscribe');
+ $I->seeFormTriggerLinkOutput(
+ $I,
+ formURL: $_ENV['CONVERTKIT_API_FORM_FORMAT_MODAL_URL'],
+ text: 'Subscribe'
+ );
// Confirm that one Kit Form is output in the DOM.
// This confirms that there is only one script on the page for this form, which renders the form.
@@ -91,7 +98,10 @@ public function testFormTriggerFormatterToggleFormSelection(EndToEndTester $I)
$I->setupKitPluginResources($I);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Form Trigger Formatter: Modal Form Toggle');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Form Trigger Formatter: Modal Form Toggle'
+ );
// Configure metabox's Form setting = None, ensuring we only test the block in Gutenberg.
$I->configureMetaboxSettings(
@@ -111,9 +121,9 @@ public function testFormTriggerFormatterToggleFormSelection(EndToEndTester $I)
// Apply formatter to link the selected text.
$I->applyGutenbergFormatter(
$I,
- 'Kit Form Trigger',
- 'convertkit-form-link',
- [
+ formatterName: 'Kit Form Trigger',
+ formatterProgrammaticName: 'convertkit-form-link',
+ formatterConfiguration: [
// Form.
'data-id' => [ 'select', $_ENV['CONVERTKIT_API_FORM_FORMAT_MODAL_NAME'] ],
]
@@ -122,9 +132,9 @@ public function testFormTriggerFormatterToggleFormSelection(EndToEndTester $I)
// Select text and apply the formatter again, this time selecting the 'None' option.
$I->applyGutenbergFormatter(
$I,
- 'Kit Form Trigger',
- 'convertkit-form-link',
- [
+ formatterName: 'Kit Form Trigger',
+ formatterProgrammaticName: 'convertkit-form-link',
+ formatterConfiguration: [
// Form.
'data-id' => [ 'select', 'None' ],
]
@@ -151,7 +161,10 @@ public function testFormTriggerFormatterWithNoForm(EndToEndTester $I)
$I->setupKitPluginResources($I);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Form Trigger Formatter: No Form');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Form Trigger Formatter: No Form'
+ );
// Configure metabox's Form setting = None, ensuring we only test the block in Gutenberg.
$I->configureMetaboxSettings(
@@ -171,9 +184,9 @@ public function testFormTriggerFormatterWithNoForm(EndToEndTester $I)
// Apply formatter to link the selected text.
$I->applyGutenbergFormatter(
$I,
- 'Kit Form Trigger',
- 'convertkit-form-link',
- [
+ formatterName: 'Kit Form Trigger',
+ formatterProgrammaticName: 'convertkit-form-link',
+ formatterConfiguration: [
// Form.
'data-id' => [ 'select', 'None' ],
]
@@ -196,7 +209,10 @@ public function testFormTriggerFormatterWithNoForm(EndToEndTester $I)
public function testFormTriggerFormatterNotRegisteredWhenNoFormsExist(EndToEndTester $I)
{
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Form Trigger Formatter: No Forms Exist');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Form Trigger Formatter: No Forms Exist'
+ );
// Add paragraph to Page.
$I->addGutenbergParagraphBlock($I, 'Subscribe');
diff --git a/tests/EndToEnd/forms/blocks-shortcodes/PageShortcodeFormCest.php b/tests/EndToEnd/forms/blocks-shortcodes/PageShortcodeFormCest.php
index c7d7f89cc..87bc5c4c1 100644
--- a/tests/EndToEnd/forms/blocks-shortcodes/PageShortcodeFormCest.php
+++ b/tests/EndToEnd/forms/blocks-shortcodes/PageShortcodeFormCest.php
@@ -38,7 +38,10 @@ public function testFormShortcodeInVisualEditorWithValidFormParameter(EndToEndTe
$I->setupKitPluginResources($I);
// Add a Page using the Classic Editor.
- $I->addClassicEditorPage($I, 'page', 'Kit: Page: Form: Shortcode: Visual Editor');
+ $I->addClassicEditorPage(
+ $I,
+ title: 'Kit: Page: Form: Shortcode: Visual Editor'
+ );
// Configure metabox's Form setting = None, ensuring we only test the shortcode in the Classic Editor.
$I->configureMetaboxSettings(
@@ -52,11 +55,11 @@ public function testFormShortcodeInVisualEditorWithValidFormParameter(EndToEndTe
// Add shortcode to Page, setting the Form setting to the value specified in the .env file.
$I->addVisualEditorShortcode(
$I,
- 'Kit Form',
- [
+ shortcodeName: 'Kit Form',
+ shortcodeConfiguration: [
'form' => [ 'select', $_ENV['CONVERTKIT_API_FORM_NAME'] ],
],
- '[convertkit_form form="' . $_ENV['CONVERTKIT_API_FORM_ID'] . '"]'
+ expectedShortcodeOutput: '[convertkit_form form="' . $_ENV['CONVERTKIT_API_FORM_ID'] . '"]'
);
// Publish and view the Page on the frontend site.
@@ -82,7 +85,10 @@ public function testFormShortcodeInTextEditorWithValidFormParameter(EndToEndTest
$I->setupKitPluginResources($I);
// Add a Page using the Classic Editor.
- $I->addClassicEditorPage($I, 'page', 'Kit: Page: Form: Shortcode: Text Editor');
+ $I->addClassicEditorPage(
+ $I,
+ title: 'Kit: Page: Form: Shortcode: Text Editor'
+ );
// Configure metabox's Form setting = None, ensuring we only test the shortcode in the Classic Editor.
$I->configureMetaboxSettings(
@@ -96,11 +102,11 @@ public function testFormShortcodeInTextEditorWithValidFormParameter(EndToEndTest
// Add shortcode to Page, setting the Form setting to the value specified in the .env file.
$I->addTextEditorShortcode(
$I,
- 'convertkit-form',
- [
+ shortcodeProgrammaticName:'convertkit-form',
+ shortcodeConfiguration:[
'form' => [ 'select', $_ENV['CONVERTKIT_API_FORM_NAME'] ],
],
- '[convertkit_form form="' . $_ENV['CONVERTKIT_API_FORM_ID'] . '"]'
+ expectedShortcodeOutput: '[convertkit_form form="' . $_ENV['CONVERTKIT_API_FORM_ID'] . '"]'
);
// Publish and view the Page on the frontend site.
@@ -439,7 +445,10 @@ public function testFormShortcodeWhenNoForms(EndToEndTester $I)
$I->setupKitPluginResourcesNoData($I);
// Add a Page using the Classic Editor.
- $I->addClassicEditorPage($I, 'page', 'Kit: Page: Form: Shortcode: No Forms');
+ $I->addClassicEditorPage(
+ $I,
+ title: 'Kit: Page: Form: Shortcode: No Forms'
+ );
// Open Visual Editor modal for the shortcode.
$I->openVisualEditorShortcodeModal(
@@ -500,7 +509,10 @@ public function testFormShortcodeWithAutoptimizePlugin(EndToEndTester $I)
$I->activateThirdPartyPlugin($I, 'autoptimize');
// Add a Page using the Classic Editor.
- $I->addClassicEditorPage($I, 'page', 'Kit: Page: Form: Shortcode: Autoptimize');
+ $I->addClassicEditorPage(
+ $I,
+ title: 'Kit: Page: Form: Shortcode: Autoptimize'
+ );
// Configure metabox's Form setting = None, ensuring we only test the shortcode in the Classic Editor.
$I->configureMetaboxSettings(
@@ -514,11 +526,11 @@ public function testFormShortcodeWithAutoptimizePlugin(EndToEndTester $I)
// Add shortcode to Page, setting the Form setting to the value specified in the .env file.
$I->addVisualEditorShortcode(
$I,
- 'Kit Form',
- [
+ shortcodeName: 'Kit Form',
+ shortcodeConfiguration: [
'form' => [ 'select', $_ENV['CONVERTKIT_API_FORM_NAME'] ],
],
- '[convertkit_form form="' . $_ENV['CONVERTKIT_API_FORM_ID'] . '"]'
+ expectedShortcodeOutput: '[convertkit_form form="' . $_ENV['CONVERTKIT_API_FORM_ID'] . '"]'
);
// Publish and view the Page on the frontend site.
@@ -556,7 +568,10 @@ public function testFormShortcodeWithJetpackBoostPlugin(EndToEndTester $I)
$I->click('#inspector-toggle-control-1');
// Add a Page using the Classic Editor.
- $I->addClassicEditorPage($I, 'page', 'Kit: Page: Form: Shortcode: Jetpack Boost');
+ $I->addClassicEditorPage(
+ $I,
+ title: 'Kit: Page: Form: Shortcode: Jetpack Boost'
+ );
// Configure metabox's Form setting = None, ensuring we only test the shortcode in the Classic Editor.
$I->configureMetaboxSettings(
@@ -570,11 +585,11 @@ public function testFormShortcodeWithJetpackBoostPlugin(EndToEndTester $I)
// Add shortcode to Page, setting the Form setting to the value specified in the .env file.
$I->addVisualEditorShortcode(
$I,
- 'Kit Form',
- [
+ shortcodeName: 'Kit Form',
+ shortcodeConfiguration: [
'form' => [ 'select', $_ENV['CONVERTKIT_API_FORM_NAME'] ],
],
- '[convertkit_form form="' . $_ENV['CONVERTKIT_API_FORM_ID'] . '"]'
+ expectedShortcodeOutput: '[convertkit_form form="' . $_ENV['CONVERTKIT_API_FORM_ID'] . '"]'
);
// Publish and view the Page on the frontend site.
@@ -612,7 +627,10 @@ public function testFormShortcodeWithLiteSpeedCachePlugin(EndToEndTester $I)
$I->enableLiteSpeedCacheLoadJSDeferred($I);
// Add a Page using the Classic Editor.
- $I->addClassicEditorPage($I, 'page', 'Kit: Page: Form: Shortcode: LiteSpeed Cache');
+ $I->addClassicEditorPage(
+ $I,
+ title: 'Kit: Page: Form: Shortcode: LiteSpeed Cache'
+ );
// Configure metabox's Form setting = None, ensuring we only test the shortcode in the Classic Editor.
$I->configureMetaboxSettings(
@@ -626,11 +644,11 @@ public function testFormShortcodeWithLiteSpeedCachePlugin(EndToEndTester $I)
// Add shortcode to Page, setting the Form setting to the value specified in the .env file.
$I->addVisualEditorShortcode(
$I,
- 'Kit Form',
- [
+ shortcodeName: 'Kit Form',
+ shortcodeConfiguration: [
'form' => [ 'select', $_ENV['CONVERTKIT_API_FORM_NAME'] ],
],
- '[convertkit_form form="' . $_ENV['CONVERTKIT_API_FORM_ID'] . '"]'
+ expectedShortcodeOutput: '[convertkit_form form="' . $_ENV['CONVERTKIT_API_FORM_ID'] . '"]'
);
// Publish and view the Page on the frontend site.
@@ -676,7 +694,10 @@ public function testFormShortcodeWithPerfmattersPlugin(EndToEndTester $I)
);
// Add a Page using the Classic Editor.
- $I->addClassicEditorPage($I, 'page', 'Kit: Page: Form: Shortcode: Perfmatters');
+ $I->addClassicEditorPage(
+ $I,
+ title: 'Kit: Page: Form: Shortcode: Perfmatters'
+ );
// Configure metabox's Form setting = None, ensuring we only test the shortcode in the Classic Editor.
$I->configureMetaboxSettings(
@@ -690,11 +711,11 @@ public function testFormShortcodeWithPerfmattersPlugin(EndToEndTester $I)
// Add shortcode to Page, setting the Form setting to the value specified in the .env file.
$I->addVisualEditorShortcode(
$I,
- 'Kit Form',
- [
+ shortcodeName: 'Kit Form',
+ shortcodeConfiguration: [
'form' => [ 'select', $_ENV['CONVERTKIT_API_FORM_NAME'] ],
],
- '[convertkit_form form="' . $_ENV['CONVERTKIT_API_FORM_ID'] . '"]'
+ expectedShortcodeOutput: '[convertkit_form form="' . $_ENV['CONVERTKIT_API_FORM_ID'] . '"]'
);
// Publish and view the Page on the frontend site.
@@ -730,7 +751,10 @@ public function testFormShortcodeWithSitegroundSpeedOptimizerPlugin(EndToEndTest
$I->haveOptionInDatabase('siteground_optimizer_combine_javascript', '1');
// Add a Page using the Classic Editor.
- $I->addClassicEditorPage($I, 'page', 'Kit: Page: Form: Shortcode: Siteground Speed Optimizer');
+ $I->addClassicEditorPage(
+ $I,
+ title: 'Kit: Page: Form: Shortcode: Siteground Speed Optimizer'
+ );
// Configure metabox's Form setting = None, ensuring we only test the shortcode in the Classic Editor.
$I->configureMetaboxSettings(
@@ -744,11 +768,11 @@ public function testFormShortcodeWithSitegroundSpeedOptimizerPlugin(EndToEndTest
// Add shortcode to Page, setting the Form setting to the value specified in the .env file.
$I->addVisualEditorShortcode(
$I,
- 'Kit Form',
- [
+ shortcodeName: 'Kit Form',
+ shortcodeConfiguration: [
'form' => [ 'select', $_ENV['CONVERTKIT_API_FORM_NAME'] ],
],
- '[convertkit_form form="' . $_ENV['CONVERTKIT_API_FORM_ID'] . '"]'
+ expectedShortcodeOutput: '[convertkit_form form="' . $_ENV['CONVERTKIT_API_FORM_ID'] . '"]'
);
// Publish and view the Page on the frontend site.
@@ -784,7 +808,10 @@ public function testFormShortcodeWithWPRocketPlugin(EndToEndTester $I)
$I->enableWPRocketDelayJS($I);
// Add a Page using the Classic Editor.
- $I->addClassicEditorPage($I, 'page', 'Kit: Page: Form: Shortcode: WP Rocket');
+ $I->addClassicEditorPage(
+ $I,
+ title: 'Kit: Page: Form: Shortcode: WP Rocket'
+ );
// Configure metabox's Form setting = None, ensuring we only test the shortcode in the Classic Editor.
$I->configureMetaboxSettings(
@@ -798,11 +825,11 @@ public function testFormShortcodeWithWPRocketPlugin(EndToEndTester $I)
// Add shortcode to Page, setting the Form setting to the value specified in the .env file.
$I->addVisualEditorShortcode(
$I,
- 'Kit Form',
- [
+ shortcodeName: 'Kit Form',
+ shortcodeConfiguration: [
'form' => [ 'select', $_ENV['CONVERTKIT_API_FORM_NAME'] ],
],
- '[convertkit_form form="' . $_ENV['CONVERTKIT_API_FORM_ID'] . '"]'
+ expectedShortcodeOutput: '[convertkit_form form="' . $_ENV['CONVERTKIT_API_FORM_ID'] . '"]'
);
// Publish and view the Page on the frontend site.
diff --git a/tests/EndToEnd/forms/blocks-shortcodes/PageShortcodeFormTriggerCest.php b/tests/EndToEnd/forms/blocks-shortcodes/PageShortcodeFormTriggerCest.php
index 0610a9fd6..5bef594a4 100644
--- a/tests/EndToEnd/forms/blocks-shortcodes/PageShortcodeFormTriggerCest.php
+++ b/tests/EndToEnd/forms/blocks-shortcodes/PageShortcodeFormTriggerCest.php
@@ -38,16 +38,19 @@ public function testFormTriggerShortcodeInVisualEditorWithValidFormParameter(End
$I->setupKitPluginResources($I);
// Add a Page using the Classic Editor.
- $I->addClassicEditorPage($I, 'page', 'Kit: Page: Form Trigger: Shortcode: Visual Editor');
+ $I->addClassicEditorPage(
+ $I,
+ title: 'Kit: Page: Form Trigger: Shortcode: Visual Editor'
+ );
// Add shortcode to Page, setting the Form setting to the value specified in the .env file.
$I->addVisualEditorShortcode(
$I,
- 'Kit Form Trigger',
- [
+ shortcodeName: 'Kit Form Trigger',
+ shortcodeConfiguration: [
'form' => [ 'select', $_ENV['CONVERTKIT_API_FORM_FORMAT_MODAL_NAME'] ],
],
- '[convertkit_formtrigger form="' . $_ENV['CONVERTKIT_API_FORM_FORMAT_MODAL_ID'] . '" text="Subscribe"]'
+ expectedShortcodeOutput: '[convertkit_formtrigger form="' . $_ENV['CONVERTKIT_API_FORM_FORMAT_MODAL_ID'] . '" text="Subscribe"]'
);
// Publish and view the Page on the frontend site.
@@ -72,16 +75,19 @@ public function testFormTriggerShortcodeInTextEditorWithValidFormTriggerParamete
$I->setupKitPluginResources($I);
// Add a Page using the Classic Editor.
- $I->addClassicEditorPage($I, 'page', 'Kit: Page: Form Trigger: Shortcode: Text Editor');
+ $I->addClassicEditorPage(
+ $I,
+ title: 'Kit: Page: Form Trigger: Shortcode: Text Editor'
+ );
// Add shortcode to Page, setting the Form setting to the value specified in the .env file.
$I->addTextEditorShortcode(
$I,
- 'convertkit-formtrigger',
- [
+ shortcodeProgrammaticName: 'convertkit-formtrigger',
+ shortcodeConfiguration: [
'form' => [ 'select', $_ENV['CONVERTKIT_API_FORM_FORMAT_MODAL_NAME'] ],
],
- '[convertkit_formtrigger form="' . $_ENV['CONVERTKIT_API_FORM_FORMAT_MODAL_ID'] . '" text="Subscribe"]'
+ expectedShortcodeOutput: '[convertkit_formtrigger form="' . $_ENV['CONVERTKIT_API_FORM_FORMAT_MODAL_ID'] . '" text="Subscribe"]'
);
// Publish and view the Page on the frontend site.
@@ -136,17 +142,20 @@ public function testFormTriggerShortcodeInVisualEditorWithTextParameter(EndToEnd
$I->setupKitPluginResources($I);
// Add a Page using the Classic Editor.
- $I->addClassicEditorPage($I, 'page', 'Kit: Page: Form Trigger: Shortcode: Text Param');
+ $I->addClassicEditorPage(
+ $I,
+ title: 'Kit: Page: Form Trigger: Shortcode: Text Param'
+ );
// Add shortcode to Page, setting the Form setting to the value specified in the .env file.
$I->addVisualEditorShortcode(
$I,
- 'Kit Form Trigger',
- [
+ shortcodeName: 'Kit Form Trigger',
+ shortcodeConfiguration: [
'form' => [ 'select', $_ENV['CONVERTKIT_API_FORM_FORMAT_MODAL_NAME'] ],
'text' => [ 'input', 'Sign up' ],
],
- '[convertkit_formtrigger form="' . $_ENV['CONVERTKIT_API_FORM_FORMAT_MODAL_ID'] . '" text="Sign up"]'
+ expectedShortcodeOutput: '[convertkit_formtrigger form="' . $_ENV['CONVERTKIT_API_FORM_FORMAT_MODAL_ID'] . '" text="Sign up"]'
);
// Publish and view the Page on the frontend site.
@@ -170,17 +179,20 @@ public function testFormTriggerShortcodeInVisualEditorWithBlankTextParameter(End
$I->setupKitPluginResources($I);
// Add a Page using the Classic Editor.
- $I->addClassicEditorPage($I, 'page', 'Kit: Page: Form Trigger: Shortcode: Blank Text Param');
+ $I->addClassicEditorPage(
+ $I,
+ title: 'Kit: Page: Form Trigger: Shortcode: Blank Text Param'
+ );
// Add shortcode to Page, setting the Form setting to the value specified in the .env file.
$I->addVisualEditorShortcode(
$I,
- 'Kit Form Trigger',
- [
+ shortcodeName: 'Kit Form Trigger',
+ shortcodeConfiguration: [
'form' => [ 'select', $_ENV['CONVERTKIT_API_FORM_FORMAT_MODAL_NAME'] ],
'text' => [ 'input', '' ],
],
- '[convertkit_formtrigger form="' . $_ENV['CONVERTKIT_API_FORM_FORMAT_MODAL_ID'] . '"]'
+ expectedShortcodeOutput: '[convertkit_formtrigger form="' . $_ENV['CONVERTKIT_API_FORM_FORMAT_MODAL_ID'] . '"]'
);
// Publish and view the Page on the frontend site.
@@ -281,12 +293,15 @@ public function testFormTriggerShortcodeParameterEscaping(EndToEndTester $I)
public function testFormTriggerShortcodeWhenNoCredentials(EndToEndTester $I)
{
// Add a Page using the Classic Editor.
- $I->addClassicEditorPage($I, 'page', 'Kit: Page: Form Trigger: Shortcode: No Credentials');
+ $I->addClassicEditorPage(
+ $I,
+ title: 'Kit: Page: Form Trigger: Shortcode: No Credentials'
+ );
// Open Visual Editor modal for the shortcode.
$I->openVisualEditorShortcodeModal(
$I,
- 'Kit Form Trigger'
+ shortcodeName: 'Kit Form Trigger'
);
// Confirm an error notice displays.
@@ -339,12 +354,15 @@ public function testFormTriggerShortcodeWhenNoForms(EndToEndTester $I)
$I->setupKitPluginResourcesNoData($I);
// Add a Page using the Classic Editor.
- $I->addClassicEditorPage($I, 'page', 'Kit: Page: Form Trigger: Shortcode: No Forms');
+ $I->addClassicEditorPage(
+ $I,
+ title: 'Kit: Page: Form Trigger: Shortcode: No Forms'
+ );
// Open Visual Editor modal for the shortcode.
$I->openVisualEditorShortcodeModal(
$I,
- 'Kit Form Trigger'
+ shortcodeName: 'Kit Form Trigger'
);
// Confirm an error notice displays.
diff --git a/tests/EndToEnd/forms/general/CategoryFormCest.php b/tests/EndToEnd/forms/general/CategoryFormCest.php
index 3a85555b1..20bccb785 100644
--- a/tests/EndToEnd/forms/general/CategoryFormCest.php
+++ b/tests/EndToEnd/forms/general/CategoryFormCest.php
@@ -45,13 +45,17 @@ public function testAddCategoryWithValidFormSetting(EndToEndTester $I)
// Create Category.
$I->fillField('tag-name', 'Kit: Create Category');
- $I->fillSelect2Field($I, '#select2-wp-convertkit-form-container', $_ENV['CONVERTKIT_API_FORM_NAME']);
+ $I->fillSelect2Field(
+ $I,
+ container: '#select2-wp-convertkit-form-container',
+ value: $_ENV['CONVERTKIT_API_FORM_NAME']
+ );
// Check the order of the Form resources are alphabetical, with the Default option prepending the Forms.
$I->checkSelectFormOptionOrder(
$I,
- '#wp-convertkit-form',
- [
+ selectElement: '#wp-convertkit-form',
+ prependOptions: [
'Default',
'None',
]
@@ -107,13 +111,17 @@ public function testAddCategoryWithNoneFormSetting(EndToEndTester $I)
// Create Category.
$I->fillField('tag-name', 'Kit: Create Category: None');
- $I->fillSelect2Field($I, '#select2-wp-convertkit-form-container', 'None');
+ $I->fillSelect2Field(
+ $I,
+ container: '#select2-wp-convertkit-form-container',
+ value: 'None'
+ );
// Check the order of the Form resources are alphabetical, with the Default option prepending the Forms.
$I->checkSelectFormOptionOrder(
$I,
- '#wp-convertkit-form',
- [
+ selectElement: '#wp-convertkit-form',
+ prependOptions: [
'Default',
'None',
]
@@ -187,15 +195,19 @@ public function testEditCategoryWithValidFormSetting(EndToEndTester $I)
// Check the order of the Form resources are alphabetical, with the Default option prepending the Forms.
$I->checkSelectFormOptionOrder(
$I,
- '#wp-convertkit-form',
- [
+ selectElement: '#wp-convertkit-form',
+ prependOptions: [
'Default',
'None',
]
);
// Change Form to value specified in the .env file.
- $I->fillSelect2Field($I, '#select2-wp-convertkit-form-container', $_ENV['CONVERTKIT_API_FORM_NAME']);
+ $I->fillSelect2Field(
+ $I,
+ container: '#select2-wp-convertkit-form-container',
+ value: $_ENV['CONVERTKIT_API_FORM_NAME']
+ );
// Click Update.
$I->click('Update');
@@ -258,15 +270,19 @@ public function testEditCategoryWithNoneFormSetting(EndToEndTester $I)
// Check the order of the Form resources are alphabetical, with the Default option prepending the Forms.
$I->checkSelectFormOptionOrder(
$I,
- '#wp-convertkit-form',
- [
+ selectElement: '#wp-convertkit-form',
+ prependOptions: [
'Default',
'None',
]
);
// Change Form to None.
- $I->fillSelect2Field($I, '#select2-wp-convertkit-form-container', 'None');
+ $I->fillSelect2Field(
+ $I,
+ container: '#select2-wp-convertkit-form-container',
+ value: 'None'
+ );
// Click Update.
$I->click('Update');
@@ -307,7 +323,11 @@ public function testAddCategoryWithFormPositionBefore(EndToEndTester $I)
// Create Category.
$I->fillField('tag-name', 'Kit: Position: Before');
- $I->fillSelect2Field($I, '#select2-wp-convertkit-form-container', $_ENV['CONVERTKIT_API_FORM_NAME']);
+ $I->fillSelect2Field(
+ $I,
+ container: '#select2-wp-convertkit-form-container',
+ value: $_ENV['CONVERTKIT_API_FORM_NAME']
+ );
$I->selectOption('wp-convertkit[form_position]', 'before');
// Save.
@@ -365,7 +385,11 @@ public function testAddCategoryWithFormPositionAfter(EndToEndTester $I)
// Create Category.
$I->fillField('tag-name', 'Kit: Position: After');
- $I->fillSelect2Field($I, '#select2-wp-convertkit-form-container', $_ENV['CONVERTKIT_API_FORM_NAME']);
+ $I->fillSelect2Field(
+ $I,
+ container: '#select2-wp-convertkit-form-container',
+ value: $_ENV['CONVERTKIT_API_FORM_NAME']
+ );
$I->selectOption('wp-convertkit[form_position]', 'after');
// Save.
@@ -445,15 +469,19 @@ public function testEditCategoryWithFormPositionBefore(EndToEndTester $I)
// Check the order of the Form resources are alphabetical, with the Default option prepending the Forms.
$I->checkSelectFormOptionOrder(
$I,
- '#wp-convertkit-form',
- [
+ selectElement: '#wp-convertkit-form',
+ prependOptions: [
'Default',
'None',
]
);
// Change Form to value specified in the .env file.
- $I->fillSelect2Field($I, '#select2-wp-convertkit-form-container', $_ENV['CONVERTKIT_API_FORM_NAME']);
+ $I->fillSelect2Field(
+ $I,
+ container: '#select2-wp-convertkit-form-container',
+ value: $_ENV['CONVERTKIT_API_FORM_NAME']
+ );
$I->selectOption('wp-convertkit[form_position]', 'before');
// Click Update.
@@ -526,15 +554,19 @@ public function testEditCategoryWithFormPositionAfter(EndToEndTester $I)
// Check the order of the Form resources are alphabetical, with the Default option prepending the Forms.
$I->checkSelectFormOptionOrder(
$I,
- '#wp-convertkit-form',
- [
+ selectElement: '#wp-convertkit-form',
+ prependOptions: [
'Default',
'None',
]
);
// Change Form to value specified in the .env file.
- $I->fillSelect2Field($I, '#select2-wp-convertkit-form-container', $_ENV['CONVERTKIT_API_FORM_NAME']);
+ $I->fillSelect2Field(
+ $I,
+ container: '#select2-wp-convertkit-form-container',
+ value: $_ENV['CONVERTKIT_API_FORM_NAME']
+ );
$I->selectOption('wp-convertkit[form_position]', 'after');
// Click Update.
diff --git a/tests/EndToEnd/forms/general/EditFormLinkCest.php b/tests/EndToEnd/forms/general/EditFormLinkCest.php
index 73d3addc0..4c7685c8b 100644
--- a/tests/EndToEnd/forms/general/EditFormLinkCest.php
+++ b/tests/EndToEnd/forms/general/EditFormLinkCest.php
@@ -39,13 +39,16 @@ public function _before(EndToEndTester $I)
public function testEditFormLinkOnPage(EndToEndTester $I)
{
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Form: Default: Edit Link');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Form: Default: Edit Link'
+ );
// Configure metabox's Form setting = Default.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'form' => [ 'select2', 'Default' ],
]
);
@@ -77,13 +80,16 @@ public function testEditFormLinkOnPage(EndToEndTester $I)
public function testEditFormLinkOnPageWithNoForm(EndToEndTester $I)
{
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Form: None: Edit Link');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Form: None: Edit Link'
+ );
// Configure metabox's Form setting = None.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'form' => [ 'select2', 'None' ],
]
);
@@ -174,13 +180,16 @@ public function testEditFormLinkOnPageWithLegacyForm(EndToEndTester $I)
);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Form: Legacy: Edit Link');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Form: Legacy: Edit Link'
+ );
// Configure metabox's Form setting = Legacy.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'form' => [ 'select2', $_ENV['CONVERTKIT_API_LEGACY_FORM_NAME'] ],
]
);
@@ -212,13 +221,16 @@ public function testEditFormLinkOnPageWithLegacyForm(EndToEndTester $I)
public function testEditFormLinkOnPageWithFormBlock(EndToEndTester $I)
{
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Form: Block: Edit Link');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Form: Block: Edit Link'
+ );
// Configure metabox's Form setting = None, ensuring we only test the block in Gutenberg.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'form' => [ 'select2', 'None' ],
]
);
@@ -226,9 +238,9 @@ public function testEditFormLinkOnPageWithFormBlock(EndToEndTester $I)
// Add block to Page, setting the Form setting to the value specified in the .env file.
$I->addGutenbergBlock(
$I,
- 'Kit Form',
- 'convertkit-form',
- [
+ blockName: 'Kit Form',
+ blockProgrammaticName: 'convertkit-form',
+ blockConfiguration: [
'form' => [ 'select', $_ENV['CONVERTKIT_API_FORM_NAME'] ],
]
);
@@ -261,13 +273,16 @@ public function testEditFormLinkOnPageWithFormBlock(EndToEndTester $I)
public function testEditFormLinkOnPageWithFormBlockSpecifyingNonInlineForm(EndToEndTester $I)
{
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Form: Block: Non Inline: Edit Link');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Form: Block: Non Inline: Edit Link'
+ );
// Configure metabox's Form setting = None, ensuring we only test the block in Gutenberg.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'form' => [ 'select2', 'None' ],
]
);
@@ -275,9 +290,9 @@ public function testEditFormLinkOnPageWithFormBlockSpecifyingNonInlineForm(EndTo
// Add block to Page, setting the Form setting to the value specified in the .env file.
$I->addGutenbergBlock(
$I,
- 'Kit Form',
- 'convertkit-form',
- [
+ blockName: 'Kit Form',
+ blockProgrammaticName: 'convertkit-form',
+ blockConfiguration: [
'form' => [ 'select', $_ENV['CONVERTKIT_API_FORM_FORMAT_STICKY_BAR_NAME'] ],
]
);
diff --git a/tests/EndToEnd/forms/general/NonInlineFormCest.php b/tests/EndToEnd/forms/general/NonInlineFormCest.php
index 6283127ae..2312c0bf1 100644
--- a/tests/EndToEnd/forms/general/NonInlineFormCest.php
+++ b/tests/EndToEnd/forms/general/NonInlineFormCest.php
@@ -200,8 +200,8 @@ public function testDefaultNonInlineFormIgnoredWhenDefaultPageNonInlineFormDefin
// Configure metabox's Form setting = Default.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'form' => [ 'select2', 'Default' ],
]
);
@@ -235,13 +235,16 @@ public function testDefaultNonInlineFormIgnoredWhenPageNonInlineFormDefined(EndT
);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Non-Inline Form: Specific');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Non-Inline Form: Specific'
+ );
// Configure metabox's Form setting = Modal Form.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'form' => [ 'select2', $_ENV['CONVERTKIT_API_FORM_FORMAT_MODAL_NAME'] ],
]
);
@@ -275,13 +278,16 @@ public function testPageLevelNoneSettingIgnored(EndToEndTester $I)
);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Non-Inline Form: None: Ignored');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Non-Inline Form: None: Ignored'
+ );
// Configure metabox's Form setting = None.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'form' => [ 'select2', 'None' ],
]
);
@@ -316,13 +322,16 @@ public function testPageLevelNoneSettingHonored(EndToEndTester $I)
);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Non-Inline Form: None: Honored');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Non-Inline Form: None: Honored'
+ );
// Configure metabox's Form setting = None.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'form' => [ 'select2', 'None' ],
]
);
@@ -355,13 +364,16 @@ public function testDefaultNonInlineFormIgnoredWhenPageNonInlineFormDefinedInBlo
);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Non-Inline Form: Block');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Non-Inline Form: Block'
+ );
// Configure metabox's Form setting = None.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'form' => [ 'select2', 'None' ],
]
);
@@ -369,9 +381,9 @@ public function testDefaultNonInlineFormIgnoredWhenPageNonInlineFormDefinedInBlo
// Add Form block to the Page set to the Modal Form.
$I->addGutenbergBlock(
$I,
- 'Kit Form',
- 'convertkit-form',
- [
+ blockName: 'Kit Form',
+ blockProgrammaticName: 'convertkit-form',
+ blockConfiguration: [
'form' => [ 'select', $_ENV['CONVERTKIT_API_FORM_FORMAT_MODAL_NAME'] ],
]
);
@@ -405,13 +417,16 @@ public function testDefaultNonInlineFormIgnoredWhenPageNonInlineFormDefinedInSho
);
// Add a Page using the Classic Editor.
- $I->addClassicEditorPage($I, 'page', 'Kit: Page: Non-Inline Form: Shortcode');
+ $I->addClassicEditorPage(
+ $I,
+ title: 'Kit: Page: Non-Inline Form: Shortcode'
+ );
// Configure metabox's Form setting = None, ensuring we only test the shortcode in the Classic Editor.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'form' => [ 'select2', 'None' ],
]
);
@@ -419,11 +434,11 @@ public function testDefaultNonInlineFormIgnoredWhenPageNonInlineFormDefinedInSho
// Add shortcode to Page, setting the Form setting to the value specified in the .env file.
$I->addVisualEditorShortcode(
$I,
- 'Kit Form',
- [
+ shortcodeName: 'Kit Form',
+ shortcodeConfiguration: [
'form' => [ 'select', $_ENV['CONVERTKIT_API_FORM_FORMAT_MODAL_NAME'] ],
],
- '[convertkit_form form="' . $_ENV['CONVERTKIT_API_FORM_FORMAT_MODAL_ID'] . '"]'
+ expectedShortcodeOutput: '[convertkit_form form="' . $_ENV['CONVERTKIT_API_FORM_FORMAT_MODAL_ID'] . '"]'
);
// Publish and view the Page on the frontend site.
@@ -457,13 +472,17 @@ public function testDefaultNonInlineFormIgnoredWhenDefaultPostNonInlineFormDefin
);
// Add a Post using the Gutenberg editor.
- $I->addGutenbergPage($I, 'post', 'Kit: Post: Non-Inline Form: Default');
+ $I->addGutenbergPage(
+ $I,
+ postType: 'post',
+ title: 'Kit: Post: Non-Inline Form: Default'
+ );
// Configure metabox's Form setting = Default.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'form' => [ 'select2', 'Default' ],
]
);
@@ -497,13 +516,17 @@ public function testDefaultNonInlineFormIgnoredWhenPostNonInlineFormDefined(EndT
);
// Add a Post using the Gutenberg editor.
- $I->addGutenbergPage($I, 'post', 'Kit: Post: Non-Inline Form: Specific');
+ $I->addGutenbergPage(
+ $I,
+ postType: 'post',
+ title: 'Kit: Post: Non-Inline Form: Specific'
+ );
// Configure metabox's Form setting = Modal Form.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'form' => [ 'select2', $_ENV['CONVERTKIT_API_FORM_FORMAT_MODAL_NAME'] ],
]
);
@@ -593,13 +616,17 @@ public function testPostLevelNoneSettingIgnored(EndToEndTester $I)
);
// Add a Post using the Gutenberg editor.
- $I->addGutenbergPage($I, 'post', 'Kit: Post: Non-Inline Form: None: Ignored');
+ $I->addGutenbergPage(
+ $I,
+ postType: 'post',
+ title: 'Kit: Post: Non-Inline Form: None: Ignored'
+ );
// Configure metabox's Form setting = None.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'form' => [ 'select2', 'None' ],
]
);
@@ -634,13 +661,17 @@ public function testPostLevelNoneSettingHonored(EndToEndTester $I)
);
// Add a Post using the Gutenberg editor.
- $I->addGutenbergPage($I, 'post', 'Kit: Post: Non-Inline Form: None: Honored');
+ $I->addGutenbergPage(
+ $I,
+ postType: 'post',
+ title: 'Kit: Post: Non-Inline Form: None: Honored'
+ );
// Configure metabox's Form setting = None.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'form' => [ 'select2', 'None' ],
]
);
diff --git a/tests/EndToEnd/forms/general/WidgetFormCest.php b/tests/EndToEnd/forms/general/WidgetFormCest.php
index ae0e9d944..8af936b12 100644
--- a/tests/EndToEnd/forms/general/WidgetFormCest.php
+++ b/tests/EndToEnd/forms/general/WidgetFormCest.php
@@ -61,9 +61,9 @@ public function testLegacyFormWidgetWithValidFormParameter(EndToEndTester $I)
// Add legacy widget, setting the Form setting to the value specified in the .env file.
$I->addLegacyWidget(
$I,
- 'Kit Form (Legacy Widget)',
- 'convertkit-form',
- [
+ blockName: 'Kit Form (Legacy Widget)',
+ blockProgrammaticName: 'convertkit-form',
+ blockConfiguration: [
'form' => [ 'select', $_ENV['CONVERTKIT_API_FORM_NAME'] ],
]
);
@@ -99,9 +99,9 @@ public function testLegacyFormWidgetWithValidLegacyFormParameter(EndToEndTester
// Add legacy widget, setting the Form setting to the value specified in the .env file.
$I->addLegacyWidget(
$I,
- 'Kit Form (Legacy Widget)',
- 'convertkit-form',
- [
+ blockName: 'Kit Form (Legacy Widget)',
+ blockProgrammaticName: 'convertkit-form',
+ blockConfiguration: [
'form' => [ 'select', $_ENV['CONVERTKIT_API_LEGACY_FORM_NAME'] ],
]
);
@@ -125,9 +125,9 @@ public function testBlockFormWidgetWithValidFormParameter(EndToEndTester $I)
// Add block widget, setting the Form setting to the value specified in the .env file.
$I->addBlockWidget(
$I,
- 'Kit Form',
- 'convertkit-form',
- [
+ blockName: 'Kit Form',
+ blockProgrammaticName: 'convertkit-form',
+ blockConfiguration: [
'form' => [ 'select', $_ENV['CONVERTKIT_API_FORM_NAME'] ],
]
);
@@ -159,9 +159,9 @@ public function testBlockFormBlockWithValidLegacyFormParameter(EndToEndTester $I
// Add block widget, setting the Form setting to the value specified in the .env file.
$I->addBlockWidget(
$I,
- 'Kit Form',
- 'convertkit-form',
- [
+ blockName: 'Kit Form',
+ blockProgrammaticName: 'convertkit-form',
+ blockConfiguration: [
'form' => [ 'select', $_ENV['CONVERTKIT_API_LEGACY_FORM_NAME'] ],
]
);
@@ -186,9 +186,9 @@ public function testFormWidgetWithValidModalFormParameter(EndToEndTester $I)
// Add block widget, setting the Form setting to the value specified in the .env file.
$I->addBlockWidget(
$I,
- 'Kit Form',
- 'convertkit-form',
- [
+ blockName: 'Kit Form',
+ blockProgrammaticName: 'convertkit-form',
+ blockConfiguration: [
'form' => [ 'select', $_ENV['CONVERTKIT_API_FORM_FORMAT_MODAL_NAME'] ],
]
);
@@ -220,9 +220,9 @@ public function testBlockFormWidgetWithValidSlideInFormParameter(EndToEndTester
// Add block widget, setting the Form setting to the value specified in the .env file.
$I->addBlockWidget(
$I,
- 'Kit Form',
- 'convertkit-form',
- [
+ blockName: 'Kit Form',
+ blockProgrammaticName: 'convertkit-form',
+ blockConfiguration: [
'form' => [ 'select', $_ENV['CONVERTKIT_API_FORM_FORMAT_SLIDE_IN_NAME'] ],
]
);
@@ -254,9 +254,9 @@ public function testBlockFormWidgetWithValidStickyBarFormParameter(EndToEndTeste
// Add block widget, setting the Form setting to the value specified in the .env file.
$I->addBlockWidget(
$I,
- 'Kit Form',
- 'convertkit-form',
- [
+ blockName: 'Kit Form',
+ blockProgrammaticName: 'convertkit-form',
+ blockConfiguration: [
'form' => [ 'select', $_ENV['CONVERTKIT_API_FORM_FORMAT_STICKY_BAR_NAME'] ],
]
);
diff --git a/tests/EndToEnd/forms/post-types/CPTFormCest.php b/tests/EndToEnd/forms/post-types/CPTFormCest.php
index 229d2a0d1..e3d2b4218 100644
--- a/tests/EndToEnd/forms/post-types/CPTFormCest.php
+++ b/tests/EndToEnd/forms/post-types/CPTFormCest.php
@@ -64,7 +64,11 @@ public function testAccessibility(EndToEndTester $I)
public function testNoOptionsOrOutputOnPrivateCustomPostType(EndToEndTester $I)
{
// Add a Private CPT using the Gutenberg editor.
- $I->addGutenbergPage($I, 'private', 'Kit: Private: Form: None');
+ $I->addGutenbergPage(
+ $I,
+ postType: 'private',
+ title: 'Kit: Private: Form: None'
+ );
// Check that the metabox is not displayed.
$I->dontSeeElementInDOM('#wp-convertkit-meta-box');
@@ -128,7 +132,11 @@ public function testAddNewCPTUsingDefaultFormWithNoDefaultFormSpecifiedInPlugin(
$I->setupKitPluginResources($I);
// Add a CPT using the Gutenberg editor.
- $I->addGutenbergPage($I, 'article', 'Kit: CPT: Form: Default: None');
+ $I->addGutenbergPage(
+ $I,
+ postType: 'article',
+ title: 'Kit: CPT: Form: Default: None'
+ );
// Check the order of the Form resources are alphabetical, with the Default and None options prepending the Forms.
$I->checkSelectFormOptionOrder(
@@ -143,8 +151,8 @@ public function testAddNewCPTUsingDefaultFormWithNoDefaultFormSpecifiedInPlugin(
// Configure metabox's Form setting = Default.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'form' => [ 'select2', 'Default' ],
]
);
@@ -176,13 +184,17 @@ public function testAddNewCPTUsingDefaultForm(EndToEndTester $I)
$I->setupKitPluginResources($I);
// Add a CPT using the Gutenberg editor.
- $I->addGutenbergPage($I, 'article', 'Kit: CPT: Form: Default');
+ $I->addGutenbergPage(
+ $I,
+ postType: 'article',
+ title: 'Kit: CPT: Form: Default'
+ );
// Configure metabox's Form setting = Default.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'form' => [ 'select2', 'Default' ],
]
);
@@ -217,7 +229,11 @@ public function testAddNewCPTUsingDefaultFormBeforeContent(EndToEndTester $I)
$I->setupKitPluginResources($I);
// Add a CPT using the Gutenberg editor.
- $I->addGutenbergPage($I, 'article', 'Kit: CPT: Form: Default: Before Content');
+ $I->addGutenbergPage(
+ $I,
+ postType: 'article',
+ title: 'Kit: CPT: Form: Default: Before Content'
+ );
// Add paragraph to CPT.
$I->addGutenbergParagraphBlock($I, 'CPT content');
@@ -225,8 +241,8 @@ public function testAddNewCPTUsingDefaultFormBeforeContent(EndToEndTester $I)
// Configure metabox's Form setting = Default.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'form' => [ 'select2', 'Default' ],
]
);
@@ -261,7 +277,11 @@ public function testAddNewCPTUsingDefaultFormBeforeAndAfterContent(EndToEndTeste
$I->setupKitPluginResources($I);
// Add a CPT using the Gutenberg editor.
- $I->addGutenbergPage($I, 'article', 'Kit: CPT: Form: Default: Before and After Content');
+ $I->addGutenbergPage(
+ $I,
+ postType: 'article',
+ title: 'Kit: CPT: Form: Default: Before and After Content'
+ );
// Add paragraph to CPT.
$I->addGutenbergParagraphBlock($I, 'CPT content');
@@ -269,8 +289,8 @@ public function testAddNewCPTUsingDefaultFormBeforeAndAfterContent(EndToEndTeste
// Configure metabox's Form setting = Default.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'form' => [ 'select2', 'Default' ],
]
);
@@ -279,7 +299,11 @@ public function testAddNewCPTUsingDefaultFormBeforeAndAfterContent(EndToEndTeste
$I->publishAndViewGutenbergPage($I);
// Confirm that two Kit Forms are output in the DOM before and after the CPT content.
- $I->seeFormOutput($I, $_ENV['CONVERTKIT_API_FORM_ID'], 'before_after_content');
+ $I->seeFormOutput(
+ $I,
+ formID: $_ENV['CONVERTKIT_API_FORM_ID'],
+ position: 'before_after_content'
+ );
}
/**
@@ -306,7 +330,11 @@ public function testAddNewCPTUsingDefaultFormAfterParagraphElement(EndToEndTeste
$I->setupKitPluginResources($I);
// Setup Article with placeholder content.
- $pageID = $I->addGutenbergPageToDatabase($I, 'article', 'Kit: CPT: Form: Default: After 3rd Paragraph Element');
+ $pageID = $I->addGutenbergPageToDatabase(
+ $I,
+ postType: 'article',
+ title: 'Kit: CPT: Form: Default: After 3rd Paragraph Element'
+ );
// View the CPT on the frontend site.
$I->amOnPage('?p=' . $pageID);
@@ -315,7 +343,13 @@ public function testAddNewCPTUsingDefaultFormAfterParagraphElement(EndToEndTeste
$I->checkNoWarningsAndNoticesOnScreen($I);
// Confirm that one Kit Form is output in the DOM after the third paragraph.
- $I->seeFormOutput($I, $_ENV['CONVERTKIT_API_FORM_ID'], 'after_element', 'p', 3);
+ $I->seeFormOutput(
+ $I,
+ formID: $_ENV['CONVERTKIT_API_FORM_ID'],
+ position: 'after_element',
+ element: 'p',
+ elementIndex: 3
+ );
// Confirm character encoding is not broken due to using DOMDocument.
$I->seeInSource('Adhaésionés altéram improbis mi pariendarum sit stulti triarium');
@@ -348,7 +382,11 @@ public function testAddNewCPTUsingDefaultNonInlineFormAfterParagraphElement(EndT
$I->setupKitPluginResources($I);
// Setup CPT with placeholder content.
- $pageID = $I->addGutenbergPageToDatabase($I, 'article', 'Kit: CPT: Non-Inline Form: Default: After 3rd Paragraph Element');
+ $pageID = $I->addGutenbergPageToDatabase(
+ $I,
+ postType: 'article',
+ title: 'Kit: CPT: Non-Inline Form: Default: After 3rd Paragraph Element'
+ );
// View the Page on the frontend site.
$I->amOnPage('?p=' . $pageID);
@@ -391,7 +429,11 @@ public function testAddNewCPTUsingDefaultFormAfterHeadingElement(EndToEndTester
$I->setupKitPluginResources($I);
// Setup Article with placeholder content.
- $pageID = $I->addGutenbergPageToDatabase($I, 'article', 'Kit: CPT: Form: Default: After 2nd H2 Element');
+ $pageID = $I->addGutenbergPageToDatabase(
+ $I,
+ postType: 'article',
+ title: 'Kit: CPT: Form: Default: After 2nd H2 Element'
+ );
// View the CPT on the frontend site.
$I->amOnPage('?p=' . $pageID);
@@ -400,7 +442,13 @@ public function testAddNewCPTUsingDefaultFormAfterHeadingElement(EndToEndTester
$I->checkNoWarningsAndNoticesOnScreen($I);
// Confirm that one Kit Form is output in the DOM after the second element.
- $I->seeFormOutput($I, $_ENV['CONVERTKIT_API_FORM_ID'], 'after_element', 'h2', 2);
+ $I->seeFormOutput(
+ $I,
+ formID: $_ENV['CONVERTKIT_API_FORM_ID'],
+ position: 'after_element',
+ element: 'h2',
+ elementIndex: 2
+ );
// Confirm character encoding is not broken due to using DOMDocument.
$I->seeInSource('Adhaésionés altéram improbis mi pariendarum sit stulti triarium');
@@ -433,7 +481,11 @@ public function testAddNewCPTUsingDefaultFormAfterImageElement(EndToEndTester $I
$I->setupKitPluginResources($I);
// Setup Article with placeholder content.
- $pageID = $I->addGutenbergPageToDatabase($I, 'article', 'Kit: CPT: Form: Default: After 2nd Image Element');
+ $pageID = $I->addGutenbergPageToDatabase(
+ $I,
+ postType: 'article',
+ title: 'Kit: CPT: Form: Default: After 2nd Image Element'
+ );
// View the CPT on the frontend site.
$I->amOnPage('?p=' . $pageID);
@@ -442,7 +494,13 @@ public function testAddNewCPTUsingDefaultFormAfterImageElement(EndToEndTester $I
$I->checkNoWarningsAndNoticesOnScreen($I);
// Confirm that one Kit Form is output in the DOM after the second
element.
- $I->seeFormOutput($I, $_ENV['CONVERTKIT_API_FORM_ID'], 'after_element', 'img', 2);
+ $I->seeFormOutput(
+ $I,
+ formID: $_ENV['CONVERTKIT_API_FORM_ID'],
+ position: 'after_element',
+ element: 'img',
+ elementIndex: 2
+ );
// Confirm character encoding is not broken due to using DOMDocument.
$I->seeInSource('Adhaésionés altéram improbis mi pariendarum sit stulti triarium');
@@ -475,7 +533,11 @@ public function testAddNewCPTUsingDefaultFormAfterOutOfBoundsElement(EndToEndTes
$I->setupKitPluginResources($I);
// Setup Article with placeholder content.
- $pageID = $I->addGutenbergPageToDatabase($I, 'article', 'Kit: CPT: Form: Default: After 9th Paragraph Element');
+ $pageID = $I->addGutenbergPageToDatabase(
+ $I,
+ postType: 'article',
+ title: 'Kit: CPT: Form: Default: After 9th Paragraph Element'
+ );
// View the CPT on the frontend site.
$I->amOnPage('?p=' . $pageID);
@@ -485,7 +547,11 @@ public function testAddNewCPTUsingDefaultFormAfterOutOfBoundsElement(EndToEndTes
// Confirm that one Kit Form is output in the DOM after the content, as
// the number of paragraphs is less than the position.
- $I->seeFormOutput($I, $_ENV['CONVERTKIT_API_FORM_ID'], 'after_content');
+ $I->seeFormOutput(
+ $I,
+ formID: $_ENV['CONVERTKIT_API_FORM_ID'],
+ position: 'after_content'
+ );
// Confirm character encoding is not broken due to using DOMDocument.
$I->seeInSource('Adhaésionés altéram improbis mi pariendarum sit stulti triarium');
@@ -516,7 +582,11 @@ public function testAddNewCPTUsingDefaultLegacyForm(EndToEndTester $I)
$I->setupKitPluginResources($I);
// Add a CPT using the Gutenberg editor.
- $I->addGutenbergPage($I, 'article', 'Kit: CPT: Form: Legacy: Default');
+ $I->addGutenbergPage(
+ $I,
+ postType: 'article',
+ title: 'Kit: CPT: Form: Legacy: Default'
+ );
// Configure metabox's Form setting = Default.
$I->configureMetaboxSettings(
@@ -554,13 +624,17 @@ public function testAddNewCPTUsingNoForm(EndToEndTester $I)
$I->setupKitPluginResources($I);
// Add a CPT using the Gutenberg editor.
- $I->addGutenbergPage($I, 'article', 'Kit: CPT: Form: None');
+ $I->addGutenbergPage(
+ $I,
+ postType: 'article',
+ title: 'Kit: CPT: Form: None'
+ );
// Configure metabox's Form setting = None.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'form' => [ 'select2', 'None' ],
]
);
@@ -592,13 +666,17 @@ public function testAddNewCPTUsingDefinedForm(EndToEndTester $I)
$I->setupKitPluginResources($I);
// Add a CPT using the Gutenberg editor.
- $I->addGutenbergPage($I, 'article', 'Kit: CPT: Form: ' . $_ENV['CONVERTKIT_API_FORM_NAME']);
+ $I->addGutenbergPage(
+ $I,
+ postType: 'article',
+ title: 'Kit: CPT: Form: ' . $_ENV['CONVERTKIT_API_FORM_NAME']
+ );
// Configure metabox's Form setting = None.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'form' => [ 'select2', $_ENV['CONVERTKIT_API_FORM_NAME'] ],
]
);
@@ -633,13 +711,17 @@ public function testAddNewCPTUsingDefinedLegacyForm(EndToEndTester $I)
$I->setupKitPluginResources($I);
// Add a CPT using the Gutenberg editor.
- $I->addGutenbergPage($I, 'article', 'Kit: CPT: Form: ' . $_ENV['CONVERTKIT_API_LEGACY_FORM_NAME']);
+ $I->addGutenbergPage(
+ $I,
+ postType: 'article',
+ title: 'Kit: CPT: Form: ' . $_ENV['CONVERTKIT_API_LEGACY_FORM_NAME']
+ );
// Configure metabox's Form setting = None.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'form' => [ 'select2', $_ENV['CONVERTKIT_API_LEGACY_FORM_NAME'] ],
]
);
@@ -735,9 +817,9 @@ public function testQuickEditUsingDefaultForm(EndToEndTester $I)
// Quick Edit the CPT in the CPTs WP_List_Table.
$I->quickEdit(
$I,
- 'article',
- $postID,
- [
+ postType: 'article',
+ postID: $postID,
+ configuration: [
'form' => [ 'select', 'Default' ],
]
);
@@ -783,9 +865,9 @@ public function testQuickEditUsingDefinedForm(EndToEndTester $I)
// Quick Edit the CPT in the CPTs WP_List_Table.
$I->quickEdit(
$I,
- 'article',
- $postID,
- [
+ postType: 'article',
+ postID: $postID,
+ configuration: [
'form' => [ 'select', $_ENV['CONVERTKIT_API_FORM_NAME'] ],
]
);
@@ -839,9 +921,9 @@ public function testBulkEditUsingDefaultForm(EndToEndTester $I)
// Bulk Edit the CPTs in the CPTs WP_List_Table.
$I->bulkEdit(
$I,
- 'article',
- $postIDs,
- [
+ postType: 'article',
+ postIDs: $postIDs,
+ configuration: [
'form' => [ 'select', 'Default' ],
]
);
@@ -898,9 +980,9 @@ public function testBulkEditUsingDefinedForm(EndToEndTester $I)
// Bulk Edit the CPTs in the CPTs WP_List_Table.
$I->bulkEdit(
$I,
- 'article',
- $postIDs,
- [
+ postType: 'article',
+ postIDs: $postIDs,
+ configuration: [
'form' => [ 'select', $_ENV['CONVERTKIT_API_FORM_NAME'] ],
]
);
@@ -971,9 +1053,9 @@ public function testBulkEditWithNoChanges(EndToEndTester $I)
// Bulk Edit the CPTs in the CPTs WP_List_Table.
$I->bulkEdit(
$I,
- 'article',
- $postIDs,
- [
+ postType: 'article',
+ postIDs: $postIDs,
+ configuration: [
'form' => [ 'select', '— No Change —' ],
]
);
diff --git a/tests/EndToEnd/forms/post-types/PageFormCest.php b/tests/EndToEnd/forms/post-types/PageFormCest.php
index c98a1fe0e..66678d30f 100644
--- a/tests/EndToEnd/forms/post-types/PageFormCest.php
+++ b/tests/EndToEnd/forms/post-types/PageFormCest.php
@@ -62,13 +62,16 @@ public function testAddNewPageUsingDefaultFormWithNoDefaultFormSpecifiedInPlugin
$I->setupKitPluginResources($I);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Form: Default: None');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Form: Default: None'
+ );
// Check the order of the Form resources are alphabetical, with the Default and None options prepending the Forms.
$I->checkSelectFormOptionOrder(
$I,
- '#wp-convertkit-form',
- [
+ selectElement: '#wp-convertkit-form',
+ prependOptions: [
'Default',
'None',
]
@@ -77,8 +80,8 @@ public function testAddNewPageUsingDefaultFormWithNoDefaultFormSpecifiedInPlugin
// Configure metabox's Form setting = Default.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'form' => [ 'select2', 'Default' ],
]
);
@@ -105,13 +108,16 @@ public function testAddNewPageUsingDefaultForm(EndToEndTester $I)
$I->setupKitPluginResources($I);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Form: Default');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Form: Default'
+ );
// Configure metabox's Form setting = Default.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'form' => [ 'select2', 'Default' ],
]
);
@@ -145,7 +151,10 @@ public function testAddNewPageUsingDefaultFormBeforeContent(EndToEndTester $I)
$I->setupKitPluginResources($I);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Form: Default: Before Content');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Form: Default: Before Content'
+ );
// Add paragraph to Page.
$I->addGutenbergParagraphBlock($I, 'Page content');
@@ -153,8 +162,8 @@ public function testAddNewPageUsingDefaultFormBeforeContent(EndToEndTester $I)
// Configure metabox's Form setting = Default.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'form' => [ 'select2', 'Default' ],
]
);
@@ -164,7 +173,11 @@ public function testAddNewPageUsingDefaultFormBeforeContent(EndToEndTester $I)
// Confirm that one Kit Form is output in the DOM after the Page content.
// This confirms that there is only one script on the page for this form, which renders the form.
- $I->seeFormOutput($I, $_ENV['CONVERTKIT_API_FORM_ID'], 'before_content');
+ $I->seeFormOutput(
+ $I,
+ formID: $_ENV['CONVERTKIT_API_FORM_ID'],
+ position: 'before_content'
+ );
}
/**
@@ -188,7 +201,10 @@ public function testAddNewPageUsingDefaultFormBeforeAndAfterContent(EndToEndTest
$I->setupKitPluginResources($I);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Form: Default: Before and After Content');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Form: Default: Before and After Content'
+ );
// Add paragraph to Page.
$I->addGutenbergParagraphBlock($I, 'Page content');
@@ -196,8 +212,8 @@ public function testAddNewPageUsingDefaultFormBeforeAndAfterContent(EndToEndTest
// Configure metabox's Form setting = Default.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'form' => [ 'select2', 'Default' ],
]
);
@@ -206,7 +222,11 @@ public function testAddNewPageUsingDefaultFormBeforeAndAfterContent(EndToEndTest
$I->publishAndViewGutenbergPage($I);
// Confirm that two Kit Forms are output in the DOM before and after the Page content.
- $I->seeFormOutput($I, $_ENV['CONVERTKIT_API_FORM_ID'], 'before_after_content');
+ $I->seeFormOutput(
+ $I,
+ formID: $_ENV['CONVERTKIT_API_FORM_ID'],
+ position: 'before_after_content'
+ );
}
/**
@@ -233,7 +253,10 @@ public function testAddNewPageUsingDefaultFormAfterParagraphElement(EndToEndTest
$I->setupKitPluginResources($I);
// Setup Page with placeholder content.
- $pageID = $I->addGutenbergPageToDatabase($I, 'page', 'Kit: Page: Form: Default: After 3rd Paragraph Element');
+ $pageID = $I->addGutenbergPageToDatabase(
+ $I,
+ title: 'Kit: Page: Form: Default: After 3rd Paragraph Element'
+ );
// View the Page on the frontend site.
$I->amOnPage('?p=' . $pageID);
@@ -242,7 +265,13 @@ public function testAddNewPageUsingDefaultFormAfterParagraphElement(EndToEndTest
$I->checkNoWarningsAndNoticesOnScreen($I);
// Confirm that one Kit Form is output in the DOM after the third paragraph.
- $I->seeFormOutput($I, $_ENV['CONVERTKIT_API_FORM_ID'], 'after_element', 'p', 3);
+ $I->seeFormOutput(
+ $I,
+ formID: $_ENV['CONVERTKIT_API_FORM_ID'],
+ position: 'after_element',
+ element: 'p',
+ elementIndex: 3
+ );
// Confirm character encoding is not broken due to using DOMDocument.
$I->seeInSource('Adhaésionés altéram improbis mi pariendarum sit stulti triarium');
@@ -275,7 +304,10 @@ public function testAddNewPageUsingDefaultNonInlineFormAfterParagraphElement(End
$I->setupKitPluginResources($I);
// Setup Page with placeholder content.
- $pageID = $I->addGutenbergPageToDatabase($I, 'page', 'Kit: Page: Non-Inline Form: Default: After 3rd Paragraph Element');
+ $pageID = $I->addGutenbergPageToDatabase(
+ $I,
+ title: 'Kit: Page: Non-Inline Form: Default: After 3rd Paragraph Element'
+ );
// View the Page on the frontend site.
$I->amOnPage('?p=' . $pageID);
@@ -318,7 +350,10 @@ public function testAddNewPageUsingDefaultFormAfterHeadingElement(EndToEndTester
$I->setupKitPluginResources($I);
// Setup Page with placeholder content.
- $pageID = $I->addGutenbergPageToDatabase($I, 'page', 'Kit: Page: Form: Default: After 2nd H2 Element');
+ $pageID = $I->addGutenbergPageToDatabase(
+ $I,
+ title: 'Kit: Page: Form: Default: After 2nd H2 Element'
+ );
// View the Page on the frontend site.
$I->amOnPage('?p=' . $pageID);
@@ -327,7 +362,13 @@ public function testAddNewPageUsingDefaultFormAfterHeadingElement(EndToEndTester
$I->checkNoWarningsAndNoticesOnScreen($I);
// Confirm that one Kit Form is output in the DOM after the second element.
- $I->seeFormOutput($I, $_ENV['CONVERTKIT_API_FORM_ID'], 'after_element', 'h2', 2);
+ $I->seeFormOutput(
+ $I,
+ formID: $_ENV['CONVERTKIT_API_FORM_ID'],
+ position: 'after_element',
+ element: 'h2',
+ elementIndex: 2
+ );
// Confirm character encoding is not broken due to using DOMDocument.
$I->seeInSource('Adhaésionés altéram improbis mi pariendarum sit stulti triarium');
@@ -360,7 +401,10 @@ public function testAddNewPageUsingDefaultFormAfterImageElement(EndToEndTester $
$I->setupKitPluginResources($I);
// Setup Page with placeholder content.
- $pageID = $I->addGutenbergPageToDatabase($I, 'page', 'Kit: Page: Form: Default: After 2nd H2 Element');
+ $pageID = $I->addGutenbergPageToDatabase(
+ $I,
+ title: 'Kit: Page: Form: Default: After 2nd Image Element'
+ );
// View the Post on the frontend site.
$I->amOnPage('?p=' . $pageID);
@@ -369,7 +413,13 @@ public function testAddNewPageUsingDefaultFormAfterImageElement(EndToEndTester $
$I->checkNoWarningsAndNoticesOnScreen($I);
// Confirm that one Kit Form is output in the DOM after the second
element.
- $I->seeFormOutput($I, $_ENV['CONVERTKIT_API_FORM_ID'], 'after_element', 'img', 2);
+ $I->seeFormOutput(
+ $I,
+ formID: $_ENV['CONVERTKIT_API_FORM_ID'],
+ position: 'after_element',
+ element: 'img',
+ elementIndex: 2
+ );
// Confirm character encoding is not broken due to using DOMDocument.
$I->seeInSource('Adhaésionés altéram improbis mi pariendarum sit stulti triarium');
@@ -405,7 +455,10 @@ public function testAddNewPageUsingDefaultFormAfterOutOfBoundsElement(EndToEndTe
$I->setupKitPluginResources($I);
// Setup Page with placeholder content.
- $pageID = $I->addGutenbergPageToDatabase($I, 'page', 'Kit: Page: Form: Default: After 9th Paragraph Element');
+ $pageID = $I->addGutenbergPageToDatabase(
+ $I,
+ title: 'Kit: Page: Form: Default: After 9th Paragraph Element'
+ );
// View the Page on the frontend site.
$I->amOnPage('?p=' . $pageID);
@@ -415,7 +468,11 @@ public function testAddNewPageUsingDefaultFormAfterOutOfBoundsElement(EndToEndTe
// Confirm that one Kit Form is output in the DOM after the content, as
// the number of paragraphs is less than the position.
- $I->seeFormOutput($I, $_ENV['CONVERTKIT_API_FORM_ID'], 'after_content');
+ $I->seeFormOutput(
+ $I,
+ formID: $_ENV['CONVERTKIT_API_FORM_ID'],
+ position: 'after_content'
+ );
// Confirm character encoding is not broken due to using DOMDocument.
$I->seeInSource('Adhaésionés altéram improbis mi pariendarum sit stulti triarium');
@@ -446,13 +503,16 @@ public function testAddNewPageUsingDefaultLegacyForm(EndToEndTester $I)
$I->setupKitPluginResources($I);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Form: Legacy: Default');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Form: Legacy: Default'
+ );
// Configure metabox's Form setting = Default.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'form' => [ 'select2', 'Default' ],
]
);
@@ -482,13 +542,16 @@ public function testAddNewPageUsingNoForm(EndToEndTester $I)
$I->setupKitPluginResources($I);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Form: None');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Form: None'
+ );
// Configure metabox's Form setting = None.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'form' => [ 'select2', 'None' ],
]
);
@@ -515,13 +578,16 @@ public function testAddNewPageUsingDefinedForm(EndToEndTester $I)
$I->setupKitPluginResources($I);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Form: ' . $_ENV['CONVERTKIT_API_FORM_NAME']);
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Form: ' . $_ENV['CONVERTKIT_API_FORM_NAME']
+ );
// Configure metabox's Form setting = None.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'form' => [ 'select2', $_ENV['CONVERTKIT_API_FORM_NAME'] ],
]
);
@@ -552,13 +618,16 @@ public function testAddNewPageUsingModalFormWithAutoptimizePlugin(EndToEndTester
$I->activateThirdPartyPlugin($I, 'autoptimize');
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Form: ' . $_ENV['CONVERTKIT_API_FORM_FORMAT_MODAL_NAME'] . ': Autoptimize');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Form: ' . $_ENV['CONVERTKIT_API_FORM_FORMAT_MODAL_NAME'] . ': Autoptimize'
+ );
// Configure metabox's Form setting = None.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'form' => [ 'select2', $_ENV['CONVERTKIT_API_FORM_FORMAT_MODAL_NAME'] ],
]
);
@@ -598,13 +667,16 @@ public function testAddNewPageUsingModalFormWithJetpackBoostPlugin(EndToEndTeste
$I->click('#inspector-toggle-control-1');
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Form: ' . $_ENV['CONVERTKIT_API_FORM_FORMAT_MODAL_NAME'] . ': Jetpack Boost');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Form: ' . $_ENV['CONVERTKIT_API_FORM_FORMAT_MODAL_NAME'] . ': Jetpack Boost'
+ );
// Configure metabox's Form setting = None.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'form' => [ 'select2', $_ENV['CONVERTKIT_API_FORM_FORMAT_MODAL_NAME'] ],
]
);
@@ -644,13 +716,16 @@ public function testAddNewPageUsingModalFormWithLiteSpeedCachePlugin(EndToEndTes
$I->enableLiteSpeedCacheLoadJSDeferred($I);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Form: ' . $_ENV['CONVERTKIT_API_FORM_FORMAT_MODAL_NAME'] . ': LiteSpeed Cache');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Form: ' . $_ENV['CONVERTKIT_API_FORM_FORMAT_MODAL_NAME'] . ': LiteSpeed Cache'
+ );
// Configure metabox's Form setting = None.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'form' => [ 'select2', $_ENV['CONVERTKIT_API_FORM_FORMAT_MODAL_NAME'] ],
]
);
@@ -688,13 +763,16 @@ public function testAddNewPageUsingModalFormWithSitegroundSpeedOptimizerPlugin(E
$I->haveOptionInDatabase('siteground_optimizer_combine_javascript', '1');
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Form: ' . $_ENV['CONVERTKIT_API_FORM_FORMAT_MODAL_NAME'] . ': Siteground Speed Optimizer');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Form: ' . $_ENV['CONVERTKIT_API_FORM_FORMAT_MODAL_NAME'] . ': Siteground Speed Optimizer'
+ );
// Configure metabox's Form setting = None.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'form' => [ 'select2', $_ENV['CONVERTKIT_API_FORM_FORMAT_MODAL_NAME'] ],
]
);
@@ -739,13 +817,16 @@ public function testAddNewPageUsingModalFormWithPerfmattersPlugin(EndToEndTester
);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Form: ' . $_ENV['CONVERTKIT_API_FORM_FORMAT_MODAL_NAME'] . ': Perfmatters');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Form: ' . $_ENV['CONVERTKIT_API_FORM_FORMAT_MODAL_NAME'] . ': Perfmatters'
+ );
// Configure metabox's Form setting = None.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'form' => [ 'select2', $_ENV['CONVERTKIT_API_FORM_FORMAT_MODAL_NAME'] ],
]
);
@@ -783,13 +864,16 @@ public function testAddNewPageUsingModalFormWithWPRocketPlugin(EndToEndTester $I
$I->enableWPRocketDelayJS($I);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Form: ' . $_ENV['CONVERTKIT_API_FORM_FORMAT_MODAL_NAME'] . ': WP Rocket');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Form: ' . $_ENV['CONVERTKIT_API_FORM_FORMAT_MODAL_NAME'] . ': WP Rocket'
+ );
// Configure metabox's Form setting = None.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'form' => [ 'select2', $_ENV['CONVERTKIT_API_FORM_FORMAT_MODAL_NAME'] ],
]
);
@@ -828,13 +912,16 @@ public function testAddNewPageUsingDefinedLegacyForm(EndToEndTester $I)
$I->setupKitPluginResources($I);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Form: ' . $_ENV['CONVERTKIT_API_LEGACY_FORM_NAME']);
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Form: ' . $_ENV['CONVERTKIT_API_LEGACY_FORM_NAME']
+ );
// Configure metabox's Form setting = None.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'form' => [ 'select2', $_ENV['CONVERTKIT_API_LEGACY_FORM_NAME'] ],
]
);
@@ -923,9 +1010,9 @@ public function testQuickEditUsingDefaultForm(EndToEndTester $I)
// Quick Edit the Page in the Pages WP_List_Table.
$I->quickEdit(
$I,
- 'page',
- $pageID,
- [
+ postType: 'page',
+ postID: $pageID,
+ configuration: [
'form' => [ 'select', 'Default' ],
]
);
@@ -966,9 +1053,9 @@ public function testQuickEditUsingDefinedForm(EndToEndTester $I)
// Quick Edit the Page in the Pages WP_List_Table.
$I->quickEdit(
$I,
- 'page',
- $pageID,
- [
+ postType: 'page',
+ postID: $pageID,
+ configuration: [
'form' => [ 'select', $_ENV['CONVERTKIT_API_FORM_NAME'] ],
]
);
@@ -1017,9 +1104,9 @@ public function testBulkEditUsingDefaultForm(EndToEndTester $I)
// Bulk Edit the Pages in the Pages WP_List_Table.
$I->bulkEdit(
$I,
- 'page',
- $pageIDs,
- [
+ postType: 'page',
+ postIDs: $pageIDs,
+ configuration: [
'form' => [ 'select', 'Default' ],
]
);
@@ -1071,9 +1158,9 @@ public function testBulkEditUsingDefinedForm(EndToEndTester $I)
// Bulk Edit the Pages in the Pages WP_List_Table.
$I->bulkEdit(
$I,
- 'page',
- $pageIDs,
- [
+ postType: 'page',
+ postIDs: $pageIDs,
+ configuration: [
'form' => [ 'select', $_ENV['CONVERTKIT_API_FORM_NAME'] ],
]
);
@@ -1139,9 +1226,9 @@ public function testBulkEditWithNoChanges(EndToEndTester $I)
// Bulk Edit the Pages in the Pages WP_List_Table.
$I->bulkEdit(
$I,
- 'page',
- $pageIDs,
- [
+ postType: 'page',
+ postIDs: $pageIDs,
+ configuration: [
'form' => [ 'select', '— No Change —' ],
]
);
diff --git a/tests/EndToEnd/forms/post-types/PostFormCest.php b/tests/EndToEnd/forms/post-types/PostFormCest.php
index 6b3b699e6..9d545a09e 100644
--- a/tests/EndToEnd/forms/post-types/PostFormCest.php
+++ b/tests/EndToEnd/forms/post-types/PostFormCest.php
@@ -61,13 +61,17 @@ public function testAddNewPostUsingDefaultFormWithNoDefaultFormSpecifiedInPlugin
$I->setupKitPluginResources($I);
// Add a Post using the Gutenberg editor.
- $I->addGutenbergPage($I, 'post', 'Kit: Post: Form: Default: None');
+ $I->addGutenbergPage(
+ $I,
+ postType: 'post',
+ title: 'Kit: Post: Form: Default: None'
+ );
// Check the order of the Form resources are alphabetical, with the Default and None options prepending the Forms.
$I->checkSelectFormOptionOrder(
$I,
- '#wp-convertkit-form',
- [
+ selectElement: '#wp-convertkit-form',
+ prependOptions: [
'Default',
'None',
]
@@ -76,8 +80,8 @@ public function testAddNewPostUsingDefaultFormWithNoDefaultFormSpecifiedInPlugin
// Configure metabox's Form setting = Default.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'form' => [ 'select2', 'Default' ],
]
);
@@ -104,13 +108,17 @@ public function testAddNewPostUsingDefaultForm(EndToEndTester $I)
$I->setupKitPluginResources($I);
// Add a Post using the Gutenberg editor.
- $I->addGutenbergPage($I, 'post', 'Kit: Post: Form: Default');
+ $I->addGutenbergPage(
+ $I,
+ postType: 'post',
+ title: 'Kit: Post: Form: Default'
+ );
// Configure metabox's Form setting = Default.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'form' => [ 'select2', 'Default' ],
]
);
@@ -144,7 +152,11 @@ public function testAddNewPostUsingDefaultFormBeforeContent(EndToEndTester $I)
$I->setupKitPluginResources($I);
// Add a Post using the Gutenberg editor.
- $I->addGutenbergPage($I, 'post', 'Kit: Post: Form: Default: Before Content');
+ $I->addGutenbergPage(
+ $I,
+ postType: 'post',
+ title: 'Kit: Post: Form: Default: Before Content'
+ );
// Add paragraph to Post.
$I->addGutenbergParagraphBlock($I, 'Post content');
@@ -152,8 +164,8 @@ public function testAddNewPostUsingDefaultFormBeforeContent(EndToEndTester $I)
// Configure metabox's Form setting = Default.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'form' => [ 'select2', 'Default' ],
]
);
@@ -163,7 +175,11 @@ public function testAddNewPostUsingDefaultFormBeforeContent(EndToEndTester $I)
// Confirm that one Kit Form is output in the DOM after the Post content.
// This confirms that there is only one script on the post for this form, which renders the form.
- $I->seeFormOutput($I, $_ENV['CONVERTKIT_API_FORM_ID'], 'before_content');
+ $I->seeFormOutput(
+ $I,
+ formID: $_ENV['CONVERTKIT_API_FORM_ID'],
+ position: 'before_content'
+ );
}
/**
@@ -187,7 +203,11 @@ public function testAddNewPostUsingDefaultFormBeforeAndAfterContent(EndToEndTest
$I->setupKitPluginResources($I);
// Add a Post using the Gutenberg editor.
- $I->addGutenbergPage($I, 'post', 'Kit: Post: Form: Default: Before and After Content');
+ $I->addGutenbergPage(
+ $I,
+ postType: 'post',
+ title: 'Kit: Post: Form: Default: Before and After Content'
+ );
// Add paragraph to Post.
$I->addGutenbergParagraphBlock($I, 'Post content');
@@ -195,8 +215,8 @@ public function testAddNewPostUsingDefaultFormBeforeAndAfterContent(EndToEndTest
// Configure metabox's Form setting = Default.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'form' => [ 'select2', 'Default' ],
]
);
@@ -205,7 +225,11 @@ public function testAddNewPostUsingDefaultFormBeforeAndAfterContent(EndToEndTest
$I->publishAndViewGutenbergPage($I);
// Confirm that two Kit Forms are output in the DOM before and after the Post content.
- $I->seeFormOutput($I, $_ENV['CONVERTKIT_API_FORM_ID'], 'before_after_content');
+ $I->seeFormOutput(
+ $I,
+ formID: $_ENV['CONVERTKIT_API_FORM_ID'],
+ position: 'before_after_content'
+ );
}
/**
@@ -232,7 +256,11 @@ public function testAddNewPostUsingDefaultFormAfterParagraphElement(EndToEndTest
$I->setupKitPluginResources($I);
// Setup Post with placeholder content.
- $pageID = $I->addGutenbergPageToDatabase($I, 'post', 'Kit: Post: Form: Default: After 3rd Paragraph Element');
+ $pageID = $I->addGutenbergPageToDatabase(
+ $I,
+ postType: 'post',
+ title: 'Kit: Post: Form: Default: After 3rd Paragraph Element'
+ );
// View the Post on the frontend site.
$I->amOnPage('?p=' . $pageID);
@@ -241,7 +269,13 @@ public function testAddNewPostUsingDefaultFormAfterParagraphElement(EndToEndTest
$I->checkNoWarningsAndNoticesOnScreen($I);
// Confirm that one Kit Form is output in the DOM after the third paragraph.
- $I->seeFormOutput($I, $_ENV['CONVERTKIT_API_FORM_ID'], 'after_element', 'p', 3);
+ $I->seeFormOutput(
+ $I,
+ formID: $_ENV['CONVERTKIT_API_FORM_ID'],
+ position: 'after_element',
+ element: 'p',
+ elementIndex: 3
+ );
// Confirm character encoding is not broken due to using DOMDocument.
$I->seeInSource('Adhaésionés altéram improbis mi pariendarum sit stulti triarium');
@@ -274,7 +308,11 @@ public function testAddNewPostUsingDefaultNonInlineFormAfterParagraphElement(End
$I->setupKitPluginResources($I);
// Setup Post with placeholder content.
- $pageID = $I->addGutenbergPageToDatabase($I, 'post', 'Kit: Post: Non-Inline Form: Default: After 3rd Paragraph Element');
+ $pageID = $I->addGutenbergPageToDatabase(
+ $I,
+ postType: 'post',
+ title: 'Kit: Post: Non-Inline Form: Default: After 3rd Paragraph Element'
+ );
// View the Page on the frontend site.
$I->amOnPage('?p=' . $pageID);
@@ -317,7 +355,11 @@ public function testAddNewPostUsingDefaultFormAfterHeadingElement(EndToEndTester
$I->setupKitPluginResources($I);
// Setup Post with placeholder content.
- $pageID = $I->addGutenbergPageToDatabase($I, 'post', 'Kit: Post: Form: Default: After 2nd H2 Element');
+ $pageID = $I->addGutenbergPageToDatabase(
+ $I,
+ postType: 'post',
+ title: 'Kit: Post: Form: Default: After 2nd H2 Element'
+ );
// View the Post on the frontend site.
$I->amOnPage('?p=' . $pageID);
@@ -326,7 +368,13 @@ public function testAddNewPostUsingDefaultFormAfterHeadingElement(EndToEndTester
$I->checkNoWarningsAndNoticesOnScreen($I);
// Confirm that one Kit Form is output in the DOM after the second element.
- $I->seeFormOutput($I, $_ENV['CONVERTKIT_API_FORM_ID'], 'after_element', 'h2', 2);
+ $I->seeFormOutput(
+ $I,
+ formID: $_ENV['CONVERTKIT_API_FORM_ID'],
+ position: 'after_element',
+ element: 'h2',
+ elementIndex: 2
+ );
// Confirm character encoding is not broken due to using DOMDocument.
$I->seeInSource('Adhaésionés altéram improbis mi pariendarum sit stulti triarium');
@@ -359,7 +407,11 @@ public function testAddNewPostUsingDefaultFormAfterImageElement(EndToEndTester $
$I->setupKitPluginResources($I);
// Setup Post with placeholder content.
- $pageID = $I->addGutenbergPageToDatabase($I, 'post', 'Kit: Post: Form: Default: After 2nd Image Element');
+ $pageID = $I->addGutenbergPageToDatabase(
+ $I,
+ postType: 'post',
+ title: 'Kit: Post: Form: Default: After 2nd Image Element'
+ );
// View the Post on the frontend site.
$I->amOnPage('?p=' . $pageID);
@@ -368,7 +420,13 @@ public function testAddNewPostUsingDefaultFormAfterImageElement(EndToEndTester $
$I->checkNoWarningsAndNoticesOnScreen($I);
// Confirm that one Kit Form is output in the DOM after the second
element.
- $I->seeFormOutput($I, $_ENV['CONVERTKIT_API_FORM_ID'], 'after_element', 'img', 2);
+ $I->seeFormOutput(
+ $I,
+ formID: $_ENV['CONVERTKIT_API_FORM_ID'],
+ position: 'after_element',
+ element: 'img',
+ elementIndex: 2
+ );
// Confirm character encoding is not broken due to using DOMDocument.
$I->seeInSource('Adhaésionés altéram improbis mi pariendarum sit stulti triarium');
@@ -401,7 +459,11 @@ public function testAddNewPostUsingDefaultFormAfterOutOfBoundsElement(EndToEndTe
$I->setupKitPluginResources($I);
// Setup Post with placeholder content.
- $pageID = $I->addGutenbergPageToDatabase($I, 'post', 'Kit: Post: Form: Default: After 9th Paragraph Element');
+ $pageID = $I->addGutenbergPageToDatabase(
+ $I,
+ postType: 'post',
+ title: 'Kit: Post: Form: Default: After 9th Paragraph Element'
+ );
// View the Post on the frontend site.
$I->amOnPage('?p=' . $pageID);
@@ -411,7 +473,11 @@ public function testAddNewPostUsingDefaultFormAfterOutOfBoundsElement(EndToEndTe
// Confirm that one Kit Form is output in the DOM after the content, as
// the number of paragraphs is less than the position.
- $I->seeFormOutput($I, $_ENV['CONVERTKIT_API_FORM_ID'], 'after_content');
+ $I->seeFormOutput(
+ $I,
+ formID: $_ENV['CONVERTKIT_API_FORM_ID'],
+ position: 'after_content'
+ );
// Confirm character encoding is not broken due to using DOMDocument.
$I->seeInSource('Adhaésionés altéram improbis mi pariendarum sit stulti triarium');
@@ -442,13 +508,17 @@ public function testAddNewPostUsingDefaultLegacyForm(EndToEndTester $I)
$I->setupKitPluginResources($I);
// Add a Post using the Gutenberg editor.
- $I->addGutenbergPage($I, 'post', 'Kit: Post: Form: Legacy: Default');
+ $I->addGutenbergPage(
+ $I,
+ postType: 'post',
+ title: 'Kit: Post: Form: Legacy: Default'
+ );
// Configure metabox's Form setting = Default.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'form' => [ 'select2', 'Default' ],
]
);
@@ -475,13 +545,17 @@ public function testAddNewPostUsingNoForm(EndToEndTester $I)
$I->setupKitPluginResources($I);
// Add a Post using the Gutenberg editor.
- $I->addGutenbergPage($I, 'post', 'Kit: Post: Form: None');
+ $I->addGutenbergPage(
+ $I,
+ postType: 'post',
+ title: 'Kit: Post: Form: None'
+ );
// Configure metabox's Form setting = None.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'form' => [ 'select2', 'None' ],
]
);
@@ -508,13 +582,17 @@ public function testAddNewPostUsingDefinedForm(EndToEndTester $I)
$I->setupKitPluginResources($I);
// Add a Post using the Gutenberg editor.
- $I->addGutenbergPage($I, 'post', 'Kit: Post: Form: ' . $_ENV['CONVERTKIT_API_FORM_NAME']);
+ $I->addGutenbergPage(
+ $I,
+ postType: 'post',
+ title: 'Kit: Post: Form: ' . $_ENV['CONVERTKIT_API_FORM_NAME']
+ );
// Configure metabox's Form setting = None.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'form' => [ 'select2', $_ENV['CONVERTKIT_API_FORM_NAME'] ],
]
);
@@ -549,13 +627,17 @@ public function testAddNewPostUsingDefinedLegacyForm(EndToEndTester $I)
$I->setupKitPluginResources($I);
// Add a Post using the Gutenberg editor.
- $I->addGutenbergPage($I, 'post', 'Kit: Post: Form: ' . $_ENV['CONVERTKIT_API_LEGACY_FORM_NAME']);
+ $I->addGutenbergPage(
+ $I,
+ postType: 'post',
+ title: 'Kit: Post: Form: ' . $_ENV['CONVERTKIT_API_LEGACY_FORM_NAME']
+ );
// Configure metabox's Form setting = None.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'form' => [ 'select2', $_ENV['CONVERTKIT_API_LEGACY_FORM_NAME'] ],
]
);
@@ -641,9 +723,9 @@ public function testQuickEditUsingDefaultForm(EndToEndTester $I)
// Quick Edit the Post in the Posts WP_List_Table.
$I->quickEdit(
$I,
- 'post',
- $postID,
- [
+ postType: 'post',
+ postID: $postID,
+ configuration: [
'form' => [ 'select', 'Default' ],
]
);
@@ -684,9 +766,9 @@ public function testQuickEditUsingDefinedForm(EndToEndTester $I)
// Quick Edit the Post in the Posts WP_List_Table.
$I->quickEdit(
$I,
- 'post',
- $postID,
- [
+ postType: 'post',
+ postID: $postID,
+ configuration: [
'form' => [ 'select', $_ENV['CONVERTKIT_API_FORM_NAME'] ],
]
);
@@ -735,9 +817,9 @@ public function testBulkEditUsingDefaultForm(EndToEndTester $I)
// Bulk Edit the Posts in the Posts WP_List_Table.
$I->bulkEdit(
$I,
- 'post',
- $postIDs,
- [
+ postType: 'post',
+ postIDs: $postIDs,
+ configuration: [
'form' => [ 'select', 'Default' ],
]
);
@@ -789,9 +871,9 @@ public function testBulkEditUsingDefinedForm(EndToEndTester $I)
// Bulk Edit the Posts in the Posts WP_List_Table.
$I->bulkEdit(
$I,
- 'post',
- $postIDs,
- [
+ postType: 'post',
+ postIDs: $postIDs,
+ configuration: [
'form' => [ 'select', $_ENV['CONVERTKIT_API_FORM_NAME'] ],
]
);
@@ -857,9 +939,9 @@ public function testBulkEditWithNoChanges(EndToEndTester $I)
// Bulk Edit the Posts in the Posts WP_List_Table.
$I->bulkEdit(
$I,
- 'post',
- $postIDs,
- [
+ postType: 'post',
+ postIDs: $postIDs,
+ configuration: [
'form' => [ 'select', '— No Change —' ],
]
);
diff --git a/tests/EndToEnd/general/other/RefreshResourcesButtonCest.php b/tests/EndToEnd/general/other/RefreshResourcesButtonCest.php
index 60c4c9dff..6175901e1 100644
--- a/tests/EndToEnd/general/other/RefreshResourcesButtonCest.php
+++ b/tests/EndToEnd/general/other/RefreshResourcesButtonCest.php
@@ -51,8 +51,8 @@ public function testRefreshResourcesOnPage(EndToEndTester $I)
// Check the order of the Form resources are alphabetical, with Default and None options prepending the Forms.
$I->checkSelectFormOptionOrder(
$I,
- '#wp-convertkit-form',
- [
+ selectElement: '#wp-convertkit-form',
+ prependOptions: [
'Default',
'None',
]
@@ -60,7 +60,11 @@ public function testRefreshResourcesOnPage(EndToEndTester $I)
// Change resource to value specified in the .env file, which should now be available.
// If the expected dropdown value does not exist in the Select2 field, this will fail the test.
- $I->fillSelect2Field($I, '#select2-wp-convertkit-form-container', $_ENV['CONVERTKIT_API_FORM_NAME']);
+ $I->fillSelect2Field(
+ $I,
+ container: '#select2-wp-convertkit-form-container',
+ value: $_ENV['CONVERTKIT_API_FORM_NAME']
+ );
// Click the Landing Pages refresh button.
$I->click('button.wp-convertkit-refresh-resources[data-resource="landing_pages"]');
@@ -71,15 +75,19 @@ public function testRefreshResourcesOnPage(EndToEndTester $I)
// Check the order of the Landing Page resources are alphabetical, with the None option prepending the Landing Pages.
$I->checkSelectLandingPageOptionOrder(
$I,
- '#wp-convertkit-landing_page',
- [
+ selectElement: '#wp-convertkit-landing_page',
+ prependOptions: [
'None',
]
);
// Change resource to value specified in the .env file, which should now be available.
// If the expected dropdown value does not exist in the Select2 field, this will fail the test.
- $I->fillSelect2Field($I, '#select2-wp-convertkit-landing_page-container', $_ENV['CONVERTKIT_API_LANDING_PAGE_NAME']);
+ $I->fillSelect2Field(
+ $I,
+ container: '#select2-wp-convertkit-landing_page-container',
+ value: $_ENV['CONVERTKIT_API_LANDING_PAGE_NAME']
+ );
// Click the Tags refresh button.
$I->click('button.wp-convertkit-refresh-resources[data-resource="tags"]');
@@ -90,15 +98,19 @@ public function testRefreshResourcesOnPage(EndToEndTester $I)
// Check the order of the Tag resources are alphabetical, with the None option prepending the Tags.
$I->checkSelectTagOptionOrder(
$I,
- '#wp-convertkit-tag',
- [
+ selectElement: '#wp-convertkit-tag',
+ prependOptions: [
'None',
]
);
// Change resource to value specified in the .env file, which should now be available.
// If the expected dropdown value does not exist in the Select2 field, this will fail the test.
- $I->fillSelect2Field($I, '#select2-wp-convertkit-tag-container', $_ENV['CONVERTKIT_API_TAG_NAME']);
+ $I->fillSelect2Field(
+ $I,
+ container: '#select2-wp-convertkit-tag-container',
+ value: $_ENV['CONVERTKIT_API_TAG_NAME']
+ );
// Click the Restrict Content refresh button.
$I->click('button.wp-convertkit-refresh-resources[data-resource="restrict_content"]');
@@ -108,11 +120,19 @@ public function testRefreshResourcesOnPage(EndToEndTester $I)
// Confirm that the expected Tag is within the Tags option group and selectable.
$I->seeElementInDOM('select#wp-convertkit-restrict_content optgroup[data-resource="tags"] option[value="tag_' . $_ENV['CONVERTKIT_API_TAG_ID'] . '"]');
- $I->fillSelect2Field($I, '#select2-wp-convertkit-restrict_content-container', $_ENV['CONVERTKIT_API_TAG_NAME']);
+ $I->fillSelect2Field(
+ $I,
+ container: '#select2-wp-convertkit-restrict_content-container',
+ value: $_ENV['CONVERTKIT_API_TAG_NAME']
+ );
// Confirm that the expected Product is within the Products option group and selectable.
$I->seeElementInDOM('select#wp-convertkit-restrict_content optgroup[data-resource="products"] option[value="product_' . $_ENV['CONVERTKIT_API_PRODUCT_ID'] . '"]');
- $I->fillSelect2Field($I, '#select2-wp-convertkit-restrict_content-container', $_ENV['CONVERTKIT_API_PRODUCT_NAME']);
+ $I->fillSelect2Field(
+ $I,
+ container: '#select2-wp-convertkit-restrict_content-container',
+ value: $_ENV['CONVERTKIT_API_PRODUCT_NAME']
+ );
}
/**
@@ -147,8 +167,8 @@ public function testRefreshResourcesOnQuickEdit(EndToEndTester $I)
// Check the order of the Form resources are alphabetical, with Default and None options prepending the Forms.
$I->checkSelectFormOptionOrder(
$I,
- '#wp-convertkit-quick-edit-form',
- [
+ selectElement: '#wp-convertkit-quick-edit-form',
+ prependOptions: [
'Default',
'None',
]
@@ -167,8 +187,8 @@ public function testRefreshResourcesOnQuickEdit(EndToEndTester $I)
// Check the order of the Tag resources are alphabetical, with the None option prepending the Tags.
$I->checkSelectTagOptionOrder(
$I,
- '#wp-convertkit-quick-edit-tag',
- [
+ selectElement: '#wp-convertkit-quick-edit-tag',
+ prependOptions: [
'None',
]
);
@@ -232,8 +252,8 @@ public function testRefreshResourcesOnBulkEdit(EndToEndTester $I)
// Check the order of the Form resources are alphabetical, with No Change, Default and None options prepending the Forms.
$I->checkSelectFormOptionOrder(
$I,
- '#wp-convertkit-bulk-edit-form',
- [
+ selectElement: '#wp-convertkit-bulk-edit-form',
+ prependOptions: [
'— No Change —',
'Default',
'None',
@@ -253,8 +273,8 @@ public function testRefreshResourcesOnBulkEdit(EndToEndTester $I)
// Check the order of the Tag resources are alphabetical, with the No Chage and None options prepending the Tags.
$I->checkSelectTagOptionOrder(
$I,
- '#wp-convertkit-bulk-edit-tag',
- [
+ selectElement: '#wp-convertkit-bulk-edit-tag',
+ prependOptions: [
'— No Change —',
'None',
]
@@ -303,8 +323,8 @@ public function testRefreshResourcesOnAddCategory(EndToEndTester $I)
// Check the order of the Form resources are alphabetical, with the Default option prepending the Forms.
$I->checkSelectFormOptionOrder(
$I,
- '#wp-convertkit-form',
- [
+ selectElement: '#wp-convertkit-form',
+ prependOptions: [
'Default',
'None',
]
@@ -312,7 +332,11 @@ public function testRefreshResourcesOnAddCategory(EndToEndTester $I)
// Change resource to value specified in the .env file, which should now be available.
// If the expected dropdown value does not exist in the Select2 field, this will fail the test.
- $I->fillSelect2Field($I, '#select2-wp-convertkit-form-container', $_ENV['CONVERTKIT_API_FORM_NAME']);
+ $I->fillSelect2Field(
+ $I,
+ container: '#select2-wp-convertkit-form-container',
+ value: $_ENV['CONVERTKIT_API_FORM_NAME']
+ );
}
/**
@@ -343,8 +367,8 @@ public function testRefreshResourcesOnEditCategory(EndToEndTester $I)
// Check the order of the Form resources are alphabetical, with the Default option prepending the Forms.
$I->checkSelectFormOptionOrder(
$I,
- '#wp-convertkit-form',
- [
+ selectElement: '#wp-convertkit-form',
+ prependOptions: [
'Default',
'None',
]
@@ -352,7 +376,11 @@ public function testRefreshResourcesOnEditCategory(EndToEndTester $I)
// Change resource to value specified in the .env file, which should now be available.
// If the expected dropdown value does not exist in the Select2 field, this will fail the test.
- $I->fillSelect2Field($I, '#select2-wp-convertkit-form-container', $_ENV['CONVERTKIT_API_FORM_NAME']);
+ $I->fillSelect2Field(
+ $I,
+ container: '#select2-wp-convertkit-form-container',
+ value: $_ENV['CONVERTKIT_API_FORM_NAME']
+ );
}
/**
@@ -386,13 +414,16 @@ public function testRefreshResourcesOnFormBlock(EndToEndTester $I)
);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Forms: Block: Refresh Button');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Forms: Block: Refresh Button'
+ );
// Add block to Page.
$I->addGutenbergBlock(
$I,
- 'Kit Form',
- 'convertkit-form'
+ blockName: 'Kit Form',
+ blockProgrammaticName: 'convertkit-form'
);
// Click the refresh button.
@@ -441,7 +472,10 @@ public function testRefreshResourcesOnFormShortcodeUsingTinyMCE(EndToEndTester $
);
// Add a Page using the Classic Editor.
- $I->addClassicEditorPage($I, 'page', 'Kit: Page: Form: Shortcode: Visual Editor: Refresh Button');
+ $I->addClassicEditorPage(
+ $I,
+ title: 'Kit: Page: Form: Shortcode: Visual Editor: Refresh Button'
+ );
// Open Visual Editor shortcode modal.
$I->openVisualEditorShortcodeModal($I, 'Kit Form');
@@ -501,7 +535,10 @@ public function testRefreshResourcesOnFormShortcodeUsingTextEditor(EndToEndTeste
);
// Add a Page using the Classic Editor.
- $I->addClassicEditorPage($I, 'page', 'Kit: Page: Form: Shortcode: Text Editor: Refresh Button');
+ $I->addClassicEditorPage(
+ $I,
+ title: 'Kit: Page: Form: Shortcode: Text Editor: Refresh Button'
+ );
// Open Text Editor shortcode modal.
$I->openTextEditorShortcodeModal($I, 'convertkit-form');
@@ -560,13 +597,16 @@ public function testRefreshResourcesOnFormTriggerBlock(EndToEndTester $I)
);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Form Trigger: Block: Refresh Button');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Form Trigger: Block: Refresh Button'
+ );
// Add block to Page.
$I->addGutenbergBlock(
$I,
- 'Kit Form Trigger',
- 'convertkit-formtrigger'
+ blockName: 'Kit Form Trigger',
+ blockProgrammaticName: 'convertkit-formtrigger'
);
// Click the refresh button.
@@ -615,7 +655,10 @@ public function testRefreshResourcesOnFormTriggerShortcodeUsingTinyMCE(EndToEndT
);
// Add a Page using the Classic Editor.
- $I->addClassicEditorPage($I, 'page', 'Kit: Page: Form Trigger: Shortcode: Visual Editor: Refresh Button');
+ $I->addClassicEditorPage(
+ $I,
+ title: 'Kit: Page: Form Trigger: Shortcode: Visual Editor: Refresh Button'
+ );
// Open Visual Editor shortcode modal.
$I->openVisualEditorShortcodeModal($I, 'Kit Form Trigger');
@@ -675,7 +718,10 @@ public function testRefreshResourcesOnFormTriggerShortcodeUsingTextEditor(EndToE
);
// Add a Page using the Classic Editor.
- $I->addClassicEditorPage($I, 'page', 'Kit: Page: Form Trigger: Shortcode: Text Editor: Refresh Button');
+ $I->addClassicEditorPage(
+ $I,
+ title: 'Kit: Page: Form Trigger: Shortcode: Text Editor: Refresh Button'
+ );
// Open Text Editor shortcode modal.
$I->openTextEditorShortcodeModal($I, 'convertkit-formtrigger');
@@ -729,13 +775,16 @@ public function testRefreshResourcesOnProductBlock(EndToEndTester $I)
);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Product: Block: Refresh Button');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Product: Block: Refresh Button'
+ );
// Add block to Page.
$I->addGutenbergBlock(
$I,
- 'Kit Product',
- 'convertkit-product'
+ blockName: 'Kit Product',
+ blockProgrammaticName: 'convertkit-product'
);
// Click the refresh button.
@@ -779,7 +828,10 @@ public function testRefreshResourcesOnProductShortcodeUsingTinyMCE(EndToEndTeste
);
// Add a Page using the Classic Editor.
- $I->addClassicEditorPage($I, 'page', 'Kit: Page: Product: Shortcode: Visual Editor: Refresh Button');
+ $I->addClassicEditorPage(
+ $I,
+ title: 'Kit: Page: Product: Shortcode: Visual Editor: Refresh Button'
+ );
// Open Visual Editor shortcode modal.
$I->openVisualEditorShortcodeModal($I, 'Kit Product');
@@ -834,7 +886,10 @@ public function testRefreshResourcesOnProductShortcodeUsingTextEditor(EndToEndTe
);
// Add a Page using the Classic Editor.
- $I->addClassicEditorPage($I, 'page', 'Kit: Page: Product: Shortcode: Text Editor: Refresh Button');
+ $I->addClassicEditorPage(
+ $I,
+ title: 'Kit: Page: Product: Shortcode: Text Editor: Refresh Button'
+ );
// Open Text Editor shortcode modal.
$I->openTextEditorShortcodeModal($I, 'convertkit-product');
@@ -908,7 +963,10 @@ public function testRefreshResourcesErrorNoticeOnPageClassicEditor(EndToEndTeste
$I->setupKitPluginFakeAPIKey($I);
// Add a Page using the Classic Editor.
- $I->addClassicEditorPage($I, 'page', 'Kit: Page: Refresh Resources: Classic Editor' );
+ $I->addClassicEditorPage(
+ $I,
+ title: 'Kit: Page: Refresh Resources: Classic Editor'
+ );
// Click the Forms refresh button.
$I->click('button.wp-convertkit-refresh-resources[data-resource="forms"]');
diff --git a/tests/EndToEnd/general/other/ReviewRequestCest.php b/tests/EndToEnd/general/other/ReviewRequestCest.php
index 3bcae7c9d..96e20cf1b 100644
--- a/tests/EndToEnd/general/other/ReviewRequestCest.php
+++ b/tests/EndToEnd/general/other/ReviewRequestCest.php
@@ -40,8 +40,16 @@ public function testReviewRequestOnSaveSettings(EndToEndTester $I)
$I->loadKitSettingsGeneralScreen($I);
// Select Default Form for Pages and Posts.
- $I->fillSelect2Field($I, '#select2-_wp_convertkit_settings_page_form-container', $_ENV['CONVERTKIT_API_FORM_NAME']);
- $I->fillSelect2Field($I, '#select2-_wp_convertkit_settings_post_form-container', $_ENV['CONVERTKIT_API_FORM_NAME']);
+ $I->fillSelect2Field(
+ $I,
+ container: '#select2-_wp_convertkit_settings_page_form-container',
+ value: $_ENV['CONVERTKIT_API_FORM_NAME']
+ );
+ $I->fillSelect2Field(
+ $I,
+ container: '#select2-_wp_convertkit_settings_post_form-container',
+ value: $_ENV['CONVERTKIT_API_FORM_NAME']
+ );
// Click the Save Changes button.
$I->click('Save Changes');
@@ -99,13 +107,16 @@ public function testReviewRequestOnSavePageWithFormSpecified(EndToEndTester $I)
$I->setupKitPluginResources($I);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Test Review Request on Save with Form Specified');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Test Review Request on Save with Form Specified'
+ );
// Configure metabox's Form setting = Default.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'form' => [ 'select2', $_ENV['CONVERTKIT_API_FORM_NAME'] ],
]
);
@@ -139,13 +150,16 @@ public function testReviewRequestOnSavePageWithLandingPageSpecified(EndToEndTest
$I->setupKitPluginResources($I);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Test Review Request on Save with Form Specified');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Test Review Request on Save with Landing Page Specified'
+ );
// Configure metabox's Form setting = Default.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'landing_page' => [ 'select2', $_ENV['CONVERTKIT_API_LANDING_PAGE_NAME'] ],
]
);
diff --git a/tests/EndToEnd/general/plugin-screens/PluginSettingsGeneralCest.php b/tests/EndToEnd/general/plugin-screens/PluginSettingsGeneralCest.php
index 3b76dd0bf..7eaad9222 100644
--- a/tests/EndToEnd/general/plugin-screens/PluginSettingsGeneralCest.php
+++ b/tests/EndToEnd/general/plugin-screens/PluginSettingsGeneralCest.php
@@ -246,7 +246,11 @@ public function testChangeDefaultFormSettingAndPreviewFormLinks(EndToEndTester $
$I->loadKitSettingsGeneralScreen($I);
// Select Default Form for Pages, and change the Position.
- $I->fillSelect2Field($I, '#select2-_wp_convertkit_settings_page_form-container', $_ENV['CONVERTKIT_API_FORM_NAME']);
+ $I->fillSelect2Field(
+ $I,
+ container: '#select2-_wp_convertkit_settings_page_form-container',
+ value: $_ENV['CONVERTKIT_API_FORM_NAME']
+ );
$I->selectOption('_wp_convertkit_settings[page_form_position]', 'Before Page content');
// Open preview.
@@ -267,7 +271,11 @@ public function testChangeDefaultFormSettingAndPreviewFormLinks(EndToEndTester $
$I->closeTab();
// Select Default Form for Posts.
- $I->fillSelect2Field($I, '#select2-_wp_convertkit_settings_post_form-container', $_ENV['CONVERTKIT_API_FORM_NAME']);
+ $I->fillSelect2Field(
+ $I,
+ container: '#select2-_wp_convertkit_settings_post_form-container',
+ value: $_ENV['CONVERTKIT_API_FORM_NAME']
+ );
// Open preview.
$I->click('a#convertkit-preview-form-post');
@@ -317,7 +325,11 @@ public function testChangeDefaultSiteWideFormsSettingAndPreviewFormLinks(EndToEn
$I->loadKitSettingsGeneralScreen($I);
// Select the Sticky Bar Form for the Site Wide option.
- $I->fillSelect2MultipleField($I, '#select2-_wp_convertkit_settings_non_inline_form-container', $_ENV['CONVERTKIT_API_FORM_FORMAT_STICKY_BAR_NAME']);
+ $I->fillSelect2MultipleField(
+ $I,
+ container: '#select2-_wp_convertkit_settings_non_inline_form-container',
+ value: $_ENV['CONVERTKIT_API_FORM_FORMAT_STICKY_BAR_NAME']
+ );
// Open preview.
$I->click('a#convertkit-preview-non-inline-form');
@@ -337,7 +349,11 @@ public function testChangeDefaultSiteWideFormsSettingAndPreviewFormLinks(EndToEn
$I->closeTab();
// Select a second Modal Form for the Site Wide option.
- $I->fillSelect2MultipleField($I, '#select2-_wp_convertkit_settings_non_inline_form-container', $_ENV['CONVERTKIT_API_FORM_FORMAT_MODAL_NAME']);
+ $I->fillSelect2MultipleField(
+ $I,
+ container: '#select2-_wp_convertkit_settings_non_inline_form-container',
+ value: $_ENV['CONVERTKIT_API_FORM_FORMAT_MODAL_NAME']
+ );
// Open preview.
$I->click('a#convertkit-preview-non-inline-form');
@@ -395,7 +411,11 @@ public function testChangeDefaultFormPositionAfterElementSetting(EndToEndTester
$I->dontSeeElement('_wp_convertkit_settings[page_form_position_element]');
// Select Default Form for Pages, and change the Position.
- $I->fillSelect2Field($I, '#select2-_wp_convertkit_settings_page_form-container', $_ENV['CONVERTKIT_API_FORM_NAME']);
+ $I->fillSelect2Field(
+ $I,
+ container: '#select2-_wp_convertkit_settings_page_form-container',
+ value: $_ENV['CONVERTKIT_API_FORM_NAME']
+ );
$I->selectOption('_wp_convertkit_settings[page_form_position]', 'After element');
// Confirm the conditional fields display for Pages, now that 'After element' is selected.
@@ -410,7 +430,11 @@ public function testChangeDefaultFormPositionAfterElementSetting(EndToEndTester
$I->dontSeeElement('select[name="_wp_convertkit_settings[post_form_position_element]"]');
// Select Default Form for Posts, and change the Position.
- $I->fillSelect2Field($I, '#select2-_wp_convertkit_settings_post_form-container', $_ENV['CONVERTKIT_API_FORM_NAME']);
+ $I->fillSelect2Field(
+ $I,
+ container: '#select2-_wp_convertkit_settings_post_form-container',
+ value: $_ENV['CONVERTKIT_API_FORM_NAME']
+ );
$I->selectOption('_wp_convertkit_settings[post_form_position]', 'After element');
// Confirm the conditional fields display for Posts, now that 'After element' is selected.
@@ -482,7 +506,11 @@ public function testPublicPrivateCustomPostTypeSettingsExist(EndToEndTester $I)
$I->loadKitSettingsGeneralScreen($I);
// Select Default Form for Articles.
- $I->fillSelect2Field($I, '#select2-_wp_convertkit_settings_article_form-container', $_ENV['CONVERTKIT_API_FORM_NAME']);
+ $I->fillSelect2Field(
+ $I,
+ container: '#select2-_wp_convertkit_settings_article_form-container',
+ value: $_ENV['CONVERTKIT_API_FORM_NAME']
+ );
// Confirm no Default Form option is displayed for the Private CPT.
$I->dontSeeElementInDOM('#_wp_convertkit_settings_private_form');
diff --git a/tests/EndToEnd/general/plugin-screens/PluginSetupWizardCest.php b/tests/EndToEnd/general/plugin-screens/PluginSetupWizardCest.php
index ac97f4045..b06dd8e61 100644
--- a/tests/EndToEnd/general/plugin-screens/PluginSetupWizardCest.php
+++ b/tests/EndToEnd/general/plugin-screens/PluginSetupWizardCest.php
@@ -239,7 +239,11 @@ public function testSetupWizardFormConfigurationScreen(EndToEndTester $I)
$this->_seeExpectedSetupWizardScreen($I, 2, 'Display an email capture form');
// Select a Post Form.
- $I->fillSelect2Field($I, '#select2-wp-convertkit-form-posts-container', $_ENV['CONVERTKIT_API_FORM_NAME']);
+ $I->fillSelect2Field(
+ $I,
+ container: '#select2-wp-convertkit-form-posts-container',
+ value: $_ENV['CONVERTKIT_API_FORM_NAME']
+ );
// Open preview.
$I->click('a#convertkit-preview-form-post');
@@ -259,7 +263,11 @@ public function testSetupWizardFormConfigurationScreen(EndToEndTester $I)
$I->closeTab();
// Select a Page Form.
- $I->fillSelect2Field($I, '#select2-wp-convertkit-form-pages-container', $_ENV['CONVERTKIT_API_FORM_NAME']);
+ $I->fillSelect2Field(
+ $I,
+ container: '#select2-wp-convertkit-form-pages-container',
+ value: $_ENV['CONVERTKIT_API_FORM_NAME']
+ );
// Open preview.
$I->click('a#convertkit-preview-form-page');
@@ -331,7 +339,11 @@ public function testSetupWizardFormConfigurationScreenWhenNoFormsExist(EndToEndT
$this->_seeExpectedSetupWizardScreen($I, 2, 'Display an email capture form');
// Confirm we can select a Post Form.
- $I->fillSelect2Field($I, '#select2-wp-convertkit-form-posts-container', $_ENV['CONVERTKIT_API_FORM_NAME']);
+ $I->fillSelect2Field(
+ $I,
+ container: '#select2-wp-convertkit-form-posts-container',
+ value: $_ENV['CONVERTKIT_API_FORM_NAME']
+ );
}
/**
diff --git a/tests/EndToEnd/integrations/divi-builder/DiviPluginBroadcastsCest.php b/tests/EndToEnd/integrations/divi-builder/DiviPluginBroadcastsCest.php
index 2669ae663..a3a2ade15 100644
--- a/tests/EndToEnd/integrations/divi-builder/DiviPluginBroadcastsCest.php
+++ b/tests/EndToEnd/integrations/divi-builder/DiviPluginBroadcastsCest.php
@@ -45,8 +45,8 @@ public function testBroadcastsModuleInBackendEditor(EndToEndTester $I)
// Insert the Broadcasts module.
$I->insertDiviRowWithModule(
$I,
- 'Kit Broadcasts',
- 'convertkit_broadcasts'
+ name: 'Kit Broadcasts',
+ programmaticName:'convertkit_broadcasts'
);
// Save Divi module and view the page on the frontend site.
@@ -91,8 +91,8 @@ public function testBroadcastsModuleInFrontendEditor(EndToEndTester $I)
// Insert the Broadcasts module.
$I->insertDiviRowWithModule(
$I,
- 'Kit Broadcasts',
- 'convertkit_broadcasts'
+ name: 'Kit Broadcasts',
+ programmaticName: 'convertkit_broadcasts'
);
// Save Divi module and view the page on the frontend site.
@@ -129,8 +129,8 @@ public function testBroadcastsModuleInFrontendEditorWhenNoCredentials(EndToEndTe
// Insert the Broadcasts module.
$I->insertDiviRowWithModule(
$I,
- 'Kit Broadcasts',
- 'convertkit_broadcasts'
+ name: 'Kit Broadcasts',
+ programmaticName: 'convertkit_broadcasts'
);
// Confirm the on screen message displays.
@@ -158,8 +158,8 @@ public function testBroadcastsModuleInFrontendEditorWhenNoBroadcasts(EndToEndTes
// Insert the Broadcasts module.
$I->insertDiviRowWithModule(
$I,
- 'Kit Broadcasts',
- 'convertkit_broadcasts'
+ name: 'Kit Broadcasts',
+ programmaticName: 'convertkit_broadcasts'
);
// Confirm the on screen message displays.
diff --git a/tests/EndToEnd/integrations/divi-builder/DiviPluginFormCest.php b/tests/EndToEnd/integrations/divi-builder/DiviPluginFormCest.php
index 768218d53..2de93876c 100644
--- a/tests/EndToEnd/integrations/divi-builder/DiviPluginFormCest.php
+++ b/tests/EndToEnd/integrations/divi-builder/DiviPluginFormCest.php
@@ -45,10 +45,10 @@ public function testFormModuleInBackendEditor(EndToEndTester $I)
// Insert the Form module.
$I->insertDiviRowWithModule(
$I,
- 'Kit Form',
- 'convertkit_form',
- 'form',
- $_ENV['CONVERTKIT_API_FORM_ID']
+ name: 'Kit Form',
+ programmaticName: 'convertkit_form',
+ fieldName: 'form',
+ fieldValue: $_ENV['CONVERTKIT_API_FORM_ID']
);
// Save Divi module and view the page on the frontend site.
@@ -82,10 +82,10 @@ public function testFormModuleInFrontendEditor(EndToEndTester $I)
// Insert the Form module.
$I->insertDiviRowWithModule(
$I,
- 'Kit Form',
- 'convertkit_form',
- 'form',
- $_ENV['CONVERTKIT_API_FORM_ID']
+ name: 'Kit Form',
+ programmaticName: 'convertkit_form',
+ fieldName: 'form',
+ fieldValue: $_ENV['CONVERTKIT_API_FORM_ID']
);
// Save Divi module and view the page on the frontend site.
@@ -111,8 +111,8 @@ public function testFormModuleInFrontendEditorWhenNoCredentials(EndToEndTester $
// Insert the Form module.
$I->insertDiviRowWithModule(
$I,
- 'Kit Form',
- 'convertkit_form'
+ name: 'Kit Form',
+ programmaticName: 'convertkit_form'
);
// Confirm the on screen message displays.
@@ -140,8 +140,8 @@ public function testFormModuleInFrontendEditorWhenNoForms(EndToEndTester $I)
// Insert the Form module.
$I->insertDiviRowWithModule(
$I,
- 'Kit Form',
- 'convertkit_form'
+ name: 'Kit Form',
+ programmaticName: 'convertkit_form'
);
// Confirm the on screen message displays.
@@ -174,10 +174,10 @@ public function testFormModuleWithValidLegacyFormParameter(EndToEndTester $I)
// Create Page with Form module in Divi.
$pageID = $I->createPageWithDiviModuleProgrammatically(
$I,
- 'Kit: Legacy Form: Divi Module: Valid Form Param',
- 'convertkit_form',
- 'form',
- $_ENV['CONVERTKIT_API_LEGACY_FORM_ID']
+ title: 'Kit: Legacy Form: Divi Module: Valid Form Param',
+ programmaticName: 'convertkit_form',
+ fieldName: 'form',
+ fieldValue: $_ENV['CONVERTKIT_API_LEGACY_FORM_ID']
);
// Load Page.
@@ -206,10 +206,10 @@ public function testFormModuleWithNoFormParameter(EndToEndTester $I)
// Create Page with Form module in Divi.
$pageID = $I->createPageWithDiviModuleProgrammatically(
$I,
- 'Kit: Legacy Form: Divi Module: No Form Param',
- 'convertkit_form',
- 'form',
- ''
+ title: 'Kit: Legacy Form: Divi Module: No Form Param',
+ programmaticName: 'convertkit_form',
+ fieldName: 'form',
+ fieldValue: ''
);
// Load Page.
diff --git a/tests/EndToEnd/integrations/divi-builder/DiviPluginFormTriggerCest.php b/tests/EndToEnd/integrations/divi-builder/DiviPluginFormTriggerCest.php
index 211f12305..8c8d13b2e 100644
--- a/tests/EndToEnd/integrations/divi-builder/DiviPluginFormTriggerCest.php
+++ b/tests/EndToEnd/integrations/divi-builder/DiviPluginFormTriggerCest.php
@@ -45,10 +45,10 @@ public function testFormTriggerModuleInBackendEditor(EndToEndTester $I)
// Insert the Form module.
$I->insertDiviRowWithModule(
$I,
- 'Kit Form Trigger',
- 'convertkit_formtrigger',
- 'form',
- $_ENV['CONVERTKIT_API_FORM_FORMAT_MODAL_ID']
+ name: 'Kit Form Trigger',
+ programmaticName: 'convertkit_formtrigger',
+ fieldName: 'form',
+ fieldValue: $_ENV['CONVERTKIT_API_FORM_FORMAT_MODAL_ID']
);
// Save Divi module and view the page on the frontend site.
@@ -85,10 +85,10 @@ public function testFormTriggerModuleInFrontendEditor(EndToEndTester $I)
// Insert the Form module.
$I->insertDiviRowWithModule(
$I,
- 'Kit Form Trigger',
- 'convertkit_formtrigger',
- 'form',
- $_ENV['CONVERTKIT_API_FORM_FORMAT_MODAL_ID']
+ name: 'Kit Form Trigger',
+ programmaticName: 'convertkit_formtrigger',
+ fieldName: 'form',
+ fieldValue: $_ENV['CONVERTKIT_API_FORM_FORMAT_MODAL_ID']
);
// Save Divi module and view the page on the frontend site.
@@ -117,8 +117,8 @@ public function testFormTriggerModuleInFrontendEditorWhenNoCredentials(EndToEndT
// Insert the Form module.
$I->insertDiviRowWithModule(
$I,
- 'Kit Form Trigger',
- 'convertkit_formtrigger'
+ name: 'Kit Form Trigger',
+ programmaticName: 'convertkit_formtrigger'
);
// Confirm the on screen message displays.
@@ -146,8 +146,8 @@ public function testFormTriggerModuleInFrontendEditorWhenNoForms(EndToEndTester
// Insert the Form module.
$I->insertDiviRowWithModule(
$I,
- 'Kit Form Trigger',
- 'convertkit_formtrigger'
+ name: 'Kit Form Trigger',
+ programmaticName: 'convertkit_formtrigger'
);
// Confirm the on screen message displays.
@@ -171,10 +171,10 @@ public function testFormTriggerModuleWithNoFormParameter(EndToEndTester $I)
// Create Page with Form module in Divi.
$pageID = $I->createPageWithDiviModuleProgrammatically(
$I,
- 'Kit: Legacy Form Trigger: Divi Module: No Form Param',
- 'convertkit_formtrigger',
- 'form',
- ''
+ title: 'Kit: Legacy Form Trigger: Divi Module: No Form Param',
+ programmaticName: 'convertkit_formtrigger',
+ fieldName: 'form',
+ fieldValue: ''
);
// Load Page.
diff --git a/tests/EndToEnd/integrations/divi-builder/DiviPluginProductCest.php b/tests/EndToEnd/integrations/divi-builder/DiviPluginProductCest.php
index df94ccd95..272eb1d05 100644
--- a/tests/EndToEnd/integrations/divi-builder/DiviPluginProductCest.php
+++ b/tests/EndToEnd/integrations/divi-builder/DiviPluginProductCest.php
@@ -45,10 +45,10 @@ public function testProductModuleInBackendEditor(EndToEndTester $I)
// Insert the Product module.
$I->insertDiviRowWithModule(
$I,
- 'Kit Product',
- 'convertkit_product',
- 'product',
- $_ENV['CONVERTKIT_API_PRODUCT_ID']
+ name: 'Kit Product',
+ programmaticName: 'convertkit_product',
+ fieldName: 'product',
+ fieldValue: $_ENV['CONVERTKIT_API_PRODUCT_ID']
);
// Save Divi module and view the page on the frontend site.
@@ -81,10 +81,10 @@ public function testProductModuleInFrontendEditor(EndToEndTester $I)
// Insert the Product module.
$I->insertDiviRowWithModule(
$I,
- 'Kit Product',
- 'convertkit_product',
- 'product',
- $_ENV['CONVERTKIT_API_PRODUCT_ID']
+ name: 'Kit Product',
+ programmaticName: 'convertkit_product',
+ fieldName: 'product',
+ fieldValue: $_ENV['CONVERTKIT_API_PRODUCT_ID']
);
// Save Divi module and view the page on the frontend site.
@@ -109,8 +109,8 @@ public function testProductModuleInFrontendEditorWhenNoCredentials(EndToEndTeste
// Insert the Product module.
$I->insertDiviRowWithModule(
$I,
- 'Kit Product',
- 'convertkit_product'
+ name: 'Kit Product',
+ programmaticName: 'convertkit_product'
);
// Confirm the on screen message displays.
@@ -138,8 +138,8 @@ public function testProductModuleInFrontendEditorWhenNoProducts(EndToEndTester $
// Insert the Product module.
$I->insertDiviRowWithModule(
$I,
- 'Kit Product',
- 'convertkit_product'
+ name: 'Kit Product',
+ programmaticName: 'convertkit_product'
);
// Confirm the on screen message displays.
@@ -163,10 +163,10 @@ public function testProductModuleWithNoProductParameter(EndToEndTester $I)
// Create Page with Product module in Divi.
$pageID = $I->createPageWithDiviModuleProgrammatically(
$I,
- 'Kit: Product: Divi Module: No Product Param',
- 'convertkit_product',
- 'product',
- ''
+ title: 'Kit: Product: Divi Module: No Product Param',
+ programmaticName: 'convertkit_product',
+ fieldName: 'product',
+ fieldValue: ''
);
// Load Page.
diff --git a/tests/EndToEnd/integrations/divi-theme/DiviThemeBroadcastsCest.php b/tests/EndToEnd/integrations/divi-theme/DiviThemeBroadcastsCest.php
index a6c230af0..90546a41e 100644
--- a/tests/EndToEnd/integrations/divi-theme/DiviThemeBroadcastsCest.php
+++ b/tests/EndToEnd/integrations/divi-theme/DiviThemeBroadcastsCest.php
@@ -47,8 +47,8 @@ public function testBroadcastsModuleInBackendEditor(EndToEndTester $I)
// Insert the Broadcasts module.
$I->insertDiviRowWithModule(
$I,
- 'Kit Broadcasts',
- 'convertkit_broadcasts'
+ name: 'Kit Broadcasts',
+ programmaticName: 'convertkit_broadcasts'
);
// Save Divi module and view the page on the frontend site.
@@ -93,8 +93,8 @@ public function testBroadcastsModuleInFrontendEditor(EndToEndTester $I)
// Insert the Broadcasts module.
$I->insertDiviRowWithModule(
$I,
- 'Kit Broadcasts',
- 'convertkit_broadcasts'
+ name: 'Kit Broadcasts',
+ programmaticName: 'convertkit_broadcasts'
);
// Save Divi module and view the page on the frontend site.
@@ -131,8 +131,8 @@ public function testBroadcastsModuleInFrontendEditorWhenNoCredentials(EndToEndTe
// Insert the Broadcasts module.
$I->insertDiviRowWithModule(
$I,
- 'Kit Broadcasts',
- 'convertkit_broadcasts'
+ name: 'Kit Broadcasts',
+ programmaticName: 'convertkit_broadcasts'
);
// Confirm the on screen message displays.
@@ -160,8 +160,8 @@ public function testBroadcastsModuleInFrontendEditorWhenNoBroadcasts(EndToEndTes
// Insert the Broadcasts module.
$I->insertDiviRowWithModule(
$I,
- 'Kit Broadcasts',
- 'convertkit_broadcasts'
+ name: 'Kit Broadcasts',
+ programmaticName: 'convertkit_broadcasts'
);
// Confirm the on screen message displays.
diff --git a/tests/EndToEnd/integrations/divi-theme/DiviThemeFormCest.php b/tests/EndToEnd/integrations/divi-theme/DiviThemeFormCest.php
index 657251a7f..ac9eb484b 100644
--- a/tests/EndToEnd/integrations/divi-theme/DiviThemeFormCest.php
+++ b/tests/EndToEnd/integrations/divi-theme/DiviThemeFormCest.php
@@ -45,10 +45,10 @@ public function testFormModuleInBackendEditor(EndToEndTester $I)
// Insert the Form module.
$I->insertDiviRowWithModule(
$I,
- 'Kit Form',
- 'convertkit_form',
- 'form',
- $_ENV['CONVERTKIT_API_FORM_ID']
+ name: 'Kit Form',
+ programmaticName: 'convertkit_form',
+ fieldName: 'form',
+ fieldValue: $_ENV['CONVERTKIT_API_FORM_ID']
);
// Save Divi module and view the page on the frontend site.
@@ -82,10 +82,10 @@ public function testFormModuleInFrontendEditor(EndToEndTester $I)
// Insert the Form module.
$I->insertDiviRowWithModule(
$I,
- 'Kit Form',
- 'convertkit_form',
- 'form',
- $_ENV['CONVERTKIT_API_FORM_ID']
+ name: 'Kit Form',
+ programmaticName: 'convertkit_form',
+ fieldName: 'form',
+ fieldValue: $_ENV['CONVERTKIT_API_FORM_ID']
);
// Save Divi module and view the page on the frontend site.
@@ -111,8 +111,8 @@ public function testFormModuleInFrontendEditorWhenNoCredentials(EndToEndTester $
// Insert the Form module.
$I->insertDiviRowWithModule(
$I,
- 'Kit Form',
- 'convertkit_form'
+ name: 'Kit Form',
+ programmaticName: 'convertkit_form'
);
// Confirm the on screen message displays.
@@ -140,8 +140,8 @@ public function testFormModuleInFrontendEditorWhenNoForms(EndToEndTester $I)
// Insert the Form module.
$I->insertDiviRowWithModule(
$I,
- 'Kit Form',
- 'convertkit_form'
+ name: 'Kit Form',
+ programmaticName: 'convertkit_form'
);
// Confirm the on screen message displays.
@@ -174,10 +174,10 @@ public function testFormModuleWithValidLegacyFormParameter(EndToEndTester $I)
// Create Page with Form module in Divi.
$pageID = $I->createPageWithDiviModuleProgrammatically(
$I,
- 'Kit: Legacy Form: Divi Module: Valid Form Param',
- 'convertkit_form',
- 'form',
- $_ENV['CONVERTKIT_API_LEGACY_FORM_ID']
+ title: 'Kit: Legacy Form: Divi Module: Valid Form Param',
+ programmaticName: 'convertkit_form',
+ fieldName: 'form',
+ fieldValue: $_ENV['CONVERTKIT_API_LEGACY_FORM_ID']
);
// Load Page.
@@ -206,10 +206,10 @@ public function testFormModuleWithNoFormParameter(EndToEndTester $I)
// Create Page with Form module in Divi.
$pageID = $I->createPageWithDiviModuleProgrammatically(
$I,
- 'Kit: Legacy Form: Divi Module: No Form Param',
- 'convertkit_form',
- 'form',
- ''
+ title: 'Kit: Legacy Form: Divi Module: No Form Param',
+ programmaticName: 'convertkit_form',
+ fieldName: 'form',
+ fieldValue: ''
);
// Load Page.
diff --git a/tests/EndToEnd/integrations/divi-theme/DiviThemeFormTriggerCest.php b/tests/EndToEnd/integrations/divi-theme/DiviThemeFormTriggerCest.php
index d4d44bf67..36ab10a6e 100644
--- a/tests/EndToEnd/integrations/divi-theme/DiviThemeFormTriggerCest.php
+++ b/tests/EndToEnd/integrations/divi-theme/DiviThemeFormTriggerCest.php
@@ -45,10 +45,10 @@ public function testFormTriggerModuleInBackendEditor(EndToEndTester $I)
// Insert the Form module.
$I->insertDiviRowWithModule(
$I,
- 'Kit Form Trigger',
- 'convertkit_formtrigger',
- 'form',
- $_ENV['CONVERTKIT_API_FORM_FORMAT_MODAL_ID']
+ name: 'Kit Form Trigger',
+ programmaticName: 'convertkit_formtrigger',
+ fieldName: 'form',
+ fieldValue: $_ENV['CONVERTKIT_API_FORM_FORMAT_MODAL_ID']
);
// Save Divi module and view the page on the frontend site.
@@ -85,10 +85,10 @@ public function testFormTriggerModuleInFrontendEditor(EndToEndTester $I)
// Insert the Form module.
$I->insertDiviRowWithModule(
$I,
- 'Kit Form Trigger',
- 'convertkit_formtrigger',
- 'form',
- $_ENV['CONVERTKIT_API_FORM_FORMAT_MODAL_ID']
+ name: 'Kit Form Trigger',
+ programmaticName: 'convertkit_formtrigger',
+ fieldName: 'form',
+ fieldValue: $_ENV['CONVERTKIT_API_FORM_FORMAT_MODAL_ID']
);
// Save Divi module and view the page on the frontend site.
@@ -117,8 +117,8 @@ public function testFormTriggerModuleInFrontendEditorWhenNoCredentials(EndToEndT
// Insert the Form module.
$I->insertDiviRowWithModule(
$I,
- 'Kit Form Trigger',
- 'convertkit_formtrigger'
+ name: 'Kit Form Trigger',
+ programmaticName: 'convertkit_formtrigger'
);
// Confirm the on screen message displays.
@@ -146,8 +146,8 @@ public function testFormTriggerModuleInFrontendEditorWhenNoForms(EndToEndTester
// Insert the Form module.
$I->insertDiviRowWithModule(
$I,
- 'Kit Form Trigger',
- 'convertkit_formtrigger'
+ name: 'Kit Form Trigger',
+ programmaticName: 'convertkit_formtrigger'
);
// Confirm the on screen message displays.
@@ -171,10 +171,10 @@ public function testFormTriggerModuleWithNoFormParameter(EndToEndTester $I)
// Create Page with Form module in Divi.
$pageID = $I->createPageWithDiviModuleProgrammatically(
$I,
- 'Kit: Legacy Form Trigger: Divi Module: No Form Param',
- 'convertkit_formtrigger',
- 'form',
- ''
+ title: 'Kit: Legacy Form Trigger: Divi Module: No Form Param',
+ programmaticName: 'convertkit_formtrigger',
+ fieldName: 'form',
+ fieldValue: ''
);
// Load Page.
diff --git a/tests/EndToEnd/integrations/divi-theme/DiviThemeProductCest.php b/tests/EndToEnd/integrations/divi-theme/DiviThemeProductCest.php
index 62546bffe..877f1c080 100644
--- a/tests/EndToEnd/integrations/divi-theme/DiviThemeProductCest.php
+++ b/tests/EndToEnd/integrations/divi-theme/DiviThemeProductCest.php
@@ -45,10 +45,10 @@ public function testProductModuleInBackendEditor(EndToEndTester $I)
// Insert the Product module.
$I->insertDiviRowWithModule(
$I,
- 'Kit Product',
- 'convertkit_product',
- 'product',
- $_ENV['CONVERTKIT_API_PRODUCT_ID']
+ name: 'Kit Product',
+ programmaticName: 'convertkit_product',
+ fieldName: 'product',
+ fieldValue: $_ENV['CONVERTKIT_API_PRODUCT_ID']
);
// Save Divi module and view the page on the frontend site.
@@ -81,10 +81,10 @@ public function testProductModuleInFrontendEditor(EndToEndTester $I)
// Insert the Product module.
$I->insertDiviRowWithModule(
$I,
- 'Kit Product',
- 'convertkit_product',
- 'product',
- $_ENV['CONVERTKIT_API_PRODUCT_ID']
+ name: 'Kit Product',
+ programmaticName: 'convertkit_product',
+ fieldName: 'product',
+ fieldValue: $_ENV['CONVERTKIT_API_PRODUCT_ID']
);
// Save Divi module and view the page on the frontend site.
@@ -109,8 +109,8 @@ public function testProductModuleInFrontendEditorWhenNoCredentials(EndToEndTeste
// Insert the Product module.
$I->insertDiviRowWithModule(
$I,
- 'Kit Product',
- 'convertkit_product'
+ name: 'Kit Product',
+ programmaticName: 'convertkit_product'
);
// Confirm the on screen message displays.
@@ -138,8 +138,8 @@ public function testProductModuleInFrontendEditorWhenNoProducts(EndToEndTester $
// Insert the Product module.
$I->insertDiviRowWithModule(
$I,
- 'Kit Product',
- 'convertkit_product'
+ name: 'Kit Product',
+ programmaticName: 'convertkit_product'
);
// Confirm the on screen message displays.
@@ -163,10 +163,10 @@ public function testProductModuleWithNoProductParameter(EndToEndTester $I)
// Create Page with Product module in Divi.
$pageID = $I->createPageWithDiviModuleProgrammatically(
$I,
- 'Kit: Product: Divi Module: No Product Param',
- 'convertkit_product',
- 'product',
- ''
+ title: 'Kit: Product: Divi Module: No Product Param',
+ programmaticName: 'convertkit_product',
+ fieldName: 'product',
+ fieldValue: ''
);
// Load Page.
diff --git a/tests/EndToEnd/integrations/other/ContactForm7FormCest.php b/tests/EndToEnd/integrations/other/ContactForm7FormCest.php
index d471d26bc..fd4934f30 100644
--- a/tests/EndToEnd/integrations/other/ContactForm7FormCest.php
+++ b/tests/EndToEnd/integrations/other/ContactForm7FormCest.php
@@ -62,19 +62,22 @@ public function testSettingsContactForm7ToKitFormMapping(EndToEndTester $I)
// Complete and submit Contact Form 7 Form.
$this->_contactForm7CompleteAndSubmitForm(
$I,
- $pageID,
- $emailAddress
+ pageID: $pageID,
+ emailAddress: $emailAddress
);
+ // Wait for the API to update.
+ $I->wait(2);
+
// Confirm that the email address was added to Kit.
$subscriberID = $I->apiCheckSubscriberExists($I, $emailAddress);
// Check that the subscriber has the expected form and referrer value set.
$I->apiCheckSubscriberHasForm(
$I,
- $subscriberID,
- $_ENV['CONVERTKIT_API_THIRD_PARTY_INTEGRATIONS_FORM_ID'],
- $_ENV['WORDPRESS_URL'] . $I->grabFromCurrentUrl()
+ subscriberID: $subscriberID,
+ formID: $_ENV['CONVERTKIT_API_THIRD_PARTY_INTEGRATIONS_FORM_ID'],
+ referrer: $_ENV['WORDPRESS_URL'] . $I->grabFromCurrentUrl()
);
}
@@ -99,10 +102,13 @@ public function testSettingsContactForm7ToKitLegacyFormMapping(EndToEndTester $I
// Complete and submit Contact Form 7 Form.
$this->_contactForm7CompleteAndSubmitForm(
$I,
- $pageID,
- $emailAddress
+ pageID: $pageID,
+ emailAddress: $emailAddress
);
+ // Wait for the API to update.
+ $I->wait(2);
+
// Confirm that the email address was added to Kit.
$I->apiCheckSubscriberExists($I, $emailAddress);
}
@@ -128,15 +134,22 @@ public function testSettingsContactForm7ToKitTagMapping(EndToEndTester $I)
// Complete and submit Contact Form 7 Form.
$this->_contactForm7CompleteAndSubmitForm(
$I,
- $pageID,
- $emailAddress
+ pageID: $pageID,
+ emailAddress: $emailAddress
);
+ // Wait for the API to update.
+ $I->wait(2);
+
// Confirm that the email address was added to Kit.
$subscriberID = $I->apiCheckSubscriberExists($I, $emailAddress);
// Check that the subscriber has been assigned to the tag.
- $I->apiCheckSubscriberHasTag($I, $subscriberID, $_ENV['CONVERTKIT_API_TAG_ID']);
+ $I->apiCheckSubscriberHasTag(
+ $I,
+ subscriberID: $subscriberID,
+ tagID: $_ENV['CONVERTKIT_API_TAG_ID']
+ );
}
/**
@@ -160,15 +173,22 @@ public function testSettingsContactForm7ToKitSequenceMapping(EndToEndTester $I)
// Complete and submit Contact Form 7 Form.
$this->_contactForm7CompleteAndSubmitForm(
$I,
- $pageID,
- $emailAddress
+ pageID: $pageID,
+ emailAddress: $emailAddress
);
+ // Wait for the API to update.
+ $I->wait(2);
+
// Confirm that the email address was added to Kit.
$subscriberID = $I->apiCheckSubscriberExists($I, $emailAddress);
// Check that the subscriber has been assigned to the sequence.
- $I->apiCheckSubscriberHasSequence($I, $subscriberID, $_ENV['CONVERTKIT_API_SEQUENCE_ID']);
+ $I->apiCheckSubscriberHasSequence(
+ $I,
+ subscriberID: $subscriberID,
+ sequenceID: $_ENV['CONVERTKIT_API_SEQUENCE_ID']
+ );
}
/**
@@ -192,8 +212,8 @@ public function testSettingsContactForm7DoNotSubscribeOption(EndToEndTester $I)
// Complete and submit Contact Form 7 Form.
$this->_contactForm7CompleteAndSubmitForm(
$I,
- $pageID,
- $emailAddress
+ pageID: $pageID,
+ emailAddress: $emailAddress
);
// Confirm that the email address was not added to Kit.
@@ -221,10 +241,13 @@ public function testSettingsContactForm7SubscribeOption(EndToEndTester $I)
// Complete and submit Contact Form 7 Form.
$this->_contactForm7CompleteAndSubmitForm(
$I,
- $pageID,
- $emailAddress
+ pageID: $pageID,
+ emailAddress: $emailAddress
);
+ // Wait for the API to update.
+ $I->wait(2);
+
// Confirm that the email address was added to Kit.
$I->apiCheckSubscriberExists($I, $emailAddress);
}
diff --git a/tests/EndToEnd/integrations/other/ElementorBroadcastsCest.php b/tests/EndToEnd/integrations/other/ElementorBroadcastsCest.php
index 935751e01..38b0363c1 100644
--- a/tests/EndToEnd/integrations/other/ElementorBroadcastsCest.php
+++ b/tests/EndToEnd/integrations/other/ElementorBroadcastsCest.php
@@ -36,7 +36,10 @@ public function _before(EndToEndTester $I)
public function testBroadcastsWidgetIsRegistered(EndToEndTester $I)
{
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Broadcasts: Elementor: Registered');
+ $I->addGutenbergPage(
+ I: $I,
+ title: 'Kit: Page: Broadcasts: Elementor: Registered'
+ );
// Click Edit with Elementor button.
$I->click('#elementor-switch-mode-button');
@@ -65,8 +68,8 @@ public function testBroadcastsWidgetWithValidParameters(EndToEndTester $I)
// Create Page with Broadcasts widget in Elementor.
$pageID = $this->_createPageWithBroadcastsWidget(
$I,
- 'Kit: Page: Broadcasts: Elementor Widget: Valid Params',
- [
+ title: 'Kit: Page: Broadcasts: Elementor Widget: Valid Params',
+ settings: [
'date_format' => 'F j, Y',
'limit' => 10,
]
@@ -106,8 +109,8 @@ public function testBroadcastsWidgetWithDateFormatParameter(EndToEndTester $I)
// Create Page with Broadcasts widget in Elementor.
$pageID = $this->_createPageWithBroadcastsWidget(
$I,
- 'Kit: Page: Broadcasts: Elementor Widget: Date Format',
- [
+ title: 'Kit: Page: Broadcasts: Elementor Widget: Date Format',
+ settings: [
'date_format' => 'Y-m-d',
'limit' => 10,
]
@@ -147,8 +150,8 @@ public function testBroadcastsWidgetWithLimitParameter(EndToEndTester $I)
// Create Page with Broadcasts widget in Elementor.
$pageID = $this->_createPageWithBroadcastsWidget(
$I,
- 'Kit: Page: Broadcasts: Elementor Widget: Limit',
- [
+ title: 'Kit: Page: Broadcasts: Elementor Widget: Limit',
+ settings: [
'date_format' => 'F j, Y',
'limit' => 2,
]
@@ -185,8 +188,8 @@ public function testBroadcastsWidgetWithPaginationEnabled(EndToEndTester $I)
// Create Page with Broadcasts widget in Elementor.
$pageID = $this->_createPageWithBroadcastsWidget(
$I,
- 'Kit: Page: Broadcasts: Elementor Widget: Pagination',
- [
+ title: 'Kit: Page: Broadcasts: Elementor Widget: Pagination',
+ settings: [
'date_format' => 'F j, Y',
'limit' => 2,
'paginate' => 1,
@@ -215,8 +218,8 @@ public function testBroadcastsWidgetWithPaginationLabelParameters(EndToEndTester
// Create Page with Broadcasts widget in Elementor.
$pageID = $this->_createPageWithBroadcastsWidget(
$I,
- 'Kit: Page: Broadcasts: Elementor Widget: Valid Params',
- [
+ title: 'Kit: Page: Broadcasts: Elementor Widget: Valid Params',
+ settings: [
'date_format' => 'F j, Y',
'limit' => 2,
'paginate' => 1,
@@ -252,8 +255,8 @@ public function testBroadcastsWidgetWithHexColorParameters(EndToEndTester $I)
// Create Page with Broadcasts widget in Elementor.
$pageID = $this->_createPageWithBroadcastsWidget(
$I,
- 'Kit: Page: Broadcasts: Elementor Widget: Hex Colors',
- [
+ title: 'Kit: Page: Broadcasts: Elementor Widget: Hex Colors',
+ settings: [
'date_format' => 'F j, Y',
'limit' => 2,
'paginate' => 1,
diff --git a/tests/EndToEnd/integrations/other/ElementorFormCest.php b/tests/EndToEnd/integrations/other/ElementorFormCest.php
index f5862e19c..8b71e5746 100644
--- a/tests/EndToEnd/integrations/other/ElementorFormCest.php
+++ b/tests/EndToEnd/integrations/other/ElementorFormCest.php
@@ -38,7 +38,10 @@ public function _before(EndToEndTester $I)
public function testFormWidgetIsRegistered(EndToEndTester $I)
{
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Form: Elementor: Valid Form Param');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Form: Elementor: Valid Form Param'
+ );
// Click Edit with Elementor button.
$I->click('#elementor-switch-mode-button');
@@ -65,7 +68,11 @@ public function testFormWidgetIsRegistered(EndToEndTester $I)
public function testFormWidgetWithValidFormParameter(EndToEndTester $I)
{
// Create Page with Form widget in Elementor.
- $pageID = $this->_createPageWithFormWidget($I, 'Kit: Page: Form: Elementor Widget: Valid Form Param', $_ENV['CONVERTKIT_API_FORM_ID']);
+ $pageID = $this->_createPageWithFormWidget(
+ $I,
+ title: 'Kit: Page: Form: Elementor Widget: Valid Form Param',
+ formID: $_ENV['CONVERTKIT_API_FORM_ID']
+ );
// Load Page.
$I->amOnPage('?p=' . $pageID);
@@ -100,7 +107,11 @@ public function testFormWidgetWithValidLegacyFormParameter(EndToEndTester $I)
);
// Create Page with Form widget in Elementor.
- $pageID = $this->_createPageWithFormWidget($I, 'Kit: Legacy Form: Elementor Widget: Valid Form Param', $_ENV['CONVERTKIT_API_LEGACY_FORM_ID']);
+ $pageID = $this->_createPageWithFormWidget(
+ $I,
+ title: 'Kit: Legacy Form: Elementor Widget: Valid Form Param',
+ formID: $_ENV['CONVERTKIT_API_LEGACY_FORM_ID']
+ );
// Load Page.
$I->amOnPage('?p=' . $pageID);
@@ -122,7 +133,11 @@ public function testFormWidgetWithValidLegacyFormParameter(EndToEndTester $I)
public function testFormWidgetWithNoFormParameter(EndToEndTester $I)
{
// Create Page with Form widget in Elementor.
- $pageID = $this->_createPageWithFormWidget($I, 'Kit: Page: Form: Elementor Widget: No Form Param', '');
+ $pageID = $this->_createPageWithFormWidget(
+ $I,
+ title: 'Kit: Page: Form: Elementor Widget: No Form Param',
+ formID: ''
+ );
// Load Page.
$I->amOnPage('?p=' . $pageID);
diff --git a/tests/EndToEnd/integrations/other/ElementorFormTriggerCest.php b/tests/EndToEnd/integrations/other/ElementorFormTriggerCest.php
index e7c08248c..754b3098f 100644
--- a/tests/EndToEnd/integrations/other/ElementorFormTriggerCest.php
+++ b/tests/EndToEnd/integrations/other/ElementorFormTriggerCest.php
@@ -36,7 +36,10 @@ public function _before(EndToEndTester $I)
public function testFormTriggerWidgetIsRegistered(EndToEndTester $I)
{
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Form Trigger: Elementor: Registered');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Form Trigger: Elementor: Registered'
+ );
// Click Edit with Elementor button.
$I->click('#elementor-switch-mode-button');
@@ -65,8 +68,8 @@ public function testFormTriggerWidgetWithValidParameters(EndToEndTester $I)
// Create Page with Form Trigger widget in Elementor.
$pageID = $this->_createPageWithFormTriggerWidget(
$I,
- 'Kit: Page: Form Trigger: Elementor Widget: Valid Params',
- [
+ title: 'Kit: Page: Form Trigger: Elementor Widget: Valid Params',
+ settings: [
'form' => $_ENV['CONVERTKIT_API_FORM_FORMAT_MODAL_ID'],
'text' => 'Subscribe',
]
@@ -79,7 +82,11 @@ public function testFormTriggerWidgetWithValidParameters(EndToEndTester $I)
$I->checkNoWarningsAndNoticesOnScreen($I);
// Confirm that the form trigger button displays.
- $I->seeFormTriggerOutput($I, $_ENV['CONVERTKIT_API_FORM_FORMAT_MODAL_URL'], 'Subscribe');
+ $I->seeFormTriggerOutput(
+ $I,
+ formURL: $_ENV['CONVERTKIT_API_FORM_FORMAT_MODAL_URL'],
+ text: 'Subscribe'
+ );
}
/**
@@ -98,8 +105,8 @@ public function testFormTriggerWidgetWithHexColorParameters(EndToEndTester $I)
// Create Page with Form Trigger widget in Elementor.
$pageID = $this->_createPageWithFormTriggerWidget(
$I,
- 'Kit: Page: Form Trigger: Elementor Widget: Hex Colors',
- [
+ title: 'Kit: Page: Form Trigger: Elementor Widget: Hex Colors',
+ settings: [
'form' => $_ENV['CONVERTKIT_API_FORM_FORMAT_MODAL_ID'],
'text' => 'Subscribe',
'background_color' => $backgroundColor,
@@ -114,7 +121,13 @@ public function testFormTriggerWidgetWithHexColorParameters(EndToEndTester $I)
$I->checkNoWarningsAndNoticesOnScreen($I);
// Confirm that the form trigger button displays.
- $I->seeFormTriggerOutput($I, $_ENV['CONVERTKIT_API_FORM_FORMAT_MODAL_URL'], 'Subscribe', $textColor, $backgroundColor);
+ $I->seeFormTriggerOutput(
+ $I,
+ formURL: $_ENV['CONVERTKIT_API_FORM_FORMAT_MODAL_URL'],
+ text: 'Subscribe',
+ textColor: $textColor,
+ backgroundColor: $backgroundColor
+ );
}
/**
diff --git a/tests/EndToEnd/integrations/other/ElementorProductCest.php b/tests/EndToEnd/integrations/other/ElementorProductCest.php
index 893e3b1ef..96a4b0a35 100644
--- a/tests/EndToEnd/integrations/other/ElementorProductCest.php
+++ b/tests/EndToEnd/integrations/other/ElementorProductCest.php
@@ -36,7 +36,10 @@ public function _before(EndToEndTester $I)
public function testProductWidgetIsRegistered(EndToEndTester $I)
{
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Product: Elementor: Registered');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Product: Elementor: Registered'
+ );
// Click Edit with Elementor button.
$I->click('#elementor-switch-mode-button');
@@ -65,8 +68,8 @@ public function testProductWidgetWithValidParameters(EndToEndTester $I)
// Create Page with Product widget in Elementor.
$pageID = $this->_createPageWithProductWidget(
$I,
- 'Kit: Page: Product: Elementor Widget: Valid Params',
- [
+ title: 'Kit: Page: Product: Elementor Widget: Valid Params',
+ settings: [
'product' => $_ENV['CONVERTKIT_API_PRODUCT_ID'],
'text' => 'Buy my product',
]
@@ -98,8 +101,8 @@ public function testProductWidgetWithHexColorParameters(EndToEndTester $I)
// Create Page with Product widget in Elementor.
$pageID = $this->_createPageWithProductWidget(
$I,
- 'Kit: Page: Product: Elementor Widget: Hex Colors',
- [
+ title: 'Kit: Page: Product: Elementor Widget: Hex Colors',
+ settings: [
'product' => $_ENV['CONVERTKIT_API_PRODUCT_ID'],
'text' => 'Buy my product',
'background_color' => $backgroundColor,
@@ -114,7 +117,13 @@ public function testProductWidgetWithHexColorParameters(EndToEndTester $I)
$I->checkNoWarningsAndNoticesOnScreen($I);
// Confirm that the block displays.
- $I->seeProductOutput($I, $_ENV['CONVERTKIT_API_PRODUCT_URL'], 'Buy my product', $textColor, $backgroundColor);
+ $I->seeProductOutput(
+ $I,
+ productURL: $_ENV['CONVERTKIT_API_PRODUCT_URL'],
+ text: 'Buy my product',
+ textColor: $textColor,
+ backgroundColor: $backgroundColor
+ );
}
/**
diff --git a/tests/EndToEnd/integrations/other/ForminatorCest.php b/tests/EndToEnd/integrations/other/ForminatorCest.php
index 865ce3f30..60e8a9cb2 100644
--- a/tests/EndToEnd/integrations/other/ForminatorCest.php
+++ b/tests/EndToEnd/integrations/other/ForminatorCest.php
@@ -62,19 +62,22 @@ public function testSettingsForminatorFormToKitFormMapping(EndToEndTester $I)
// Complete and submit Forminator Form.
$this->_forminatorCompleteAndSubmitForm(
$I,
- $pageID,
- $emailAddress
+ pageID: $pageID,
+ emailAddress: $emailAddress
);
+ // Wait for the API to update.
+ $I->wait(2);
+
// Confirm that the email address was added to Kit.
$subscriberID = $I->apiCheckSubscriberExists($I, $emailAddress);
// Check that the subscriber has the expected form and referrer value set.
$I->apiCheckSubscriberHasForm(
$I,
- $subscriberID,
- $_ENV['CONVERTKIT_API_THIRD_PARTY_INTEGRATIONS_FORM_ID'],
- $_ENV['WORDPRESS_URL'] . $I->grabFromCurrentUrl()
+ subscriberID: $subscriberID,
+ formID: $_ENV['CONVERTKIT_API_THIRD_PARTY_INTEGRATIONS_FORM_ID'],
+ referrer: $_ENV['WORDPRESS_URL'] . $I->grabFromCurrentUrl()
);
}
@@ -99,10 +102,13 @@ public function testSettingsForminatorFormToKitLegacyFormMapping(EndToEndTester
// Complete and submit Forminator Form.
$this->_forminatorCompleteAndSubmitForm(
$I,
- $pageID,
- $emailAddress
+ pageID: $pageID,
+ emailAddress: $emailAddress
);
+ // Wait for the API to update.
+ $I->wait(2);
+
// Confirm that the email address was added to Kit.
$I->apiCheckSubscriberExists($I, $emailAddress);
}
@@ -128,15 +134,22 @@ public function testSettingsForminatorFormToKitTagMapping(EndToEndTester $I)
// Complete and submit Forminator Form.
$this->_forminatorCompleteAndSubmitForm(
$I,
- $pageID,
- $emailAddress
+ pageID: $pageID,
+ emailAddress: $emailAddress
);
+ // Wait for the API to update.
+ $I->wait(2);
+
// Confirm that the email address was added to Kit.
$subscriberID = $I->apiCheckSubscriberExists($I, $emailAddress);
// Check that the subscriber has been assigned to the tag.
- $I->apiCheckSubscriberHasTag($I, $subscriberID, $_ENV['CONVERTKIT_API_TAG_ID']);
+ $I->apiCheckSubscriberHasTag(
+ $I,
+ subscriberID: $subscriberID,
+ tagID: $_ENV['CONVERTKIT_API_TAG_ID']
+ );
}
/**
@@ -160,10 +173,13 @@ public function testSettingsForminatorFormToKitSequenceMapping(EndToEndTester $I
// Complete and submit Forminator Form.
$this->_forminatorCompleteAndSubmitForm(
$I,
- $pageID,
- $emailAddress
+ pageID: $pageID,
+ emailAddress: $emailAddress
);
+ // Wait for the API to update.
+ $I->wait(2);
+
// Confirm that the email address was added to Kit.
$subscriberID = $I->apiCheckSubscriberExists($I, $emailAddress);
@@ -192,8 +208,8 @@ public function testSettingsForminatorFormDoNotSubscribeOption(EndToEndTester $I
// Complete and submit Forminator Form.
$this->_forminatorCompleteAndSubmitForm(
$I,
- $pageID,
- $emailAddress
+ pageID: $pageID,
+ emailAddress: $emailAddress
);
// Confirm that the email address was not added to Kit.
@@ -221,8 +237,8 @@ public function testSettingsForminatorFormSubscribeOption(EndToEndTester $I)
// Complete and submit Forminator Form.
$this->_forminatorCompleteAndSubmitForm(
$I,
- $pageID,
- $emailAddress
+ pageID: $pageID,
+ emailAddress: $emailAddress
);
// Confirm that the email address was added to Kit.
@@ -250,10 +266,13 @@ public function testSettingsForminatorQuizToKitFormMapping(EndToEndTester $I)
// Complete and submit Forminator Quiz.
$this->_forminatorCompleteAndSubmitQuiz(
$I,
- $pageID,
- $emailAddress
+ pageID: $pageID,
+ emailAddress: $emailAddress
);
+ // Wait for the API to update.
+ $I->wait(2);
+
// Confirm that the email address was added to Kit.
$I->apiCheckSubscriberExists($I, $emailAddress);
}
@@ -279,15 +298,22 @@ public function testSettingsForminatorQuizToKitTagMapping(EndToEndTester $I)
// Complete and submit Forminator Quiz.
$this->_forminatorCompleteAndSubmitQuiz(
$I,
- $pageID,
- $emailAddress
+ pageID: $pageID,
+ emailAddress: $emailAddress
);
+ // Wait for the API to update.
+ $I->wait(2);
+
// Confirm that the email address was added to Kit.
$subscriberID = $I->apiCheckSubscriberExists($I, $emailAddress);
// Check that the subscriber has been assigned to the tag.
- $I->apiCheckSubscriberHasTag($I, $subscriberID, $_ENV['CONVERTKIT_API_TAG_ID']);
+ $I->apiCheckSubscriberHasTag(
+ $I,
+ subscriberID: $subscriberID,
+ tagID: $_ENV['CONVERTKIT_API_TAG_ID']
+ );
}
/**
@@ -311,15 +337,22 @@ public function testSettingsForminatorQuizToKitSequenceMapping(EndToEndTester $I
// Complete and submit Forminator Quiz.
$this->_forminatorCompleteAndSubmitQuiz(
$I,
- $pageID,
- $emailAddress
+ pageID: $pageID,
+ emailAddress: $emailAddress
);
+ // Wait for the API to update.
+ $I->wait(2);
+
// Confirm that the email address was added to Kit.
$subscriberID = $I->apiCheckSubscriberExists($I, $emailAddress);
// Check that the subscriber has been assigned to the sequence.
- $I->apiCheckSubscriberHasSequence($I, $subscriberID, $_ENV['CONVERTKIT_API_SEQUENCE_ID']);
+ $I->apiCheckSubscriberHasSequence(
+ $I,
+ subscriberID: $subscriberID,
+ sequenceID: $_ENV['CONVERTKIT_API_SEQUENCE_ID']
+ );
}
/**
@@ -343,8 +376,8 @@ public function testSettingsForminatorQuizDoNotSubscribeOption(EndToEndTester $I
// Complete and submit Forminator Quiz.
$this->_forminatorCompleteAndSubmitQuiz(
$I,
- $pageID,
- $emailAddress
+ pageID: $pageID,
+ emailAddress: $emailAddress
);
// Confirm that the email address was not added to Kit.
@@ -372,10 +405,13 @@ public function testSettingsForminatorQuizSubscribeOption(EndToEndTester $I)
// Complete and submit Forminator Quiz.
$this->_forminatorCompleteAndSubmitQuiz(
$I,
- $pageID,
- $emailAddress
+ pageID: $pageID,
+ emailAddress: $emailAddress
);
+ // Wait for the API to update.
+ $I->wait(2);
+
// Confirm that the email address was added to Kit.
$I->apiCheckSubscriberExists($I, $emailAddress);
}
diff --git a/tests/EndToEnd/integrations/woocommerce/WooCommerceProductFormCest.php b/tests/EndToEnd/integrations/woocommerce/WooCommerceProductFormCest.php
index 87c34647e..4d7ab297d 100644
--- a/tests/EndToEnd/integrations/woocommerce/WooCommerceProductFormCest.php
+++ b/tests/EndToEnd/integrations/woocommerce/WooCommerceProductFormCest.php
@@ -262,9 +262,9 @@ public function testQuickEditUsingDefaultForm(EndToEndTester $I)
// Quick Edit the Product in the Products WP_List_Table.
$I->quickEdit(
$I,
- 'product',
- $productID,
- [
+ postType: 'product',
+ postID: $productID,
+ configuration: [
'form' => [ 'select', 'Default' ],
]
);
@@ -305,9 +305,9 @@ public function testQuickEditUsingDefinedForm(EndToEndTester $I)
// Quick Edit the Product in the Products WP_List_Table.
$I->quickEdit(
$I,
- 'product',
- $productID,
- [
+ postType: 'product',
+ postID: $productID,
+ configuration: [
'form' => [ 'select', $_ENV['CONVERTKIT_API_FORM_NAME'] ],
]
);
@@ -356,9 +356,9 @@ public function testBulkEditUsingDefaultForm(EndToEndTester $I)
// Bulk Edit the Products in the Products WP_List_Table.
$I->bulkEdit(
$I,
- 'product',
- $productIDs,
- [
+ postType: 'product',
+ postIDs: $productIDs,
+ configuration: [
'form' => [ 'select', 'Default' ],
]
);
@@ -410,9 +410,9 @@ public function testBulkEditUsingDefinedForm(EndToEndTester $I)
// Bulk Edit the Products in the Products WP_List_Table.
$I->bulkEdit(
$I,
- 'product',
- $productIDs,
- [
+ postType: 'product',
+ postIDs: $productIDs,
+ configuration: [
'form' => [ 'select', $_ENV['CONVERTKIT_API_FORM_NAME'] ],
]
);
@@ -478,9 +478,9 @@ public function testBulkEditWithNoChanges(EndToEndTester $I)
// Bulk Edit the Products in the Products WP_List_Table.
$I->bulkEdit(
$I,
- 'product',
- $productIDs,
- [
+ postType: 'product',
+ postIDs: $productIDs,
+ configuration: [
'form' => [ 'select', '— No Change —' ],
]
);
diff --git a/tests/EndToEnd/landing-pages/PageLandingPageCest.php b/tests/EndToEnd/landing-pages/PageLandingPageCest.php
index 8ef1e8810..930c93b99 100644
--- a/tests/EndToEnd/landing-pages/PageLandingPageCest.php
+++ b/tests/EndToEnd/landing-pages/PageLandingPageCest.php
@@ -39,13 +39,16 @@ public function _before(EndToEndTester $I)
public function testAddNewPageUsingNoLandingPage(EndToEndTester $I)
{
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Landing Page: None');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Landing Page: None'
+ );
// Check the order of the Landing Page resources are alphabetical, with the None option prepending the Landing Pages.
$I->checkSelectLandingPageOptionOrder(
$I,
- '#wp-convertkit-landing_page',
- [
+ selectElement: '#wp-convertkit-landing_page',
+ prependOptions:[
'None',
]
);
@@ -53,8 +56,8 @@ public function testAddNewPageUsingNoLandingPage(EndToEndTester $I)
// Configure metabox's Landing Page setting = None.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'landing_page' => [ 'select2', 'None' ],
]
);
@@ -78,13 +81,16 @@ public function testAddNewPageUsingNoLandingPage(EndToEndTester $I)
public function testAddNewPageUsingDefinedLandingPage(EndToEndTester $I)
{
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Landing Page: ' . $_ENV['CONVERTKIT_API_LANDING_PAGE_NAME']);
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Landing Page: ' . $_ENV['CONVERTKIT_API_LANDING_PAGE_NAME']
+ );
// Configure metabox's Landing Page setting to value specified in the .env file.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'landing_page' => [ 'select2', $_ENV['CONVERTKIT_API_LANDING_PAGE_NAME'] ],
]
);
@@ -125,13 +131,16 @@ public function testLandingPageSiteIcon(EndToEndTester $I)
$I->haveOptionInDatabase('site_icon', $imageID);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Landing Page: Site Icon: ' . $_ENV['CONVERTKIT_API_LANDING_PAGE_NAME']);
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Landing Page: Site Icon: ' . $_ENV['CONVERTKIT_API_LANDING_PAGE_NAME']
+ );
// Configure metabox's Landing Page setting to value specified in the .env file.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'landing_page' => [ 'select2', $_ENV['CONVERTKIT_API_LANDING_PAGE_NAME'] ],
]
);
@@ -167,13 +176,16 @@ public function testLandingPageSiteIcon(EndToEndTester $I)
public function testLandingPageCharacterEncoding(EndToEndTester $I)
{
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Landing Page: ' . $_ENV['CONVERTKIT_API_LANDING_PAGE_CHARACTER_ENCODING_NAME']);
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Landing Page: ' . $_ENV['CONVERTKIT_API_LANDING_PAGE_CHARACTER_ENCODING_NAME']
+ );
// Configure metabox's Landing Page setting to value specified in the .env file.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'landing_page' => [ 'select2', $_ENV['CONVERTKIT_API_LANDING_PAGE_CHARACTER_ENCODING_NAME'] ],
]
);
@@ -202,13 +214,16 @@ public function testLandingPageCharacterEncoding(EndToEndTester $I)
public function testAddNewPageUsingDefinedLegacyLandingPage(EndToEndTester $I)
{
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Landing Page: ' . $_ENV['CONVERTKIT_API_LEGACY_LANDING_PAGE_NAME']);
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Landing Page: ' . $_ENV['CONVERTKIT_API_LEGACY_LANDING_PAGE_NAME']
+ );
// Configure metabox's Landing Page setting to value specified in the .env file.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'landing_page' => [ 'select2', $_ENV['CONVERTKIT_API_LEGACY_LANDING_PAGE_NAME'] ],
]
);
@@ -242,13 +257,16 @@ public function testLegacyLandingPageSiteIcon(EndToEndTester $I)
$I->haveOptionInDatabase('site_icon', $imageID);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Legacy Landing Page: Site Icon: ' . $_ENV['CONVERTKIT_API_LEGACY_LANDING_PAGE_NAME']);
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Legacy Landing Page: Site Icon: ' . $_ENV['CONVERTKIT_API_LEGACY_LANDING_PAGE_NAME']
+ );
// Configure metabox's Landing Page setting to value specified in the .env file.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'landing_page' => [ 'select2', $_ENV['CONVERTKIT_API_LEGACY_LANDING_PAGE_NAME'] ],
]
);
@@ -347,13 +365,16 @@ public function testAddNewPageUsingDefinedLandingPageWithPerfmattersPlugin(EndTo
);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Landing Page: Perfmatters: ' . $_ENV['CONVERTKIT_API_LANDING_PAGE_NAME']);
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Landing Page: Perfmatters: ' . $_ENV['CONVERTKIT_API_LANDING_PAGE_NAME']
+ );
// Configure metabox's Landing Page setting to value specified in the .env file.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'landing_page' => [ 'select2', $_ENV['CONVERTKIT_API_LANDING_PAGE_NAME'] ],
]
);
@@ -402,13 +423,16 @@ public function testAddNewPageUsingDefinedLandingPageWithWPRocket(EndToEndTester
$I->enableWPRocketLazyLoad($I);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Landing Page: WP Rocket: ' . $_ENV['CONVERTKIT_API_LANDING_PAGE_NAME']);
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Landing Page: WP Rocket: ' . $_ENV['CONVERTKIT_API_LANDING_PAGE_NAME']
+ );
// Configure metabox's Landing Page setting to value specified in the .env file.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'landing_page' => [ 'select2', $_ENV['CONVERTKIT_API_LANDING_PAGE_NAME'] ],
]
);
diff --git a/tests/EndToEnd/landing-pages/PageLandingPageSetupWizardCest.php b/tests/EndToEnd/landing-pages/PageLandingPageSetupWizardCest.php
index c9c3e1dbd..dd5270eb9 100644
--- a/tests/EndToEnd/landing-pages/PageLandingPageSetupWizardCest.php
+++ b/tests/EndToEnd/landing-pages/PageLandingPageSetupWizardCest.php
@@ -185,7 +185,11 @@ public function testAddNewMemberLandingPage(EndToEndTester $I)
$this->_setupAndLoadAddNewLandingPageScreen($I);
// Select a landing page and enter a slug.
- $I->fillSelect2Field($I, '#select2-landing_page-container', $_ENV['CONVERTKIT_API_LANDING_PAGE_NAME']);
+ $I->fillSelect2Field(
+ $I,
+ container: '#select2-landing_page-container',
+ value: $_ENV['CONVERTKIT_API_LANDING_PAGE_NAME']
+ );
$I->fillField('post_name', 'landing-page-setup-wizard');
// Click create button.
@@ -226,7 +230,11 @@ public function testAddNewMemberLegacyLandingPage(EndToEndTester $I)
$this->_setupAndLoadAddNewLandingPageScreen($I);
// Select a landing page and enter a slug.
- $I->fillSelect2Field($I, '#select2-landing_page-container', $_ENV['CONVERTKIT_API_LEGACY_LANDING_PAGE_NAME']);
+ $I->fillSelect2Field(
+ $I,
+ container: '#select2-landing_page-container',
+ value: $_ENV['CONVERTKIT_API_LEGACY_LANDING_PAGE_NAME']
+ );
$I->fillField('post_name', 'landing-page-setup-wizard');
// Click create button.
diff --git a/tests/EndToEnd/landing-pages/PostLandingPageCest.php b/tests/EndToEnd/landing-pages/PostLandingPageCest.php
index b5841af4e..ed99a7c2d 100644
--- a/tests/EndToEnd/landing-pages/PostLandingPageCest.php
+++ b/tests/EndToEnd/landing-pages/PostLandingPageCest.php
@@ -40,7 +40,11 @@ public function _before(EndToEndTester $I)
public function testAddNewPostDoesNotDisplayLandingPageOption(EndToEndTester $I)
{
// Add a Post using the Gutenberg editor.
- $I->addGutenbergPage($I, 'post', 'Kit: Post: Landing Page');
+ $I->addGutenbergPage(
+ $I,
+ postType: 'post',
+ title: 'Kit: Post: Landing Page'
+ );
// Check that the metabox is displayed.
$I->seeElementInDOM('#wp-convertkit-meta-box');
@@ -51,8 +55,8 @@ public function testAddNewPostDoesNotDisplayLandingPageOption(EndToEndTester $I)
// Configure metabox's Form setting = Default.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'form' => [ 'select2', 'Default' ],
]
);
diff --git a/tests/EndToEnd/products/PageBlockFormatterProductLinkCest.php b/tests/EndToEnd/products/PageBlockFormatterProductLinkCest.php
index 326d30d4c..c3b3945ed 100644
--- a/tests/EndToEnd/products/PageBlockFormatterProductLinkCest.php
+++ b/tests/EndToEnd/products/PageBlockFormatterProductLinkCest.php
@@ -37,13 +37,16 @@ public function testProductLinkFormatter(EndToEndTester $I)
$I->setupKitPluginResources($I);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Product Link Formatter');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Product Link Formatter'
+ );
// Configure metabox's Form setting = None, ensuring we only test the block in Gutenberg.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'form' => [ 'select2', 'None' ],
]
);
@@ -57,9 +60,9 @@ public function testProductLinkFormatter(EndToEndTester $I)
// Apply formatter to link the selected text.
$I->applyGutenbergFormatter(
$I,
- 'Kit Product Trigger',
- 'convertkit-product-link',
- [
+ formatterName: 'Kit Product Trigger',
+ formatterProgrammaticName: 'convertkit-product-link',
+ formatterConfiguration:[
// Product.
'data-id' => [ 'select', $_ENV['CONVERTKIT_API_PRODUCT_NAME'] ],
]
@@ -87,13 +90,16 @@ public function testProductLinkFormatterToggleProductSelection(EndToEndTester $I
$I->setupKitPluginResources($I);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Product Link Formatter: Product Toggle');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Product Link Formatter: Product Toggle'
+ );
// Configure metabox's Form setting = None, ensuring we only test the block in Gutenberg.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'form' => [ 'select2', 'None' ],
]
);
@@ -107,9 +113,9 @@ public function testProductLinkFormatterToggleProductSelection(EndToEndTester $I
// Apply formatter to link the selected text.
$I->applyGutenbergFormatter(
$I,
- 'Kit Product Trigger',
- 'convertkit-product-link',
- [
+ formatterName: 'Kit Product Trigger',
+ formatterProgrammaticName: 'convertkit-product-link',
+ formatterConfiguration:[
// Product.
'data-id' => [ 'select', $_ENV['CONVERTKIT_API_PRODUCT_NAME'] ],
]
@@ -118,10 +124,10 @@ public function testProductLinkFormatterToggleProductSelection(EndToEndTester $I
// Apply the formatter again, this time selecting the 'None' option.
$I->applyGutenbergFormatter(
$I,
- 'Kit Product Trigger',
- 'convertkit-product-link',
- [
- // Form.
+ formatterName: 'Kit Product Trigger',
+ formatterProgrammaticName: 'convertkit-product-link',
+ formatterConfiguration:[
+ // Product.
'data-id' => [ 'select', 'None' ],
]
);
@@ -147,13 +153,16 @@ public function testProductLinkFormatterWithNoProduct(EndToEndTester $I)
$I->setupKitPluginResources($I);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Product Link Formatter: No Product');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Product Link Formatter: No Product'
+ );
// Configure metabox's Form setting = None, ensuring we only test the block in Gutenberg.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'form' => [ 'select2', 'None' ],
]
);
@@ -167,10 +176,10 @@ public function testProductLinkFormatterWithNoProduct(EndToEndTester $I)
// Apply formatter to link the selected text.
$I->applyGutenbergFormatter(
$I,
- 'Kit Product Trigger',
- 'convertkit-product-link',
- [
- // Form.
+ formatterName: 'Kit Product Trigger',
+ formatterProgrammaticName: 'convertkit-product-link',
+ formatterConfiguration:[
+ // Product.
'data-id' => [ 'select', 'None' ],
]
);
@@ -192,7 +201,10 @@ public function testProductLinkFormatterWithNoProduct(EndToEndTester $I)
public function testProductLinkFormatterNotRegisteredWhenNoProductsExist(EndToEndTester $I)
{
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Product Link Formatter: No Products Exist');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Product Link Formatter: No Products Exist'
+ );
// Add paragraph to Page.
$I->addGutenbergParagraphBlock($I, 'Subscribe');
diff --git a/tests/EndToEnd/products/PageBlockProductCest.php b/tests/EndToEnd/products/PageBlockProductCest.php
index b2d96672c..a5925dcff 100644
--- a/tests/EndToEnd/products/PageBlockProductCest.php
+++ b/tests/EndToEnd/products/PageBlockProductCest.php
@@ -37,13 +37,16 @@ public function testProductBlockWithValidProductParameter(EndToEndTester $I)
$I->setupKitPluginResources($I);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Product: Valid Product Param');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Product: Valid Product Param'
+ );
// Configure metabox's Form setting = None, ensuring we only test the block in Gutenberg.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'form' => [ 'select2', 'None' ],
]
);
@@ -51,9 +54,9 @@ public function testProductBlockWithValidProductParameter(EndToEndTester $I)
// Add block to Page, setting the Product setting to the value specified in the .env file.
$I->addGutenbergBlock(
$I,
- 'Kit Product',
- 'convertkit-product',
- [
+ blockName: 'Kit Product',
+ blockProgrammaticName: 'convertkit-product',
+ blockConfiguration: [
'product' => [ 'select', $_ENV['CONVERTKIT_API_PRODUCT_NAME'] ],
]
);
@@ -62,7 +65,11 @@ public function testProductBlockWithValidProductParameter(EndToEndTester $I)
$I->publishAndViewGutenbergPage($I);
// Confirm that the block displays.
- $I->seeProductOutput($I, $_ENV['CONVERTKIT_API_PRODUCT_URL'], 'Buy my product');
+ $I->seeProductOutput(
+ $I,
+ productURL: $_ENV['CONVERTKIT_API_PRODUCT_URL'],
+ text: 'Buy my product'
+ );
}
/**
@@ -79,19 +86,26 @@ public function testProductBlockWithNoProductParameter(EndToEndTester $I)
$I->setupKitPluginResources($I);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Product: No Product Param');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Product: No Product Param'
+ );
// Configure metabox's Form setting = None, ensuring we only test the block in Gutenberg.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'form' => [ 'select2', 'None' ],
]
);
// Add block to Page.
- $I->addGutenbergBlock($I, 'Kit Product', 'convertkit-product');
+ $I->addGutenbergBlock(
+ $I,
+ blockName: 'Kit Product',
+ blockProgrammaticName: 'convertkit-product'
+ );
// Confirm that the Product block displays instructions to the user on how to select a Product.
$I->seeBlockHasNoContentMessage($I, 'Select a Product using the Product option in the Gutenberg sidebar.');
@@ -117,14 +131,17 @@ public function testProductBlockWithTextParameter(EndToEndTester $I)
$I->setupKitPluginResources($I);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Product: Text Param');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Product: Text Param'
+ );
// Add block to Page, setting the date format.
$I->addGutenbergBlock(
$I,
- 'Kit Product',
- 'convertkit-product',
- [
+ blockName: 'Kit Product',
+ blockProgrammaticName: 'convertkit-product',
+ blockConfiguration: [
'product' => [ 'select', $_ENV['CONVERTKIT_API_PRODUCT_NAME'] ],
'text' => [ 'text', 'Buy Now' ],
]
@@ -134,7 +151,11 @@ public function testProductBlockWithTextParameter(EndToEndTester $I)
$I->publishAndViewGutenbergPage($I);
// Confirm that the block displays.
- $I->seeProductOutput($I, $_ENV['CONVERTKIT_API_PRODUCT_URL'], 'Buy Now');
+ $I->seeProductOutput(
+ $I,
+ productURL: $_ENV['CONVERTKIT_API_PRODUCT_URL'],
+ text: 'Buy Now'
+ );
}
/**
@@ -151,14 +172,17 @@ public function testProductBlockWithBlankTextParameter(EndToEndTester $I)
$I->setupKitPluginResources($I);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Product: Blank Text Param');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Product: Blank Text Param'
+ );
// Add block to Page, setting the date format.
$I->addGutenbergBlock(
$I,
- 'Kit Product',
- 'convertkit-product',
- [
+ blockName: 'Kit Product',
+ blockProgrammaticName: 'convertkit-product',
+ blockConfiguration: [
'product' => [ 'select', $_ENV['CONVERTKIT_API_PRODUCT_NAME'] ],
'text' => [ 'text', '' ],
]
@@ -168,7 +192,11 @@ public function testProductBlockWithBlankTextParameter(EndToEndTester $I)
$I->publishAndViewGutenbergPage($I);
// Confirm that the block displays.
- $I->seeProductOutput($I, $_ENV['CONVERTKIT_API_PRODUCT_URL'], 'Buy my product');
+ $I->seeProductOutput(
+ $I,
+ productURL: $_ENV['CONVERTKIT_API_PRODUCT_URL'],
+ text: 'Buy my product'
+ );
}
/**
@@ -185,13 +213,16 @@ public function testProductBlockWithValidDiscountCodeParameter(EndToEndTester $I
$I->setupKitPluginResources($I);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Product: Valid Discount Code Param');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Product: Valid Discount Code Param'
+ );
// Configure metabox's Form setting = None, ensuring we only test the block in Gutenberg.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'form' => [ 'select2', 'None' ],
]
);
@@ -199,9 +230,9 @@ public function testProductBlockWithValidDiscountCodeParameter(EndToEndTester $I
// Add block to Page, setting the Product setting to the value specified in the .env file.
$I->addGutenbergBlock(
$I,
- 'Kit Product',
- 'convertkit-product',
- [
+ blockName: 'Kit Product',
+ blockProgrammaticName: 'convertkit-product',
+ blockConfiguration: [
'product' => [ 'select', $_ENV['CONVERTKIT_API_PRODUCT_NAME'] ],
'discount_code' => [ 'text', $_ENV['CONVERTKIT_API_PRODUCT_DISCOUNT_CODE'] ],
]
@@ -211,7 +242,11 @@ public function testProductBlockWithValidDiscountCodeParameter(EndToEndTester $I
$I->publishAndViewGutenbergPage($I);
// Confirm that the block displays.
- $I->seeProductOutput($I, $_ENV['CONVERTKIT_API_PRODUCT_URL'], 'Buy my product');
+ $I->seeProductOutput(
+ $I,
+ productURL: $_ENV['CONVERTKIT_API_PRODUCT_URL'],
+ text: 'Buy my product'
+ );
// Confirm the discount code has been applied.
$I->switchToIFrame('iframe[data-active]');
@@ -233,13 +268,16 @@ public function testProductBlockWithInvalidDiscountCodeParameter(EndToEndTester
$I->setupKitPluginResources($I);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Product: Invalid Discount Code Param');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Product: Invalid Discount Code Param'
+ );
// Configure metabox's Form setting = None, ensuring we only test the block in Gutenberg.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'form' => [ 'select2', 'None' ],
]
);
@@ -247,9 +285,9 @@ public function testProductBlockWithInvalidDiscountCodeParameter(EndToEndTester
// Add block to Page, setting the Product setting to the value specified in the .env file.
$I->addGutenbergBlock(
$I,
- 'Kit Product',
- 'convertkit-product',
- [
+ blockName: 'Kit Product',
+ blockProgrammaticName: 'convertkit-product',
+ blockConfiguration: [
'product' => [ 'select', $_ENV['CONVERTKIT_API_PRODUCT_NAME'] ],
'discount_code' => [ 'text', 'fake' ],
]
@@ -259,7 +297,11 @@ public function testProductBlockWithInvalidDiscountCodeParameter(EndToEndTester
$I->publishAndViewGutenbergPage($I);
// Confirm that the block displays.
- $I->seeProductOutput($I, $_ENV['CONVERTKIT_API_PRODUCT_URL'], 'Buy my product');
+ $I->seeProductOutput(
+ $I,
+ productURL: $_ENV['CONVERTKIT_API_PRODUCT_URL'],
+ text: 'Buy my product'
+ );
// Confirm the discount code is not valid, but the modal displays so the user can still purchase.
$I->switchToIFrame('iframe[data-active]');
@@ -282,13 +324,16 @@ public function testProductBlockWithCheckoutParameterEnabled(EndToEndTester $I)
$I->setupKitPluginResources($I);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Product: Checkout Step');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Product: Checkout Step'
+ );
// Configure metabox's Form setting = None, ensuring we only test the block in Gutenberg.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'form' => [ 'select2', 'None' ],
]
);
@@ -296,9 +341,9 @@ public function testProductBlockWithCheckoutParameterEnabled(EndToEndTester $I)
// Add block to Page, setting the Product setting to the value specified in the .env file.
$I->addGutenbergBlock(
$I,
- 'Kit Product',
- 'convertkit-product',
- [
+ blockName: 'Kit Product',
+ blockProgrammaticName: 'convertkit-product',
+ blockConfiguration: [
'product' => [ 'select', $_ENV['CONVERTKIT_API_PRODUCT_NAME'] ],
'#inspector-toggle-control-0' => [ 'toggle', true ],
]
@@ -308,7 +353,11 @@ public function testProductBlockWithCheckoutParameterEnabled(EndToEndTester $I)
$I->publishAndViewGutenbergPage($I);
// Confirm that the Kit Product is displayed.
- $I->seeProductOutput($I, $_ENV['CONVERTKIT_API_PRODUCT_URL'], 'Buy my product');
+ $I->seeProductOutput(
+ $I,
+ productURL: $_ENV['CONVERTKIT_API_PRODUCT_URL'],
+ text: 'Buy my product'
+ );
// Confirm the checkout step is displayed.
$I->switchToIFrame('iframe[data-active]');
@@ -331,13 +380,16 @@ public function testProductBlockWithDisableModalOnMobileParameterEnabled(EndToEn
$I->setupKitPluginResources($I);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Product: Disable Modal on Mobile');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Product: Disable Modal on Mobile'
+ );
// Configure metabox's Form setting = None, ensuring we only test the block in Gutenberg.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'form' => [ 'select2', 'None' ],
]
);
@@ -345,9 +397,9 @@ public function testProductBlockWithDisableModalOnMobileParameterEnabled(EndToEn
// Add block to Page, setting the Product setting to the value specified in the .env file.
$I->addGutenbergBlock(
$I,
- 'Kit Product',
- 'convertkit-product',
- [
+ blockName: 'Kit Product',
+ blockProgrammaticName: 'convertkit-product',
+ blockConfiguration: [
'product' => [ 'select', $_ENV['CONVERTKIT_API_PRODUCT_NAME'] ],
'#inspector-toggle-control-1' => [ 'toggle', true ],
]
@@ -412,7 +464,10 @@ public function testProductBlockWithThemeColorParameters(EndToEndTester $I)
$I->checkNoWarningsAndNoticesOnScreen($I);
// Confirm that the block displays.
- $I->seeProductOutput($I, $_ENV['CONVERTKIT_API_PRODUCT_URL']);
+ $I->seeProductOutput(
+ $I,
+ productURL: $_ENV['CONVERTKIT_API_PRODUCT_URL']
+ );
// Confirm that the chosen colors are applied as CSS styles.
$I->seeInSource('class="wp-block-button__link convertkit-product has-text-color has-' . $textColor . '-color has-background has-' . $backgroundColor . '-background-color');
@@ -456,7 +511,13 @@ public function testProductBlockWithHexColorParameters(EndToEndTester $I)
$I->checkNoWarningsAndNoticesOnScreen($I);
// Confirm that the block displays.
- $I->seeProductOutput($I, $_ENV['CONVERTKIT_API_PRODUCT_URL'], 'Buy my product', $textColor, $backgroundColor);
+ $I->seeProductOutput(
+ $I,
+ productURL: $_ENV['CONVERTKIT_API_PRODUCT_URL'],
+ text: 'Buy my product',
+ textColor: $textColor,
+ backgroundColor: $backgroundColor
+ );
}
/**
@@ -470,16 +531,23 @@ public function testProductBlockWithHexColorParameters(EndToEndTester $I)
public function testProductBlockWhenNoCredentials(EndToEndTester $I)
{
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Product: Block: No API Key');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Product: Block: No API Key'
+ );
// Add block to Page.
- $I->addGutenbergBlock($I, 'Kit Product', 'convertkit-product');
+ $I->addGutenbergBlock(
+ $I,
+ blockName: 'Kit Product',
+ blockProgrammaticName: 'convertkit-product'
+ );
// Test that the popup window works.
$I->testBlockNoCredentialsPopupWindow(
$I,
- 'convertkit-product',
- 'Select a Product using the Product option in the Gutenberg sidebar.'
+ blockName: 'convertkit-product',
+ expectedMessage:'Select a Product using the Product option in the Gutenberg sidebar.'
);
// Save page to avoid alert box when _passed() runs to deactivate the Plugin.
@@ -501,10 +569,17 @@ public function testProductBlockWhenNoProducts(EndToEndTester $I)
$I->setupKitPluginResourcesNoData($I);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Product: Block: No Products');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Product: Block: No Products'
+ );
// Add block to Page.
- $I->addGutenbergBlock($I, 'Kit Product', 'convertkit-product');
+ $I->addGutenbergBlock(
+ $I,
+ blockName: 'Kit Product',
+ blockProgrammaticName: 'convertkit-product'
+ );
// Confirm that the Product block displays instructions to the user on how to add a Product in Kit.
$I->seeBlockHasNoContentMessage($I, 'No products exist in Kit.');
@@ -530,10 +605,17 @@ public function testProductBlockRefreshButton(EndToEndTester $I)
$I->setupKitPluginResourcesNoData($I);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Product: Refresh Button');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Product: Refresh Button'
+ );
// Add block to Page.
- $I->addGutenbergBlock($I, 'Kit Product', 'convertkit-product');
+ $I->addGutenbergBlock(
+ $I,
+ blockName: 'Kit Product',
+ blockProgrammaticName: 'convertkit-product'
+ );
// Setup Plugin with a valid API Key and resources, as if the user performed the necessary steps to authenticate
// and create a product.
@@ -586,7 +668,11 @@ public function testProductBlockParameterEscaping(EndToEndTester $I)
$I->dontSeeInSource('style="color:red" onmouseover="alert(1)""');
// Confirm that the Kit Product is displayed.
- $I->seeProductOutput($I, $_ENV['CONVERTKIT_API_PRODUCT_URL'], 'Buy my product');
+ $I->seeProductOutput(
+ $I,
+ productURL: $_ENV['CONVERTKIT_API_PRODUCT_URL'],
+ text: 'Buy my product'
+ );
}
/**
diff --git a/tests/EndToEnd/products/PageShortcodeProductCest.php b/tests/EndToEnd/products/PageShortcodeProductCest.php
index 93626452f..56b42ce4e 100644
--- a/tests/EndToEnd/products/PageShortcodeProductCest.php
+++ b/tests/EndToEnd/products/PageShortcodeProductCest.php
@@ -38,23 +38,30 @@ public function testProductShortcodeInVisualEditorWithValidProductParameter(EndT
$I->setupKitPluginResources($I);
// Add a Page using the Classic Editor.
- $I->addClassicEditorPage($I, 'page', 'Kit: Page: Product: Shortcode: Visual Editor');
+ $I->addClassicEditorPage(
+ $I,
+ title: 'Kit: Page: Product: Shortcode: Visual Editor'
+ );
// Add shortcode to Page, setting the Product setting to the value specified in the .env file.
$I->addVisualEditorShortcode(
$I,
- 'Kit Product',
- [
+ shortcodeName: 'Kit Product',
+ shortcodeConfiguration: [
'product' => [ 'select', $_ENV['CONVERTKIT_API_PRODUCT_NAME'] ],
],
- '[convertkit_product product="' . $_ENV['CONVERTKIT_API_PRODUCT_ID'] . '" text="Buy my product" checkout="0" disable_modal_on_mobile="0"]'
+ expectedShortcodeOutput: '[convertkit_product product="' . $_ENV['CONVERTKIT_API_PRODUCT_ID'] . '" text="Buy my product" checkout="0" disable_modal_on_mobile="0"]'
);
// Publish and view the Page on the frontend site.
$I->publishAndViewClassicEditorPage($I);
// Confirm that the Kit Product is displayed.
- $I->seeProductOutput($I, $_ENV['CONVERTKIT_API_PRODUCT_URL'], 'Buy my product');
+ $I->seeProductOutput(
+ $I,
+ productURL: $_ENV['CONVERTKIT_API_PRODUCT_URL'],
+ text: 'Buy my product'
+ );
}
/**
@@ -72,23 +79,30 @@ public function testProductShortcodeInTextEditorWithValidProductParameter(EndToE
$I->setupKitPluginResources($I);
// Add a Page using the Classic Editor.
- $I->addClassicEditorPage($I, 'page', 'Kit: Page: Product: Shortcode: Text Editor');
+ $I->addClassicEditorPage(
+ $I,
+ title: 'Kit: Page: Product: Shortcode: Text Editor'
+ );
// Add shortcode to Page, setting the Product setting to the value specified in the .env file.
$I->addTextEditorShortcode(
$I,
- 'convertkit-product',
- [
+ shortcodeProgrammaticName: 'convertkit-product',
+ shortcodeConfiguration: [
'product' => [ 'select', $_ENV['CONVERTKIT_API_PRODUCT_NAME'] ],
],
- '[convertkit_product product="' . $_ENV['CONVERTKIT_API_PRODUCT_ID'] . '" text="Buy my product" checkout="0" disable_modal_on_mobile="0"]'
+ expectedShortcodeOutput: '[convertkit_product product="' . $_ENV['CONVERTKIT_API_PRODUCT_ID'] . '" text="Buy my product" checkout="0" disable_modal_on_mobile="0"]'
);
// Publish and view the Page on the frontend site.
$I->publishAndViewClassicEditorPage($I);
// Confirm that the Kit Product is displayed.
- $I->seeProductOutput($I, $_ENV['CONVERTKIT_API_PRODUCT_URL'], 'Buy my product');
+ $I->seeProductOutput(
+ $I,
+ productURL: $_ENV['CONVERTKIT_API_PRODUCT_URL'],
+ text: 'Buy my product'
+ );
}
/**
@@ -136,24 +150,31 @@ public function testProductShortcodeInVisualEditorWithTextParameter(EndToEndTest
$I->setupKitPluginResources($I);
// Add a Page using the Classic Editor.
- $I->addClassicEditorPage($I, 'page', 'Kit: Page: Product: Shortcode: Text Param');
+ $I->addClassicEditorPage(
+ $I,
+ title: 'Kit: Page: Product: Shortcode: Text Param'
+ );
// Add shortcode to Page, setting the Product setting to the value specified in the .env file.
$I->addVisualEditorShortcode(
$I,
- 'Kit Product',
- [
+ shortcodeName: 'Kit Product',
+ shortcodeConfiguration: [
'product' => [ 'select', $_ENV['CONVERTKIT_API_PRODUCT_NAME'] ],
'text' => [ 'input', 'Buy now' ],
],
- '[convertkit_product product="' . $_ENV['CONVERTKIT_API_PRODUCT_ID'] . '" text="Buy now" checkout="0" disable_modal_on_mobile="0"]'
+ expectedShortcodeOutput: '[convertkit_product product="' . $_ENV['CONVERTKIT_API_PRODUCT_ID'] . '" text="Buy now" checkout="0" disable_modal_on_mobile="0"]'
);
// Publish and view the Page on the frontend site.
$I->publishAndViewClassicEditorPage($I);
// Confirm that the Kit Product is displayed.
- $I->seeProductOutput($I, $_ENV['CONVERTKIT_API_PRODUCT_URL'], 'Buy now');
+ $I->seeProductOutput(
+ $I,
+ productURL: $_ENV['CONVERTKIT_API_PRODUCT_URL'],
+ text: 'Buy now'
+ );
}
/**
@@ -170,24 +191,31 @@ public function testProductShortcodeInVisualEditorWithBlankTextParameter(EndToEn
$I->setupKitPluginResources($I);
// Add a Page using the Classic Editor.
- $I->addClassicEditorPage($I, 'page', 'Kit: Page: Product: Shortcode: Blank Text Param');
+ $I->addClassicEditorPage(
+ $I,
+ title: 'Kit: Page: Product: Shortcode: Blank Text Param'
+ );
// Add shortcode to Page, setting the Product setting to the value specified in the .env file.
$I->addVisualEditorShortcode(
$I,
- 'Kit Product',
- [
+ shortcodeName: 'Kit Product',
+ shortcodeConfiguration: [
'product' => [ 'select', $_ENV['CONVERTKIT_API_PRODUCT_NAME'] ],
'text' => [ 'input', '' ],
],
- '[convertkit_product product="' . $_ENV['CONVERTKIT_API_PRODUCT_ID'] . '" checkout="0" disable_modal_on_mobile="0"]'
+ expectedShortcodeOutput: '[convertkit_product product="' . $_ENV['CONVERTKIT_API_PRODUCT_ID'] . '" checkout="0" disable_modal_on_mobile="0"]'
);
// Publish and view the Page on the frontend site.
$I->publishAndViewClassicEditorPage($I);
// Confirm that the Kit Product is displayed.
- $I->seeProductOutput($I, $_ENV['CONVERTKIT_API_PRODUCT_URL'], 'Buy my product');
+ $I->seeProductOutput(
+ $I,
+ productURL: $_ENV['CONVERTKIT_API_PRODUCT_URL'],
+ text: 'Buy my product'
+ );
}
/**
@@ -204,24 +232,31 @@ public function testProductShortcodeInVisualEditorWithValidDiscountCodeParameter
$I->setupKitPluginResources($I);
// Add a Page using the Classic Editor.
- $I->addClassicEditorPage($I, 'page', 'Kit: Page: Product: Shortcode: Valid Discount Code Param');
+ $I->addClassicEditorPage(
+ $I,
+ title: 'Kit: Page: Product: Shortcode: Valid Discount Code Param'
+ );
// Add shortcode to Page, setting the Product setting to the value specified in the .env file.
$I->addVisualEditorShortcode(
$I,
- 'Kit Product',
- [
+ shortcodeName: 'Kit Product',
+ shortcodeConfiguration: [
'product' => [ 'select', $_ENV['CONVERTKIT_API_PRODUCT_NAME'] ],
'discount_code' => [ 'input', $_ENV['CONVERTKIT_API_PRODUCT_DISCOUNT_CODE'] ],
],
- '[convertkit_product product="' . $_ENV['CONVERTKIT_API_PRODUCT_ID'] . '" text="Buy my product" discount_code="' . $_ENV['CONVERTKIT_API_PRODUCT_DISCOUNT_CODE'] . '" checkout="0" disable_modal_on_mobile="0"]'
+ expectedShortcodeOutput: '[convertkit_product product="' . $_ENV['CONVERTKIT_API_PRODUCT_ID'] . '" text="Buy my product" discount_code="' . $_ENV['CONVERTKIT_API_PRODUCT_DISCOUNT_CODE'] . '" checkout="0" disable_modal_on_mobile="0"]'
);
// Publish and view the Page on the frontend site.
$I->publishAndViewClassicEditorPage($I);
// Confirm that the Kit Product is displayed.
- $I->seeProductOutput($I, $_ENV['CONVERTKIT_API_PRODUCT_URL'], 'Buy my product');
+ $I->seeProductOutput(
+ $I,
+ productURL: $_ENV['CONVERTKIT_API_PRODUCT_URL'],
+ text: 'Buy my product'
+ );
// Confirm the discount code has been applied.
$I->switchToIFrame('iframe[data-active]');
@@ -243,24 +278,31 @@ public function testProductShortcodeInVisualEditorWithInvalidDiscountCodeParamet
$I->setupKitPluginResources($I);
// Add a Page using the Classic Editor.
- $I->addClassicEditorPage($I, 'page', 'Kit: Page: Product: Shortcode: Valid Discount Code Param');
+ $I->addClassicEditorPage(
+ $I,
+ title: 'Kit: Page: Product: Shortcode: Valid Discount Code Param'
+ );
// Add shortcode to Page, setting the Product setting to the value specified in the .env file.
$I->addVisualEditorShortcode(
$I,
- 'Kit Product',
- [
+ shortcodeName: 'Kit Product',
+ shortcodeConfiguration: [
'product' => [ 'select', $_ENV['CONVERTKIT_API_PRODUCT_NAME'] ],
'discount_code' => [ 'input', 'fake' ],
],
- '[convertkit_product product="' . $_ENV['CONVERTKIT_API_PRODUCT_ID'] . '" text="Buy my product" discount_code="fake" checkout="0" disable_modal_on_mobile="0"]'
+ expectedShortcodeOutput: '[convertkit_product product="' . $_ENV['CONVERTKIT_API_PRODUCT_ID'] . '" text="Buy my product" discount_code="fake" checkout="0" disable_modal_on_mobile="0"]'
);
// Publish and view the Page on the frontend site.
$I->publishAndViewClassicEditorPage($I);
// Confirm that the Kit Product is displayed.
- $I->seeProductOutput($I, $_ENV['CONVERTKIT_API_PRODUCT_URL'], 'Buy my product');
+ $I->seeProductOutput(
+ $I,
+ productURL: $_ENV['CONVERTKIT_API_PRODUCT_URL'],
+ text: 'Buy my product'
+ );
// Confirm the discount code is not valid, but the modal displays so the user can still purchase.
$I->switchToIFrame('iframe[data-active]');
@@ -283,24 +325,31 @@ public function testProductShortcodeWithCheckoutParameterEnabled(EndToEndTester
$I->setupKitPluginResources($I);
// Add a Page using the Classic Editor.
- $I->addClassicEditorPage($I, 'page', 'Kit: Page: Product: Shortcode: Checkout Step');
+ $I->addClassicEditorPage(
+ $I,
+ title: 'Kit: Page: Product: Shortcode: Checkout Step'
+ );
// Add shortcode to Page, setting the Product setting to the value specified in the .env file.
$I->addVisualEditorShortcode(
$I,
- 'Kit Product',
- [
+ shortcodeName: 'Kit Product',
+ shortcodeConfiguration: [
'product' => [ 'select', $_ENV['CONVERTKIT_API_PRODUCT_NAME'] ],
'checkout' => [ 'toggle', 'Yes' ],
],
- '[convertkit_product product="' . $_ENV['CONVERTKIT_API_PRODUCT_ID'] . '" text="Buy my product" checkout="1" disable_modal_on_mobile="0"]'
+ expectedShortcodeOutput: '[convertkit_product product="' . $_ENV['CONVERTKIT_API_PRODUCT_ID'] . '" text="Buy my product" checkout="1" disable_modal_on_mobile="0"]'
);
// Publish and view the Page on the frontend site.
$I->publishAndViewClassicEditorPage($I);
// Confirm that the Kit Product is displayed.
- $I->seeProductOutput($I, $_ENV['CONVERTKIT_API_PRODUCT_URL'], 'Buy my product');
+ $I->seeProductOutput(
+ $I,
+ productURL: $_ENV['CONVERTKIT_API_PRODUCT_URL'],
+ text: 'Buy my product'
+ );
// Confirm the checkout step is displayed.
$I->switchToIFrame('iframe[data-active]');
@@ -323,17 +372,20 @@ public function testProductShortcodeWithDisableModalOnMobileParameterEnabled(End
$I->setupKitPluginResources($I);
// Add a Page using the Classic Editor.
- $I->addClassicEditorPage($I, 'page', 'Kit: Page: Product: Shortcode: Disable Modal on Mobile');
+ $I->addClassicEditorPage(
+ $I,
+ title: 'Kit: Page: Product: Shortcode: Disable Modal on Mobile'
+ );
// Add shortcode to Page, setting the Product setting to the value specified in the .env file.
$I->addVisualEditorShortcode(
$I,
- 'Kit Product',
- [
+ shortcodeName: 'Kit Product',
+ shortcodeConfiguration: [
'product' => [ 'select', $_ENV['CONVERTKIT_API_PRODUCT_NAME'] ],
'disable_modal_on_mobile' => [ 'toggle', 'Yes' ],
],
- '[convertkit_product product="' . $_ENV['CONVERTKIT_API_PRODUCT_ID'] . '" text="Buy my product" checkout="0" disable_modal_on_mobile="1"]'
+ expectedShortcodeOutput: '[convertkit_product product="' . $_ENV['CONVERTKIT_API_PRODUCT_ID'] . '" text="Buy my product" checkout="0" disable_modal_on_mobile="1"]'
);
// Publish and view the Page on the frontend site.
@@ -398,7 +450,13 @@ public function testProductShortcodeWithHexColorParameters(EndToEndTester $I)
$I->checkNoWarningsAndNoticesOnScreen($I);
// Confirm that the Kit Product is displayed.
- $I->seeProductOutput($I, $_ENV['CONVERTKIT_API_PRODUCT_URL'], 'Buy my product', $textColor, $backgroundColor);
+ $I->seeProductOutput(
+ $I,
+ productURL: $_ENV['CONVERTKIT_API_PRODUCT_URL'],
+ text: 'Buy my product',
+ textColor: $textColor,
+ backgroundColor: $backgroundColor
+ );
}
/**
@@ -437,7 +495,11 @@ public function testProductShortcodeParameterEscaping(EndToEndTester $I)
$I->dontSeeInSource('style="color:red" onmouseover="alert(1)""');
// Confirm that the Kit Product is displayed.
- $I->seeProductOutput($I, $_ENV['CONVERTKIT_API_PRODUCT_URL'], 'Buy my product');
+ $I->seeProductOutput(
+ $I,
+ productURL: $_ENV['CONVERTKIT_API_PRODUCT_URL'],
+ text: 'Buy my product'
+ );
}
/**
@@ -451,12 +513,15 @@ public function testProductShortcodeParameterEscaping(EndToEndTester $I)
public function testProductShortcodeWhenNoCredentials(EndToEndTester $I)
{
// Add a Page using the Classic Editor.
- $I->addClassicEditorPage($I, 'page', 'Kit: Page: Product: Shortcode: No API Key');
+ $I->addClassicEditorPage(
+ $I,
+ title: 'Kit: Page: Product: Shortcode: No API Key'
+ );
// Open Visual Editor modal for the shortcode.
$I->openVisualEditorShortcodeModal(
$I,
- 'Kit Product'
+ shortcodeName: 'Kit Product'
);
// Confirm an error notice displays.
@@ -509,12 +574,15 @@ public function testProductShortcodeWhenNoProducts(EndToEndTester $I)
$I->setupKitPluginResourcesNoData($I);
// Add a Page using the Classic Editor.
- $I->addClassicEditorPage($I, 'page', 'Kit: Page: Product: Shortcode: No Products');
+ $I->addClassicEditorPage(
+ $I,
+ title: 'Kit: Page: Product: Shortcode: No Products'
+ );
// Open Visual Editor modal for the shortcode.
$I->openVisualEditorShortcodeModal(
$I,
- 'Kit Product'
+ shortcodeName: 'Kit Product'
);
// Confirm an error notice displays.
diff --git a/tests/EndToEnd/restrict-content/general/RestrictContentCacheCest.php b/tests/EndToEnd/restrict-content/general/RestrictContentCacheCest.php
index ed3d425cc..9495df5a0 100644
--- a/tests/EndToEnd/restrict-content/general/RestrictContentCacheCest.php
+++ b/tests/EndToEnd/restrict-content/general/RestrictContentCacheCest.php
@@ -85,7 +85,11 @@ public function testRestrictContentLiteSpeedCache(EndToEndTester $I)
// Test that the restricted content displays when a valid signed subscriber ID is used,
// to confirm caching does not show the incorrect content.
- $I->setRestrictContentCookieAndReload($I, $_ENV['CONVERTKIT_API_SIGNED_SUBSCRIBER_ID'], $pageID);
+ $I->setRestrictContentCookieAndReload(
+ $I,
+ subscriberID: $_ENV['CONVERTKIT_API_SIGNED_SUBSCRIBER_ID'],
+ urlOrPageID: $pageID
+ );
$I->testRestrictContentDisplaysContent($I);
// Deactivate Litespeed Cache Plugin.
@@ -150,7 +154,11 @@ public function testRestrictContentW3TotalCache(EndToEndTester $I)
// Test that the restricted content displays when a valid signed subscriber ID is used,
// to confirm caching does not show the incorrect content.
- $I->setRestrictContentCookieAndReload($I, $_ENV['CONVERTKIT_API_SIGNED_SUBSCRIBER_ID'], $pageID);
+ $I->setRestrictContentCookieAndReload(
+ $I,
+ subscriberID: $_ENV['CONVERTKIT_API_SIGNED_SUBSCRIBER_ID'],
+ urlOrPageID: $pageID
+ );
$I->testRestrictContentDisplaysContent($I);
// Deactivate W3 Total Cache Plugin.
@@ -224,7 +232,11 @@ public function testRestrictContentWPFastestCache(EndToEndTester $I)
// Test that the restricted content displays when a valid signed subscriber ID is used,
// to confirm caching does not show the incorrect content.
- $I->setRestrictContentCookieAndReload($I, $_ENV['CONVERTKIT_API_SIGNED_SUBSCRIBER_ID'], $pageID);
+ $I->setRestrictContentCookieAndReload(
+ $I,
+ subscriberID: $_ENV['CONVERTKIT_API_SIGNED_SUBSCRIBER_ID'],
+ urlOrPageID: $pageID
+ );
$I->testRestrictContentDisplaysContent($I);
// Deactivate WP Fastest Cache Plugin.
@@ -289,7 +301,11 @@ public function testRestrictContentWPOptimize(EndToEndTester $I)
// Test that the restricted content displays when a valid signed subscriber ID is used,
// to confirm caching does not show the incorrect content.
- $I->setRestrictContentCookieAndReload($I, $_ENV['CONVERTKIT_API_SIGNED_SUBSCRIBER_ID'], $pageID);
+ $I->setRestrictContentCookieAndReload(
+ $I,
+ subscriberID: $_ENV['CONVERTKIT_API_SIGNED_SUBSCRIBER_ID'],
+ urlOrPageID: $pageID
+ );
$I->testRestrictContentDisplaysContent($I);
// Deactivate WP-Optimize Cache Plugin.
@@ -354,7 +370,11 @@ public function testRestrictContentWPSuperCache(EndToEndTester $I)
// Test that the restricted content displays when a valid signed subscriber ID is used,
// to confirm caching does not show the incorrect content.
- $I->setRestrictContentCookieAndReload($I, $_ENV['CONVERTKIT_API_SIGNED_SUBSCRIBER_ID'], $pageID);
+ $I->setRestrictContentCookieAndReload(
+ $I,
+ subscriberID: $_ENV['CONVERTKIT_API_SIGNED_SUBSCRIBER_ID'],
+ urlOrPageID: $pageID
+ );
$I->testRestrictContentDisplaysContent($I);
// Deactivate WP Super Cache Plugin.
@@ -410,7 +430,11 @@ public function testRestrictContentWPRocketCache(EndToEndTester $I)
// Test that the restricted content displays when a valid signed subscriber ID is used,
// to confirm caching does not show the incorrect content.
- $I->setRestrictContentCookieAndReload($I, $_ENV['CONVERTKIT_API_SIGNED_SUBSCRIBER_ID'], $pageID);
+ $I->setRestrictContentCookieAndReload(
+ $I,
+ subscriberID: $_ENV['CONVERTKIT_API_SIGNED_SUBSCRIBER_ID'],
+ urlOrPageID: $pageID
+ );
$I->testRestrictContentDisplaysContent($I);
// Deactivate WP Super Cache Plugin.
diff --git a/tests/EndToEnd/restrict-content/general/RestrictContentFormCest.php b/tests/EndToEnd/restrict-content/general/RestrictContentFormCest.php
index b8bd17f0a..9792aaa07 100644
--- a/tests/EndToEnd/restrict-content/general/RestrictContentFormCest.php
+++ b/tests/EndToEnd/restrict-content/general/RestrictContentFormCest.php
@@ -38,7 +38,10 @@ public function testRestrictContentByForm(EndToEndTester $I)
$I->setupKitPluginDisableJS($I);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Restrict Content: Form');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Restrict Content: Form'
+ );
// Configure metabox's Restrict Content setting = Form name.
$I->configureMetaboxSettings(
@@ -52,14 +55,22 @@ public function testRestrictContentByForm(EndToEndTester $I)
// Add blocks.
$I->addGutenbergParagraphBlock($I, 'Visible content.');
- $I->addGutenbergBlock($I, 'More', 'more');
+ $I->addGutenbergBlock(
+ $I,
+ blockName: 'More',
+ blockProgrammaticName: 'more'
+ );
$I->addGutenbergParagraphBlock($I, 'Member-only content.');
// Publish Page.
$url = $I->publishGutenbergPage($I);
// Test Restrict Content functionality.
- $I->testRestrictedContentByFormOnFrontend($I, $url, $_ENV['CONVERTKIT_API_FORM_ID']);
+ $I->testRestrictedContentByFormOnFrontend(
+ $I,
+ urlOrPageID: $url,
+ formID: $_ENV['CONVERTKIT_API_FORM_ID']
+ );
}
/**
@@ -76,13 +87,16 @@ public function testRestrictContentByFormWithLoginModal(EndToEndTester $I)
$I->setupKitPlugin($I);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Restrict Content: Form');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Restrict Content: Form'
+ );
// Configure metabox's Restrict Content setting = Form name.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration:[
'form' => [ 'select2', 'None' ],
'restrict_content' => [ 'select2', $_ENV['CONVERTKIT_API_FORM_NAME'] ],
]
@@ -90,14 +104,22 @@ public function testRestrictContentByFormWithLoginModal(EndToEndTester $I)
// Add blocks.
$I->addGutenbergParagraphBlock($I, 'Visible content.');
- $I->addGutenbergBlock($I, 'More', 'more');
+ $I->addGutenbergBlock(
+ $I,
+ blockName: 'More',
+ blockProgrammaticName: 'more'
+ );
$I->addGutenbergParagraphBlock($I, 'Member-only content.');
// Publish Page.
$url = $I->publishGutenbergPage($I);
// Test Restrict Content functionality.
- $I->testRestrictedContentByFormOnFrontendUsingLoginModal($I, $url, $_ENV['CONVERTKIT_API_FORM_ID']);
+ $I->testRestrictedContentByFormOnFrontendUsingLoginModal(
+ $I,
+ urlOrPageID: $url,
+ formID: $_ENV['CONVERTKIT_API_FORM_ID']
+ );
}
/**
@@ -164,7 +186,11 @@ public function testRestrictContentByFormUsingQuickEdit(EndToEndTester $I)
);
// Test Restrict Content functionality.
- $I->testRestrictedContentByFormOnFrontend($I, $pageID, $_ENV['CONVERTKIT_API_FORM_ID']);
+ $I->testRestrictedContentByFormOnFrontend(
+ $I,
+ urlOrPageID: $pageID,
+ formID: $_ENV['CONVERTKIT_API_FORM_ID']
+ );
}
/**
@@ -199,9 +225,9 @@ public function testRestrictContentByFormUsingBulkEdit(EndToEndTester $I)
// Bulk Edit the Pages in the Pages WP_List_Table.
$I->bulkEdit(
$I,
- 'page',
- $pageIDs,
- [
+ postType: 'page',
+ postIDs: $pageIDs,
+ configuration: [
'restrict_content' => [ 'select', $_ENV['CONVERTKIT_API_FORM_NAME'] ],
]
);
@@ -209,7 +235,11 @@ public function testRestrictContentByFormUsingBulkEdit(EndToEndTester $I)
// Iterate through Pages to run frontend tests.
foreach ($pageIDs as $pageID) {
// Test Restrict Content functionality.
- $I->testRestrictedContentByFormOnFrontend($I, $pageID, $_ENV['CONVERTKIT_API_FORM_ID']);
+ $I->testRestrictedContentByFormOnFrontend(
+ $I,
+ urlOrPageID: $pageID,
+ formID: $_ENV['CONVERTKIT_API_FORM_ID']
+ );
}
}
diff --git a/tests/EndToEnd/restrict-content/general/RestrictContentSetupCest.php b/tests/EndToEnd/restrict-content/general/RestrictContentSetupCest.php
index 82e4028f5..196b24167 100644
--- a/tests/EndToEnd/restrict-content/general/RestrictContentSetupCest.php
+++ b/tests/EndToEnd/restrict-content/general/RestrictContentSetupCest.php
@@ -370,9 +370,9 @@ public function testAddNewMemberContentDownloadsByTag(EndToEndTester $I)
// Test Restrict Content functionality.
$I->testRestrictedContentByTagOnFrontend(
$I,
- $url,
- $I->generateEmailAddress(),
- [
+ urlOrPageID: $url,
+ emailAddress: $I->generateEmailAddress(),
+ options: [
'member_content' => 'The downloadable content (that is available when the visitor has paid for the Kit product) goes here.',
]
);
@@ -439,9 +439,9 @@ public function testAddNewMemberContentCourseByTag(EndToEndTester $I)
// Test Restrict Content functionality.
$I->testRestrictedContentByTagOnFrontend(
$I,
- $url,
- $I->generateEmailAddress(),
- [
+ urlOrPageID: $url,
+ emailAddress: $I->generateEmailAddress(),
+ options: [
'visible_content' => 'Some introductory text about lesson 1',
'member_content' => 'Lesson 1 content (that is available when the visitor has paid for the Kit product) goes here.',
]
diff --git a/tests/EndToEnd/restrict-content/general/RestrictContentTagCest.php b/tests/EndToEnd/restrict-content/general/RestrictContentTagCest.php
index efeb94d52..e848ba7e1 100644
--- a/tests/EndToEnd/restrict-content/general/RestrictContentTagCest.php
+++ b/tests/EndToEnd/restrict-content/general/RestrictContentTagCest.php
@@ -38,13 +38,16 @@ public function testRestrictContentByTag(EndToEndTester $I)
$I->setupKitPluginDisableJS($I);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Restrict Content: Tag');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Restrict Content: Tag'
+ );
// Configure metabox's Restrict Content setting = Tag name.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'form' => [ 'select2', 'None' ],
'restrict_content' => [ 'select2', $_ENV['CONVERTKIT_API_TAG_NAME'] ],
]
@@ -52,14 +55,22 @@ public function testRestrictContentByTag(EndToEndTester $I)
// Add blocks.
$I->addGutenbergParagraphBlock($I, 'Visible content.');
- $I->addGutenbergBlock($I, 'More', 'more');
+ $I->addGutenbergBlock(
+ $I,
+ blockName: 'More',
+ blockProgrammaticName: 'more'
+ );
$I->addGutenbergParagraphBlock($I, 'Member-only content.');
// Publish Page.
$url = $I->publishGutenbergPage($I);
// Test Restrict Content functionality.
- $I->testRestrictedContentByTagOnFrontend($I, $url, $I->generateEmailAddress());
+ $I->testRestrictedContentByTagOnFrontend(
+ $I,
+ urlOrPageID: $url,
+ emailAddress: $I->generateEmailAddress()
+ );
}
/**
@@ -87,13 +98,16 @@ public function testRestrictContentByTagWithRequireLoginEnabled(EndToEndTester $
);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Restrict Content: Tag: Require Login');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Restrict Content: Tag: Require Login'
+ );
// Configure metabox's Restrict Content setting = Tag name.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'form' => [ 'select2', 'None' ],
'restrict_content' => [ 'select2', $_ENV['CONVERTKIT_API_TAG_NAME'] ],
]
@@ -101,14 +115,22 @@ public function testRestrictContentByTagWithRequireLoginEnabled(EndToEndTester $
// Add blocks.
$I->addGutenbergParagraphBlock($I, 'Visible content.');
- $I->addGutenbergBlock($I, 'More', 'more');
+ $I->addGutenbergBlock(
+ $I,
+ blockName: 'More',
+ blockProgrammaticName: 'more'
+ );
$I->addGutenbergParagraphBlock($I, 'Member-only content.');
// Publish Page.
$url = $I->publishGutenbergPage($I);
// Test Restrict Content functionality.
- $I->testRestrictedContentByTagOnFrontendWhenRequireLoginEnabled($I, $url, $I->generateEmailAddress());
+ $I->testRestrictedContentByTagOnFrontendWhenRequireLoginEnabled(
+ $I,
+ urlOrPageID: $url,
+ emailAddress: $I->generateEmailAddress()
+ );
}
/**
@@ -142,13 +164,16 @@ public function testRestrictContentByTagWithRecaptchaAndRequireLoginEnabled(EndT
$I->setupKitPluginRestrictContent($I, $options['settings']);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Restrict Content: Tag: Recaptcha and Require Login');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Restrict Content: Tag: Recaptcha and Require Login'
+ );
// Configure metabox's Restrict Content setting = Tag name.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'form' => [ 'select2', 'None' ],
'restrict_content' => [ 'select2', $_ENV['CONVERTKIT_API_TAG_NAME'] ],
]
@@ -156,14 +181,23 @@ public function testRestrictContentByTagWithRecaptchaAndRequireLoginEnabled(EndT
// Add blocks.
$I->addGutenbergParagraphBlock($I, 'Visible content.');
- $I->addGutenbergBlock($I, 'More', 'more');
+ $I->addGutenbergBlock(
+ $I,
+ blockName: 'More',
+ blockProgrammaticName: 'more'
+ );
$I->addGutenbergParagraphBlock($I, 'Member-only content.');
// Publish Page.
$url = $I->publishGutenbergPage($I);
// Test Restrict Content functionality.
- $I->testRestrictedContentByTagOnFrontendWhenRequireLoginEnabled($I, $url, $I->generateEmailAddress(), $options);
+ $I->testRestrictedContentByTagOnFrontendWhenRequireLoginEnabled(
+ $I,
+ urlOrPageID: $url,
+ emailAddress: $I->generateEmailAddress(),
+ options: $options
+ );
}
/**
@@ -194,13 +228,16 @@ public function testRestrictContentByTagUsingLoginModal(EndToEndTester $I)
$I->setupKitPluginRestrictContent($I, $options['settings']);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Restrict Content: Tag: Login Modal');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Restrict Content: Tag: Login Modal'
+ );
// Configure metabox's Restrict Content setting = Tag name.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'form' => [ 'select2', 'None' ],
'restrict_content' => [ 'select2', $_ENV['CONVERTKIT_API_TAG_NAME'] ],
]
@@ -208,14 +245,22 @@ public function testRestrictContentByTagUsingLoginModal(EndToEndTester $I)
// Add blocks.
$I->addGutenbergParagraphBlock($I, 'Visible content.');
- $I->addGutenbergBlock($I, 'More', 'more');
+ $I->addGutenbergBlock(
+ $I,
+ blockName: 'More',
+ blockProgrammaticName: 'more'
+ );
$I->addGutenbergParagraphBlock($I, 'Member-only content.');
// Publish Page.
$url = $I->publishGutenbergPage($I);
// Test Restrict Content functionality.
- $I->testRestrictedContentByTagOnFrontendUsingLoginModal($I, $url, $options);
+ $I->testRestrictedContentByTagOnFrontendUsingLoginModal(
+ $I,
+ urlOrPageID: $url,
+ options: $options
+ );
}
/**
@@ -276,13 +321,16 @@ public function testRestrictContentByTagWithRecaptchaEnabled(EndToEndTester $I)
$I->setupKitPluginRestrictContent($I, $options);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Restrict Content: Tag: reCAPTCHA');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Restrict Content: Tag: reCAPTCHA'
+ );
// Configure metabox's Restrict Content setting = Tag name.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'form' => [ 'select2', 'None' ],
'restrict_content' => [ 'select2', $_ENV['CONVERTKIT_API_TAG_NAME'] ],
]
@@ -290,14 +338,23 @@ public function testRestrictContentByTagWithRecaptchaEnabled(EndToEndTester $I)
// Add blocks.
$I->addGutenbergParagraphBlock($I, 'Visible content.');
- $I->addGutenbergBlock($I, 'More', 'more');
+ $I->addGutenbergBlock(
+ $I,
+ blockName: 'More',
+ blockProgrammaticName: 'more'
+ );
$I->addGutenbergParagraphBlock($I, 'Member-only content.');
// Publish Page.
$url = $I->publishGutenbergPage($I);
// Test Restrict Content functionality.
- $I->testRestrictedContentByTagOnFrontend($I, $url, $I->generateEmailAddress(), $options['settings']);
+ $I->testRestrictedContentByTagOnFrontend(
+ $I,
+ urlOrPageID: $url,
+ emailAddress: $I->generateEmailAddress(),
+ options: $options['settings']
+ );
}
/**
@@ -324,13 +381,16 @@ public function testRestrictContentByTagWithRecaptchaEnabledWithHighMinimumScore
);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Restrict Content: Tag: reCAPTCHA High Min Score');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Restrict Content: Tag: reCAPTCHA High Min Score'
+ );
// Configure metabox's Restrict Content setting = Tag name.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'form' => [ 'select2', 'None' ],
'restrict_content' => [ 'select2', $_ENV['CONVERTKIT_API_TAG_NAME'] ],
]
@@ -338,7 +398,11 @@ public function testRestrictContentByTagWithRecaptchaEnabledWithHighMinimumScore
// Add blocks.
$I->addGutenbergParagraphBlock($I, 'Visible content.');
- $I->addGutenbergBlock($I, 'More', 'more');
+ $I->addGutenbergBlock(
+ $I,
+ blockName: 'More',
+ blockProgrammaticName: 'more'
+ );
$I->addGutenbergParagraphBlock($I, 'Member-only content.');
// Publish Page.
@@ -383,15 +447,19 @@ public function testRestrictContentByTagUsingQuickEdit(EndToEndTester $I)
// Quick Edit the Page in the Pages WP_List_Table.
$I->quickEdit(
$I,
- 'page',
- $pageID,
- [
+ postType: 'page',
+ postID: $pageID,
+ configuration: [
'restrict_content' => [ 'select', $_ENV['CONVERTKIT_API_TAG_NAME'] ],
]
);
// Test Restrict Content functionality.
- $I->testRestrictedContentByTagOnFrontend($I, $pageID, $I->generateEmailAddress());
+ $I->testRestrictedContentByTagOnFrontend(
+ $I,
+ urlOrPageID: $pageID,
+ emailAddress: $I->generateEmailAddress()
+ );
}
/**
@@ -426,9 +494,9 @@ public function testRestrictContentByTagUsingBulkEdit(EndToEndTester $I)
// Bulk Edit the Pages in the Pages WP_List_Table.
$I->bulkEdit(
$I,
- 'page',
- $pageIDs,
- [
+ postType: 'page',
+ postIDs: $pageIDs,
+ configuration: [
'restrict_content' => [ 'select', $_ENV['CONVERTKIT_API_TAG_NAME'] ],
]
);
@@ -436,7 +504,11 @@ public function testRestrictContentByTagUsingBulkEdit(EndToEndTester $I)
// Iterate through Pages to run frontend tests.
foreach ($pageIDs as $pageID) {
// Test Restrict Content functionality.
- $I->testRestrictedContentByTagOnFrontend($I, $pageID, $I->generateEmailAddress());
+ $I->testRestrictedContentByTagOnFrontend(
+ $I,
+ urlOrPageID: $pageID,
+ emailAddress: $I->generateEmailAddress()
+ );
}
}
diff --git a/tests/EndToEnd/restrict-content/post-types/RestrictContentProductCPTCest.php b/tests/EndToEnd/restrict-content/post-types/RestrictContentProductCPTCest.php
index 0027d0858..9dbd09530 100644
--- a/tests/EndToEnd/restrict-content/post-types/RestrictContentProductCPTCest.php
+++ b/tests/EndToEnd/restrict-content/post-types/RestrictContentProductCPTCest.php
@@ -40,11 +40,19 @@ public function testRestrictContentWhenDisabled(EndToEndTester $I)
$I->setupKitPluginDisableJS($I);
// Add the CPT using the Gutenberg editor.
- $I->addGutenbergPage($I, 'article', 'Kit: Article: Restrict Content: Product');
+ $I->addGutenbergPage(
+ $I,
+ postType: 'article',
+ title: 'Kit: Article: Restrict Content: Product'
+ );
// Add blocks.
$I->addGutenbergParagraphBlock($I, 'Visible content.');
- $I->addGutenbergBlock($I, 'More', 'more');
+ $I->addGutenbergBlock(
+ $I,
+ blockName: 'More',
+ blockProgrammaticName: 'more'
+ );
$I->addGutenbergParagraphBlock($I, 'Member-only content.');
// Publish Article.
@@ -70,7 +78,11 @@ public function testNoRestrictContentOnPrivateCPT(EndToEndTester $I)
$I->setupKitPluginDisableJS($I);
// Add the CPT using the Gutenberg editor.
- $I->addGutenbergPage($I, 'private', 'Kit: Private: Restrict Content');
+ $I->addGutenbergPage(
+ $I,
+ postType: 'private',
+ title: 'Kit: Private: Restrict Content'
+ );
// Check that the metabox is not displayed.
$I->dontSeeElementInDOM('#wp-convertkit-meta-box');
@@ -93,13 +105,17 @@ public function testRestrictContentByProduct(EndToEndTester $I)
$I->setupKitPluginDisableJS($I);
// Add the CPT using the Gutenberg editor.
- $I->addGutenbergPage($I, 'article', 'Kit: Article: Restrict Content: Product');
+ $I->addGutenbergPage(
+ $I,
+ postType: 'article',
+ title: 'Kit: Article: Restrict Content: Product'
+ );
// Configure metabox's Restrict Content setting = Product name.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'form' => [ 'select2', 'None' ],
'restrict_content' => [ 'select2', $_ENV['CONVERTKIT_API_PRODUCT_NAME'] ],
]
@@ -107,7 +123,11 @@ public function testRestrictContentByProduct(EndToEndTester $I)
// Add blocks.
$I->addGutenbergParagraphBlock($I, 'Visible content.');
- $I->addGutenbergBlock($I, 'More', 'more');
+ $I->addGutenbergBlock(
+ $I,
+ blockName: 'More',
+ blockProgrammaticName: 'more'
+ );
$I->addGutenbergParagraphBlock($I, 'Member-only content.');
// Publish Article.
@@ -132,13 +152,17 @@ public function testRestrictContentByProductWithAddTag(EndToEndTester $I)
$I->setupKitPluginDisableJS($I);
// Add a CPT using the Gutenberg editor.
- $I->addGutenbergPage($I, 'article', 'Kit: Article: Restrict Content: Product');
+ $I->addGutenbergPage(
+ $I,
+ postType: 'article',
+ title: 'Kit: Article: Restrict Content: Product'
+ );
// Configure metabox's Restrict Content setting = Product name.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'form' => [ 'select2', 'None' ],
'tag' => [ 'select2', $_ENV['CONVERTKIT_API_TAG_NAME'] ],
'restrict_content' => [ 'select2', $_ENV['CONVERTKIT_API_PRODUCT_NAME'] ],
@@ -147,7 +171,11 @@ public function testRestrictContentByProductWithAddTag(EndToEndTester $I)
// Add blocks.
$I->addGutenbergParagraphBlock($I, 'Visible content.');
- $I->addGutenbergBlock($I, 'More', 'more');
+ $I->addGutenbergBlock(
+ $I,
+ blockName: 'More',
+ blockProgrammaticName: 'more'
+ );
$I->addGutenbergParagraphBlock($I, 'Member-only content.');
// Publish Article.
@@ -176,13 +204,17 @@ public function testRestrictContentByProductWithGeneratedExcerpt(EndToEndTester
$memberOnlyContent = 'Member-only content';
// Add the CPT using the Gutenberg editor.
- $I->addGutenbergPage($I, 'article', 'Kit: Article: Restrict Content: Product: Generated Excerpt');
+ $I->addGutenbergPage(
+ $I,
+ postType: 'article',
+ title: 'Kit: Article: Restrict Content: Product: Generated Excerpt'
+ );
// Configure metabox's Restrict Content setting = Product name.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'form' => [ 'select2', 'None' ],
'restrict_content' => [ 'select2', $_ENV['CONVERTKIT_API_PRODUCT_NAME'] ],
]
@@ -198,8 +230,8 @@ public function testRestrictContentByProductWithGeneratedExcerpt(EndToEndTester
// Test Restrict Content functionality.
$I->testRestrictedContentByProductOnFrontend(
$I,
- $url,
- [
+ urlOrPageID: $url,
+ options: [
'visible_content' => $visibleContent,
'member_content' => $memberOnlyContent,
]
@@ -221,13 +253,17 @@ public function testRestrictContentModalByProduct(EndToEndTester $I)
$I->setupKitPlugin($I);
// Add the CPT using the Gutenberg editor.
- $I->addGutenbergPage($I, 'article', 'Kit: Article: Restrict Content: Product: Modal');
+ $I->addGutenbergPage(
+ $I,
+ postType: 'article',
+ title: 'Kit: Article: Restrict Content: Product: Modal'
+ );
// Configure metabox's Restrict Content setting = Product name.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'form' => [ 'select2', 'None' ],
'restrict_content' => [ 'select2', $_ENV['CONVERTKIT_API_PRODUCT_NAME'] ],
]
@@ -235,7 +271,11 @@ public function testRestrictContentModalByProduct(EndToEndTester $I)
// Add blocks.
$I->addGutenbergParagraphBlock($I, 'Visible content.');
- $I->addGutenbergBlock($I, 'More', 'more');
+ $I->addGutenbergBlock(
+ $I,
+ blockName: 'More',
+ blockProgrammaticName: 'more'
+ );
$I->addGutenbergParagraphBlock($I, 'Member-only content.');
// Publish Article.
@@ -303,9 +343,9 @@ public function testRestrictContentByProductUsingQuickEdit(EndToEndTester $I)
// Quick Edit the CPT in the CPTs WP_List_Table.
$I->quickEdit(
$I,
- 'article',
- $postID,
- [
+ postType: 'article',
+ postID: $postID,
+ configuration: [
'restrict_content' => [ 'select', $_ENV['CONVERTKIT_API_PRODUCT_NAME'] ],
]
);
@@ -348,9 +388,9 @@ public function testRestrictContentByProductUsingBulkEdit(EndToEndTester $I)
// Bulk Edit the CPTs in the CPTs WP_List_Table.
$I->bulkEdit(
$I,
- 'article',
- $postIDs,
- [
+ postType: 'article',
+ postIDs: $postIDs,
+ configuration: [
'restrict_content' => [ 'select', $_ENV['CONVERTKIT_API_PRODUCT_NAME'] ],
]
);
diff --git a/tests/EndToEnd/restrict-content/post-types/RestrictContentProductPageCest.php b/tests/EndToEnd/restrict-content/post-types/RestrictContentProductPageCest.php
index 178e27f21..dba4e306f 100644
--- a/tests/EndToEnd/restrict-content/post-types/RestrictContentProductPageCest.php
+++ b/tests/EndToEnd/restrict-content/post-types/RestrictContentProductPageCest.php
@@ -37,11 +37,18 @@ public function testRestrictContentWhenDisabled(EndToEndTester $I)
$I->setupKitPluginDisableJS($I);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Restrict Content: Product');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Restrict Content: Product'
+ );
// Add blocks.
$I->addGutenbergParagraphBlock($I, 'Visible content.');
- $I->addGutenbergBlock($I, 'More', 'more');
+ $I->addGutenbergBlock(
+ $I,
+ blockName: 'More',
+ blockProgrammaticName: 'more'
+ );
$I->addGutenbergParagraphBlock($I, 'Member-only content.');
// Publish Page.
@@ -67,13 +74,16 @@ public function testRestrictContentByProduct(EndToEndTester $I)
$I->setupKitPluginDisableJS($I);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Restrict Content: Product');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Restrict Content: Product'
+ );
// Configure metabox's Restrict Content setting = Product name.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'form' => [ 'select2', 'None' ],
'restrict_content' => [ 'select2', $_ENV['CONVERTKIT_API_PRODUCT_NAME'] ],
]
@@ -81,7 +91,11 @@ public function testRestrictContentByProduct(EndToEndTester $I)
// Add blocks.
$I->addGutenbergParagraphBlock($I, 'Visible content.');
- $I->addGutenbergBlock($I, 'More', 'more');
+ $I->addGutenbergBlock(
+ $I,
+ blockName: 'More',
+ blockProgrammaticName: 'more'
+ );
$I->addGutenbergParagraphBlock($I, 'Member-only content.');
// Publish Page.
@@ -106,13 +120,16 @@ public function testRestrictContentByProductWithAddTag(EndToEndTester $I)
$I->setupKitPluginDisableJS($I);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Restrict Content: Product');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Restrict Content: Product'
+ );
// Configure metabox's Restrict Content setting = Product name.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'form' => [ 'select2', 'None' ],
'tag' => [ 'select2', $_ENV['CONVERTKIT_API_TAG_NAME'] ],
'restrict_content' => [ 'select2', $_ENV['CONVERTKIT_API_PRODUCT_NAME'] ],
@@ -121,7 +138,11 @@ public function testRestrictContentByProductWithAddTag(EndToEndTester $I)
// Add blocks.
$I->addGutenbergParagraphBlock($I, 'Visible content.');
- $I->addGutenbergBlock($I, 'More', 'more');
+ $I->addGutenbergBlock(
+ $I,
+ blockName: 'More',
+ blockProgrammaticName: 'more'
+ );
$I->addGutenbergParagraphBlock($I, 'Member-only content.');
// Publish Page.
@@ -150,13 +171,16 @@ public function testRestrictContentByProductWithGeneratedExcerpt(EndToEndTester
$memberOnlyContent = 'Member-only content';
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Restrict Content: Product: Generated Excerpt');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Restrict Content: Product: Generated Excerpt'
+ );
// Configure metabox's Restrict Content setting = Product name.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'form' => [ 'select2', 'None' ],
'restrict_content' => [ 'select2', $_ENV['CONVERTKIT_API_PRODUCT_NAME'] ],
]
@@ -172,8 +196,8 @@ public function testRestrictContentByProductWithGeneratedExcerpt(EndToEndTester
// Test Restrict Content functionality.
$I->testRestrictedContentByProductOnFrontend(
$I,
- $url,
- [
+ urlOrPageID: $url,
+ options: [
'visible_content' => $visibleContent,
'member_content' => $memberOnlyContent,
]
@@ -195,13 +219,16 @@ public function testRestrictContentModalByProduct(EndToEndTester $I)
$I->setupKitPlugin($I);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Restrict Content: Product: Modal');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Restrict Content: Product: Modal'
+ );
// Configure metabox's Restrict Content setting = Product name.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'form' => [ 'select2', 'None' ],
'restrict_content' => [ 'select2', $_ENV['CONVERTKIT_API_PRODUCT_NAME'] ],
]
@@ -209,7 +236,11 @@ public function testRestrictContentModalByProduct(EndToEndTester $I)
// Add blocks.
$I->addGutenbergParagraphBlock($I, 'Visible content.');
- $I->addGutenbergBlock($I, 'More', 'more');
+ $I->addGutenbergBlock(
+ $I,
+ blockName: 'More',
+ blockProgrammaticName: 'more'
+ );
$I->addGutenbergParagraphBlock($I, 'Member-only content.');
// Publish Page.
@@ -276,13 +307,16 @@ public function testRestrictContentWhenEditingWithFrontendPageBuilder(EndToEndTe
$I->activateThirdPartyPlugin($I, 'beaver-builder-lite-version');
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Restrict Content: Beaver Builder');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Restrict Content: Beaver Builder'
+ );
// Configure metabox's Restrict Content setting = Product name.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'form' => [ 'select2', 'None' ],
'restrict_content' => [ 'select2', $_ENV['CONVERTKIT_API_PRODUCT_NAME'] ],
]
@@ -338,13 +372,16 @@ public function testRestrictContentUsingCrawler(EndToEndTester $I)
);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Restrict Content: Product: Search Engines');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Restrict Content: Product: Search Engines'
+ );
// Configure metabox's Restrict Content setting = Product name.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'form' => [ 'select2', 'None' ],
'restrict_content' => [ 'select2', $_ENV['CONVERTKIT_API_PRODUCT_NAME'] ],
]
@@ -352,7 +389,11 @@ public function testRestrictContentUsingCrawler(EndToEndTester $I)
// Add blocks.
$I->addGutenbergParagraphBlock($I, 'Visible content.');
- $I->addGutenbergBlock($I, 'More', 'more');
+ $I->addGutenbergBlock(
+ $I,
+ blockName: 'More',
+ blockProgrammaticName: 'more'
+ );
$I->addGutenbergParagraphBlock($I, 'Member-only content.');
// Publish Page.
@@ -389,9 +430,9 @@ public function testRestrictContentByProductUsingQuickEdit(EndToEndTester $I)
// Quick Edit the Page in the Pages WP_List_Table.
$I->quickEdit(
$I,
- 'page',
- $pageID,
- [
+ postType: 'page',
+ postID: $pageID,
+ configuration: [
'restrict_content' => [ 'select', $_ENV['CONVERTKIT_API_PRODUCT_NAME'] ],
]
);
@@ -432,9 +473,9 @@ public function testRestrictContentByProductUsingBulkEdit(EndToEndTester $I)
// Bulk Edit the Pages in the Pages WP_List_Table.
$I->bulkEdit(
$I,
- 'page',
- $pageIDs,
- [
+ postType: 'page',
+ postIDs: $pageIDs,
+ configuration: [
'restrict_content' => [ 'select', $_ENV['CONVERTKIT_API_PRODUCT_NAME'] ],
]
);
diff --git a/tests/EndToEnd/restrict-content/post-types/RestrictContentProductPostCest.php b/tests/EndToEnd/restrict-content/post-types/RestrictContentProductPostCest.php
index fd2390b5e..36fc31568 100644
--- a/tests/EndToEnd/restrict-content/post-types/RestrictContentProductPostCest.php
+++ b/tests/EndToEnd/restrict-content/post-types/RestrictContentProductPostCest.php
@@ -37,11 +37,19 @@ public function testRestrictContentWhenDisabled(EndToEndTester $I)
$I->setupKitPluginDisableJS($I);
// Add a Post using the Gutenberg editor.
- $I->addGutenbergPage($I, 'post', 'Kit: Post: Restrict Content: Product');
+ $I->addGutenbergPage(
+ $I,
+ postType: 'post',
+ title: 'Kit: Post: Restrict Content: Product'
+ );
// Add blocks.
$I->addGutenbergParagraphBlock($I, 'Visible content.');
- $I->addGutenbergBlock($I, 'More', 'more');
+ $I->addGutenbergBlock(
+ $I,
+ blockName: 'More',
+ blockProgrammaticName: 'more'
+ );
$I->addGutenbergParagraphBlock($I, 'Member-only content.');
// Publish Post.
@@ -67,13 +75,17 @@ public function testRestrictContentByProduct(EndToEndTester $I)
$I->setupKitPluginDisableJS($I);
// Add a Post using the Gutenberg editor.
- $I->addGutenbergPage($I, 'post', 'Kit: Post: Restrict Content: Product');
+ $I->addGutenbergPage(
+ $I,
+ postType: 'post',
+ title: 'Kit: Post: Restrict Content: Product'
+ );
// Configure metabox's Restrict Content setting = Product name.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'form' => [ 'select2', 'None' ],
'restrict_content' => [ 'select2', $_ENV['CONVERTKIT_API_PRODUCT_NAME'] ],
]
@@ -81,7 +93,11 @@ public function testRestrictContentByProduct(EndToEndTester $I)
// Add blocks.
$I->addGutenbergParagraphBlock($I, 'Visible content.');
- $I->addGutenbergBlock($I, 'More', 'more');
+ $I->addGutenbergBlock(
+ $I,
+ blockName: 'More',
+ blockProgrammaticName: 'more'
+ );
$I->addGutenbergParagraphBlock($I, 'Member-only content.');
// Publish Post.
@@ -106,13 +122,17 @@ public function testRestrictContentByProductWithAddTag(EndToEndTester $I)
$I->setupKitPluginDisableJS($I);
// Add a Post using the Gutenberg editor.
- $I->addGutenbergPage($I, 'post', 'Kit: Post: Restrict Content: Product');
+ $I->addGutenbergPage(
+ $I,
+ postType: 'post',
+ title: 'Kit: Post: Restrict Content: Product'
+ );
// Configure metabox's Restrict Content setting = Product name.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'form' => [ 'select2', 'None' ],
'tag' => [ 'select2', $_ENV['CONVERTKIT_API_TAG_NAME'] ],
'restrict_content' => [ 'select2', $_ENV['CONVERTKIT_API_PRODUCT_NAME'] ],
@@ -121,7 +141,11 @@ public function testRestrictContentByProductWithAddTag(EndToEndTester $I)
// Add blocks.
$I->addGutenbergParagraphBlock($I, 'Visible content.');
- $I->addGutenbergBlock($I, 'More', 'more');
+ $I->addGutenbergBlock(
+ $I,
+ blockName: 'More',
+ blockProgrammaticName: 'more'
+ );
$I->addGutenbergParagraphBlock($I, 'Member-only content.');
// Publish Post.
@@ -150,13 +174,17 @@ public function testRestrictContentByProductWithGeneratedExcerpt(EndToEndTester
$memberOnlyContent = 'Member-only content';
// Add a Post using the Gutenberg editor.
- $I->addGutenbergPage($I, 'post', 'Kit: Post: Restrict Content: Product: Generated Excerpt');
+ $I->addGutenbergPage(
+ $I,
+ postType: 'post',
+ title: 'Kit: Post: Restrict Content: Product: Generated Excerpt'
+ );
// Configure metabox's Restrict Content setting = Product name.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'form' => [ 'select2', 'None' ],
'restrict_content' => [ 'select2', $_ENV['CONVERTKIT_API_PRODUCT_NAME'] ],
]
@@ -172,8 +200,8 @@ public function testRestrictContentByProductWithGeneratedExcerpt(EndToEndTester
// Test Restrict Content functionality.
$I->testRestrictedContentByProductOnFrontend(
$I,
- $url,
- [
+ urlOrPageID: $url,
+ options: [
'visible_content' => $visibleContent,
'member_content' => $memberOnlyContent,
]
@@ -201,13 +229,17 @@ public function testRestrictContentByProductWithDefinedExcerpt(EndToEndTester $I
];
// Add a Post using the Gutenberg editor.
- $I->addGutenbergPage($I, 'post', 'Kit: Post: Restrict Content: Product: Defined Excerpt');
+ $I->addGutenbergPage(
+ $I,
+ postType: 'post',
+ title: 'Kit: Post: Restrict Content: Product: Defined Excerpt'
+ );
// Configure metabox's Restrict Content setting = Product name.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'form' => [ 'select2', 'None' ],
'restrict_content' => [ 'select2', $_ENV['CONVERTKIT_API_PRODUCT_NAME'] ],
]
@@ -258,13 +290,17 @@ public function testRestrictContentModalByProduct(EndToEndTester $I)
$I->setupKitPlugin($I);
// Add a Post using the Gutenberg editor.
- $I->addGutenbergPage($I, 'post', 'Kit: Post: Restrict Content: Product: Modal');
+ $I->addGutenbergPage(
+ $I,
+ postType: 'post',
+ title: 'Kit: Post: Restrict Content: Product: Modal'
+ );
// Configure metabox's Restrict Content setting = Product name.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'form' => [ 'select2', 'None' ],
'restrict_content' => [ 'select2', $_ENV['CONVERTKIT_API_PRODUCT_NAME'] ],
]
@@ -272,7 +308,11 @@ public function testRestrictContentModalByProduct(EndToEndTester $I)
// Add blocks.
$I->addGutenbergParagraphBlock($I, 'Visible content.');
- $I->addGutenbergBlock($I, 'More', 'more');
+ $I->addGutenbergBlock(
+ $I,
+ blockName: 'More',
+ blockProgrammaticName: 'more'
+ );
$I->addGutenbergParagraphBlock($I, 'Member-only content.');
// Publish Post.
@@ -340,9 +380,9 @@ public function testRestrictContentByProductUsingQuickEdit(EndToEndTester $I)
// Quick Edit the Post in the Posts WP_List_Table.
$I->quickEdit(
$I,
- 'post',
- $postID,
- [
+ postType: 'post',
+ postID: $postID,
+ configuration: [
'restrict_content' => [ 'select', $_ENV['CONVERTKIT_API_PRODUCT_NAME'] ],
]
);
@@ -385,9 +425,9 @@ public function testRestrictContentByProductUsingBulkEdit(EndToEndTester $I)
// Bulk Edit the Posts in the Posts WP_List_Table.
$I->bulkEdit(
$I,
- 'post',
- $postIDs,
- [
+ postType: 'post',
+ postIDs: $postIDs,
+ configuration: [
'restrict_content' => [ 'select', $_ENV['CONVERTKIT_API_PRODUCT_NAME'] ],
]
);
diff --git a/tests/EndToEnd/restrict-content/post-types/RestrictContentProductThirdPartyThemeOrPageBuilderCest.php b/tests/EndToEnd/restrict-content/post-types/RestrictContentProductThirdPartyThemeOrPageBuilderCest.php
index 5c5708a50..82970aaa1 100644
--- a/tests/EndToEnd/restrict-content/post-types/RestrictContentProductThirdPartyThemeOrPageBuilderCest.php
+++ b/tests/EndToEnd/restrict-content/post-types/RestrictContentProductThirdPartyThemeOrPageBuilderCest.php
@@ -71,8 +71,8 @@ public function testRestrictContentByProductWithUncodeThemeAndVisualComposer(End
// Test Restrict Content functionality.
$I->testRestrictedContentByProductOnFrontend(
$I,
- $pageID,
- [
+ urlOrPageID: $pageID,
+ options: [
'visible_content' => '',
'member_content' => 'Member-only content.',
]
@@ -127,8 +127,8 @@ public function testRestrictContentByProductWithUncodeTheme(EndToEndTester $I)
// Test Restrict Content functionality.
$I->testRestrictedContentByProductOnFrontend(
$I,
- $pageID,
- [
+ urlOrPageID: $pageID,
+ options: [
'visible_content' => '',
'member_content' => 'Member-only content.',
]
diff --git a/tests/EndToEnd/tags/PageShortcodeCustomContentCest.php b/tests/EndToEnd/tags/PageShortcodeCustomContentCest.php
index da14a7856..837da3349 100644
--- a/tests/EndToEnd/tags/PageShortcodeCustomContentCest.php
+++ b/tests/EndToEnd/tags/PageShortcodeCustomContentCest.php
@@ -37,16 +37,19 @@ public function _before(EndToEndTester $I)
public function testCustomContentShortcodeInVisualEditor(EndToEndTester $I)
{
// Add a Page using the Classic Editor.
- $I->addClassicEditorPage($I, 'page', 'Kit: Page: Custom Content: Shortcode: Visual Editor');
+ $I->addClassicEditorPage(
+ $I,
+ title: 'Kit: Page: Custom Content: Shortcode: Visual Editor'
+ );
// Add shortcode to Page, setting the Tag setting to the value specified in the .env file.
$I->addVisualEditorShortcode(
$I,
- 'Kit Custom Content',
- [
+ shortcodeName: 'Kit Custom Content',
+ shortcodeConfiguration: [
'tag' => [ 'select', $_ENV['CONVERTKIT_API_TAG_NAME'] ],
],
- '[convertkit_content tag="' . $_ENV['CONVERTKIT_API_TAG_ID'] . '"][/convertkit_content]'
+ expectedShortcodeOutput: '[convertkit_content tag="' . $_ENV['CONVERTKIT_API_TAG_ID'] . '"][/convertkit_content]'
);
// Publish and view the Page on the frontend site.
@@ -63,16 +66,19 @@ public function testCustomContentShortcodeInVisualEditor(EndToEndTester $I)
public function testCustomContentShortcodeInTextEditor(EndToEndTester $I)
{
// Add a Page using the Classic Editor.
- $I->addClassicEditorPage($I, 'page', 'Kit: Page: Custom Content: Shortcode: Text Editor');
+ $I->addClassicEditorPage(
+ $I,
+ title: 'Kit: Page: Custom Content: Shortcode: Text Editor'
+ );
// Add shortcode to Page, setting the Tag setting to the value specified in the .env file.
$I->addTextEditorShortcode(
$I,
- 'convertkit-content',
- [
+ shortcodeProgrammaticName: 'convertkit-content',
+ shortcodeConfiguration: [
'tag' => [ 'select', $_ENV['CONVERTKIT_API_TAG_NAME'] ],
],
- '[convertkit_content tag="' . $_ENV['CONVERTKIT_API_TAG_ID'] . '"][/convertkit_content]'
+ expectedShortcodeOutput: '[convertkit_content tag="' . $_ENV['CONVERTKIT_API_TAG_ID'] . '"][/convertkit_content]'
);
// Publish and view the Page on the frontend site.
diff --git a/tests/EndToEnd/tags/PageTagCest.php b/tests/EndToEnd/tags/PageTagCest.php
index 38aa60828..a696e4763 100644
--- a/tests/EndToEnd/tags/PageTagCest.php
+++ b/tests/EndToEnd/tags/PageTagCest.php
@@ -47,13 +47,16 @@ public function testAddNewPageUsingNoTag(EndToEndTester $I)
$subscriberID = $I->apiSubscribe($emailAddress, $_ENV['CONVERTKIT_API_FORM_ID']);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Tag: None');
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Tag: None'
+ );
// Check the order of the Tag resources are alphabetical, with the None option prepending the Tags.
$I->checkSelectTagOptionOrder(
$I,
- '#wp-convertkit-tag',
- [
+ selectElement: '#wp-convertkit-tag',
+ prependOptions:[
'None',
]
);
@@ -61,8 +64,8 @@ public function testAddNewPageUsingNoTag(EndToEndTester $I)
// Configure metabox's Tag setting = None.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'tag' => [ 'select2', 'None' ],
]
);
@@ -77,7 +80,7 @@ public function testAddNewPageUsingNoTag(EndToEndTester $I)
$I->checkNoWarningsAndNoticesOnScreen($I);
// Check that the subscriber has not been assigned to the tag.
- $I->apiCheckSubscriberHasNoTags($I, $subscriberID, $_ENV['CONVERTKIT_API_TAG_ID']);
+ $I->apiCheckSubscriberHasNoTags($I, $subscriberID);
}
/**
@@ -99,13 +102,16 @@ public function testAddNewPageUsingDefinedTag(EndToEndTester $I)
$subscriberID = $I->apiSubscribe($emailAddress, $_ENV['CONVERTKIT_API_FORM_ID']);
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Tag: ' . $_ENV['CONVERTKIT_API_TAG_NAME'] );
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Tag: ' . $_ENV['CONVERTKIT_API_TAG_NAME']
+ );
// Configure metabox's Tag setting to the value specified in the .env file.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'tag' => [ 'select2', $_ENV['CONVERTKIT_API_TAG_NAME'] ],
]
);
@@ -120,7 +126,11 @@ public function testAddNewPageUsingDefinedTag(EndToEndTester $I)
$I->checkNoWarningsAndNoticesOnScreen($I);
// Check that the subscriber has been assigned to the tag.
- $I->apiCheckSubscriberHasTag($I, $subscriberID, $_ENV['CONVERTKIT_API_TAG_ID']);
+ $I->apiCheckSubscriberHasTag(
+ $I,
+ subscriberID: $subscriberID,
+ tagID: $_ENV['CONVERTKIT_API_TAG_ID']
+ );
}
/**
@@ -135,13 +145,16 @@ public function testAddNewPageUsingDefinedTag(EndToEndTester $I)
public function testAddNewPageUsingDefinedTagWithInvalidSubscriberID(EndToEndTester $I)
{
// Add a Page using the Gutenberg editor.
- $I->addGutenbergPage($I, 'page', 'Kit: Page: Tag: ' . $_ENV['CONVERTKIT_API_TAG_NAME'] . ': Invalid Subscriber ID' );
+ $I->addGutenbergPage(
+ $I,
+ title: 'Kit: Page: Tag: ' . $_ENV['CONVERTKIT_API_TAG_NAME'] . ': Invalid Subscriber ID'
+ );
// Configure metabox's Tag setting to the value specified in the .env file.
$I->configureMetaboxSettings(
$I,
- 'wp-convertkit-meta-box',
- [
+ metabox: 'wp-convertkit-meta-box',
+ configuration: [
'tag' => [ 'select2', $_ENV['CONVERTKIT_API_TAG_NAME'] ],
]
);
@@ -184,9 +197,9 @@ public function testQuickEditUsingDefinedTag(EndToEndTester $I)
// Quick Edit the Page in the Pages WP_List_Table.
$I->quickEdit(
$I,
- 'page',
- $pageID,
- [
+ postType: 'page',
+ postID: $pageID,
+ configuration: [
'tag' => [ 'select', $_ENV['CONVERTKIT_API_TAG_NAME'] ],
]
);
@@ -198,7 +211,11 @@ public function testQuickEditUsingDefinedTag(EndToEndTester $I)
$I->checkNoWarningsAndNoticesOnScreen($I);
// Check that the subscriber has been assigned to the tag.
- $I->apiCheckSubscriberHasTag($I, $subscriberID, $_ENV['CONVERTKIT_API_TAG_ID']);
+ $I->apiCheckSubscriberHasTag(
+ $I,
+ subscriberID: $subscriberID,
+ tagID: $_ENV['CONVERTKIT_API_TAG_ID']
+ );
}
/**
@@ -230,9 +247,9 @@ public function testBulkEditUsingDefinedTag(EndToEndTester $I)
// Bulk Edit the Pages in the Pages WP_List_Table.
$I->bulkEdit(
$I,
- 'page',
- $pageIDs,
- [
+ postType: 'page',
+ postIDs: $pageIDs,
+ configuration: [
'tag' => [ 'select', $_ENV['CONVERTKIT_API_TAG_NAME'] ],
]
);
@@ -300,9 +317,9 @@ public function testBulkEditWithNoChanges(EndToEndTester $I)
// Bulk Edit the Pages in the Pages WP_List_Table.
$I->bulkEdit(
$I,
- 'page',
- $pageIDs,
- [
+ postType: 'page',
+ postIDs: $pageIDs,
+ configuration: [
'tag' => [ 'select', '— No Change —' ],
]
);
@@ -323,7 +340,11 @@ public function testBulkEditWithNoChanges(EndToEndTester $I)
$I->checkNoWarningsAndNoticesOnScreen($I);
// Check that the subscriber has been assigned to the tag.
- $I->apiCheckSubscriberHasTag($I, $subscriberID, $_ENV['CONVERTKIT_API_TAG_ID']);
+ $I->apiCheckSubscriberHasTag(
+ $I,
+ subscriberID: $subscriberID,
+ tagID: $_ENV['CONVERTKIT_API_TAG_ID']
+ );
}
}
diff --git a/tests/Support/Helper/KitForms.php b/tests/Support/Helper/KitForms.php
index ad5a072c4..09619157f 100644
--- a/tests/Support/Helper/KitForms.php
+++ b/tests/Support/Helper/KitForms.php
@@ -19,9 +19,9 @@ class KitForms extends \Codeception\Module
* @param int $formID Form ID.
* @param bool|string $position Position of the form in the DOM relative to the content.
* @param bool|string $element Element the form should display after.
- * @param bool|string $element_index Number of elements before the form should display.
+ * @param bool|string $elementIndex Number of elements before the form should display.
*/
- public function seeFormOutput($I, $formID, $position = false, $element = false, $element_index = 0)
+ public function seeFormOutput($I, $formID, $position = false, $element = false, $elementIndex = 0)
{
// Calculate how many times the Form should be in the DOM.
$count = ( ( $position === 'before_after_content' ) ? 2 : 1 );
@@ -53,16 +53,16 @@ public function seeFormOutput($I, $formID, $position = false, $element = false,
// The block editor automatically adds CSS classes to some elements.
switch ( $element ) {
case 'p':
- $I->seeInSource('<' . $element . '>Item #' . $element_index . '' . $element . '>