Skip to content

Commit

Permalink
Brings back xpath selector
Browse files Browse the repository at this point in the history
  • Loading branch information
filipefurtad0 committed Jul 12, 2024
1 parent 37d3108 commit ffb39d5
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions spec/system/admin/products_v3/index_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,18 @@
end

it "displays an on hand count in a span for each product" do
expect(page).to have_content "On demand"
expect(page).not_to have_content "20" # does not display the total stock
expect(page).to have_content "16" # displays the stock for variant_2
expect(page).to have_content "4" # displays the stock for variant_3
within(:xpath, '//*[@id="products-form"]/table/tbody[1]/tr[1]/td[5]/div') do
expect(page).to have_content "On demand"
end
within(:xpath, '//*[@id="products-form"]/table/tbody[2]/tr[1]/td[5]/div') do
expect(page).to have_content "20" # displays the total stock
end
within(:xpath, '//*[@id="products-form"]/table/tbody[2]/tr[2]/td[5]/div') do
expect(page).to have_content "16" # displays the stock for variant_2
end
within(:xpath, '//*[@id="products-form"]/table/tbody[2]/tr[3]/td[5]/div') do
expect(page).to have_content "4" # displays the stock for variant_3
end
end
end

Expand Down

0 comments on commit ffb39d5

Please sign in to comment.