discourse-subscriptions/spec/system/page_objects/admin_subscription_product.rb
Natalie Tay 0d28c9a56d
FIX: Ensure deletion of product upon confirmation (#195)
Ensure deletion of product upon confirmation
2024-03-13 17:16:07 +08:00

29 lines
706 B
Ruby

# frozen_string_literal: true
module PageObjects
module Pages
class AdminSubscriptionProduct < PageObjects::Pages::Base
PRODUCTS_TABLE_SELECTOR = "table.discourse-patrons-table"
def visit_products
visit("/admin/plugins/discourse-subscriptions/products")
self
end
def has_product?(name)
has_css?("table.discourse-patrons-table tr", text: name)
self
end
def has_number_of_products?(count)
has_css?("table.discourse-patrons-table tr", count:)
self
end
def click_trash_nth_row(row)
find("table.discourse-patrons-table tr:nth-child(#{row}) button.btn-danger").click()
end
end
end
end