#Getting Started
##Webpage:
<html>
<head>
<title>Testing with Ruby and Selenium WebDriver</title>
</head>
<body bgcolor="antiquewhite">
# NOTE: Be sure to set the API key further down in the code! | |
require "net/http" | |
require "uri" | |
require "json" | |
class WIP | |
def initialize(api_key:) | |
@api_key = api_key | |
end |
=Navigating= | |
visit('/projects') | |
visit(post_comments_path(post)) | |
=Clicking links and buttons= | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') | |
click('Link Text') # Click either a link or a button | |
click('Button Value') |
#Getting Started
##Webpage:
<html>
<head>
<title>Testing with Ruby and Selenium WebDriver</title>
</head>
<body bgcolor="antiquewhite">
# best practice: linux | |
nano ~/.pgpass | |
*:5432:*:username:password | |
chmod 0600 ~/.pgpass | |
# best practice: windows | |
edit %APPDATA%\postgresql\pgpass.conf | |
*:5432:*:username:password | |
# linux |
pb-kill-line () { | |
zle kill-line | |
echo -n $CUTBUFFER | pbcopy | |
} | |
pb-kill-whole-line () { | |
zle kill-whole-line | |
echo -n $CUTBUFFER | pbcopy | |
} |
# Add as Rake task or Rails console | |
class CSVFormatter | |
def initialize | |
@buffer = [] | |
end | |
def result | |
@buffer.join("\n") | |
end |