You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: analytics_system_test.rb
    path of file: ./repos/workarea/storefront/test/system/workarea/storefront
    
    the code of the file until where you have to start completion: require 'test_helper'

module Workarea
  module Storefront
    class AnalyticsSystemTest < Workarea::SystemTest
      include Storefront::SystemTest

      setup :set_products
      setup :set_category
      setup :set_search_settings

      def set_products
        @products = [
          create_product(
            id: 'PROD1',
            name: 'Test Product 1',
            variants: [{ sku: 'SKU1', regular: 10.to_m }],
            filters: { 'Size' => 'Medium', 'Color' => 'Blue' }
          ),
          create_product(
            id: 'PROD2',
            name: 'Test Product 2',
            variants: [{ sku: 'SKU2', regular: 12.to_m }],
            filters: {
              'Size' => ['Medium', 'Small'],
              'Color' => ['Blue', 'Green']
            }
          )
        ]
      end

      def set_category
        @category = create_category(

    
      def test_announcing_checkout_payment_view_event
        setup_checkout_specs
        add_user_data
        start_user_checkout

        visit storefront.checkout_payment_path

        events = find_analytics_events(for_event: 'checkoutPaymentView')
        assert_equal(1, events.count)
        payload = events.first['arguments'].first

        assert_equal(Workarea.config.site_name, payload['site_name'])
        assert(payload['id'].present?)
        assert_equal([], payload['promo_codes'])
        assert_equal('Ground', payload['shipping_service'])
        assert_equal(7, payload['shipping_total'])
        assert_equal(0.84, payload['tax_total'])
        assert_equal(12.84, payload['total_price'])
        assert_equal(current_currency, payload['currency'])
        assert_equal([], payload['tenders'])
        assert_equal(1, payload['items'].count)

        order_item = payload['items'].first
        assert(order_item['id'].present?)
        assert_equal('INT_PRODUCT', order_item['product_id'])
        assert_equal('Integration Product', order_item['product_name'])
        assert_equal('SKU', order_item['sku'])
        assert_equal({}, order_item['options'])
        assert_equal(5, order_item['price'])
        assert_equal(current_currency, payload['currency'])
        assert_equal(1, order_item['quantity'])
        assert_nil(order_item['category'])

        assert_page_view
      end