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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions docs/e2e-testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ The setup script (`scripts/setup.php`) creates these WordPress pages:
| `e2e-supporter` | Supporter mode with 3 tiers (GBP 5, 10, 20/month) |
| `e2e-supporter-custom` | Supporter mode with custom amount allowed |
| `e2e-supporter-no-plans` | Supporter mode with no plans (triggers warning UI) |
| `e2e-custom-fields` | Standard membership with one custom field ("Branch") |


## What is covered
Expand Down Expand Up @@ -77,8 +78,8 @@ The join form specs (the table below) are listed with their test counts. The set
|---|---|---|
| Features | `features.spec.ts`, `features-integrations.spec.ts` | Every setting. Integration switches: refused without credentials, saved with them, payment-step and form effects. Use Stripe sets global plans up in Stripe on save (fake API). Known problem: JOIN-161 (a rejected Stripe key crashes the save). |
| Membership Plans | | Not yet |
| Theme | | Not yet |
| Copy | | Not yet |
| Theme | `theme.spec.ts` | Every setting: colour defaults, each colour reaching the form's styles (the primary colour on its buttons), custom CSS applied. |
| Copy | `copy.spec.ts` | Every setting: each one's default (or none), the fallbacks for blank sidebar, stage label and joining verb, and where each shows (details, plan and bank-details steps, confirmation step, sidebar). Known problems: JOIN-162 (Home Address Copy never shows), JOIN-163 (day-of-month copy unused), JOIN-164 (organisation details marked required but not enforced). |
| Integrations | | Not yet. What Mailchimp, Action Network and Zetkin receive on a join will be covered here. |
| Logging | | Not yet |
| Debug | | Not yet |
Expand Down
17 changes: 17 additions & 0 deletions packages/join-e2e/scripts/setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,22 @@ function ck_e2e_upsert_page(string $slug, string $title, string $content): int
// that care about it.
carbon_set_theme_option('stripe_direct_debit_only', true);

// Custom fields page: standard join with one custom field, so the form shows
// its "more about you" section (and the settings page's heading for it).
$custom_fields_page_id = ck_e2e_upsert_page(
'e2e-custom-fields',
'E2E Custom Fields Test',
ck_e2e_make_block_content($standard_plans, [
'custom_fields' => [[
'_type' => '_',
'label' => 'Branch',
'id' => 'branch',
'required' => false,
'field_type' => 'text',
]],
])
);

// Persist URLs as options so get-page-url.sh can retrieve them.
update_option('ck_e2e_standard_page_url', get_permalink($standard_page_id));
update_option('ck_e2e_free_page_url', get_permalink($free_page_id));
Expand All @@ -353,6 +369,7 @@ function ck_e2e_upsert_page(string $slug, string $title, string $content): int
update_option('ck_e2e_supporter_no_plans_page_url', get_permalink($supporter_no_plans_page_id));
update_option('ck_e2e_allow_cards_override_page_url', get_permalink($allow_cards_override_page_id));
update_option('ck_e2e_multi_currency_page_url', get_permalink($multi_currency_page_id));
update_option('ck_e2e_custom_fields_page_url', get_permalink($custom_fields_page_id));

echo 'Standard page URL: ' . get_permalink($standard_page_id) . "\n";
echo 'Free page URL: ' . get_permalink($free_page_id) . "\n";
Expand Down
2 changes: 1 addition & 1 deletion packages/join-e2e/tests/multi-currency-plans.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { test, expect } from '@playwright/test';
import { CONTINUE, mockRestEndpoints } from './helpers';
import { MULTI_CURRENCY_PAGE } from './settings/support';

/**
* Multi-currency plan selection
Expand All @@ -17,7 +18,6 @@ import { CONTINUE, mockRestEndpoints } from './helpers';
* - "Standard" EUR €7/month (id: standard-eur)
*/

const MULTI_CURRENCY_PAGE = '/e2e-multi-currency-join/';

async function advanceToPlanStep(page: import('@playwright/test').Page) {
await mockRestEndpoints(page);
Expand Down
Loading
Loading