Brings back xpath selector

Fixes xpath
This commit is contained in:
filipefurtad0
2024-07-12 20:10:00 +01:00
parent 91daec4806
commit e1976c6cc2

View File

@@ -76,10 +76,15 @@ RSpec.describe 'As an enterprise user, I can manage my products', feature: :admi
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[2]/td[7]') do
expect(page).to have_content "On demand"
end
within(:xpath, '//*[@id="products-form"]/table/tbody[2]/tr[2]/td[7]') 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[7]') do
expect(page).to have_content "4" # displays the stock for variant_3
end
end
end