discourse-subscriptions/spec/system/page_objects/user_billing_subscription.rb
Blake Erickson 66e8857c20
DEV: Stop deleting customers on cancel (#207)
Instead of deleting customers on cancel we will now update the
subscription status to canceled. This way we can have some visibility on
which users have canceled.
2024-05-02 13:38:30 -06:00

33 lines
820 B
Ruby

# frozen_string_literal: true
module PageObjects
module Pages
class UserBillingSubscription < PageObjects::Pages::Base
SUBSCRIPTIONS_TABLE_SELECTOR = "table.discourse-subscriptions-user-table"
def visit_subscriptions
visit("/my/billing/subscriptions")
self
end
def has_subscription?(id)
has_css?("#{SUBSCRIPTIONS_TABLE_SELECTOR} tr", text: id)
self
end
def subscription_row(id)
find("#{SUBSCRIPTIONS_TABLE_SELECTOR} tr", text: id)
end
def has_number_of_subscriptions?(count)
has_css?("#{SUBSCRIPTIONS_TABLE_SELECTOR} tr", count:)
self
end
def click_cancel_nth_row(row)
find("#{SUBSCRIPTIONS_TABLE_SELECTOR} tr:nth-child(#{row}) button.btn-danger").click()
end
end
end
end