diff --git a/packages/js/internal-style-build/abstracts/_mixins.scss b/packages/js/internal-style-build/abstracts/_mixins.scss index 43ab642052d..bbbce36cd95 100644 --- a/packages/js/internal-style-build/abstracts/_mixins.scss +++ b/packages/js/internal-style-build/abstracts/_mixins.scss @@ -102,20 +102,6 @@ cursor: default; } -@mixin button-style__hover { - background-color: $studio-white; - color: $gray-900; - box-shadow: inset 0 0 0 1px $gray-400, inset 0 0 0 2px $studio-white, - 0 1px 1px rgba( $gray-900, 0.2 ); -} - -@mixin button-style__active() { - outline: none; - background-color: $studio-white; - color: $gray-900; - box-shadow: inset 0 0 0 1px $gray-400, inset 0 0 0 2px $studio-white; -} - @mixin button-style__focus-active() { background-color: $studio-white; color: $gray-900; diff --git a/plugins/woocommerce-admin/client/layout/controller.js b/plugins/woocommerce-admin/client/layout/controller.js index 023b9af24c5..1863c17522e 100644 --- a/plugins/woocommerce-admin/client/layout/controller.js +++ b/plugins/woocommerce-admin/client/layout/controller.js @@ -51,11 +51,6 @@ const Dashboard = lazy( () => const Homescreen = lazy( () => import( /* webpackChunkName: "homescreen" */ '../homescreen' ) ); -const MarketingOverview = lazy( () => - import( - /* webpackChunkName: "marketing-overview" */ '../marketing/overview' - ) -); const MarketingOverviewMultichannel = lazy( () => import( /* webpackChunkName: "multichannel-marketing" */ '../marketing/overview-multichannel' @@ -157,9 +152,7 @@ export const getPages = () => { if ( window.wcAdminFeatures.marketing ) { pages.push( { - container: window.wcAdminFeatures[ 'multichannel-marketing' ] - ? MarketingOverviewMultichannel - : MarketingOverview, + container: MarketingOverviewMultichannel, path: '/marketing', breadcrumbs: [ ...initialBreadcrumbs, diff --git a/plugins/woocommerce-admin/client/marketing/components/button/README.md b/plugins/woocommerce-admin/client/marketing/components/button/README.md deleted file mode 100644 index 5c0298a9428..00000000000 --- a/plugins/woocommerce-admin/client/marketing/components/button/README.md +++ /dev/null @@ -1,22 +0,0 @@ -Button -=== - -This component creates simple reusable html `` element. - -## Usage - -```jsx - -``` - -### Props - -Name | Type | Default | Description ---- | --- | --- | --- -`className` | String | `null` | Additional class name to style the component diff --git a/plugins/woocommerce-admin/client/marketing/components/button/index.js b/plugins/woocommerce-admin/client/marketing/components/button/index.js deleted file mode 100644 index 0542f4fc998..00000000000 --- a/plugins/woocommerce-admin/client/marketing/components/button/index.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * External dependencies - */ -import { Button } from '@wordpress/components'; -import classnames from 'classnames'; - -/** - * Internal dependencies - */ -import './style.scss'; - -export default ( props ) => { - return ( - - ); - } - - getFinishSetupButton() { - return ( - - ); - } - - render() { - const { name, description, status, slug } = this.props; - let actions = null; - - switch ( status ) { - case 'installed': - actions = this.getActivateButton(); - break; - case 'activated': - actions = this.getFinishSetupButton(); - break; - case 'configured': - actions = this.getLinks(); - break; - } - - return ( -
- -
-
-

{ name }

- { status === 'configured' || ( -

- { description } -

- ) } -
-
- { actions } -
-
-
- ); - } -} - -InstalledExtensionRow.defaultProps = { - isLoading: false, -}; - -InstalledExtensionRow.propTypes = { - name: PropTypes.string.isRequired, - slug: PropTypes.string.isRequired, - description: PropTypes.string.isRequired, - status: PropTypes.string.isRequired, - settingsUrl: PropTypes.string, - docsUrl: PropTypes.string, - supportUrl: PropTypes.string, - dashboardUrl: PropTypes.string, - activatePlugin: PropTypes.func.isRequired, -}; - -export default InstalledExtensionRow; diff --git a/plugins/woocommerce-admin/client/marketing/overview/installed-extensions/style.scss b/plugins/woocommerce-admin/client/marketing/overview/installed-extensions/style.scss deleted file mode 100644 index 8968f5315fe..00000000000 --- a/plugins/woocommerce-admin/client/marketing/overview/installed-extensions/style.scss +++ /dev/null @@ -1,91 +0,0 @@ -.woocommerce-marketing-installed-extensions-card { - &__item { - display: flex; - align-items: center; - padding: 18px 24px; - - h4 { - font-weight: 400; - font-size: 16px; - margin: 0 0 5px; - color: $gray-900; - } - - p { - color: $gray-700; - margin: 0; - } - } - - &__item:not(:last-child) { - border-bottom: 1px solid $gray-200; - } - - &__item-text-and-actions { - display: flex; - flex-wrap: wrap; - align-items: center; - flex-grow: 2; - min-width: 0; // Flexbox truncated text fix - - @include breakpoint( '>600px' ) { - flex-wrap: nowrap; - } - } - - &__item-actions { - @include breakpoint( '>600px' ) { - text-align: right; - white-space: nowrap; - padding-left: 25px; - } - } - - &__item-description { - @include breakpoint( '>960px' ) { - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - max-width: 550px; - } - } - - &__item-links { - margin: 0; - padding: 0; - - li { - display: inline-block; - margin: 0 25px 0 0; - - @include breakpoint( '>600px' ) { - margin: 0 0 0 30px; - } - } - - a { - font-weight: 600; - color: var(--wp-admin-theme-color) !important; - text-decoration: none; - font-size: 14px; - } - } - - .woocommerce-admin-marketing-product-icon { - align-self: flex-start; - margin-right: 14px; - margin-top: 2px; // Align top of image with text - } - - &__item-text { - min-width: 0; // Flexbox truncated text fix - flex-grow: 2; - margin: 0 0 10px; - width: 100%; - - @include breakpoint( '>600px' ) { - margin: 0; - width: auto; - } - } -} diff --git a/plugins/woocommerce-admin/client/marketing/overview/section-slot/index.ts b/plugins/woocommerce-admin/client/marketing/overview/section-slot/index.ts deleted file mode 100644 index 38d712f793e..00000000000 --- a/plugins/woocommerce-admin/client/marketing/overview/section-slot/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './section-slot'; -export * from './utils'; diff --git a/plugins/woocommerce-admin/client/marketing/overview/section-slot/section-slot.tsx b/plugins/woocommerce-admin/client/marketing/overview/section-slot/section-slot.tsx deleted file mode 100644 index f06fc18292e..00000000000 --- a/plugins/woocommerce-admin/client/marketing/overview/section-slot/section-slot.tsx +++ /dev/null @@ -1,38 +0,0 @@ -/** - * External dependencies - */ -import { useSlot } from '@woocommerce/experimental'; -import classnames from 'classnames'; - -/** - * Internal dependencies - */ -import { - EXPERIMENTAL_WC_MARKETING_OVERVIEW_SECTION_SLOT_NAME, - WooMarketingOverviewSection, -} from './utils'; - -export const MarketingOverviewSectionSlot = ( { - className, -}: { - className: string; -} ) => { - const slot = useSlot( - EXPERIMENTAL_WC_MARKETING_OVERVIEW_SECTION_SLOT_NAME - ); - const hasFills = Boolean( slot?.fills?.length ); - - if ( ! hasFills ) { - return null; - } - return ( -
- -
- ); -}; diff --git a/plugins/woocommerce-admin/client/marketing/overview/section-slot/utils.tsx b/plugins/woocommerce-admin/client/marketing/overview/section-slot/utils.tsx deleted file mode 100644 index 5c9a9de9ea0..00000000000 --- a/plugins/woocommerce-admin/client/marketing/overview/section-slot/utils.tsx +++ /dev/null @@ -1,63 +0,0 @@ -/** - * External dependencies - */ -import { Slot, Fill } from '@wordpress/components'; -import { - createOrderedChildren, - sortFillsByOrder, -} from '@woocommerce/components'; - -export const EXPERIMENTAL_WC_MARKETING_OVERVIEW_SECTION_SLOT_NAME = - 'experimental_woocommerce_marketing_overview_section'; -/** - * Create a Fill for extensions to add a section to the Marketing Overview page. - * - * @slotFill WooMarketingOverviewSection - * @scope woocommerce-admin - * @example - * const MySection = () => ( - * - *
- *
- * Slotfill goes in here! - *
- *
- *
- * ); - * - * registerPlugin( 'my-extension', { - * render: MySection, - * scope: 'woocommerce-admin', - * } ); - * @param {Object} param0 - * @param {Array} param0.children - Node children. - * @param {Array} param0.order - Node order. - */ -export const WooMarketingOverviewSection = ( { - children, - order = 1, -}: { - children: React.ReactNode; - order?: number; -} ) => { - return ( - - { ( fillProps: Fill.Props ) => { - return createOrderedChildren( children, order, fillProps ); - } } - - ); -}; - -WooMarketingOverviewSection.Slot = ( { - fillProps, -}: { - fillProps?: Slot.Props; -} ) => ( - - { sortFillsByOrder } - -); diff --git a/plugins/woocommerce-admin/client/marketing/overview/style.scss b/plugins/woocommerce-admin/client/marketing/overview/style.scss deleted file mode 100644 index eaf6fdbbf4f..00000000000 --- a/plugins/woocommerce-admin/client/marketing/overview/style.scss +++ /dev/null @@ -1,8 +0,0 @@ -.woocommerce-marketing-overview { - max-width: 1032px; - margin: 0 auto; - - .components-card { - margin-bottom: 24px; - } -} diff --git a/plugins/woocommerce-admin/client/marketing/overview/welcome-card/images/welcome.svg b/plugins/woocommerce-admin/client/marketing/overview/welcome-card/images/welcome.svg deleted file mode 100644 index ae8d8a7a75f..00000000000 --- a/plugins/woocommerce-admin/client/marketing/overview/welcome-card/images/welcome.svg +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/plugins/woocommerce-admin/client/marketing/overview/welcome-card/index.js b/plugins/woocommerce-admin/client/marketing/overview/welcome-card/index.js deleted file mode 100644 index 99ed62c0b46..00000000000 --- a/plugins/woocommerce-admin/client/marketing/overview/welcome-card/index.js +++ /dev/null @@ -1,85 +0,0 @@ -/** - * External dependencies - */ -import { __ } from '@wordpress/i18n'; -import { Button, Card, CardBody } from '@wordpress/components'; -import CrossIcon from 'gridicons/dist/cross'; -import { compose } from '@wordpress/compose'; -import { withDispatch, withSelect } from '@wordpress/data'; -import PropTypes from 'prop-types'; -import { OPTIONS_STORE_NAME } from '@woocommerce/data'; -import { recordEvent } from '@woocommerce/tracks'; - -/** - * Internal dependencies - */ -import './style.scss'; -import WelcomeImage from './images/welcome.svg'; - -const WelcomeCard = ( { isHidden, updateOptions } ) => { - const hide = () => { - updateOptions( { - woocommerce_marketing_overview_welcome_hidden: 'yes', - } ); - recordEvent( 'marketing_intro_close', {} ); - }; - - if ( isHidden ) { - return null; - } - - return ( - - - - -

- { __( - 'Grow your customer base and increase your sales with marketing tools built for WooCommerce', - 'woocommerce' - ) } -

-
-
- ); -}; - -WelcomeCard.propTypes = { - /** - * Whether the card is hidden. - */ - isHidden: PropTypes.bool.isRequired, - /** - * updateOptions function. - */ - updateOptions: PropTypes.func.isRequired, -}; - -// named export -export { WelcomeCard }; - -// default export -export default compose( - withSelect( ( select ) => { - const { getOption, isOptionsUpdating } = select( OPTIONS_STORE_NAME ); - const isUpdateRequesting = isOptionsUpdating(); - - return { - isHidden: - getOption( 'woocommerce_marketing_overview_welcome_hidden' ) === - 'yes' || isUpdateRequesting, - }; - } ), - withDispatch( ( dispatch ) => { - const { updateOptions } = dispatch( OPTIONS_STORE_NAME ); - return { - updateOptions, - }; - } ) -)( WelcomeCard ); diff --git a/plugins/woocommerce-admin/client/marketing/overview/welcome-card/style.scss b/plugins/woocommerce-admin/client/marketing/overview/welcome-card/style.scss deleted file mode 100644 index 3a6549a89ee..00000000000 --- a/plugins/woocommerce-admin/client/marketing/overview/welcome-card/style.scss +++ /dev/null @@ -1,76 +0,0 @@ -.woocommerce-marketing-overview-welcome-card { - position: relative; - - .components-card__body { - display: flex; - justify-content: center; - align-items: center; - flex-wrap: wrap; - padding: 22px; - - @include breakpoint( '>600px' ) { - flex-wrap: nowrap; - } - - @include breakpoint( '>960px' ) { - padding: 32px 108px; - } - } - - &__hide-button { - display: flex; - align-items: center; - padding: 8px; - margin: 0; - border: none; - background: none; - color: $gray-700; - overflow: hidden; - border-radius: 4px; - position: absolute; - top: 10px; - right: 10px; - - // Ensure that even SVG icons that don't include the .dashicon class are colored. - svg { - fill: currentColor; - outline: none; - } - - &:not(:disabled):not([aria-disabled='true']):not(.is-default):hover { - @include button-style__hover; - } - - &:not(:disabled):not([aria-disabled='true']):not(.is-default):active { - @include button-style__active; - } - - &[aria-disabled='true']:focus, - &:disabled:focus { - box-shadow: none; - } - } - - h3 { - font-size: 20px; - line-height: 26px; - font-weight: normal; - text-align: center; - margin: 1em 0 0; - - @include breakpoint( '>600px' ) { - text-align: left; - margin: 0 0 0 20px; - } - - @include breakpoint( '>960px' ) { - font-size: 24px; - line-height: 32px; - } - } - - img { - width: 231px; - flex: none; - } -} diff --git a/plugins/woocommerce-admin/client/marketing/overview/welcome-card/test/index.js b/plugins/woocommerce-admin/client/marketing/overview/welcome-card/test/index.js deleted file mode 100644 index b737ff6f204..00000000000 --- a/plugins/woocommerce-admin/client/marketing/overview/welcome-card/test/index.js +++ /dev/null @@ -1,68 +0,0 @@ -/** - * External dependencies - */ -import { recordEvent } from '@woocommerce/tracks'; -import { render, waitFor } from '@testing-library/react'; -import userEvent from '@testing-library/user-event'; -import { createElement } from '@wordpress/element'; - -/** - * Internal dependencies - */ -import { WelcomeCard } from '../index.js'; - -jest.mock( '@woocommerce/tracks' ); -jest.mock( '@woocommerce/settings' ); - -describe( 'WelcomeCard hide button', () => { - it( 'should record an event when clicked', () => { - const { getByRole } = render( - - ); - - userEvent.click( getByRole( 'button', { name: 'Hide' } ) ); - - expect( recordEvent ).toHaveBeenCalledTimes( 1 ); - expect( recordEvent ).toHaveBeenCalledWith( - 'marketing_intro_close', - {} - ); - } ); - - it( 'should update option when clicked', async () => { - const mockUpdateOptions = jest.fn(); - const { getByRole } = render( - - ); - - userEvent.click( getByRole( 'button' ) ); - - await waitFor( () => - expect( mockUpdateOptions ).toHaveBeenCalledTimes( 1 ) - ); - expect( mockUpdateOptions ).toHaveBeenCalledWith( { - woocommerce_marketing_overview_welcome_hidden: 'yes', - } ); - } ); -} ); - -describe( 'Component visibility can be toggled', () => { - it( 'WelcomeCard should be visible if isHidden is false', () => { - const { getByRole } = render( - - ); - - expect( getByRole( 'button' ) ).toBeInTheDocument(); - } ); - - it( 'WelcomeCard should be hidden if isHidden is true', () => { - const { queryByRole } = render( - - ); - - expect( queryByRole( 'button' ) ).toBeNull(); - } ); -} ); diff --git a/plugins/woocommerce/changelog/feature-37367-marketing-multichannel-remove-toggle b/plugins/woocommerce/changelog/feature-37367-marketing-multichannel-remove-toggle new file mode 100644 index 00000000000..a36d836c3dc --- /dev/null +++ b/plugins/woocommerce/changelog/feature-37367-marketing-multichannel-remove-toggle @@ -0,0 +1,4 @@ +Significance: minor +Type: update + +Make Multichannel Marketing the default new UI for Marketing page; remove classic Marketing page and unused code. diff --git a/plugins/woocommerce/client/admin/config/core.json b/plugins/woocommerce/client/admin/config/core.json index 48e6fe51ff5..f796d84a040 100644 --- a/plugins/woocommerce/client/admin/config/core.json +++ b/plugins/woocommerce/client/admin/config/core.json @@ -11,7 +11,6 @@ "shipping-setting-tour": true, "homescreen": true, "marketing": true, - "multichannel-marketing": true, "minified-js": false, "mobile-app-banner": true, "navigation": true, diff --git a/plugins/woocommerce/client/admin/config/development.json b/plugins/woocommerce/client/admin/config/development.json index 39286384fb8..b2511893a64 100644 --- a/plugins/woocommerce/client/admin/config/development.json +++ b/plugins/woocommerce/client/admin/config/development.json @@ -11,7 +11,6 @@ "shipping-setting-tour": true, "homescreen": true, "marketing": true, - "multichannel-marketing": true, "minified-js": true, "mobile-app-banner": true, "navigation": true, diff --git a/plugins/woocommerce/src/Admin/API/Options.php b/plugins/woocommerce/src/Admin/API/Options.php index 7205f72f711..c37a6058931 100644 --- a/plugins/woocommerce/src/Admin/API/Options.php +++ b/plugins/woocommerce/src/Admin/API/Options.php @@ -167,7 +167,6 @@ class Options extends \WC_REST_Data_Controller { 'woocommerce_task_list_dismissed_tasks', 'woocommerce_setting_payments_recommendations_hidden', 'woocommerce_navigation_favorites_tooltip_hidden', - 'woocommerce_marketing_overview_welcome_hidden', 'woocommerce_admin_transient_notices_queue', 'woocommerce_task_list_welcome_modal_dismissed', 'woocommerce_welcome_from_calypso_modal_dismissed', diff --git a/plugins/woocommerce/src/Admin/Features/Features.php b/plugins/woocommerce/src/Admin/Features/Features.php index cca803dbca9..681b322bb6c 100644 --- a/plugins/woocommerce/src/Admin/Features/Features.php +++ b/plugins/woocommerce/src/Admin/Features/Features.php @@ -26,7 +26,6 @@ class Features { * @var array */ protected static $optional_features = array( - 'multichannel-marketing' => array( 'default' => 'no' ), 'navigation' => array( 'default' => 'no' ), 'settings' => array( 'default' => 'no' ), 'analytics' => array( 'default' => 'yes' ), @@ -39,7 +38,6 @@ class Features { * @var array */ protected static $beta_features = array( - 'multichannel-marketing', 'navigation', 'new-product-management-experience', 'block-editor-feature-enabled', diff --git a/plugins/woocommerce/src/Admin/Features/MultichannelMarketing/Init.php b/plugins/woocommerce/src/Admin/Features/MultichannelMarketing/Init.php deleted file mode 100644 index 1d9aa43c805..00000000000 --- a/plugins/woocommerce/src/Admin/Features/MultichannelMarketing/Init.php +++ /dev/null @@ -1,87 +0,0 @@ - __( 'Marketing', 'woocommerce' ), - 'desc' => $description, - 'id' => self::TOGGLE_OPTION_NAME, - 'type' => 'checkbox', - 'class' => '', - ); - - return $features; - } - - /** - * Reloads the page when the option is toggled to make sure all Multichannel Marketing features are loaded. - * - * @param string $old_value Old value. - * @param string $value New value. - */ - public static function reload_page_on_toggle( $old_value, $value ) { - if ( $old_value === $value ) { - return; - } - - self::$is_updated = true; - } - - /** - * Reload the page if the setting has been updated. - */ - public static function maybe_reload_page() { - if ( ! isset( $_SERVER['REQUEST_URI'] ) || ! self::$is_updated ) { - return; - } - - wp_safe_redirect( wp_unslash( $_SERVER['REQUEST_URI'] ) ); - exit(); - } -} diff --git a/plugins/woocommerce/src/Internal/Admin/Marketing.php b/plugins/woocommerce/src/Internal/Admin/Marketing.php index 47d4ab241bb..acde214b53d 100644 --- a/plugins/woocommerce/src/Internal/Admin/Marketing.php +++ b/plugins/woocommerce/src/Internal/Admin/Marketing.php @@ -44,7 +44,6 @@ class Marketing { add_action( 'admin_menu', array( $this, 'register_pages' ), 5 ); add_action( 'admin_menu', array( $this, 'add_parent_menu_item' ), 6 ); - add_filter( 'woocommerce_admin_preload_options', array( $this, 'preload_options' ) ); add_filter( 'woocommerce_admin_shared_settings', array( $this, 'component_settings' ), 30 ); } @@ -141,18 +140,6 @@ class Marketing { } } - /** - * Preload options to prime state of the application. - * - * @param array $options Array of options to preload. - * @return array - */ - public function preload_options( $options ) { - $options[] = 'woocommerce_marketing_overview_welcome_hidden'; - - return $options; - } - /** * Add settings for marketing feature. * diff --git a/plugins/woocommerce/tests/api-core-tests/tests/settings/settings-crud.test.js b/plugins/woocommerce/tests/api-core-tests/tests/settings/settings-crud.test.js index b8d10686e3c..f5314972d76 100644 --- a/plugins/woocommerce/tests/api-core-tests/tests/settings/settings-crud.test.js +++ b/plugins/woocommerce/tests/api-core-tests/tests/settings/settings-crud.test.js @@ -1693,15 +1693,6 @@ test.describe('Settings API tests: CRUD', () => { "value": "yes", }) ])); - expect(responseJSON).toEqual( - expect.arrayContaining([ - expect.objectContaining({ - "id": "woocommerce_multichannel_marketing_enabled", - "label": "Marketing", - "description": "Enables the new WooCommerce Multichannel Marketing experience in the Marketing page", - "type": "checkbox", - }) - ])); expect(responseJSON).toEqual( expect.arrayContaining([ expect.objectContaining({ diff --git a/plugins/woocommerce/tests/e2e-pw/tests/admin-marketing/overview.spec.js b/plugins/woocommerce/tests/e2e-pw/tests/admin-marketing/overview.spec.js index 5de02a455b0..42e19921939 100644 --- a/plugins/woocommerce/tests/e2e-pw/tests/admin-marketing/overview.spec.js +++ b/plugins/woocommerce/tests/e2e-pw/tests/admin-marketing/overview.spec.js @@ -3,47 +3,9 @@ const { test, expect } = require( '@playwright/test' ); test.describe( 'Marketing page', () => { test.use( { storageState: process.env.ADMINSTATE } ); - test( 'A user can disable the Multichannel Marketing feature in WC Settings and view the Marketing > Overview page without it crashing', async ( { + test( 'A user can view the Marketing > Overview page without it crashing', async ( { page, } ) => { - // Go to WC Settings > Advanced > Features page. - await page.goto( - 'wp-admin/admin.php?page=wc-settings&tab=advanced§ion=features' - ); - - // Disable multichannel marketing experience by unchecking the checkbox and clicking on "Save changes" button. - await page - .locator( - '"Enables the new WooCommerce Multichannel Marketing experience in the Marketing page"' - ) - .uncheck(); - await page.locator( '"Save changes"' ).click(); - - // Go to the Marketing page. - await page.goto( 'wp-admin/admin.php?page=wc-admin&path=%2Fmarketing' ); - - // Users should see the knowledge base card. - await expect( - page.locator( '"WooCommerce knowledge base"' ) - ).toBeVisible(); - } ); - - test( 'A user can enable the Multichannel Marketing feature in WC Settings and view the Marketing > Overview page without it crashing', async ( { - page, - } ) => { - // Go to WC Settings > Advanced > Features page. - await page.goto( - 'wp-admin/admin.php?page=wc-settings&tab=advanced§ion=features' - ); - - // Enable multichannel marketing experience by checking the checkbox and clicking on "Save changes" button. - await page - .locator( - '"Enables the new WooCommerce Multichannel Marketing experience in the Marketing page"' - ) - .check(); - await page.locator( '"Save changes"' ).click(); - // Go to the Marketing page. await page.goto( 'wp-admin/admin.php?page=wc-admin&path=%2Fmarketing' );