-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
536 additions
and
18 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
Content Trigger | ||
=============== | ||
|
||
This document will guide admins to | ||
add an IFTTT "Content Trigger" to any folder on their site | ||
that will send a trigger to IFTTT when content at or below the current path is published. | ||
This will allow them to create IFTTT applets to, | ||
for example, email, tweet, or Facebook post about the content. | ||
|
||
Follow the steps given below to Add an IFTTT Content Trigger onto any folder. | ||
|
||
1. Traverse to folder on which you desire to apply IFTTT content trigger. | ||
|
||
2. From actions menu select ``Add Ifttt Content Trigger`` | ||
|
||
.. image:: _static/images/add_ifttt_content_trigger/select_actions.png | ||
|
||
3. Fill the given form with required values and click ``Add`` | ||
|
||
.. image:: _static/images/add_ifttt_content_trigger/fill_form.png | ||
|
||
4. Tada, trigger has been applied on your folder!! | ||
|
||
.. image:: _static/images/add_ifttt_content_trigger/success.png | ||
|
||
|
||
Behind the Scenes | ||
----------------- | ||
|
||
This section details all jobs performed behind the scenes | ||
after form gets filled. | ||
|
||
1. A new Content Rule is dynamically created and assigned with requested | ||
conditions and IFTTT event name for this folder and it's sub-folder. | ||
|
||
To know more about content rules, follow this | ||
`link <https://docs.plone.org/working-with-content/managing-content/contentrules.html>`_. | ||
|
||
2. ``Rules`` menu on left bar will show you all content rules applied on this folder. | ||
|
||
.. image:: _static/images/add_ifttt_content_trigger/rule_tab.png | ||
|
||
|
||
Default Settings | ||
----------------- | ||
|
||
Following are the default settings which are configured during | ||
creation of content rule. | ||
|
||
Conditions | ||
^^^^^^^^^^ | ||
|
||
1. Default Trigger condition for this content rule is: ``Workflow state changed`` | ||
|
||
2. Default contition for this content rule is: Workflow State as | ||
``published`` | ||
|
||
Data sent to IFTTT applet | ||
^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
In the data sent to IFTTT, following values will be dynamically included | ||
(for which content on the site this content rule triggers): | ||
|
||
- Title | ||
- Absolute_url | ||
- Description | ||
|
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
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
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
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
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
143 changes: 143 additions & 0 deletions
143
src/collective/ifttt/tests/robot/test_content_trigger.robot
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,143 @@ | ||
|
||
# ============================================================================ | ||
# CONTENT TRIGGER ROBOT TESTS | ||
# ============================================================================ | ||
# | ||
# Run this robot test stand-alone: | ||
# | ||
# $ bin/test -s collective.ifttt -t test_content_trigger.robot --all | ||
# | ||
# Run this robot test with robot server (which is faster): | ||
# | ||
# 1) Start robot server: | ||
# | ||
# $ bin/robot-server --reload-path src collective.ifttt.testing.COLLECTIVE_IFTTT_ACCEPTANCE_TESTING | ||
# | ||
# 2) Run robot tests: | ||
# | ||
# $ bin/robot src/collective/ifttt/tests/robot/test_content_trigger.robot | ||
# | ||
# for debug mode | ||
# $ bin/robot-debug src/collective/ifttt/tests/robot/test_content_trigger.robot | ||
|
||
# See the http://docs.plone.org for further details (search for robot | ||
# framework). | ||
# | ||
# ============================================================================ | ||
|
||
*** Settings *** | ||
|
||
Resource plone/app/robotframework/selenium.robot | ||
Resource plone/app/robotframework/keywords.robot | ||
Resource Selenium2Screenshots/keywords.robot | ||
|
||
Library Remote ${PLONE_URL}/RobotRemote | ||
Library Selenium2Screenshots | ||
|
||
Test Setup Test Setup | ||
Test Teardown Close all browsers | ||
|
||
*** Variables *** | ||
|
||
${SELENIUM2LIBRARY_RUN_ON_FAILURE} Capture page screenshot | ||
${SCREENSHOTS} false | ||
|
||
|
||
*** Test Cases *** | ||
|
||
Scenario: As a site administrator I cannot see Content Trigger actions form if secret key is not filled | ||
Given I'm logged in as a Site Administrator | ||
And I goto home page | ||
Then I check the 'Add IFTTT Content Trigger' action menu item | ||
|
||
Scenario: As a site administrator I can see Content Trigger actions form | ||
Given I'm logged in as a Site Administrator | ||
And I fill secret key | ||
And I goto home page | ||
When I trigger the 'Add IFTTT Content Trigger' action menu item | ||
Then check 'This will add new IFTTT Trigger' on pagecontent | ||
|
||
Scenario: As a site administrator I can configure Content Trigger action | ||
Given I'm logged in as a Site Administrator | ||
And I fill secret key | ||
And I goto home page | ||
And I trigger the 'Add IFTTT Content Trigger' action menu item | ||
When I fill Content Trigger form | ||
Then I see 'Successfully applied the IFTTT event test_event to Plone site' on success | ||
|
||
*** Keywords *** | ||
|
||
# --- Given ------------------------------------------------------------------ | ||
|
||
I'm logged in as a Site Administrator | ||
Enable autologin as Site Administrator | ||
|
||
I fill secret key | ||
Goto ${PLONE_URL}/@@collectiveifttt-controlpanel | ||
check 'IFTTT Settings' on pagecontent | ||
input 'secret' into 'form.widgets.ifttt_secret_key' textinput | ||
press 'Save' clickbutton | ||
check 'Changes' on pagecontent | ||
|
||
I goto home page | ||
GOTO ${PLONE_URL}/ | ||
|
||
# --- WHEN ------------------------------------------------------------------- | ||
|
||
I check the 'Add IFTTT Content Trigger' action menu item | ||
Element should not be visible xpath=//li[@id='plone-contentmenu-actions']/a | ||
|
||
I trigger the '${action}' action menu item | ||
Element should be visible xpath=//li[@id='plone-contentmenu-actions']/a | ||
Click link xpath=//li[@id='plone-contentmenu-actions']/a | ||
Wait until element is visible id=plone-contentmenu-actions-${action} | ||
Click link id=plone-contentmenu-actions-${action} | ||
|
||
I fill Content Trigger form | ||
input 'test_event' into 'form-widgets-ifttt_event_name' textinput | ||
select 'Collection' into 'form-widgets-content_types-from' selectbox | ||
press 'from2toButton' clickbutton | ||
select 'Event' into 'form-widgets-content_types-from' selectbox | ||
press 'from2toButton' clickbutton | ||
select 'File' into 'form-widgets-content_types-from' selectbox | ||
press 'from2toButton' clickbutton | ||
press 'form.buttons.add' clickbutton | ||
|
||
# --- THEN ------------------------------------------------------------------- | ||
|
||
I see '${sucess_message}' on success | ||
Page should contain ${sucess_message} | ||
|
||
Test Setup | ||
Open test browser | ||
# Set Window Size 1280 720 | ||
|
||
|
||
# --- selenium library keywords ------------------------------------------------------------------- | ||
|
||
select '${select}' into '${id}' selectbox | ||
Select from list by value id=${id} ${select} | ||
|
||
press '${value}' clickbutton | ||
Click button ${value} | ||
|
||
input '${value}' into '${field}' textinput | ||
Input text ${field} ${value} | ||
|
||
press '${value}' into '${id}' clickoverlaybutton | ||
Click button ${id} ${value} | ||
|
||
check '${text}' on pagecontent | ||
Wait until page contains ${text} | ||
|
||
check element '${text}' on pagecsscontent | ||
Wait until page contains element ${text} | ||
|
||
check '${text}' on instantpage | ||
Page should contain ${text} | ||
|
||
check element '${text}' on instantpagecss | ||
Page should contain element ${text} | ||
|
||
sleep for '${duration}' | ||
Sleep time_=${duration} |
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
Oops, something went wrong.