Skip to content

Smoke tests

Ian Yu-Hsun Lin edited this page Feb 12, 2025 · 37 revisions

GLA Manual Smoke Tests

Use this guide to smoke-test the plugin (for compatibility or other reasons). If there's a common use case or cause of errors not included, please add it!

After each step during testing, be sure to check the debug logs and the browser console for errors, warnings, or notices.

If you see 🧪 in the test, it indicates that there's an E2E test that covers this particular scenario.

  • Prerequisites: Wordpress.com and Google accounts, WooCommerce store with existing products and categories. (For example, see Importing WooCommerce Sample Data ).

  • Install extension / Uninstall extension

Onboarding Wizard

Set up your accounts

  • 🧪 Connect wordpress.com
  • 🧪 After wordpress.com is connected, the UI doesn't show the connection card UI of wordpress.com
  • 🧪 Connect Google account
  • 🧪 Connect Google account. Then change the URL and connect that account. You should be able to claim the website.
  • 🧪 After a Google account is connected, it automatically creates Google Merchant Center or Google Ads accounts when the connected Google account doesn't have a respective existing one
  • 🧪 Set up Google Merchant Center (Connect existing account).
  • 🧪 Set up Google Merchant Center (Create a new account).
  • 🧪 Connect an existing Google Ads account
  • 🧪 Disconnect Google Ads account
  • 🧪 Create a new Google Ads account and connect it
  • 🧪 Save an invalid store address in WooCommerce settings and click the "Update store address" button, it shows the corresponding error messages
  • 🧪 The "Continue" button should not be enabled until all accounts are connected and the store address is valid.
  • 🧪 Verify the UI: FAQ can expand; check that doc links and tooltips are working.
  • Onboarding: Verify that you can navigate back using the menu at the top.

Configure product listings

  • 🧪 Select countries.
  • 🧪 Checking the "All countries" option hides the country select textbook.
  • 🧪 If the "My shipping settings are simple. I can manually estimate flat shipping rates" option is checked
    • 🧪 The "Estimated shipping rates" field is displayed
    • 🧪 If the "Estimated shipping rates" field is 0, the "Free shipping for all orders" tag is displayed
    • 🧪 If the "Estimated shipping rates" field is >0, the "I offer free shipping for orders over a certain price" field is displayed
    • 🧪 If the "Free shipping over a specific order value" field is checked, the minimum order field is displayed
    • There is an error message and the "Continue" button is disabled when any shipping times are invalid
  • 🧪 If the "My shipping settings are complex. I will enter my shipping rates and times manually in Google Merchant Center" option is selected; both the shipping rate and Shipping time are hidden, and the "Continue" button is enabled
  • 🧪 The "Continue" button is disabled if no shipping time is entered on a simple shipping setup

Create a campaign

  • 🧪 Before setting up the billing method, there should be a billing information card for opening Google's billing setting page by a button or an alternative link
  • 🧪 Button should open the billing setting page via a pop-up window aligned to the center of the current browser window
  • 🧪 After completing the billing setting and waiting for a while, the billing information card should change to a setup successful
  • 🧪 The highest recommended value among audience countries should be set as the default budget value
  • 🧪 Setting different budget values lower or higher than the suggestion should also display or hide the corresponding tip below
  • 🧪 Setting a budget value to be lower than 30% of the highest recommended value among audience countries should display an error message below the budget input
  • The ad previews automatically rotate and the bestselling product, shop name, shop URL, and shop logo are composited with the reviews if applicable
  • 🧪 Verify the UI: FAQ can expand
  • 🧪 Complete onboarding without setting up a campaign - then you should see a modal "You’ve successfully set up Google Listings & Ads! 🎉" click next and check if there is a "Create campaign" button
  • Check FAQ
  • 🧪 Click complete setup, it should navigate to Product Feed tab.
  • You should see a modal with the following text: "You’ve successfully set up Google Listings & Ads! 🎉" & click View Product Feed.
  • Navigate all Google Listings & Ads tabs (Reports, Product Feed, Settings) - The content loads with no errors or warnings

