From c50219e501b0881cd57a76d8cbb808168f416f6b Mon Sep 17 00:00:00 2001 From: filipefurtad0 Date: Thu, 12 Oct 2023 11:44:19 +0100 Subject: [PATCH] Fixes case on assertions, on failing specs Selects white_label tab with trigger(click) Scrolling down did no fix it, it still fails https://github.com/openfoodfoundation/openfoodnetwork/actions/runs/6526149195/job/17719815533?pr=11645, selecting the element with trigger(click) should work Udates invoice tests --- spec/support/features/datepicker_helper.rb | 2 +- spec/system/admin/authentication_spec.rb | 4 +- .../admin/bulk_order_management_spec.rb | 46 ++--- spec/system/admin/bulk_product_update_spec.rb | 28 +-- .../configuration/general_settings_spec.rb | 2 +- spec/system/admin/customers_spec.rb | 4 +- spec/system/admin/enterprises_spec.rb | 179 +++++++++--------- spec/system/admin/flatpickr_spec.rb | 4 +- ...lex_editing_multiple_product_pages_spec.rb | 2 +- .../complex_editing_multiple_updation_spec.rb | 2 +- .../order_cycles/complex_editing_spec.rb | 2 +- spec/system/admin/order_cycles/list_spec.rb | 2 +- spec/system/admin/order_cycles/simple_spec.rb | 4 +- spec/system/admin/order_spec.rb | 24 +-- spec/system/admin/orders_spec.rb | 36 ++-- spec/system/admin/overview_spec.rb | 2 +- spec/system/admin/product_import_spec.rb | 4 +- ...mmary_fee_with_tax_report_by_order_spec.rb | 4 +- ...ry_fee_with_tax_report_by_producer_spec.rb | 2 +- .../reports/orders_and_fulfillment_spec.rb | 7 - .../admin/reports/packing_report_spec.rb | 6 +- .../admin/reports/payments_report_spec.rb | 4 +- .../admin/reports/revenues_by_hub_spec.rb | 34 ++-- .../sales_tax_totals_by_order_spec.rb | 8 +- .../sales_tax_totals_by_producer_spec.rb | 6 +- .../reports/users_and_enterprises_spec.rb | 14 +- spec/system/admin/reports_spec.rb | 33 ++-- spec/system/admin/schedules_spec.rb | 2 +- spec/system/admin/subscriptions/crud_spec.rb | 4 +- .../admin/subscriptions/smoke_tests_spec.rb | 2 +- spec/system/admin/variant_overrides_spec.rb | 4 +- 31 files changed, 232 insertions(+), 245 deletions(-) diff --git a/spec/support/features/datepicker_helper.rb b/spec/support/features/datepicker_helper.rb index 3840670f54c1..793361e095d1 100644 --- a/spec/support/features/datepicker_helper.rb +++ b/spec/support/features/datepicker_helper.rb @@ -4,7 +4,7 @@ module Features module DatepickerHelper def choose_today_from_datepicker within(".flatpickr-calendar.open") do - find("button", text: "TODAY").click + find("button", text: "Today").click end end diff --git a/spec/system/admin/authentication_spec.rb b/spec/system/admin/authentication_spec.rb index d83e2a3f7d7e..21ff2fead141 100644 --- a/spec/system/admin/authentication_spec.rb +++ b/spec/system/admin/authentication_spec.rb @@ -16,9 +16,9 @@ fill_in "Email", with: user.email fill_in "Password", with: user.password click_login_button - expect(page).to have_content "DASHBOARD" + expect(page).to have_content "Dashboard" expect(page).to have_current_path spree.admin_dashboard_path - expect(page).to have_no_content "CONFIGURATION" + expect(page).to have_no_content "Configuration" end it "viewing my account" do diff --git a/spec/system/admin/bulk_order_management_spec.rb b/spec/system/admin/bulk_order_management_spec.rb index 153e7f8b1208..e3323481e664 100644 --- a/spec/system/admin/bulk_order_management_spec.rb +++ b/spec/system/admin/bulk_order_management_spec.rb @@ -69,11 +69,11 @@ end it "orders by completion date" do - find("a", text: 'COMPLETED AT').click # sets ascending ordering + find("a", text: 'Completed at').click # sets ascending ordering expect(page).to have_content( /#{li2.product.name}.*#{li1.product.name}.*#{li22.product.name}.*#{li21.product.name}/m ) - find("a", text: 'COMPLETED AT').click # sets descending ordering + find("a", text: 'Completed at').click # sets descending ordering expect(page).to have_content( /#{li21.product.name}.*#{li22.product.name}.*#{li1.product.name}.*#{li2.product.name}/m ) @@ -155,9 +155,9 @@ expect(page).to have_content "Little Fish", count: 15 expect(page).not_to have_content "Big Fish" end - find("a", text: "Clear").click # closes BOM box - expect(page).to have_content "Little Fish", count: 10 + click_link "Clear" # closes BOM box expect(page).to have_content "Big Fish", count: 5 + expect(page).to have_content "Little Fish", count: 10 end end @@ -263,7 +263,7 @@ end it "displays a column for user's full name" do - expect(page).to have_selector "th.full_name", text: "NAME" + expect(page).to have_selector "th.full_name", text: "Name" expect(page) .to have_selector "td.full_name", text: "#{o1.bill_address.last_name}, #{o1.bill_address.first_name}" @@ -272,33 +272,33 @@ it "displays a column for order date" do expect(page).to have_selector "th.date", - text: 'Completed at'.upcase + text: 'Completed at' expect(page).to have_selector "td.date", text: o1.completed_at.strftime('%B %d, %Y') expect(page).to have_selector "td.date", text: o2.completed_at.strftime('%B %d, %Y') end it "displays a column for producer" do - expect(page).to have_selector "th.producer", text: "PRODUCER" + expect(page).to have_selector "th.producer", text: "Producer" expect(page).to have_selector "td.producer", text: li1.product.supplier.name expect(page).to have_selector "td.producer", text: li2.product.supplier.name end it "displays a column for variant description, which shows only product name " \ "when options text is blank" do - expect(page).to have_selector "th.variant", text: "PRODUCT: UNIT" + expect(page).to have_selector "th.variant", text: "Product: Unit" expect(page).to have_selector "td.variant", text: li1.product.name expect(page).to have_selector "td.variant", text: "#{li2.product.name}: #{li2.variant.options_text}" end it "displays a field for quantity" do - expect(page).to have_selector "th.quantity", text: "QUANTITY" + expect(page).to have_selector "th.quantity", text: "Quantity" expect(page).to have_field "quantity", with: li1.quantity.to_s expect(page).to have_field "quantity", with: li2.quantity.to_s end it "displays a column for max quantity" do - expect(page).to have_selector "th.max", text: "MAX" + expect(page).to have_selector "th.max", text: "Max" expect(page).to have_selector "td.max", text: li1.max_quantity.to_s expect(page).to have_selector "td.max", text: li2.max_quantity.to_s end @@ -502,13 +502,13 @@ context "using column display toggle" do it "displays the default selected columns" do - expect(page).to have_selector "th", text: "NAME" + expect(page).to have_selector "th", text: "Name" expect(page).to have_selector "th", - text: 'Completed at'.upcase - expect(page).to have_selector "th", text: "PRODUCER" - expect(page).to have_selector "th", text: "PRODUCT: UNIT" - expect(page).to have_selector "th", text: "QUANTITY" - expect(page).to have_selector "th", text: "MAX" + text: 'Completed at' + expect(page).to have_selector "th", text: "Producer" + expect(page).to have_selector "th", text: "Product: Unit" + expect(page).to have_selector "th", text: "Quantity" + expect(page).to have_selector "th", text: "Max" end context "hiding a column, by de-selecting it from the drop-down" do @@ -517,13 +517,13 @@ end it "shows all default columns, except the de-selected column" do - expect(page).to have_no_selector "th", text: "PRODUCER" - expect(page).to have_selector "th", text: "NAME" + expect(page).to have_no_selector "th", text: "Producer" + expect(page).to have_selector "th", text: "Name" expect(page).to have_selector "th", - text: 'Completed at'.upcase - expect(page).to have_selector "th", text: "PRODUCT: UNIT" - expect(page).to have_selector "th", text: "QUANTITY" - expect(page).to have_selector "th", text: "MAX" + text: 'Completed at' + expect(page).to have_selector "th", text: "Product: Unit" + expect(page).to have_selector "th", text: "Quantity" + expect(page).to have_selector "th", text: "Max" end end end @@ -1159,7 +1159,7 @@ context "clicking 'Clear' in group buy box" do before :each do - find("a", text: "Clear").click + click_link "Clear" # closes BOM box end it "shows all products and clears group buy box" do diff --git a/spec/system/admin/bulk_product_update_spec.rb b/spec/system/admin/bulk_product_update_spec.rb index 9444cc87ab1f..2c8bd5a7e17f 100644 --- a/spec/system/admin/bulk_product_update_spec.rb +++ b/spec/system/admin/bulk_product_update_spec.rb @@ -201,8 +201,8 @@ login_as_admin visit spree.admin_products_path - find("a", text: "NEW PRODUCT").click - expect(page).to have_content 'NEW PRODUCT' + find("a", text: "New Product").click + expect(page).to have_content 'New Product' fill_in 'product_name', with: 'Big Bag Of Apples' select supplier.name, from: 'product_supplier_id' @@ -311,8 +311,10 @@ end it "creating a variant with unit value is: '120g' and 'on_demand' checked" do + scroll_to(:bottom) + within "tr#v_#{v2.id}" do - page.find(".add-variant").trigger("click") + page.find(".add-variant").click end within "tr#v_-1" do @@ -701,17 +703,17 @@ login_as_admin visit spree.admin_products_path - expect(page).to have_selector "th", text: "NAME" - expect(page).to have_selector "th", text: "PRODUCER" - expect(page).to have_selector "th", text: "PRICE" - expect(page).to have_selector "th", text: "ON HAND" + expect(page).to have_selector "th", text: "Name" + expect(page).to have_selector "th", text: "Producer" + expect(page).to have_selector "th", text: "Price" + expect(page).to have_selector "th", text: "On Hand" toggle_columns /^.{0,1}Producer$/i - expect(page).to have_no_selector "th", text: "PRODUCER" - expect(page).to have_selector "th", text: "NAME" - expect(page).to have_selector "th", text: "PRICE" - expect(page).to have_selector "th", text: "ON HAND" + expect(page).to have_no_selector "th", text: "Producer" + expect(page).to have_selector "th", text: "Name" + expect(page).to have_selector "th", text: "Price" + expect(page).to have_selector "th", text: "On Hand" end end @@ -816,8 +818,8 @@ visit spree.admin_products_path - find("a", text: "NEW PRODUCT").click - expect(page).to have_content 'NEW PRODUCT' + find("a", text: "New Product").click + expect(page).to have_content 'New Product' expect(page).to have_select 'product_supplier_id', with_options: [supplier_managed1.name, supplier_managed2.name, supplier_permitted.name] diff --git a/spec/system/admin/configuration/general_settings_spec.rb b/spec/system/admin/configuration/general_settings_spec.rb index ddbf01bbd3c9..f20c00685813 100644 --- a/spec/system/admin/configuration/general_settings_spec.rb +++ b/spec/system/admin/configuration/general_settings_spec.rb @@ -30,7 +30,7 @@ context 'editing currency symbol position' do it 'updates its position' do - expect(page).to have_content('CURRENCY SETTINGS') + expect(page).to have_content('Currency Settings') within('.currency') do find("[for='currency_symbol_position_after']").click diff --git a/spec/system/admin/customers_spec.rb b/spec/system/admin/customers_spec.rb index 8c82778f866b..28907b5a3498 100644 --- a/spec/system/admin/customers_spec.rb +++ b/spec/system/admin/customers_spec.rb @@ -347,7 +347,7 @@ end it 'updates the existing billing address' do - expect(page).to have_content 'BILLING ADDRESS' + expect(page).to have_content 'Billing Address' first('#bill-address-link').click wait_for_modal_fade_in @@ -374,7 +374,7 @@ end it 'creates a new shipping address' do - expect(page).to have_content 'SHIPPING ADDRESS' + expect(page).to have_content 'Shipping Address' first('#ship-address-link').click wait_for_modal_fade_in diff --git a/spec/system/admin/enterprises_spec.rb b/spec/system/admin/enterprises_spec.rb index 3e550a0167ba..4c1bf959a00c 100644 --- a/spec/system/admin/enterprises_spec.rb +++ b/spec/system/admin/enterprises_spec.rb @@ -92,7 +92,7 @@ # Require login to view shopfront or for checkout accept_alert do - within(".side_menu") { click_link "Shop Preferences" } + within(".side_menu") { find(:link, "Shop Preferences").trigger("click") } end expect(page).to have_checked_field "enterprise_require_login_false" expect(page).to have_checked_field "enterprise_allow_guest_orders_true" @@ -100,6 +100,7 @@ expect(page).to have_no_checked_field "enterprise_require_login_false" # expect(page).to have_checked_field "enterprise_enable_subscriptions_false" + scroll_to(:bottom) accept_alert do within(".side_menu") { click_link "Users" } end @@ -197,7 +198,7 @@ page.find(".option", text: "Victoria").click accept_alert do - click_link "Shop Preferences" + within(".side_menu") { find(:link, "Shop Preferences").trigger("click") } end shop_message_input = page.find("text-angular#enterprise_preferred_shopfront_message div[id^='taTextElement']") @@ -239,7 +240,7 @@ click_link "About" expect(page).to have_content 'This is an interesting long description' - click_link "Shop Preferences" + within(".side_menu") { find(:link, "Shop Preferences").trigger("click") } expect(page).to have_content 'This is my shopfront message.' expect(page).to have_checked_field( "enterprise_preferred_shopfront_order_cycle_order_orders_open_at" @@ -515,7 +516,7 @@ visit edit_admin_enterprise_path(distributor1) within(".side_menu") do - click_link "Shop Preferences" + find(:link, "Shop Preferences").trigger("click") end choose "enterprise_preferred_shopfront_product_sorting_method_by_category" @@ -537,10 +538,11 @@ visit edit_admin_enterprise_path(distributor1) within(".side_menu") do - click_link "Shop Preferences" + find(:link, "Shop Preferences").trigger("click") end choose "enterprise_preferred_shopfront_product_sorting_method_by_producer" + scroll_to(:bottom) find("#s2id_enterprise_preferred_shopfront_producer_order").click find(".select2-result-label", text: "First Supplier").click click_button 'Update' @@ -560,7 +562,7 @@ login_as_admin visit edit_admin_enterprise_path(distributor1) within ".side_menu" do - click_link 'Users' + find(:link, "Users").trigger("click") end end @@ -612,10 +614,7 @@ context "white label settings" do before do visit edit_admin_enterprise_path(distributor1) - - within(".side_menu") do - click_link "White Label" - end + select_white_label end it "set the hide_ofn_navigation preference for the current shop" do @@ -626,9 +625,7 @@ expect(distributor1.reload.hide_ofn_navigation).to be true visit edit_admin_enterprise_path(distributor1) - within(".side_menu") do - click_link "White Label" - end + select_white_label uncheck "Hide OFN navigation" click_button 'Update' @@ -637,7 +634,7 @@ end it "set the hide_ofn_navigation preference for the current shop" do - expect(page).not_to have_content "LOGO USED IN SHOPFRONT" + expect(page).not_to have_content "Logo used in shopfront" check "Hide OFN navigation" click_button 'Update' expect(flash_message) @@ -645,11 +642,9 @@ expect(distributor1.reload.hide_ofn_navigation).to be true visit edit_admin_enterprise_path(distributor1) - within(".side_menu") do - click_link "White Label" - end + select_white_label - expect(page).to have_content "LOGO USED IN SHOPFRONT" + expect(page).to have_content "Logo used in shopfront" uncheck "Hide OFN navigation" click_button 'Update' expect(flash_message) @@ -662,9 +657,7 @@ distributor1.update_attribute(:hide_ofn_navigation, true) visit edit_admin_enterprise_path(distributor1) - within(".side_menu") do - click_link "White Label" - end + select_white_label end it "can updload the white label logo for the current shop" do @@ -684,9 +677,7 @@ distributor1.update white_label_logo: white_logo_file visit edit_admin_enterprise_path(distributor1) - within(".side_menu") do - click_link "White Label" - end + select_white_label end it "can remove the white label logo for the current shop" do @@ -740,9 +731,7 @@ expect(distributor1.reload.hide_groups_tab).to be true visit edit_admin_enterprise_path(distributor1) - within(".side_menu") do - click_link "White Label" - end + select_white_label uncheck "Hide groups tab in shopfront" click_button 'Update' @@ -754,9 +743,7 @@ context "creating custom tabs" do before do visit edit_admin_enterprise_path(distributor1) - within(".side_menu") do - click_link "White Label" - end + select_white_label check "Create custom tab in shopfront" end @@ -778,9 +765,7 @@ expect(page).to have_content("Custom tab title can't be blank") expect(distributor1.reload.custom_tab).to be_nil - within(".side_menu") do - click_link "White Label" - end + select_white_label expect(page).to have_checked_field "Create custom tab in shopfront" end @@ -803,9 +788,7 @@ before do distributor1.update(custom_tab:) visit edit_admin_enterprise_path(distributor1) - within(".side_menu") do - click_link "White Label" - end + select_white_label end it "display the custom tab fields with the current values" do @@ -856,14 +839,14 @@ click_button "Change Package" # checks options for producer profile - expect(page).to have_content "PRODUCER PROFILE" - expect(page).to have_content "PRODUCER SHOP" - expect(page).to have_content "PRODUCER HUB" - expect(page).not_to have_content "PROFILE ONLY" - expect(page).not_to have_content "HUB SHOP" + expect(page).to have_content "Producer Profile" + expect(page).to have_content "Producer Shop" + expect(page).to have_content "Producer Hub" + expect(page).not_to have_content "Profile Only" + expect(page).not_to have_content "Hub Shop" # Producer hub option is selected - page.find('a', class: 'selected', text: "PRODUCER HUB") + page.find('a', class: 'selected', text: "Producer Hub") expect(enterprise.reload.is_primary_producer).to eq true expect(enterprise.reload.sells).to eq('any') @@ -872,14 +855,14 @@ assert_hub_content # Changes to producer shop - page.find('a', text: "PRODUCER SHOP").click + page.find('a', text: "Producer Shop").click click_button "Change now" expect(page).to have_content update_message # Checks changes are persistent click_button "Change Package" - page.find('a', class: 'selected', text: "PRODUCER SHOP") + page.find('a', class: 'selected', text: "Producer Shop") expect(enterprise.reload.is_primary_producer).to eq true expect(enterprise.reload.sells).to eq('own') @@ -888,14 +871,14 @@ assert_hub_content # Changes to producer profile - page.find('a', text: "PRODUCER PROFILE").click + page.find('a', text: "Producer Profile").click click_button "Change now" expect(page).to have_content update_message # Checks changes are persistent click_button "Change Package" - page.find('a', class: 'selected', text: "PRODUCER PROFILE") + page.find('a', class: 'selected', text: "Producer Profile") # a primary producer: expect(enterprise.reload.is_primary_producer).to eq true @@ -924,14 +907,14 @@ click_button "Change Package" # checks options for non-producer profile - expect(page).not_to have_content "PRODUCER PROFILE" - expect(page).not_to have_content "PRODUCER SHOP" - expect(page).not_to have_content "PRODUCER HUB" - expect(page).to have_content "PROFILE ONLY" - expect(page).to have_content "HUB SHOP" + expect(page).not_to have_content "Producer Profile" + expect(page).not_to have_content "Producer Shop" + expect(page).not_to have_content "Producer Hub" + expect(page).to have_content "Profile Only" + expect(page).to have_content "Hub Shop" # Producer hub option is selected - page.find('a', class: 'selected', text: "HUB SHOP") + page.find('a', class: 'selected', text: "Hub Shop") expect(enterprise.reload.is_primary_producer).to eq false expect(enterprise.reload.producer_profile_only).to eq false @@ -940,14 +923,14 @@ assert_hub_content # Changes to producer shop - page.find('a', text: "PROFILE ONLY").click + page.find('a', text: "Profile Only").click click_button "Change now" expect(page).to have_content update_message # Checks changes are persistent click_button "Change Package" - page.find('a', class: 'selected', text: "PROFILE ONLY") + page.find('a', class: 'selected', text: "Profile Only") expect(enterprise.reload.is_primary_producer).to eq false expect(enterprise.reload.producer_profile_only).to eq false @@ -965,13 +948,15 @@ page.find("td.package").click # checks options for producer profile - expect(page).to have_content "PROFILE ONLY" - expect(page).to have_content "PRODUCER SHOP" - expect(page).to have_content "PRODUCER HUB" - expect(page).not_to have_content "HUB SHOP" + within ".enterprise_package_panel" do + expect(page).to have_content "Profile Only" + expect(page).to have_content "Producer Shop" + expect(page).to have_content "Producer Hub" + expect(page).not_to have_content "Hub Shop" + end # Producer hub option is selected - page.find('a', class: 'selected', text: "PRODUCER HUB") + page.find('a', class: 'selected', text: "Producer Hub") expect(enterprise.is_primary_producer).to eq true expect(enterprise.reload.sells).to eq('any') @@ -979,11 +964,11 @@ assert_hub_menu # Changes to producer shop - page.find('a', text: "PRODUCER SHOP").click + page.find('a', text: "Producer Shop").click page.find('a', text: "SAVE").click # Checks changes are persistent - page.find('a', class: 'selected', text: "PRODUCER SHOP") + page.find('a', class: 'selected', text: "Producer Shop") # updates page page.refresh @@ -995,11 +980,11 @@ # Changes to producer profile page.find("td.package").click - page.find('a', text: "PROFILE ONLY").click + page.find('a', text: "Profile Only").click page.find('a', text: "SAVE").click # Checks changes are persistent - page.find('a', class: 'selected', text: "PROFILE ONLY") + page.find('a', class: 'selected', text: "Profile Only") # updates page page.refresh @@ -1030,16 +1015,16 @@ page.find("td.producer").click # checks options for producer profile - expect(page).to have_content "PRODUCER" - expect(page).to have_content "NON-PRODUCER" + expect(page).to have_content "Producer" + expect(page).to have_content "Non-producer" # Producer hub option is selected - page.find('a', class: 'selected', text: "PRODUCER") + page.find('a', class: 'selected', text: "Producer") expect(enterprise.is_primary_producer).to eq true expect(enterprise.reload.sells).to eq('any') # Changes to non-producer - page.find('a', text: "NON-PRODUCER").click + page.find('a', text: "Non-producer").click page.find('a', text: "SAVE").click # updates page @@ -1051,19 +1036,21 @@ page.find("td.package").click # checks options for non-producer profile - expect(page).not_to have_content "PRODUCER PROFILE" - expect(page).not_to have_content "PRODUCER SHOP" - expect(page).not_to have_content "PRODUCER HUB" - expect(page).to have_content "PROFILE ONLY" - expect(page).to have_content "HUB SHOP" + within ".enterprise_package_panel" do + expect(page).not_to have_content "Producer Profile" + expect(page).not_to have_content "Producer Shop" + expect(page).not_to have_content "Producer Hub" + expect(page).to have_content "Profile Only" + expect(page).to have_content "Hub Shop" + end # Producer hub option is selected - page.find('a', class: 'selected', text: "HUB SHOP") + page.find('a', class: 'selected', text: "Hub Shop") expect(enterprise.reload.is_primary_producer).to eq false expect(enterprise.reload.sells).to eq('any') # Changes to producer shop - page.find('a', text: "PROFILE ONLY").click + page.find('a', text: "Profile Only").click page.find('a', text: "SAVE").click # updates page @@ -1071,12 +1058,12 @@ # Checks changes are persistent page.find("td.package").click - page.find('a', class: 'selected', text: "PROFILE ONLY") + page.find('a', class: 'selected', text: "Profile Only") # Displays the correct dashboard sections within "#admin-menu" do - expect(page).to have_content "DASHBOARD" - expect(page).to have_content "ENTERPRISES" + expect(page).to have_content "Dashboard" + expect(page).to have_content "Enterprises" end expect(enterprise.reload.is_primary_producer).to eq false @@ -1092,13 +1079,13 @@ def update_message def assert_hub_menu within "#admin-menu" do - expect(page).to have_content "DASHBOARD" - expect(page).to have_content "PRODUCTS" - expect(page).to have_content "ORDER CYCLES" - expect(page).to have_content "ORDERS" - expect(page).to have_content "REPORTS" - expect(page).to have_content "ENTERPRISES" - expect(page).to have_content "CUSTOMERS" + expect(page).to have_content "Dashboard" + expect(page).to have_content "Products" + expect(page).to have_content "Order cycles" + expect(page).to have_content "Orders" + expect(page).to have_content "Reports" + expect(page).to have_content "Enterprises" + expect(page).to have_content "Customers" end end @@ -1113,13 +1100,13 @@ def assert_hub_content def assert_supplier_menu within "#admin-menu" do - expect(page).to have_content "DASHBOARD" - expect(page).to have_content "PRODUCTS" - expect(page).not_to have_content "ORDER CYCLES" - expect(page).not_to have_content "ORDERS" - expect(page).to have_content "REPORTS" - expect(page).to have_content "ENTERPRISES" - expect(page).not_to have_content "CUSTOMERS" + expect(page).to have_content "Dashboard" + expect(page).to have_content "Products" + expect(page).not_to have_content "Order cycles" + expect(page).not_to have_content "Orders" + expect(page).to have_content "Reports" + expect(page).to have_content "Enterprises" + expect(page).not_to have_content "Customers" end end @@ -1134,8 +1121,8 @@ def assert_supplier_content def assert_profile within "#admin-menu" do - expect(page).to have_content "DASHBOARD" - expect(page).to have_content "ENTERPRISES" + expect(page).to have_content "Dashboard" + expect(page).to have_content "Enterprises" end within "#content" do @@ -1143,3 +1130,9 @@ def assert_profile expect(page).to have_content "Edit profile details" end end + +def select_white_label + within(".side_menu") do + find(:link, "White Label").trigger("click") + end +end diff --git a/spec/system/admin/flatpickr_spec.rb b/spec/system/admin/flatpickr_spec.rb index 901566a0eb70..a439c71061ee 100644 --- a/spec/system/admin/flatpickr_spec.rb +++ b/spec/system/admin/flatpickr_spec.rb @@ -7,14 +7,14 @@ include WebHelper context "orders" do - it "opens the datepicker and closes it using the 'CLOSE' button" do + it "opens the datepicker and closes it using the 'Close' button" do login_as_admin visit 'admin/orders' open_datepicker('.datepicker') # Looks for the close button and click it within(".flatpickr-calendar.open") do expect(page).to have_selector '.shortcut-buttons-flatpickr-buttons' - find("button", text: "CLOSE").click + find("button", text: "Close").click end # Should no more have opened flatpickr expect(page).not_to have_selector '.flatpickr-calendar.open' diff --git a/spec/system/admin/order_cycles/complex_editing_multiple_product_pages_spec.rb b/spec/system/admin/order_cycles/complex_editing_multiple_product_pages_spec.rb index 0317722eafc2..8aacad971f0c 100644 --- a/spec/system/admin/order_cycles/complex_editing_multiple_product_pages_spec.rb +++ b/spec/system/admin/order_cycles/complex_editing_multiple_product_pages_spec.rb @@ -50,7 +50,7 @@ end def expect_all_products_loaded - expect(page).to have_content new_product.name.upcase + expect(page).to have_content new_product.name expect(page).to have_content "2 of 2 Variants Loaded" end end diff --git a/spec/system/admin/order_cycles/complex_editing_multiple_updation_spec.rb b/spec/system/admin/order_cycles/complex_editing_multiple_updation_spec.rb index ba68c626e577..448061e692f8 100644 --- a/spec/system/admin/order_cycles/complex_editing_multiple_updation_spec.rb +++ b/spec/system/admin/order_cycles/complex_editing_multiple_updation_spec.rb @@ -16,7 +16,7 @@ # Expect correct values expect(page).to have_field('order_cycle_name', with: oc.name) - expect(page).to have_content "COORDINATOR #{oc.coordinator.name}" + expect(page).to have_content "Coordinator #{oc.coordinator.name}" expect(page).to have_button('Save', disabled: true) expect(page).to have_button('Save and Next', disabled: true) diff --git a/spec/system/admin/order_cycles/complex_editing_spec.rb b/spec/system/admin/order_cycles/complex_editing_spec.rb index 1438de2510ce..add51e497f66 100644 --- a/spec/system/admin/order_cycles/complex_editing_spec.rb +++ b/spec/system/admin/order_cycles/complex_editing_spec.rb @@ -30,7 +30,7 @@ .to eq(oc.orders_open_at.strftime("%Y-%m-%d %H:%M")) expect(page.find('#order_cycle_orders_close_at').value) .to eq(oc.orders_close_at.strftime("%Y-%m-%d %H:%M")) - expect(page).to have_content "COORDINATOR #{oc.coordinator.name}" + expect(page).to have_content "Coordinator #{oc.coordinator.name}" click_button 'Next' diff --git a/spec/system/admin/order_cycles/list_spec.rb b/spec/system/admin/order_cycles/list_spec.rb index 027cbb2ebc70..59b8a4c99bc6 100644 --- a/spec/system/admin/order_cycles/list_spec.rb +++ b/spec/system/admin/order_cycles/list_spec.rb @@ -177,7 +177,7 @@ within(".flatpickr-calendar.open") do expect(page).to have_selector '.shortcut-buttons-flatpickr-buttons' select_datetime_from_datepicker test_value - find("button", text: "CLOSE").click + find("button", text: "Close").click end # Should no more have opened flatpickr diff --git a/spec/system/admin/order_cycles/simple_spec.rb b/spec/system/admin/order_cycles/simple_spec.rb index 29dfba4af88a..908d3b1079e9 100644 --- a/spec/system/admin/order_cycles/simple_spec.rb +++ b/spec/system/admin/order_cycles/simple_spec.rb @@ -334,7 +334,7 @@ visit edit_admin_order_cycle_path(oc) - expect(page).to have_content 'Re notify producers'.upcase + expect(page).to have_content "Re notify producers" end it "allows removing exchanges" do @@ -750,7 +750,7 @@ uncheck "order_cycle_incoming_exchange_0_variants_#{v3.id}" # Add tags - expect(page).to have_content "TAGS" + expect(page).to have_content "Tags" within "tags-with-translation" do find(:css, "tags-input .tags input").set "wholesale\n" diff --git a/spec/system/admin/order_spec.rb b/spec/system/admin/order_spec.rb index bc398e76734e..2de352ba9a77 100644 --- a/spec/system/admin/order_spec.rb +++ b/spec/system/admin/order_spec.rb @@ -73,7 +73,7 @@ def new_order_with_distribution(distributor, order_cycle) expect(order.line_items.count).to be_zero click_link "Order Details" - expect(page).to have_content 'ADD PRODUCT' + expect(page).to have_content 'Add Product' select2_select product.name, from: 'add_variant_id', search: true find('button.add_variant').click # Wait for JS @@ -105,10 +105,10 @@ def new_order_with_distribution(distributor, order_cycle) end it "doesn't show links to other steps" do - expect(page).not_to have_content "CUSTOMER DETAILS" - expect(page).not_to have_content "ORDER DETAILS" - expect(page).not_to have_content "PAYMENTS" - expect(page).not_to have_content "ADJUSTMENTS" + expect(page).not_to have_content "Customer Details" + expect(page).not_to have_content "Order Details" + expect(page).not_to have_content "Payments" + expect(page).not_to have_content "Adjustments" end end @@ -418,7 +418,7 @@ def new_order_with_distribution(distributor, order_cycle) expect(page).to have_content "Customer Details updated" click_link "Order Details" - expect(page).to have_content 'Add Product'.upcase + expect(page).to have_content 'Add Product' select2_select product.name, from: 'add_variant_id', search: true within("table.stock-levels") do @@ -575,7 +575,7 @@ def new_order_with_distribution(distributor, order_cycle) expect(page).to have_selector "fieldset#order-total", text: order.display_total # shows the order tax adjustments - within('fieldset', text: 'Line Item Adjustments'.upcase) do + within('fieldset', text: 'Line Item Adjustments') do expect(page).to have_selector "td", match: :first, text: "Tax 1" expect(page).to have_selector "td.total", text: Spree::Money.new(10) end @@ -931,7 +931,7 @@ def new_order_with_distribution(distributor, order_cycle) visit spree.edit_admin_order_path(incomplete_order) - expect(page).to have_content "Out of Stock".upcase + expect(page).to have_content "Out of Stock" within ".insufficient-stock-items" do expect(page).to have_content incomplete_order.products.first.name @@ -943,7 +943,7 @@ def new_order_with_distribution(distributor, order_cycle) # updates the order and verifies the warning disappears click_button 'Update And Recalculate Fees' - expect(page).to_not have_content "Out of Stock".upcase + expect(page).to_not have_content "Out of Stock" end end end @@ -953,7 +953,7 @@ def new_order_with_distribution(distributor, order_cycle) expect(page).to have_selector 'h1', text: 'Customer Details' click_link "Order Details" - expect(page).to have_content 'ADD PRODUCT' + expect(page).to have_content 'Add Product' select2_select product.name, from: 'add_variant_id', search: true find('button.add_variant').click @@ -1057,9 +1057,9 @@ def serching_for_customers "Date/Time", "Invoice Number", "Amount", - "Status", + "status", "File", - ].join(" ").upcase + ].join(" ") } let(:table_contents) { diff --git a/spec/system/admin/orders_spec.rb b/spec/system/admin/orders_spec.rb index 78ac3ba5b5c1..aca600b810f4 100644 --- a/spec/system/admin/orders_spec.rb +++ b/spec/system/admin/orders_spec.rb @@ -279,7 +279,7 @@ expect(page).to have_content order_not_empty_no_address.number # And the same orders are displayed when sorting by name: - find("th a", text: "NAME").click + find("th a", text: "Name").click expect(page).to have_no_content order_empty.number expect(page).to have_content order_not_empty.number @@ -298,11 +298,11 @@ visit spree.admin_orders_path end it "orders by completion date" do - find("a", text: 'COMPLETED AT').click # sets ascending ordering + find("a", text: 'Completed At').click # sets ascending ordering expect(page).to have_content( /#{order5.number}.*#{order4.number}.*#{order3.number}.*#{order2.number}/m ) - find("a", text: 'COMPLETED AT').click # sets descending ordering + find("a", text: 'Completed At').click # sets descending ordering expect(page).to have_content( /#{order2.number}.*#{order3.number}.*#{order4.number}.*#{order5.number}/m ) @@ -320,11 +320,11 @@ end it "orders by order number" do - find("a", text: 'NUMBER').click # sets ascending ordering + find("a", text: 'Number').click # sets ascending ordering expect(page).to have_content( /#{order5.number}.*#{order4.number}.*#{order3.number}.*#{order2.number}/m ) - find("a", text: 'NUMBER').click # sets descending ordering + find("a", text: 'Number').click # sets descending ordering expect(page).to have_content( /#{order2.number}.*#{order3.number}.*#{order4.number}.*#{order5.number}/m ) @@ -344,11 +344,11 @@ end it "orders by order state" do - find("a", text: 'STATE').click # sets ascending ordering + find("a", text: 'State').click # sets ascending ordering expect(page).to have_content( /#{order5.number}.*#{order4.number}.*#{order3.number}.*#{order2.number}/m ) - find("a", text: 'STATE').click # sets descending ordering + find("a", text: 'State').click # sets descending ordering expect(page).to have_content( /#{order2.number}.*#{order3.number}.*#{order4.number}.*#{order5.number}/m ) @@ -365,9 +365,9 @@ end it "orders by payment state" do - find("a", text: 'PAYMENT STATE').click # sets ascending ordering + find("a", text: 'Payment State').click # sets ascending ordering expect(page).to have_content(/#{order4.number}.*#{order3.number}.*#{order2.number}/m) - find("a", text: 'PAYMENT STATE').click # sets descending ordering + find("a", text: 'Payment State').click # sets descending ordering expect(page).to have_content(/#{order2.number}.*#{order3.number}.*#{order4.number}/m) end end @@ -383,9 +383,9 @@ end it "orders by shipment state" do - find("a", text: 'SHIPMENT STATE').click # sets ascending ordering + find("a", text: 'Shipment State').click # sets ascending ordering expect(page).to have_content(/#{order4.number}.*#{order3.number}.*#{order2.number}/m) - find("a", text: 'SHIPMENT STATE').click # sets descending ordering + find("a", text: 'Shipment State').click # sets descending ordering expect(page).to have_content(/#{order2.number}.*#{order3.number}.*#{order4.number}/m) end end @@ -401,11 +401,11 @@ end it "orders by customer email" do - find("a", text: 'EMAIL').click # sets ascending ordering + find("a", text: 'Email').click # sets ascending ordering expect(page).to have_content( /#{order5.number}.*#{order4.number}.*#{order3.number}.*#{order2.number}/m ) - find("a", text: 'EMAIL').click # sets descending ordering + find("a", text: 'Email').click # sets descending ordering expect(page).to have_content( /#{order2.number}.*#{order3.number}.*#{order4.number}.*#{order5.number}/m ) @@ -423,11 +423,11 @@ end it "orders by last name then first name" do - find("a", text: 'NAME').click # sets ascending ordering + find("a", text: 'Name').click # sets ascending ordering expect(page).to have_content( /#{order4.number}.*#{order2.number}.*#{order3.number}.*#{order5.number}/m ) - find("a", text: 'NAME').click # sets descending ordering + find("a", text: 'Name').click # sets descending ordering expect(page).to have_content( /#{order5.number}.*#{order3.number}.*#{order2.number}.*#{order4.number}/m ) @@ -464,11 +464,11 @@ end it "orders by order total" do - find("a", text: 'TOTAL').click # sets ascending ordering + find("a", text: 'Total').click # sets ascending ordering expect(page).to have_content( /#{order5.number}.*#{order4.number}.*#{order3.number}.*#{order2.number}/m ) - find("a", text: 'TOTAL').click # sets descending ordering + find("a", text: 'Total').click # sets descending ordering expect(page).to have_content( /#{order2.number}.*#{order3.number}.*#{order4.number}.*#{order5.number}/m ) @@ -591,7 +591,7 @@ perform_enqueued_jobs(only: BulkInvoiceJob) expect(page).to have_content "Bulk Invoice created" - expect(page).to have_link(class: "button", text: "VIEW FILE", href: /invoices/) + expect(page).to have_link(class: "button", text: "View File", href: /invoices/) end it "can bulk cancel 2 orders" do diff --git a/spec/system/admin/overview_spec.rb b/spec/system/admin/overview_spec.rb index 055ef9d6e5ab..4d166ba8a8a2 100644 --- a/spec/system/admin/overview_spec.rb +++ b/spec/system/admin/overview_spec.rb @@ -28,7 +28,7 @@ visit '/admin' expect(page).to have_selector ".dashboard_item h3", text: "Your profile live" expect(page).to have_selector ".dashboard_item .button.bottom", - text: "SEE #{d1.name.upcase} LIVE" + text: "See #{d1.name} live" end context "when visibilty is set to false" do diff --git a/spec/system/admin/product_import_spec.rb b/spec/system/admin/product_import_spec.rb index 8671daa8c7c9..06b63a66fb11 100644 --- a/spec/system/admin/product_import_spec.rb +++ b/spec/system/admin/product_import_spec.rb @@ -707,8 +707,8 @@ expect(page).to have_selector '.created-count', text: '1' expect(page).to have_no_selector '.updated-count' - expect(page).to have_content "GO TO PRODUCTS PAGE" - expect(page).to have_content "UPLOAD ANOTHER FILE" + expect(page).to have_content "Go To Products Page" + expect(page).to have_content "Upload Another File" visit spree.admin_products_path diff --git a/spec/system/admin/reports/enterprise_summary_fees/enterprise_summary_fee_with_tax_report_by_order_spec.rb b/spec/system/admin/reports/enterprise_summary_fees/enterprise_summary_fee_with_tax_report_by_order_spec.rb index 13eea4aa1940..7a139a0c8597 100644 --- a/spec/system/admin/reports/enterprise_summary_fees/enterprise_summary_fee_with_tax_report_by_order_spec.rb +++ b/spec/system/admin/reports/enterprise_summary_fees/enterprise_summary_fee_with_tax_report_by_order_spec.rb @@ -15,7 +15,7 @@ [ "Distributor", "Order Cycle", - "Order Number", + "Order number", "Name", "Type", "Owner", @@ -29,7 +29,7 @@ "Last Name", "Customer Code", "Customer Email" - ].join(" ").upcase + ].join(" ") } let!(:state_zone){ create(:zone_with_state_member) } diff --git a/spec/system/admin/reports/enterprise_summary_fees/enterprise_summary_fee_with_tax_report_by_producer_spec.rb b/spec/system/admin/reports/enterprise_summary_fees/enterprise_summary_fee_with_tax_report_by_producer_spec.rb index 8fb67314214e..37941c8fc89e 100644 --- a/spec/system/admin/reports/enterprise_summary_fees/enterprise_summary_fee_with_tax_report_by_producer_spec.rb +++ b/spec/system/admin/reports/enterprise_summary_fees/enterprise_summary_fee_with_tax_report_by_producer_spec.rb @@ -16,7 +16,7 @@ let!(:table_header){ ["Distributor", "Producer", "Producer Tax Status", "Order Cycle", "Name", "Type", "Owner", "Tax Category", "Tax Rate Name", "Tax Rate", "Total excl. tax ($)", "Tax", - "Total incl. tax ($)"].join(" ").upcase + "Total incl. tax ($)"].join(" ") } let!(:state_zone){ create(:zone_with_state_member) } diff --git a/spec/system/admin/reports/orders_and_fulfillment_spec.rb b/spec/system/admin/reports/orders_and_fulfillment_spec.rb index bcd3e9e5fc0e..46fadfaddb9c 100644 --- a/spec/system/admin/reports/orders_and_fulfillment_spec.rb +++ b/spec/system/admin/reports/orders_and_fulfillment_spec.rb @@ -93,7 +93,6 @@ "Billing State", "Order number", "Date"] - .map(&:upcase) ]) end @@ -246,7 +245,6 @@ "Total Units", "Curr. Cost per Unit", "Total Cost"] - .map(&:upcase) ]) # displays the producer name in the respective column @@ -300,7 +298,6 @@ "Total Units", "Curr. Cost per Unit", "Total Cost"] - .map(&:upcase) ]) # displays the producer name in own row @@ -336,7 +333,6 @@ "Curr. Cost per Unit", "Total Cost", "Shipping Method"] - .map(&:upcase) ]) # displays the producer name in the respective column @@ -384,7 +380,6 @@ "Curr. Cost per Unit", "Total Cost", "Shipping Method"] - .map(&:upcase) ]) # displays the producer name in own row @@ -436,7 +431,6 @@ "Total Cost", "Total Shipping Cost", "Shipping Method"] - .map(&:upcase) ]) # displays the Distributor name in the respective column @@ -488,7 +482,6 @@ "Total Cost", "Total Shipping Cost", "Shipping Method"] - .map(&:upcase) ]) # displays the Distributor name in own row diff --git a/spec/system/admin/reports/packing_report_spec.rb b/spec/system/admin/reports/packing_report_spec.rb index 644684fb19f6..175391c598fc 100644 --- a/spec/system/admin/reports/packing_report_spec.rb +++ b/spec/system/admin/reports/packing_report_spec.rb @@ -62,7 +62,7 @@ expect(table).to eq([ ["Hub", "Customer Code", "First Name", "Last Name", "Supplier", "Product", "Variant", "Weight", "Height", "Width", "Depth", - "Quantity", "TempControlled?"].map(&:upcase) + "Quantity", "TempControlled?"] ]) expect(page).to have_selector 'table.report__table tbody tr', count: 5 # Totals row/order end @@ -77,7 +77,7 @@ rows = find("table.report__table").all("tr") table = rows.map { |r| r.all("th,td").map { |c| c.text.strip }[3] } expect(table).to eq([ - "LAST NAME", + "Last Name", order1.bill_address.lastname, order1.bill_address.lastname, "", @@ -102,7 +102,7 @@ table = rows.map { |r| r.all("th").map { |c| c.text.strip } } expect(table).to eq([ ["Hub", "Supplier", "Customer Code", "First Name", "Last Name", - "Product", "Variant", "Quantity", "TempControlled?"].map(&:upcase) + "Product", "Variant", "Quantity", "TempControlled?"] ]) expect(all('table.report__table tbody tr').count).to eq(3) # Totals row per supplier diff --git a/spec/system/admin/reports/payments_report_spec.rb b/spec/system/admin/reports/payments_report_spec.rb index b4e8cb0bff49..e07c3181c630 100644 --- a/spec/system/admin/reports/payments_report_spec.rb +++ b/spec/system/admin/reports/payments_report_spec.rb @@ -46,7 +46,7 @@ "Shipping Total ($)", "Outstanding Balance ($)", "Total ($)" - ].join(" ").upcase) + ].join(" ")) expect(page.find("table.report__table tbody tr").text).to have_content([ order.payment_state, @@ -83,7 +83,7 @@ "EFT ($)", "PayPal ($)", "Outstanding Balance ($)" - ].join(" ").upcase) + ].join(" ")) expect(page.find("table.report__table tbody tr").text).to have_content([ "credit owed", diff --git a/spec/system/admin/reports/revenues_by_hub_spec.rb b/spec/system/admin/reports/revenues_by_hub_spec.rb index 9d622ec355c2..87b308d0b292 100644 --- a/spec/system/admin/reports/revenues_by_hub_spec.rb +++ b/spec/system/admin/reports/revenues_by_hub_spec.rb @@ -30,23 +30,23 @@ find("[type='submit']").click expect(page.find("table.report__table thead tr").text).to have_content([ - "HUB", - "HUB ID", - "HUB BUSINESS NUMBER", - "HUB LEGAL NAME", - "HUB CONTACT NAME", - "HUB PUBLIC EMAIL", - "HUB OWNER EMAIL", - "HUB PHONE NUMBER", - "HUB ADDRESS LINE 1", - "HUB ADDRESS LINE 2", - "HUB SUBURB", - "HUB POSTCODE", - "HUB STATE", - "TOTAL NUMBER OF ORDERS", - "TOTAL EXCL. TAX ($)", - "TOTAL TAX ($)", - "TOTAL INCL. TAX ($)" + "Hub", + "Hub ID", + "Hub Business Number", + "Hub Legal Name", + "Hub Contact Name", + "Hub Public Email", + "Hub Owner Email", + "Hub Phone Number", + "Hub Address Line 1", + "Hub Address Line 2", + "Hub Suburb", + "Hub Postcode", + "Hub State", + "Total Number of Orders", + "Total excl. tax ($)", + "Total Tax ($)", + "Total incl. tax ($)" ].join(" ")) expect(page.find("table.report__table tbody tr").text).to have_content([ diff --git a/spec/system/admin/reports/sales_tax/sales_tax_totals_by_order_spec.rb b/spec/system/admin/reports/sales_tax/sales_tax_totals_by_order_spec.rb index 98bd05412ff0..a0e991aea7e4 100644 --- a/spec/system/admin/reports/sales_tax/sales_tax_totals_by_order_spec.rb +++ b/spec/system/admin/reports/sales_tax/sales_tax_totals_by_order_spec.rb @@ -15,18 +15,18 @@ [ "Distributor", "Order Cycle", - "Order Number", + "Order number", "Tax Category", "Tax Rate Name", "Tax Rate", - "Total excl. Tax ($)", + "Total excl. tax ($)", "Tax", - "Total incl. Tax ($)", + "Total incl. tax ($)", "First Name", "Last Name", "Code", "Email" - ].join(" ").upcase + ].join(" ") } let!(:state_zone){ create(:zone_with_state_member) } let!(:country_zone){ create(:zone_with_member) } diff --git a/spec/system/admin/reports/sales_tax/sales_tax_totals_by_producer_spec.rb b/spec/system/admin/reports/sales_tax/sales_tax_totals_by_producer_spec.rb index d72ae517890f..54e0c4aa9690 100644 --- a/spec/system/admin/reports/sales_tax/sales_tax_totals_by_producer_spec.rb +++ b/spec/system/admin/reports/sales_tax/sales_tax_totals_by_producer_spec.rb @@ -19,10 +19,10 @@ "Tax Category", "Tax Rate Name", "Tax Rate", - "Total excl. Tax ($)", + "Total excl. tax ($)", "Tax", - "Total incl. Tax ($)" - ].join(" ").upcase + "Total incl. tax ($)" + ].join(" ") } let!(:state_zone){ create(:zone_with_state_member) } let!(:country_zone){ create(:zone_with_member) } diff --git a/spec/system/admin/reports/users_and_enterprises_spec.rb b/spec/system/admin/reports/users_and_enterprises_spec.rb index ff3f49aaf416..d5ee545ca387 100644 --- a/spec/system/admin/reports/users_and_enterprises_spec.rb +++ b/spec/system/admin/reports/users_and_enterprises_spec.rb @@ -16,13 +16,13 @@ click_button 'Go' expect(page.find("table.report__table thead tr").text).to have_content([ - "USER", - "RELATIONSHIP", - "ENTERPRISE", - "PRODUCER?", - "SELLS", - "VISIBLE", - "CONFIRMATION DATE", + "User", + "Relationship", + "Enterprise", + "Producer?", + "Sells", + "Visible", + "Confirmation Date", "OFN UID" ].join(" ")) diff --git a/spec/system/admin/reports_spec.rb b/spec/system/admin/reports_spec.rb index ee646f8267f5..b3282e273422 100644 --- a/spec/system/admin/reports_spec.rb +++ b/spec/system/admin/reports_spec.rb @@ -42,7 +42,7 @@ generate_report expect(page).to have_selector "#report-table" - expect(page).to have_content "FIRST NAME LAST NAME BILLING ADDRESS EMAIL" + expect(page).to have_content "First Name Last Name Billing Address Email" end it "renders UTF-8 characters" do @@ -64,7 +64,7 @@ visit admin_report_path(report_type: :customers) generate_report expect(page).to have_content "Späti" - expect(page).to have_content "FIRST NAME LAST NAME BILLING ADDRESS EMAIL" + expect(page).to have_content "First Name Last Name Billing Address Email" expect(page).to have_content "Müller" end @@ -122,7 +122,7 @@ click_button "Go" expect(page).to have_selector "#report-table table" - expect(page).to have_content "FIRST NAME LAST NAME BILLING ADDRESS EMAIL" + expect(page).to have_content "First Name Last Name Billing Address Email" # Now that we see the report, we need to make sure that it's not replaced # by the "loading" spinner when the controller action finishes. @@ -157,7 +157,7 @@ expect(table.sort).to eq([ ["First Name", "Last Name", "Billing Address", "Email", "Phone", "Hub", "Hub Address", "Shipping Method", "Total Number of Orders", "Total incl. tax ($)", - "Last completed order date"].map(&:upcase) + "Last completed order date"] ].sort) end end @@ -175,7 +175,7 @@ table = rows.map { |r| r.all("th").map { |c| c.text.strip } } expect(table.sort).to eq([ ["First Name", "Last Name", "Hub", "Customer Code", "Email", "Phone", "Shipping Method", - "Payment Method", "Amount", "Balance"].map(&:upcase) + "Payment Method", "Amount", "Balance"] ].sort) end @@ -187,7 +187,7 @@ expect(table.sort).to eq([ ["First Name", "Last Name", "Hub", "Customer Code", "Delivery Address", "Delivery Postcode", "Phone", "Shipping Method", "Payment Method", "Amount", "Balance", - "Temp Controlled Items?", "Special Instructions"].map(&:upcase) + "Temp Controlled Items?", "Special Instructions"] ].sort) end end @@ -228,7 +228,6 @@ 'Distributor postcode', 'Shipping Method', 'Shipping instructions'] - .map(&:upcase) ]) expect(all('table.report__table tbody tr').count).to eq( @@ -250,7 +249,6 @@ 'Distributor', 'Payment Type', "Total (%s)" % currency_symbol] - .map(&:upcase) ]) expect(all('table.report__table tbody tr').count).to eq( @@ -400,13 +398,14 @@ expect(page).to have_content "All products" expect(page).to have_content "Inventory (on hand)" + click_link 'All products' click_button "Go" expect(page).to have_content "Supplier" expect(page).to have_table_row ["Supplier", "Producer Suburb", "Product", "Product Properties", "Taxons", "Variant Value", "Price", "Group Buy Unit Quantity", "Amount", "SKU", - "On demand?", "On hand"].map(&:upcase) + "On Demand?", "On Hand"] expect(page).to have_table_row [product1.supplier.name, product1.supplier.address.city, "Product Name", product1.properties.map(&:presentation).join(", "), @@ -432,7 +431,7 @@ expect(page).to have_table_row ['PRODUCT', 'Description', 'Qty', 'Pack Size', 'Unit', 'Unit Price', 'Total', 'GST incl.', - 'Grower and growing method', 'Taxon'].map(&:upcase) + 'Grower and growing method', 'Taxon'] expect(page).to have_table_row ['Product 2', '100g', '', '100', 'g', '99.0', '', '0', 'Supplier Name (Organic - NASAA 12345)', 'Taxon Name'] end @@ -459,7 +458,7 @@ table = rows.map { |r| r.all("th,td").map { |c| c.text.strip }[0..2] } expect(table.sort).to eq([ - ["User", "Relationship", "Enterprise"].map(&:upcase), + ["User", "Relationship", "Enterprise"], [enterprise1.owner.email, "owns", enterprise1.name], [enterprise1.owner.email, "manages", enterprise1.name], [enterprise2.owner.email, "owns", enterprise2.name], @@ -480,7 +479,7 @@ table = rows.map { |r| r.all("th,td").map { |c| c.text.strip }[0..2] } expect(table.sort).to eq([ - ["User", "Relationship", "Enterprise"].map(&:upcase), + ["User", "Relationship", "Enterprise"], [enterprise1.owner.email, "manages", enterprise3.name] ].sort) end @@ -508,7 +507,7 @@ "Units Required", "Unallocated", "Max Quantity Excess" - ].map(&:upcase) + ] end it "generating Bulk Co-op Allocation report" do @@ -527,7 +526,7 @@ "Total available", "Unallocated", "Max Quantity Excess" - ].map(&:upcase) + ] end it "generating Bulk Co-op Packing Sheets report" do @@ -539,7 +538,7 @@ "Product", "Variant", "Sum Total" - ].map(&:upcase) + ] end it "generating Bulk Co-op Customer Payments report" do @@ -552,7 +551,7 @@ "Total Cost", "Amount Owing", "Amount Paid" - ].map(&:upcase) + ] end end @@ -749,7 +748,7 @@ def xero_invoice_header POCity PORegion POPostalCode POCountry *InvoiceNumber Reference *InvoiceDate *DueDate InventoryItemCode *Description *Quantity *UnitAmount Discount *AccountCode *TaxType TrackingName1 TrackingOption1 TrackingName2 TrackingOption2 Currency BrandingTheme - Paid?).map(&:upcase) + Paid?) end def xero_invoice_summary_row(description, amount, tax_type, opts = {}) diff --git a/spec/system/admin/schedules_spec.rb b/spec/system/admin/schedules_spec.rb index 8913d9af1812..44c8962b391c 100644 --- a/spec/system/admin/schedules_spec.rb +++ b/spec/system/admin/schedules_spec.rb @@ -32,7 +32,7 @@ visit spree.admin_dashboard_path click_link 'Order cycles' expect(page).to have_selector ".order-cycle-#{oc1.id}" - find('a', text: 'NEW SCHEDULE').click + find('a', text: 'New Schedule').click within "#schedule-dialog" do # Only order cycles coordinated by managed enterprises are available to select diff --git a/spec/system/admin/subscriptions/crud_spec.rb b/spec/system/admin/subscriptions/crud_spec.rb index 274ecf823da9..2c98a57bc2ca 100644 --- a/spec/system/admin/subscriptions/crud_spec.rb +++ b/spec/system/admin/subscriptions/crud_spec.rb @@ -128,7 +128,7 @@ accept_alert 'Are you sure?' do find("a.cancel-order").click end - expect(page).to have_content 'CANCELLED' + expect(page).to have_content 'CANCELLED'.upcase expect(proxy_order.reload.canceled_at).to be_within(5.seconds).of Time.zone.now # Resuming an order @@ -260,7 +260,7 @@ def open_subscription_products_panel choose_today_from_datepicker click_button('Next') - expect(page).to have_content 'BILLING ADDRESS' + expect(page).to have_content 'Billing Address' # Customer bill address has been pre-loaded expect(page).to have_input "bill_address_firstname", with: address.firstname expect(page).to have_input "bill_address_lastname", with: address.lastname diff --git a/spec/system/admin/subscriptions/smoke_tests_spec.rb b/spec/system/admin/subscriptions/smoke_tests_spec.rb index cfd1e7a2a44d..cde0582d3837 100644 --- a/spec/system/admin/subscriptions/smoke_tests_spec.rb +++ b/spec/system/admin/subscriptions/smoke_tests_spec.rb @@ -192,7 +192,7 @@ # Fill in other details fill_in_subscription_basic_details click_button "Next" - expect(page).to have_content "BILLING ADDRESS" + expect(page).to have_content "Billing Address" click_button "Next" # Add products diff --git a/spec/system/admin/variant_overrides_spec.rb b/spec/system/admin/variant_overrides_spec.rb index f34c7691b0b7..50ce6aef78c7 100644 --- a/spec/system/admin/variant_overrides_spec.rb +++ b/spec/system/admin/variant_overrides_spec.rb @@ -82,7 +82,7 @@ context "with no overrides" do it "displays the list of products with variants" do - expect(page).to have_table_row ['PRODUCER', 'PRODUCT', 'PRICE', 'ON HAND', 'ON DEMAND?'] + expect(page).to have_table_row ['Producer', 'Product', 'Price', 'On Hand', 'On Demand?'] expect(page).to have_table_row [producer.name, product.name, '', '', ''] expect(page).to have_input "variant-overrides-#{variant.id}-price", placeholder: '1.23' expect(page).to have_input "variant-overrides-#{variant.id}-count_on_hand", @@ -493,7 +493,7 @@ "inventory." click_button "Review Now" - expect(page).to have_table_row ['PRODUCER', 'PRODUCT', 'VARIANT', 'ADD', 'HIDE'] + expect(page).to have_table_row ['Producer', 'Product', 'Variant', 'Add', 'Hide'] expect(page).to have_selector "table#new-products tr#v_#{variant1.id}" expect(page).to have_selector "table#new-products tr#v_#{variant2.id}" within "table#new-products tr#v_#{variant1.id}" do