diff --git a/plugins/woocommerce-beta-tester/api/api.php b/plugins/woocommerce-beta-tester/api/api.php
index 2d4a1fbd355..16c1ef5e7cc 100644
--- a/plugins/woocommerce-beta-tester/api/api.php
+++ b/plugins/woocommerce-beta-tester/api/api.php
@@ -64,3 +64,4 @@ require 'live-branches/install.php';
require 'remote-spec-validator/class-wca-test-helper-remote-spec-validator.php';
require 'remote-inbox-notifications/class-wca-test-helper-remote-inbox-notifications.php';
require 'remote-logging/remote-logging.php';
+require 'tools/wccom-request-errors.php';
diff --git a/plugins/woocommerce-beta-tester/api/tools/wccom-request-errors.php b/plugins/woocommerce-beta-tester/api/tools/wccom-request-errors.php
new file mode 100644
index 00000000000..4f2662763c3
--- /dev/null
+++ b/plugins/woocommerce-beta-tester/api/tools/wccom-request-errors.php
@@ -0,0 +1,48 @@
+ 'POST',
+ 'args' => array(
+ 'mode' => array(
+ 'description' => 'wccom request error mode',
+ 'type' => 'enum',
+ 'enum' => array( 'timeout', 'error', 'disabled' ),
+ ),
+ ),
+ )
+);
+
+register_woocommerce_admin_test_helper_rest_route(
+ '/tools/get-wccom-request-errors/v1',
+ 'tools_get_wccom_request_errors',
+ array(
+ 'methods' => 'GET',
+ )
+);
+
+/**
+ * A tool to set wccom request errors mode.
+ *
+ * @param WP_REST_Request $request Request object.
+ */
+function tools_set_wccom_request_errors( $request ) {
+ $mode = $request->get_param( 'mode' );
+
+ update_option( 'wc_admin_test_helper_modify_wccom_request_responses', $mode );
+
+ return new WP_REST_Response( $mode, 200 );
+}
+
+/**
+ * A tool to get wccom request mode.
+ */
+function tools_get_wccom_request_errors() {
+ $mode = get_option( 'wc_admin_test_helper_modify_wccom_request_responses', 'disabled' );
+
+ return new WP_REST_Response( $mode, 200 );
+}
diff --git a/plugins/woocommerce-beta-tester/changelog/50654-add-beta-tester-wccom-endpoints-mods b/plugins/woocommerce-beta-tester/changelog/50654-add-beta-tester-wccom-endpoints-mods
new file mode 100644
index 00000000000..c5e7e461085
--- /dev/null
+++ b/plugins/woocommerce-beta-tester/changelog/50654-add-beta-tester-wccom-endpoints-mods
@@ -0,0 +1,4 @@
+Significance: minor
+Type: add
+
+Add a tool to simulate server problems with woocommerce.com
\ No newline at end of file
diff --git a/plugins/woocommerce-beta-tester/includes/class-wc-beta-tester-wccom-requests.php b/plugins/woocommerce-beta-tester/includes/class-wc-beta-tester-wccom-requests.php
new file mode 100644
index 00000000000..d7a581aa43c
--- /dev/null
+++ b/plugins/woocommerce-beta-tester/includes/class-wc-beta-tester-wccom-requests.php
@@ -0,0 +1,74 @@
+wc_beta_tester_modify_wccom_responses();
+ }
+
+ /**
+ * Modify responses based on option value.
+ */
+ public function wc_beta_tester_modify_wccom_responses() {
+ $mode = get_option( 'wc_admin_test_helper_modify_wccom_request_responses', 'disabled' );
+
+ if ( 'disabled' === $mode ) {
+ return;
+ }
+
+ if ( 'timeout' === $mode ) {
+ add_filter( 'pre_http_request', array( $this, 'override_http_request_timeout' ), 10, 3 );
+ }
+
+ if ( 'error' === $mode ) {
+ add_filter( 'pre_http_request', array( $this, 'override_http_request_error' ), 10, 3 );
+ }
+ }
+
+ /**
+ * Override the http request with a timeout.
+ */
+ public function override_http_request_timeout( $response, $args, $url ) {
+ if ( strpos( $url, 'https://woocommerce.com/wp-json/' ) !== false || strpos( $url, 'woocommerce.test/wp-json/' ) !== false ) {
+ sleep( 6 ); // 6 seconds
+ return new WP_Error( 'http_request_timeout', 'Mock timeout error' );
+ }
+
+ return false;
+ }
+
+ /**
+ * Override the http request with an error.
+ */
+ public function override_http_request_error( $response, $args, $url ) {
+ if ( strpos( $url, 'https://woocommerce.com/wp-json/' ) !== false ) {
+ return array(
+ 'response' => array(
+ 'code' => 500,
+ 'message' => 'Internal Server Error',
+ ),
+ 'body' => 'Server Error',
+ 'headers' => array(),
+ 'cookies' => array(),
+ 'filename' => null,
+ );
+ }
+
+ return false;
+ }
+}
+
+new WC_Beta_Tester_WCCOM_Requests();
diff --git a/plugins/woocommerce-beta-tester/src/tools/commands/index.js b/plugins/woocommerce-beta-tester/src/tools/commands/index.js
index e077ae389bf..6283f0e35a8 100644
--- a/plugins/woocommerce-beta-tester/src/tools/commands/index.js
+++ b/plugins/woocommerce-beta-tester/src/tools/commands/index.js
@@ -16,6 +16,11 @@ import {
UPDATE_COMING_SOON_MODE_ACTION_NAME,
} from './set-coming-soon-mode';
+import {
+ UPDATE_WCCOM_REQUEST_ERRORS_MODE,
+ SetWccomRequestErrros,
+} from './set-wccom-request-errors';
+
export default [
{
command: 'Trigger WCA Install',
@@ -87,4 +92,9 @@ export default [
description:
Loading ...
+ ) : ( +