Google Listings & Ads > Dashboard

  • Navigate to Marketing -> Google Listing & Ads -> Dashboard
  • Edit free listings and make sure it can save successfully. "Edit free listings" was moved to a dedicated "Shipping" tab.
  • Go into Edit free listings page and click on the top left back button. It should bring you back to the Dashboard page. "Edit free listings" was moved to a dedicated "Shipping" tab.
  • Create a campaign by clicking the "Add campaign" button and ensure the journey works.
    • The FAQ display and expand/collapse correctly.
    • The highest recommended value among audience countries should be set as the default budget value
    • Setting different budget values lower or higher than the suggestion should also display or hide the corresponding tip below
    • Setting a budget value to be lower than 30% of the highest recommended value among audience countries should display an error message below the budget input
    • The "Continue" button is disabled until the "Daily average cost" value is valid
  • Create an Ads campaign without adding assets and confirm that the data is in Google Ads
  • Edit an Ads campaign without adding assets and confirm that the data is in Google Ads
    • Setting different budget values lower or higher than the suggestion should also display or hide the corresponding tip below
    • Setting a budget value to be lower than 30% of the highest recommended value among audience countries should display an error message below the budget input
    • The "Continue" button is disabled until the "Daily average cost" value is valid
  • Disable a campaign from the "Programs" table and ensure the campaign has been paused in Google ads.
  • Remove a campaign from the "Programs" table and ensure the campaign has been removed in Google ads.
  • Filter dashboard by date range
  • Campaign Assets tour on the Dashboard page
     # SQL to reset the checked flag of tours
     DELETE FROM wp_options WHERE option_name = 'gla_tours';
    • The tour floats upon the Edit button of the first campaign after having at least one campaign.
    • The tour won't appear again after clicking on the [ ] button to close it.
  • Campaign Assets
     // If the test environment is a local site, it may need to add this code snippet to
     // the end of the ./google-listings-and-ads.php file to pass the Final URL matching
     // and the SSL verification in the `wp_remote_get` calls.
    
     function replace_with_gmc_domain( $url ) {
        return str_replace( get_home_url(), 'https://domain-name-of-the-associated-google-mc-account', $url );
     }
     
     add_filter( 'page_link', 'replace_with_gmc_domain' );
     add_filter( 'term_link', 'replace_with_gmc_domain' );
     add_filter( 'post_type_link', 'replace_with_gmc_domain' );
     
     add_filter( 'https_ssl_verify', '__return_false' );
     add_filter( 'https_local_ssl_verify', '__return_false' );
    • In the Final URL card, it lists the homepage and shop pages by default and can search pages/posts/categories(taxonomies) by keywords.
    • Create a campaign with assets. All asset fields should be successfully saved.
    • Add assets to an existing campaign. All asset fields should be successfully saved.
    • Edit assets of a campaign. All asset fields should be successfully edited.
    • Should be able to remove the optional assets of a campaign.
    • An empty asset group is created first when saving assets to a campaign that doesn't have any (empty) asset groups:
      1. In GLA, create a campaign without assets.
      2. Go to Google Ads to delete the empty asset group for the newly created campaign.
      3. Back to GLA, refresh the web page, and go to edit the newly created campaign.
      4. Add assets and save changes.
    • Campaigns that already have assets are not allowed to change the Final URL.
    • All asset fields are disabled and collapsed if no selected Final URL and the "Create campaign" button is disabled as well.
    • All asset fields are enabled and expanded after a Final URL is selected and the "Create campaign" button is enabled as well.
    • Asset fields are filled in with asset suggestion data after a Final URL is selected.
    • When the number of values in each asset text field reaches its maximum limit, the add button is disabled.
    • The values in each asset text field that exceeds the minimum number requirement can be deleted.
    • After toggling the asset field, the edited values are kept. After going to step 1 and back to step 2, the edited values in asset fields are kept.
    • The "n/N characters" label below text inputs is turned to red color when exceeding its character count limit.
    • Landscape, Square and Portrait images share the maximum total number of 20.
    • Images are cropped to the required aspect ratios.
    • Images that already fit with the required aspect ratios can skip cropping.
    • Images that don't meet the required size are not allowed to be selected.
    • Before clicking on the submit button, there are no issue labels nor lists of invalid reasons except for the character count exceeding errors.
    • After clicking on the submit button without fulfilling all required asset fields, the form won't be submitted, the web page should be scrolled to the first incomplete field, and all incomplete fields show the number of issues in a label and a list of invalid reasons. assets-form-validation

Google Listings & Ads > Reports

  • Filter reports by data range.

Programs tab

  • Try some values in the "Show" field:
    • "Single program"
    • "Comparison" between 2 or more programs

Products tab

  • Try some values in the "Show" field:
    • Single product
    • Comparison view between 2 or more products

Google Listings & Ads > Product Feed

  • Select a product in the "Product Feed" table and update the channel visibility
  • Click on the pagination link on the Product table to ensure this works
  • Click on the pagination link on the "Issues to resolve" table to ensure this works

Google Listings & Ads > Settings

  • Perform store address update
  • Disconnect Google Ads only
  • Disconnect all google accounts.
  • Reconnect by going through the onboarding steps

Sync Products with Google Merchant Center

