Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUU] Activate admin_style_v3 for most system specs #11645

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
500b9ed
Enables admin_style_v3 toggle by default
filipefurtad0 Oct 10, 2023
308c559
Fixes case on assertions, on failing specs
filipefurtad0 Oct 12, 2023
9aecf9f
Brings the tests back to green, after rebasing
filipefurtad0 Oct 25, 2023
5e4381c
Fixes case on failing test
filipefurtad0 Nov 21, 2023
1c580c4
Adds assertions on products page, when no products are found
filipefurtad0 Nov 22, 2023
b9bb4a4
displays a list of products
filipefurtad0 Nov 28, 2023
8a19870
Fixes case on reports_spec.rb
filipefurtad0 Dec 13, 2023
5271361
Fixes case on products_spec.rb
filipefurtad0 Dec 13, 2023
8897e99
Clicks OC warning modal away so other buttons are reachable
filipefurtad0 Dec 13, 2023
4871e00
Deals with overlapping elements
filipefurtad0 Dec 13, 2023
50c7392
Deals with overlapping elements
filipefurtad0 Dec 13, 2023
7303c40
Introduces helper to deal with overlapping elements
filipefurtad0 Dec 13, 2023
c789489
Deals with overlapping elements
filipefurtad0 Dec 13, 2023
2937bdc
Deals with overlapping elements
filipefurtad0 Dec 13, 2023
e09fa3e
Updates v3 products page
filipefurtad0 Dec 13, 2023
3af5330
Updates product category test
filipefurtad0 Jan 3, 2024
d88db13
Updates specs to accomodate changes on warnings/banners
filipefurtad0 Jan 16, 2024
289414a
Adds tests around product creation
filipefurtad0 Jan 16, 2024
5af5eb7
Replaces all with find, within tom_select helper method
filipefurtad0 Jan 17, 2024
c4b2748
Adds pending test case on creating variants
filipefurtad0 Jan 18, 2024
8b036e5
Removes search block - covered already a few lines below
filipefurtad0 Jan 18, 2024
2c37783
Updates selector
filipefurtad0 Jan 26, 2024
0fa272a
Changes helper for dropdown selection
filipefurtad0 Feb 8, 2024
0a4c2a1
Updates tom_select_helper.rb with the recent changes from master
filipefurtad0 Feb 12, 2024
4e24af2
Applies helper changes
filipefurtad0 Feb 12, 2024
03a9f68
Fixes rubocop inconsistency
filipefurtad0 Apr 1, 2024
bcbc7c7
Fixes rubocop inconsistency
filipefurtad0 Apr 1, 2024
5824516
Fixes case
filipefurtad0 Apr 1, 2024
9f98dc2
Adds assertions on table header
filipefurtad0 Apr 1, 2024
80e8177
Mouse hovering displays the text
filipefurtad0 Apr 1, 2024
c226b10
Updates case on orders_spec.rb
filipefurtad0 Apr 16, 2024
ba355fd
Removes mouse clicks to display variants
filipefurtad0 Apr 16, 2024
8028610
Updates spec to create a variant within BUU design
filipefurtad0 Apr 17, 2024
9e25893
Sets variant creation scenarios on_hand/on_demand as shared examples
filipefurtad0 Apr 18, 2024
6dfef81
Fixes rebase
filipefurtad0 May 20, 2024
3a8c44d
fixup: Updates spec to create a variant within BUU design
dacook Jul 1, 2024
39cae44
Fix more uppercase tests after rebase
dacook Jul 1, 2024
5f01bb4
Remove unecessary message
dacook Jul 1, 2024
109432d
fixup: feature toggle old screen
dacook Jul 1, 2024
b1721d6
todo: make specs work with admin_style_v3
dacook Jul 1, 2024
c80199e
Use normal capitalisation for translation
dacook Jul 1, 2024
b1aafbf
Remove old migration spec
dacook Jul 1, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion spec/support/features/datepicker_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions spec/system/admin/authentication_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,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).not_to have_content "CONFIGURATION"
expect(page).not_to have_content "Configuration"
end

it "viewing my account" do
Expand Down
46 changes: 23 additions & 23 deletions spec/system/admin/bulk_order_management_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -311,7 +311,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}"
Expand All @@ -320,33 +320,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
Expand Down Expand Up @@ -550,13 +550,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
Expand All @@ -565,13 +565,13 @@
end

it "shows all default columns, except the de-selected column" do
expect(page).not_to have_selector "th", text: "PRODUCER"
expect(page).to have_selector "th", text: "NAME"
expect(page).not_to have_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
Expand Down Expand Up @@ -1209,7 +1209,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
Expand Down
28 changes: 15 additions & 13 deletions spec/system/admin/bulk_product_update_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -698,17 +700,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).not_to have_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).not_to have_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

Expand Down Expand Up @@ -813,8 +815,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]
Expand Down
2 changes: 1 addition & 1 deletion spec/system/admin/configuration/general_settings_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions spec/system/admin/customers_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down
Loading