From bef8ac59b9dd5775120cefbfc1eb9ef7836b5d5b Mon Sep 17 00:00:00 2001 From: Kurosh Date: Thu, 16 Sep 2021 17:54:33 -0400 Subject: [PATCH 1/2] Fix broken button clicks --- spec/yahoo/add_free_agent.rb | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/spec/yahoo/add_free_agent.rb b/spec/yahoo/add_free_agent.rb index 4642931..ef98c90 100644 --- a/spec/yahoo/add_free_agent.rb +++ b/spec/yahoo/add_free_agent.rb @@ -16,17 +16,18 @@ def login_yahoo(username, password) def add_drop(free_agent, abbrev, droppable) find('#playersearchtext').set(free_agent) - sleep 5 # Sometimes, the autocomplete dropdown interferes with clicking the Search button, so we wait a little - click_button('Search') + sleep 10 # Sometimes, the autocomplete dropdown interferes with clicking the Search button, so we wait a little + # click_button('Search') # commented out because appears to be broken + find('input.Va-bot').click page.should have_css('.First.Last', :count => 1) - if page.has_link?(free_agent) && page.has_link?('Add Player') + if page.has_link?('Add Player') click_link('Add Player') page.should have_text('Select a player to drop') find('td.player', :text => abbrev).find(:xpath, '..').find('button.add-drop-trigger-btn').click if page.has_css?('#submit-add-drop-button[value^="Create claim"]') puts 'Waivers have not cleared' else - find('#submit-add-drop-button[value="Add %s, Drop %s"]' % [free_agent, droppable]).click + find('#submit-add-drop-button,[value="Add %s, Drop %s"]' % [free_agent, droppable]).click puts 'Congratulations! %s was added.' % free_agent sleep 10 end @@ -47,12 +48,12 @@ def add_drop(free_agent, abbrev, droppable) end scenario "Log in and add/drop player" do - add_drop('Robby Anderson', 'A. Kamara', 'Alvin Kamara') # Replace with players you want to add and drop + add_drop('Jason Sanders', 'R. Gould', 'Robby Gould') # Replace with players you want to add and drop # Do not insert additional calls to add_drop() -- Create new scenarios for more players end - scenario "Log in and add/drop another player" do - add_drop('Terrance West', 'W. Gallman', 'Wayne Gallman') # Replace with players you want to add and drop - end + # scenario "Log in and add/drop another player" do + # add_drop('Terrance West', 'W. Gallman', 'Wayne Gallman') # Replace with players you want to add and drop + # end end From d539bd7b1cb718194fd204e061ca944d268b6f49 Mon Sep 17 00:00:00 2001 From: Kurosh Date: Thu, 16 Sep 2021 18:06:31 -0400 Subject: [PATCH 2/2] Revert previous code from testing adjustments --- spec/yahoo/add_free_agent.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/yahoo/add_free_agent.rb b/spec/yahoo/add_free_agent.rb index ef98c90..5c4cb06 100644 --- a/spec/yahoo/add_free_agent.rb +++ b/spec/yahoo/add_free_agent.rb @@ -16,11 +16,11 @@ def login_yahoo(username, password) def add_drop(free_agent, abbrev, droppable) find('#playersearchtext').set(free_agent) - sleep 10 # Sometimes, the autocomplete dropdown interferes with clicking the Search button, so we wait a little + sleep 5 # Sometimes, the autocomplete dropdown interferes with clicking the Search button, so we wait a little # click_button('Search') # commented out because appears to be broken find('input.Va-bot').click page.should have_css('.First.Last', :count => 1) - if page.has_link?('Add Player') + if page.has_link?(free_agent) && page.has_link?('Add Player') click_link('Add Player') page.should have_text('Select a player to drop') find('td.player', :text => abbrev).find(:xpath, '..').find('button.add-drop-trigger-btn').click @@ -48,7 +48,7 @@ def add_drop(free_agent, abbrev, droppable) end scenario "Log in and add/drop player" do - add_drop('Jason Sanders', 'R. Gould', 'Robby Gould') # Replace with players you want to add and drop + add_drop('Joey Slye', 'J. Sanders', 'Jason Sanders') # Replace with players you want to add and drop # Do not insert additional calls to add_drop() -- Create new scenarios for more players end