Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix player search #25

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions spec/yahoo/add_free_agent.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

YAHOO_USERNAME = 'taco'
YAHOO_PASSWORD = 'passwordistaco'
YAHOO_PLAYERS = 'https://football.fantasysports.yahoo.com/f1/726755/players' # Replace with Players page of your league
YAHOO_PLAYERS = 'https://football.fantasysports.yahoo.com/f1/1216032/players' # Replace with Players page of your league

def login_yahoo(username, password)
click_link('Sign in') if page.has_link?('Sign in')
Expand All @@ -15,9 +15,7 @@ def login_yahoo(username, password)
end

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')
find('#playersearchtext').send_keys(free_agent, :enter)
page.should have_css('.First.Last', :count => 1)
if page.has_link?(free_agent) && page.has_link?('Add Player')
click_link('Add Player')
Expand Down Expand Up @@ -47,12 +45,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('Romeo Doubs', 'J. Palmer', 'Josh Palmer') # 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
add_drop('Isaiah McKenzie', 'J. Palmer', 'Josh Palmer') # Replace with players you want to add and drop
end

end
end