mirror of
https://github.com/yattee/yattee.git
synced 2026-02-20 09:49:46 +00:00
Fix UI tests for onboarding flow and AddRemoteServer redesign
- Skip onboarding in tests by setting UserDefaults before launch - Update all addSource.* identifiers to addRemoteServer.* for new flow - Switch from identifier-based to text-based element lookups (iOS 26 AXe limitation) - Add Yattee Server credential support in instance setup - Update baseline screenshots for Home tab and settings
This commit is contained in:
@@ -32,20 +32,20 @@ RSpec.describe 'Settings', :smoke do
|
||||
UITest::Simulator.shutdown(@udid) if @udid && !UITest::Config.keep_simulator?
|
||||
end
|
||||
|
||||
describe 'opening Settings from Library' do
|
||||
describe 'opening Settings from Home' do
|
||||
before(:all) do
|
||||
# Ensure we're on Library tab first (check for text since inlineLarge title has no AXUniqueId)
|
||||
expect(@axe).to have_text('Library')
|
||||
# Ensure we're on Home tab first
|
||||
expect(@axe).to have_text('Home')
|
||||
|
||||
# Tap Settings button using accessibility identifier
|
||||
@axe.tap_id('library.settingsButton')
|
||||
@axe.tap_id('home.settingsButton')
|
||||
sleep 1
|
||||
end
|
||||
|
||||
after(:all) do
|
||||
# Close Settings to return to Library
|
||||
# Close Settings to return to Home
|
||||
begin
|
||||
@axe.tap_label('Done')
|
||||
@axe.tap_id('settings.doneButton')
|
||||
rescue StandardError
|
||||
nil
|
||||
end
|
||||
@@ -60,7 +60,7 @@ RSpec.describe 'Settings', :smoke do
|
||||
expect(@axe).to have_text('Settings')
|
||||
end
|
||||
|
||||
it 'displays the Done button' do
|
||||
it 'displays the Close button' do
|
||||
expect(@axe).to have_element('settings.doneButton')
|
||||
end
|
||||
|
||||
@@ -83,24 +83,33 @@ RSpec.describe 'Settings', :smoke do
|
||||
end
|
||||
|
||||
describe 'closing Settings' do
|
||||
before(:all) do
|
||||
# Open settings if not already open
|
||||
unless @axe.element_exists?('settings.view')
|
||||
@axe.tap_id('library.settingsButton')
|
||||
sleep 1
|
||||
it 'closes Settings when tapping Close' do
|
||||
# Ensure we're on Home first
|
||||
sleep 0.5
|
||||
unless @axe.text_visible?('Home') || @axe.element_exists?('home.settingsButton')
|
||||
# Try to dismiss any open sheets
|
||||
begin
|
||||
@axe.tap_id('settings.doneButton')
|
||||
sleep 0.5
|
||||
rescue StandardError
|
||||
nil
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
it 'closes Settings when tapping Done' do
|
||||
# Open Settings fresh
|
||||
@axe.tap_id('home.settingsButton')
|
||||
sleep 1
|
||||
|
||||
# Verify we're in Settings
|
||||
expect(@axe).to have_element('settings.view')
|
||||
expect(@axe).to have_element('settings.doneButton')
|
||||
|
||||
# Tap Done
|
||||
@axe.tap_label('Done')
|
||||
sleep 0.5
|
||||
# Tap Close
|
||||
@axe.tap_id('settings.doneButton')
|
||||
sleep 1.5
|
||||
|
||||
# Verify we're back on Library (check for text since inlineLarge title has no AXUniqueId)
|
||||
expect(@axe).to have_text('Library')
|
||||
# Verify we're back on Home
|
||||
expect(@axe).to have_text('Home')
|
||||
expect(@axe).not_to have_element('settings.view')
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user