mirror of
https://github.com/yattee/yattee.git
synced 2026-02-20 01:39:46 +00:00
Yattee v2 rewrite
This commit is contained in:
20
spec/ui/support/shared_contexts/with_invidious.rb
Normal file
20
spec/ui/support/shared_contexts/with_invidious.rb
Normal file
@@ -0,0 +1,20 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
# Shared context that ensures an Invidious instance is configured
|
||||
# before running tests that depend on it.
|
||||
#
|
||||
# Usage in specs:
|
||||
# RSpec.describe 'Feature requiring Invidious', :smoke do
|
||||
# include_context 'with Invidious instance'
|
||||
#
|
||||
# it 'does something with Invidious' do
|
||||
# # Instance is guaranteed to exist
|
||||
# end
|
||||
# end
|
||||
#
|
||||
RSpec.shared_context 'with Invidious instance' do
|
||||
before(:all) do
|
||||
@instance_setup ||= UITest::InstanceSetup.new(@axe)
|
||||
@instance_setup.ensure_invidious(UITest::Config.invidious_url)
|
||||
end
|
||||
end
|
||||
27
spec/ui/support/shared_contexts/with_logged_in_invidious.rb
Normal file
27
spec/ui/support/shared_contexts/with_logged_in_invidious.rb
Normal file
@@ -0,0 +1,27 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
# Shared context that ensures an Invidious instance is configured AND logged in
|
||||
# before running tests that depend on it.
|
||||
#
|
||||
# Requires environment variables:
|
||||
# INVIDIOUS_EMAIL - Invidious account email/username
|
||||
# INVIDIOUS_PASSWORD - Invidious account password
|
||||
#
|
||||
# Usage in specs:
|
||||
# RSpec.describe 'Feature requiring logged-in Invidious', :smoke do
|
||||
# include_context 'with logged-in Invidious'
|
||||
#
|
||||
# it 'does something with Invidious account' do
|
||||
# # Instance is guaranteed to exist and be logged in
|
||||
# end
|
||||
# end
|
||||
#
|
||||
RSpec.shared_context 'with logged-in Invidious' do
|
||||
before(:all) do
|
||||
skip 'Invidious credentials not configured' unless UITest::Config.invidious_credentials?
|
||||
|
||||
@instance_setup ||= UITest::InstanceSetup.new(@axe)
|
||||
@instance_setup.ensure_invidious(UITest::Config.invidious_url)
|
||||
@instance_setup.ensure_invidious_logged_in(UITest::Config.invidious_host)
|
||||
end
|
||||
end
|
||||
27
spec/ui/support/shared_contexts/with_logged_in_piped.rb
Normal file
27
spec/ui/support/shared_contexts/with_logged_in_piped.rb
Normal file
@@ -0,0 +1,27 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
# Shared context that ensures a Piped instance is configured AND logged in
|
||||
# before running tests that depend on it.
|
||||
#
|
||||
# Requires environment variables:
|
||||
# PIPED_USERNAME - Piped account username
|
||||
# PIPED_PASSWORD - Piped account password
|
||||
#
|
||||
# Usage in specs:
|
||||
# RSpec.describe 'Feature requiring logged-in Piped', :smoke do
|
||||
# include_context 'with logged-in Piped'
|
||||
#
|
||||
# it 'does something with Piped account' do
|
||||
# # Instance is guaranteed to exist and be logged in
|
||||
# end
|
||||
# end
|
||||
#
|
||||
RSpec.shared_context 'with logged-in Piped' do
|
||||
before(:all) do
|
||||
skip 'Piped credentials not configured' unless UITest::Config.piped_credentials?
|
||||
|
||||
@instance_setup ||= UITest::InstanceSetup.new(@axe)
|
||||
@instance_setup.ensure_piped(UITest::Config.piped_url)
|
||||
@instance_setup.ensure_piped_logged_in(UITest::Config.piped_host)
|
||||
end
|
||||
end
|
||||
20
spec/ui/support/shared_contexts/with_piped.rb
Normal file
20
spec/ui/support/shared_contexts/with_piped.rb
Normal file
@@ -0,0 +1,20 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
# Shared context that ensures a Piped instance is configured
|
||||
# before running tests that depend on it.
|
||||
#
|
||||
# Usage in specs:
|
||||
# RSpec.describe 'Feature requiring Piped', :smoke do
|
||||
# include_context 'with Piped instance'
|
||||
#
|
||||
# it 'does something with Piped' do
|
||||
# # Instance is guaranteed to exist
|
||||
# end
|
||||
# end
|
||||
#
|
||||
RSpec.shared_context 'with Piped instance' do
|
||||
before(:all) do
|
||||
@instance_setup ||= UITest::InstanceSetup.new(@axe)
|
||||
@instance_setup.ensure_piped(UITest::Config.piped_url)
|
||||
end
|
||||
end
|
||||
20
spec/ui/support/shared_contexts/with_yattee_server.rb
Normal file
20
spec/ui/support/shared_contexts/with_yattee_server.rb
Normal file
@@ -0,0 +1,20 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
# Shared context that ensures a Yattee Server instance is configured
|
||||
# before running tests that depend on it.
|
||||
#
|
||||
# Usage in specs:
|
||||
# RSpec.describe 'Feature requiring Yattee Server', :smoke do
|
||||
# include_context 'with Yattee Server instance'
|
||||
#
|
||||
# it 'does something with Yattee Server' do
|
||||
# # Instance is guaranteed to exist
|
||||
# end
|
||||
# end
|
||||
#
|
||||
RSpec.shared_context 'with Yattee Server instance' do
|
||||
before(:all) do
|
||||
@instance_setup ||= UITest::InstanceSetup.new(@axe)
|
||||
@instance_setup.ensure_yattee_server(UITest::Config.yattee_server_url)
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user