This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
self.assertTrue('I am some other page content' in body.text) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import unittest | |
from selenium import webdriver | |
class Selenium2OnSauce(unittest.TestCase): | |
def setUp(self): | |
desired_capabilities = webdriver.DesiredCapabilities.CHROME | |
# desired_capabilities['version'] = '' | |
desired_capabilities['platform'] = 'VISTA' | |
desired_capabilities['name'] = 'Clicking links at jackmoxon.com on Chrome' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
self.driver = webdriver.Remote( | |
desired_capabilities=desired_capabilities, | |
command_executor="http://username:API_KEY@ondemand.saucelabs.com:80/wd/hub" | |
) | |
self.driver.implicitly_wait(30) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
self.assertTrue('I am some other page content' in body.text) | |
def tearDown(self): | |
print "Link to your job: https://saucelabs.com/jobs/%s" % self.driver.session_id | |
self.driver.quit() | |
if __name__ == '__main__': | |
unittest.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
self.driver.implicitly_wait(30) | |
def test_sauce(self): | |
self.driver.get('http://saucelabs.com/test/guinea-pig') | |
self.assertTrue("I am a page title - Sauce Labs" in self.driver.title); | |
self.driver.find_element_by_id('comments').send_keys('Hello! I am some example comments. I should appear in the page after you submit the form') | |
self.driver.find_element_by_id('submit').click() | |
comments = self.driver.find_element_by_id('your_comments') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import unittest | |
from selenium import webdriver | |
class Selenium2OnSauce(unittest.TestCase): | |
def setUp(self): | |
desired_capabilities = webdriver.DesiredCapabilities.IPHONE | |
desired_capabilities['version'] = '5.0' | |
desired_capabilities['platform'] = 'MAC' | |
desired_capabilities['name'] = 'Testing Selenium 2 in Python at Sauce' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import unittest | |
from selenium import webdriver | |
class Selenium2OnSauce(unittest.TestCase): | |
def setUp(self): | |
desired_capabilities = webdriver.DesiredCapabilities.IPHONE | |
desired_capabilities['version'] = '5.0' | |
desired_capabilities['platform'] = 'MAC' | |
desired_capabilities['name'] = 'Testing Selenium 2 in Python at Sauce' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from feeds import LatestPosts | |
urlpatterns = patterns('', | |
... | |
url(r'^latest/feed/$', LatestPosts()), | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.contrib.syndication.views import Feed | |
from models import * | |
class LatestPosts(Feed): | |
title = "Your Blog" | |
link = "http://www.yourdomain.com/blog/" | |
description = "Latest blog posts..." | |
def items(self): | |
return Post.objects.order_by('-published_date')[:50] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Milton Friedman said it best: no single person could make a pencil. To do so one would have to smelt steel to build a saw to cut a tree, produce rubber for an eraser, mine graphite, etc. And yet, someone decided it was worth all that trouble provided they could sell it for a mere $.13. | |
The price of a good signals the cost that the producer paid to make the good to consumers. | |
But what if that rubber factory produces toxic waste and dumps it into an adjacent river? If you were a fisherman down stream you’d say that pencil cost you something. It cost you the fish you could otherwise catch and sell - and you won’t see a penny of that $.13! | |
The pollution that kills your fish is a negative externality - a cost associated with a good that is not reflected in the price and incurred by a party that did not agree to pay it. In this case: you – a person who receives no direct benefit from pencil manufacturing – bear a cost that you did not intend to – i.e. you can’t sell fish you expected to. | |
Several remedies exist |
NewerOlder