From 65cea03062dfc4aa7d0ebdacf2edde5a78e75f82 Mon Sep 17 00:00:00 2001 From: Andrew Cantino Date: Tue, 20 Dec 2016 13:32:48 -0500 Subject: [PATCH] Fix spec failures --- app/models/agents/phantom_js_cloud_agent.rb | 9 ++++----- spec/features/create_an_agent_spec.rb | 9 ++++----- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/app/models/agents/phantom_js_cloud_agent.rb b/app/models/agents/phantom_js_cloud_agent.rb index f0c9e605..727de10e 100644 --- a/app/models/agents/phantom_js_cloud_agent.rb +++ b/app/models/agents/phantom_js_cloud_agent.rb @@ -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 diff --git a/spec/features/create_an_agent_spec.rb b/spec/features/create_an_agent_spec.rb index ac2ce295..ae725630 100644 --- a/spec/features/create_an_agent_spec.rb +++ b/spec/features/create_an_agent_spec.rb @@ -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")