Update tests to use buttons

Add disguise/revert tests
This commit is contained in:
2023-05-14 15:57:12 +02:00
parent fbb74bd1f8
commit 5e09adeae7
3 changed files with 129 additions and 14 deletions

View File

@@ -1,10 +1,18 @@
require "test_helper"
class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
include ActionView::Helpers::UrlHelper
# NOTE: remove when capabilities no longer used by Rails
Selenium::WebDriver.logger.ignore(:capabilities)
Capybara.configure do |config|
config.save_path = "#{Rails.root}/tmp/screenshots/"
end
driven_by :selenium, using: :headless_firefox, screen_size: [2400, 1600]
driven_by :selenium, using: :headless_firefox, screen_size: [2400, 1600] do |options|
options.add_preference('browser.download.folderList', 2)
options.add_preference('browser.download.dir', "#{Rails.root}/tmp/")
end
def sign_in(user: users.select(&:confirmed?).sample, password: randomize_user_password!(user))
visit new_user_session_url
@@ -12,4 +20,8 @@ class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
fill_in User.human_attribute_name(:password).capitalize, with: password
click_on t(:sign_in)
end
#def assert_stale(element)
# assert_raise(Selenium::WebDriver::Error::StaleElementReferenceError) { element.tag_name }
#end
end