From 574c11a834eed5486ce9c78b70e2460ecf1c6230 Mon Sep 17 00:00:00 2001 From: Mike Parkhill Date: Fri, 7 Jun 2013 16:10:21 +0200 Subject: [PATCH] Behat: "Insert image from web" feature Partially fixes https://github.com/silverstripe/silverstripe-cms/issues/628 Modified a bit by Ingo :) --- tests/behat/features/insert-an-image.feature | 26 ++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 tests/behat/features/insert-an-image.feature diff --git a/tests/behat/features/insert-an-image.feature b/tests/behat/features/insert-an-image.feature new file mode 100644 index 000000000..8b5614eb9 --- /dev/null +++ b/tests/behat/features/insert-an-image.feature @@ -0,0 +1,26 @@ +Feature: Insert an image into a page +As a cms author +I want to insert an image into a page +So that I can insert them into my content efficiently + +Background: +Given a "page" "About Us" +Given I am logged in with "ADMIN" permissions +And I go to "/admin/pages" +Then I should see "About Us" in CMS Tree + +@javascript +Scenario: I can insert images into the content +When I follow "About Us" +Then I should see an edit page form + +When I press the "Insert Media" button +Then I should see "Choose files to upload..." + +When I press the "From the web" button +And I fill in "RemoteURL" with "http://www.silverstripe.com/themes/sscom/images/silverstripe_logo_web.png" +And I press the "Add url" button +Then I should see "silverstripe_logo_web.png (www.silverstripe.com)" in the ".ss-assetuploadfield span.name" element + +When I press the "Update" button +Then the "Content" HTML field should contain "silverstripe_logo_web.png"