Note that the following operations with Google MC can take some minutes.

The Mismatched URL will block product synchronization. To test this part in a local environment, please try making the following adjustments to the local env first:

  1. Add this code snippet to google-listings-and-ads.php for skipping the URL matching check.
    add_filter( 'woocommerce_gla_ready_for_syncing', '__return_true' );
  2. Clear related transients from DB.
    DELETE FROM wp_options where option_name LIKE '%gla_url_matches%';
  • Visit wp-admin/admin.php?page=connection-test-admin-page.
  • Go to the "Product Sync" section (at bottom of the page) and tick the option async for Sync All Products and Delete All Synced Products.
  • If you have products in Google MC try to delete them using Delete All Synced Products.
  • Check that they are deleted in the Google MC.
  • Sync the products again using Sync All Products.
  • Check that the products have been synced again.
  • Edit any synced product (change the title) and confirm that the changes are reflected in the Merchant Center.

Gtag events

  • Successfully run e2e tests in local env.

(Optional) Test Gtag events manually

  • Complete the onboarding of a Merchant and an Ads account.
  • Check in the page source code to confirm that the events are being output on the page.
    • Visit a frontend page and confirm the global Gtag snippet is present (with comment "Global site tag").
    • Visit a frontend page and confirm the page_view event is present.
    • Visit a single product page and confirm the view_item event is present.
    • Visit the cart page (containing products) and confirm the page_view event is present with additional cart details.
    • Visit the order completed page and confirm the conversion and purchase events are present.
  • Check if a request is sent to https://www.google.com/pagead with the add_to_cart event.
    • Check the request when adding to cart from a single product page.
    • Check the request when adding a related product to cart from a single product page.
    • Check the request when adding to cart from a regular shop page.
    • Check the request when adding to cart from a block shop page (All Products Block).
  • Confirm tracking parameters show up in Google Ads account (can be delayed up to 24 hours).
    • Go to the Ads dashboard.
    • Go to Settings > Audience Manager
    • In the left sidebar go to "Your data sources" and then click "Details" on the "Google Ads tag" card. image
    • Confirm the parameters are included and there are no issues showing up.

Google connection between multiple sites

Note that this test requires to set up one local WooCommerce Connect Server and two WP sites that using the same Google account in GLA plugin.

Individual refresh tokens

  • Set up one WC Connect Server and two WP sites locally
    • Note that the two sites should be using public domains.
  • Connect GLA using the same Google account in both sites.
    • The consent screen should appears on both sites. Like this:
    • Screenshot 2023-01-17 at 16 27 27
    • Note the slight difference of the consent screen for the second site which connects to Google. But we will get the individual refresh token anyway.
  • Check the table wcc_token, each site should have their own refresh token in refresh_token column.
  • In table wcc_token, modify the token_expires column for both sites to make the access token expired.
  • Go to both sites' GLA settings page and reload the page, it's showing connected.
  • In table wcc_token, the columns access_token and token_expires have been updated.

Disconnect one site does not affect the other site

  • Disconnect site A from its GLA settings page. (Or using connection test page to disconnect Google)
  • From the database site A's record should be removed in wcc_token table.
  • Site B should be still connected and functioning normally.
  • Reconnect site A and site A should work normally, its tokens should be stored in wcc_token table again.

Composer package conflicts with other plugins

This is a tricky one to test as we found a few conflicting plugins but we don’t have a clear set of “other” plugins that use the same libraries. In this test we pick Flexible Shipping UPS and BackWPUp as both had conflicts with GLA in the past, but there might be more plugins that use the same packages would have conflicts. The issue https://github.com/woocommerce/google-listings-and-ads/issues/1976 is an example for fixing a conflict with another plugin. This test may only be required when we are releasing GLA with updated composer packages.

  • Install Flexible Shipping UPS and BackWPUp. You can also use your best guess to install any popular plugin that has higher chance to conflict with GLA.
  • Activate BackWPUp and the site should still work normally.
  • Activate Flexible Shipping UPS, go to wp-admin/admin.php?page=wc-settings&tab=shipping, add UPS Live Rates shipping method to the shipping zone you're testing.
  • Go to cart/checkout page, there shouldn't be fatal errors.

Notifications (API PULL)

Feature Banner & Granting Authorization

  • Complete the Onboarding with an accessible domain
  • 🧪 Go to Google For WooCommerce - Settings. See the Banner at the top - "We will soon transition to a new and improved method for synchronizing product data with Google. -- Get early access"
  • Click on "Get Early access". See the button spinning and redirecting to wp.com authorization page wit the next permissions "View WooCommerce products, coupons, shipping and settings.".
  • 🧪 Approve it (you will be redirected to login). See its approved and MC Cards shows a green notice with "Google has been granted access to fetch your product data."
  • Go to Connection Test page
  • See the next info in Partner API Pull Integration section:
    Notification Service Enabled- Yes, Notification Service Ready- Yes, WPCOM REST API Status- approved
  • Click on "Get API Pull Integration Status"
  • It shows
