Fix spec failures

This commit is contained in:
Andrew Cantino 2016-12-20 13:32:48 -05:00
parent 4e2d1775a6
commit 65cea03062
2 changed files with 8 additions and 10 deletions

View file

@ -12,13 +12,14 @@ module Agents
default_schedule 'every_12h'
description <<-MD
[PhantomJs Cloud](https://phantomjscloud.com/) renders webpages in much the same way as a browser would, and allows the Website Agent to properly scrape dynamic content from javascript-heavy pages.
This Agent generates [PhantomJs Cloud](https://phantomjscloud.com/) URLs that can be used to render JavaScript-heavy webpages for content extraction.
The Phantom Js Cloud Agent is used to formulate a url in accordance with the [PhantomJs Cloud API](https://phantomjscloud.com/docs/index.html).
This url can then be supplied to Website Agent to fetch and parse content.
URLs generated by this Agent are formulated in accordance with the [PhantomJs Cloud API](https://phantomjscloud.com/docs/index.html).
The generated URLs can then be supplied to a Website Agent to fetch and parse the content.
[Sign up](https://dashboard.phantomjscloud.com/dash.html#/signup) to get an api key, and add it in Huginn credentials.
Please see the [Huginn Wiki for more info](https://github.com/cantino/huginn/wiki/Browser-Emulation-Using-PhantomJS-Cloud).
Options:
@ -33,9 +34,7 @@ module Agents
This is useful in case there are any AJAX requests or animations that need to finish up.
This can safely be set to 0 if you know there are no AJAX or animations you need to wait for (default: `1000`ms)
As this agent only provides a limited subset of the most commonly used options, you can follow [this guide](https://github.com/cantino/huginn/wiki/Browser-Emulation-Using-PhantomJS-Cloud) to make full use of additional options PhantomJsCloud provides.
MD
event_description <<-MD

View file

@ -38,7 +38,7 @@ describe "Creating a new agent", js: true do
visit new_agent_path
end
it "shows all options for agents that can be scheduled, create and receive events" do
select2("Website Agent", from: "Type")
select2("Website Agent scrapes", from: "Type")
expect(page).not_to have_content('This type of Agent cannot create events.')
end
@ -49,9 +49,8 @@ describe "Creating a new agent", js: true do
end
it "allows to click on on the agent name in select2 tags" do
agent = agents(:bob_weather_agent)
visit new_agent_path
select2("Website Agent", from: "Type")
select2("Website Agent scrapes", from: "Type")
select2("SF Weather", from: 'Sources')
click_on "SF Weather"
expect(page).to have_content "Editing your WeatherAgent"
@ -63,7 +62,7 @@ describe "Creating a new agent", js: true do
end
it "does not send previously configured sources when the current agent does not support them" do
select2("Website Agent", from: "Type")
select2("Website Agent scrapes", from: "Type")
select2("SF Weather", from: 'Sources')
select2("Webhook Agent", from: "Type")
fill_in(:agent_name, with: "No sources")
@ -85,7 +84,7 @@ describe "Creating a new agent", js: true do
end
it "does not send previously configured receivers when the current agent does not support them" do
select2("Website Agent", from: "Type")
select2("Website Agent scrapes", from: "Type")
select2("ZKCD", from: 'Receivers')
select2("Email Agent", from: "Type")
fill_in(:agent_name, with: "No receivers")