Skip to content

Commit 055c87a

Browse files
test: make e2e Pro license state deterministic
Drop the real license.json from the e2e workflow: development.php re-activates Pro from it on every request, so any "without Otter Pro" assertion could only pass when the live activation call failed. Restore the active-Pro stub baseline in form-retention's afterEach (the previous deactivatePro leaked into later Pro-gated form.spec tests, which only passed on CI because of that re-activation), and set the required Pro state inline in the upsell and legacy save-location tests instead of relying on suite order. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent bb7ac42 commit 055c87a

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

.github/workflows/e2e-js.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,6 @@ jobs:
4747
run: |
4848
npm run build-dev
4949
50-
- name: Create License File
51-
run: |
52-
printf "{\"key\":\"${{ secrets.OTTER_PRO_LICENSE }}\"}" > license.json
53-
5450
- name: Setup WP Env
5551
run: |
5652
npm run wp-env start

src/blocks/test/e2e/blocks/form-retention.spec.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,12 @@ test.describe( 'Form submission retention', () => {
7979
});
8080

8181
// Leave the site in pretend-send state for the specs that run after this one.
82+
// The run baseline is an active Pro stub (see global-setup), so restore it rather
83+
// than deactivate: later Pro-gated specs (form.spec file/hidden/export) rely on it.
8284
test.afterEach( async({ otterUtils }) => {
8385
await otterUtils.setCaptchaMode( 'off' );
8486
await otterUtils.setMailMode( 'ok' );
85-
await otterUtils.deactivatePro();
87+
await otterUtils.activatePro();
8688
});
8789

8890
test( 'successful submission stores a Record with Complete delivery', async({ editor, page, otterUtils }) => {
@@ -187,6 +189,9 @@ test.describe( 'Form submission retention', () => {
187189
});
188190

189191
test( 'legacy save-location value maps to the toggle and is rewritten on save', async({ admin, editor, page, otterUtils }) => {
192+
// The legacy mapping is Pro-gated on both sides (edit.js and Form_Settings_Data).
193+
await otterUtils.activatePro();
194+
190195
await insertContactForm({ editor, page });
191196

192197
const postId = await publishPostReliable( editor, page );
@@ -488,6 +493,7 @@ test.describe( 'Form submission retention', () => {
488493
const recordB = records.find( record => record.form === formB );
489494

490495
// Free: the filters render as disabled selects with the Pro upsell.
496+
await otterUtils.deactivatePro();
491497
await page.goto( '/wp-admin/edit.php?post_type=otter_form_record' );
492498

493499
await expect( page.locator( '.o-filters-locked select' ).first() ).toBeDisabled();

0 commit comments

Comments
 (0)