Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
fae702a
Tests: Use Named Arguments
n7studios May 20, 2025
e9a8b5c
Add named arguments to tests
n7studios May 20, 2025
9a65209
Added named arguments to Widget and Non Inline Form tests
n7studios May 21, 2025
1789255
Add named arguments to CPTFormCest
n7studios May 21, 2025
4ebe9c1
Tests: Coding Standards: Run against PHP 8.1 and higher
n7studios May 21, 2025
1b3d5c5
Merge branch 'tests-use-named-arguments' into tests-use-named-argumen…
n7studios May 21, 2025
fe9b63c
Tests: Added named arguments to PageFormCest
n7studios May 21, 2025
5a0c198
Tests: Add named arguments to other and post-types form tests
n7studios May 21, 2025
dfaec29
Tests: Integrations
n7studios May 21, 2025
850aeae
Fix failing tests
n7studios May 21, 2025
6107b02
Merge remote-tracking branch 'origin/tests-use-named-arguments' into …
n7studios May 21, 2025
39b86ce
Fix failing tests
n7studios May 21, 2025
e3bfd8b
Fix failing tests
n7studios May 23, 2025
9300040
Merge remote-tracking branch 'origin/tests-use-named-arguments' into …
n7studios May 23, 2025
06276b9
Fix failing tests
n7studios May 23, 2025
c909a13
Fix failing tests
n7studios May 23, 2025
1392bf6
Fix failing test
n7studios May 23, 2025
e85c08c
Fix failing test
n7studios May 23, 2025
92cd912
Coding standards
n7studios May 23, 2025
6e9f1e3
Tests: Contact Form 7: Wait for API to update before checking subscri…
n7studios May 23, 2025
21d8e89
Tests: Forminator: Wait for API to update before checking subscriber …
n7studios May 23, 2025
4d9c161
Tests: Use Named Arguments, Part 3
n7studios May 24, 2025
b35c2f7
Add named arguments to Tag and some Restrict Content tests
n7studios May 24, 2025
71015d7
Use named arguments on remaining Restrict Content tests
n7studios May 24, 2025
0378df9
Fix failing test
n7studios May 24, 2025
6074a98
Tests: Fix spacing on named arguments
n7studios May 28, 2025
da6c814
Merge pull request #827 from Kit/tests-use-named-arguments-3
n7studios May 28, 2025
7066556
Merge pull request #826 from Kit/tests-use-named-arguments-2
n7studios May 28, 2025
755dd98
Tests: Fix named argument spacing
n7studios May 28, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/coding-standards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
161 changes: 113 additions & 48 deletions tests/EndToEnd/broadcasts/blocks-shortcodes/PageBlockBroadcastsCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.');
Expand All @@ -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.
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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 ],
]
);
Expand Down Expand Up @@ -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' ],
]
);
Expand Down Expand Up @@ -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 ],
]
Expand Down Expand Up @@ -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 ],
]
);
Expand Down Expand Up @@ -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' ],
]
Expand Down Expand Up @@ -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.
]
);
Expand Down Expand Up @@ -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"]');
Expand Down Expand Up @@ -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 ],
]
Expand All @@ -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' ],
Expand Down Expand Up @@ -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', '' ],
Expand Down
Loading