Prop Value
Site {{your_site_domain}}
Jetpack Connection Health Healthy
Last Jetpack Contact {{date_time}}
WC REST API Health Healthy
Google token health Connected
Errors  []
  • Search for "gla_wpcom_rest_api_status" in wp_options table

  • Set it as "error"

  • 🧪 Go back to Google for WooCommerce - Settings. See a warning in the MC Card "There was an issue granting access to Google for fetching your products." and also a button Grant Access

  • 🧪 Click on it. And complete the authorization

  • 🧪 Click on "Disable product data fetch" under MC Card

  • 🧪 See the modal with the confirmation "Disable data fetching" disabled

  • 🧪 Check that you can close the modal

  • 🧪 Open it again and Check the "Yes, I want to disable the data fetching feature."

  • 🧪 Confirm

  • 🧪 See that you're redirected back to Settings.

  • 🧪 Banner shows again. Notice disappeared.

  • Go to the Connection Test page and see

prop value 
Notification Service Enabled: yes
Notification Service Ready no
WPCOM REST API Status NOT SET
  • Click on Get API Pull Integration Status and see:
Prop Value
Site {{your_site_domain}}
Jetpack Connection Health Healthy
Last Jetpack Contact {{date_time}}
WC REST API Health Healthy
Google token health Disconnected
Errors  {"rest_api_partner_token":{"error_code":"wpcom_partner_token_not_associated","error_message":"No token found associated with the client ID and user.","error_type":"rest_api_partner_token"}}

Notifications

  • With the Authorization Granted. Go to the Connection test page

  • Under "Partner API Pull Integration" add a product id (no need to be existing) and click on "Send notification"

  • See notification success

  • Click on "Disconnect" WPCOM REST API Status

  • Click again on "Send notification"

  • See notification failed

  • Grant access again in GfW settings

  • Create a new Product and publish it

  • See gla/jobs/notifications/products/process_item with product.create job in WooCommerce - Status - Scheduled Actions.

  • Run it. Go to the Logs and see a log like "2024-07-19T08:06:32+00:00 Debug Automattic\WooCommerce\GoogleListingsAndAds\API\WP\NotificationsService::notify Notification - Item ID: 341 - Topic: product.create - Data []"

  • Edit the product.

  • See gla/jobs/notifications/products/process_item with product.update job in WooCommerce - Status - Scheduled Actions.

  • Run it. Go to the Logs and see a log like "2024-07-19T08:12:28+00:00 Debug Automattic\WooCommerce\GoogleListingsAndAds\API\WP\NotificationsService::notify Notification - Item ID: 341 - Topic: product.update - Data []"

  • Set the product as "Dont sync and show" or Unpublish it

  • See the job gla/jobs/notifications/products/process_item with product.delete

  • Run it. See the log like "2024-07-19T08:15:51+00:00 Debug Automattic\WooCommerce\GoogleListingsAndAds\API\WP\NotificationsService::notify Notification - Item ID: 341 - Topic: product.delete - Data {"offer_id":"gla_341"}"

  • Edit the product. No JOB should be scheduled.

  • Enable the product again. See the Job gla/jobs/notifications/products/process_item with product.create

  • Run it.

  • Trash the product.

  • See in the logs directly "2024-07-19T11:23:50+00:00 Debug Automattic\WooCommerce\GoogleListingsAndAds\API\WP\NotificationsService::notify Notification - Item ID: 341 - Topic: product.delete - Data {"offer_id":"gla_341"}" (No action scheduled job here)

  • Create a Variable product with some variables and publish it

  • See that only a job for the variable parent product was created

  • Run it.

  • Edit the product.

  • See that only a job for the variable parent product was created

  • Delete one variation

  • See a job for the parent product with product.update

  • Go to the logs. And see the delete notification for the variation

  • Delete the Variable product

  • Go to the logs. See the job for all the variations and the parent.

  • Create a coupon without Sync and Show

  • No job is scheduled

  • Mark it as sync and show

  • See the job gla/jobs/notifications/coupons/process_item with coupon.created scheduled.

  • Run it.

  • Update the coupon. See the job. gla/jobs/notifications/coupons/process_item with coupon.updated

  • Trash the coupon. See job gla/jobs/notifications/coupons/process_itemwith coupon.deleted.

REST Endpoint