Skip to content

Commit 7f91db3

Browse files
Add Playwright E2E setup (#2486)
* Add Playwright to npm packages * Update node to v16 and npm to v8 * Update .gitignore * Add dotenv * Add config files * Update .prettierignore * Update prettier version * Fix env variables for login * Fix download URL * Delete local.env * Remove node-sass from dependencies * Fix flags on global-setup.js * Replace upload plugin method * Fix error in unit test * Fix unit tests * Add jest 27.4.5 * Update prettier * Add eslint version * Update Docs * Move plugin update step to global-setup.js * Add placeholder files for tests * Make the customer setup run in parallel * Optimize global-setup and global-teardown * Update docs * Update Docs * Update Docs * Add --woo_setup flag for WooCommerce setup * Try: Woo Setup using SSH * Update local.env.example * Add Stripe keys setup * Fix assertion for stripe keys setup * Create Stripe webhook via API * Update Docs * Remove placeholder tests * Remove unused files * Remove customer login from setup * Clean-up stripe settings if flag --with_stripe_setup is present * Fix setup edge cases * Add e2e-setup script * Add validation for setup secrets * Fail early if secrets are not set * Fix setup * Add BASE_URL validation * Update DOCS
1 parent c258212 commit 7f91db3

31 files changed

+51413
-23535
lines changed

.gitignore

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ release/
1616
build/
1717
woocommerce-gateway-stripe.zip
1818
languages/woocommerce-gateway-stripe.pot
19+
*.env
20+
*.tmp
21+
*.zip
1922

2023
# Ignore all log files except for .htaccess
2124
/logs/*
@@ -25,10 +28,14 @@ languages/woocommerce-gateway-stripe.pot
2528
deploy-to-wp-org.sh
2629

2730
# Test configs
28-
tests/e2e/config/local-*
31+
tests/e2e/storage
32+
tests/e2e/output
33+
tests/e2e/report
34+
tests/e2e/tmp
35+
tests/e2e/allure-results
2936

3037
# Volumes mounted by Docker containers
3138
docker/bin/jt
3239
docker/data
3340
docker/wordpress
34-
docker/logs
41+
docker/logs

.npmrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
legacy-peer-deps=true
2+
engine-strict=true

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
12.22.5
1+
16.18.0

.prettierignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,7 @@ wordpress_org_assets
1010

1111
tests/e2e/docker
1212
tests/e2e/deps
13+
tests/e2e/output
14+
tests/e2e/report
15+
tests/e2e/allure-results
16+
tests/e2e/storage

client/settings/payment-settings/__tests__/general-settings-section.test.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,9 +182,12 @@ describe( 'GeneralSettingsSection', () => {
182182
} ) ),
183183
} );
184184
useAccountKeysWebhookSecret.mockReturnValue( [ '', jest.fn() ] );
185-
useAccountKeysSecretKey.mockReturnValue( [ 'live_sk', jest.fn() ] );
185+
useAccountKeysSecretKey.mockReturnValue( [
186+
'sk_live_',
187+
jest.fn(),
188+
] );
186189
useAccountKeysPublishableKey.mockReturnValue( [
187-
'live_pk',
190+
'pk_live_',
188191
jest.fn(),
189192
] );
190193

client/settings/save-settings-section/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ const SaveSettingsSection = ( { onSettingsSave } ) => {
1414

1515
const onClickHandler = async () => {
1616
await saveSettings();
17-
onSettingsSave();
17+
if ( onSettingsSave ) {
18+
onSettingsSave();
19+
}
1820
};
1921

2022
return (

0 commit comments

Comments
 (0)