Skip to content
Snippets Groups Projects
Commit 74303db3 authored by Yasmeen Abuerrub's avatar Yasmeen Abuerrub Committed by Rajab Natshah
Browse files

Issue #2894140 by yasmeensalah: Added the 26 [ Feature: Content Structure...

Issue #2894140 by yasmeensalah: Added the 26 [ Feature: Content Structure Features - Landing Pages - Varbase text and image paragraphs] Automated Functional Test
parent b610bec5
No related branches found
No related tags found
No related merge requests found
......@@ -96,6 +96,7 @@ before_script:
- drush -y en varbase_heroslider_media -vvv
- drush -y en varbase_carousels -vvv
- drush -y en varbase_search -vvv
- drush -y en vbp_text_and_image -vvv
script:
- cd ./profiles/varbase
......
......@@ -484,8 +484,8 @@ class VarbaseContext extends RawDrupalContext implements SnippetAcceptingContext
}
$this->getSession()->executeScript("CKEDITOR.instances[\"$fieldId\"].execCommand( '$selectorCommand' );");
}
}
/**
* #varbase : To append text at the end of a rich text editor field WYSIWYG with content
......@@ -1361,14 +1361,14 @@ JS;
/**
* #varbase: To expand a select list by it's class attribute.
*
* @When I Expand the select list :arg1
* @When I Expand the :nth select list :arg1
*
* @param $text
* @throws \InvalidArgumentException
*/
public function iExpandTheSelectList($listClassName) {
public function iExpandTheSelectList($index, $listClassName) {
$js = <<<JS
var group = document.getElementsByClassName("{$listClassName}")[0];
var group = document.getElementsByClassName("{$listClassName}")[{$index}];
group.className += "open";
JS;
$this->getSession()->executeScript($js);
......@@ -1461,4 +1461,19 @@ JS;
public function maximizeWindow() {
$this->getSession()->getDriver()->maximizeWindow();
}
/**
* Find the :nth element having the first attribute
* and check if it's have the second one.
*
* @Then I should see the :nth :arg1 with :arg2 class
*/
public function iShouldSeeTheHaveAttribute($index, $wrapper, $position) {
$items = $this->getSession()->getPage()->findAll('css', '.' . $wrapper);
$item = $items[$index]->find('css', '.' . $wrapper . '.' . $position);
if (!$item) {
throw new Exception("The image position is wrong");
}
}
}
......@@ -10,14 +10,14 @@ So that the "Landing page" will show up having paragrpahs of different types
And I wait
And I fill in "Test Landing page Carousel" for "Title"
And I fill in "Test Landing page description Carousel" for "Page description"
And I Expand the select list "dropbutton-multiple"
And I Expand the "0" select list "dropbutton-multiple"
And I wait
And I scrolldown
And I press "Add Carousel"
And I wait for AJAX to finish
And I scrolldown
And I select "2 Seconds" from "Slide Interval"
And I Expand the select list "dropbutton-multiple"
And I Expand the "0" select list "dropbutton-multiple"
And I wait
And I press "Add Image"
And I wait for AJAX to finish
......@@ -32,7 +32,7 @@ So that the "Landing page" will show up having paragrpahs of different types
When I double click on the image with the "Embed Flag Earth all earth in space" title text
And I switch to main frame
And I wait
And I Expand the select list "dropbutton-multiple"
And I Expand the "0" select list "dropbutton-multiple"
And I wait
And I press "Add Image"
And I wait for AJAX to finish
......@@ -60,7 +60,7 @@ So that the "Landing page" will show up having paragrpahs of different types
And I wait
And I fill in "Test Landing page Accordion" for "Title"
And I fill in "Test Landing page description Accordion" for "Page description"
And I Expand the select list "dropbutton-multiple"
And I Expand the "0" select list "dropbutton-multiple"
And I wait
And I press "Add Accordion"
And I wait for AJAX to finish
......@@ -79,7 +79,7 @@ So that the "Landing page" will show up having paragrpahs of different types
And I wait
And I switch to main frame
And I fill in "Accordion Section Title test" for "Accordion Section Title"
When I Expand the select list "dropbutton-multiple"
When I Expand the "0" select list "dropbutton-multiple"
And I press "Add Simple"
And I wait
Then I should see "Accordion Section Body"
......@@ -97,7 +97,7 @@ So that the "Landing page" will show up having paragrpahs of different types
And I wait
And I fill in "Test Landing page Drupal Block" for "Title"
And I fill in "Test Landing page description Drupal Block" for "Page description"
And I Expand the select list "dropbutton-multiple"
And I Expand the "0" select list "dropbutton-multiple"
And I wait
And I scrolldown
And I press the "Add Drupal Block" button
......@@ -117,7 +117,7 @@ So that the "Landing page" will show up having paragrpahs of different types
And I wait
And I fill in "Test Landing page Columns (Equal)" for "Title"
And I fill in "Test Landing page description Columns (Equal)" for "Page description"
And I Expand the select list "dropbutton-multiple"
And I Expand the "0" select list "dropbutton-multiple"
And I wait
And I scrolldown
And I press "Add Columns (Equal)"
......@@ -136,7 +136,7 @@ So that the "Landing page" will show up having paragrpahs of different types
When I double click on the image with the "Embed Flag Earth all earth in space" title text
And I switch to main frame
When I Expand the select list "dropbutton-multiple"
When I Expand the "0" select list "dropbutton-multiple"
And I scrollup
And I press "Add Image"
And I wait for AJAX to finish
......@@ -152,7 +152,7 @@ So that the "Landing page" will show up having paragrpahs of different types
And I switch to main frame
And I wait for AJAX to finish
When I Expand the select list "dropbutton-multiple"
When I Expand the "0" select list "dropbutton-multiple"
And I press "Add Image"
And I wait for AJAX to finish
And I scrolldown
......@@ -178,7 +178,7 @@ So that the "Landing page" will show up having paragrpahs of different types
And I wait
And I fill in "Test Landing page Columns (Two Uneven)" for "Title"
And I fill in "Test Landing page description Columns (Two Uneven)" for "Page description"
And I Expand the select list "dropbutton-multiple"
And I Expand the "0" select list "dropbutton-multiple"
And I wait
And I scrolldown
And I press "Add Columns (Two Uneven)"
......@@ -197,7 +197,7 @@ So that the "Landing page" will show up having paragrpahs of different types
And I switch to main frame
And I wait
And I Expand the select list "dropbutton-multiple"
And I Expand the "0" select list "dropbutton-multiple"
And I scrollup
And I press "Add Image"
And I wait for AJAX to finish
......@@ -212,7 +212,7 @@ So that the "Landing page" will show up having paragrpahs of different types
When I double click on the image with the "Embed Flag Earth all earth in space" title text
And I switch to main frame
And I wait
And I Expand the select list "dropbutton-multiple"
And I Expand the "0" select list "dropbutton-multiple"
And I press "Add Image"
And I wait for AJAX to finish
And I scrolldown
......@@ -238,7 +238,7 @@ So that the "Landing page" will show up having paragrpahs of different types
And I wait
And I fill in "Test Landing page Columns (Three Uneven)" for "Title"
And I fill in "Test Landing page description Columns (Two Uneven)" for "Page description"
And I Expand the select list "dropbutton-multiple"
And I Expand the "0" select list "dropbutton-multiple"
And I wait
And I scrolldown
And I press "Add Columns (Three Uneven)"
......@@ -257,7 +257,7 @@ So that the "Landing page" will show up having paragrpahs of different types
And I switch to main frame
And I wait
And I Expand the select list "dropbutton-multiple"
And I Expand the "0" select list "dropbutton-multiple"
And I scrollup
And I press "Add Image"
And I wait for AJAX to finish
......@@ -273,7 +273,7 @@ So that the "Landing page" will show up having paragrpahs of different types
And I switch to main frame
And I wait
And I Expand the select list "dropbutton-multiple"
And I Expand the "0" select list "dropbutton-multiple"
And I press "Add Image"
And I wait for AJAX to finish
And I scrolldown
......@@ -289,7 +289,7 @@ So that the "Landing page" will show up having paragrpahs of different types
And I switch to main frame
And I wait for AJAX to finish
And I Expand the select list "dropbutton-multiple"
And I Expand the "0" select list "dropbutton-multiple"
And I press "Add Simple"
And I wait for AJAX to finish
And I fill in the rich text editor field "Text" with "Simple text test - column Three"
......@@ -304,7 +304,7 @@ So that the "Landing page" will show up having paragrpahs of different types
And I wait
And I fill in "Test Landing page Image" for "Title"
And I fill in "Test Landing page description Image" for "Page description"
And I Expand the select list "dropbutton-multiple"
And I Expand the "0" select list "dropbutton-multiple"
And I wait
And I scrolldown
And I press "Add Image"
......@@ -332,7 +332,7 @@ So that the "Landing page" will show up having paragrpahs of different types
And I wait
And I fill in "Test Landing page Modal" for "Title"
And I fill in "Test Landing page description Modal" for "Page description"
And I Expand the select list "dropbutton-multiple"
And I Expand the "0" select list "dropbutton-multiple"
And I wait
And I scrolldown
And I press "Add Modal"
......@@ -340,7 +340,7 @@ So that the "Landing page" will show up having paragrpahs of different types
Then I should see "Components"
When I fill in "Modal button" for "Modal Button Text"
And I fill in "Modal title" for "Modal Title"
And I Expand the select list "dropbutton-multiple"
And I Expand the "0" select list "dropbutton-multiple"
And I press "Add Simple"
And I wait
Then I should see "Modal Body"
......@@ -359,7 +359,7 @@ So that the "Landing page" will show up having paragrpahs of different types
And I wait
And I fill in "Test Landing page Simple" for "Title"
And I fill in "Test Landing page description Simple" for "Page description"
And I Expand the select list "dropbutton-multiple"
And I Expand the "0" select list "dropbutton-multiple"
And I wait
And I scrolldown
And I press "Add Simple"
......@@ -392,7 +392,7 @@ So that the "Landing page" will show up having paragrpahs of different types
And I wait
And I fill in "Test Landing page Tabs" for "Title"
And I fill in "Test Landing page description Tabs" for "Page description"
And I Expand the select list "dropbutton-multiple"
And I Expand the "0" select list "dropbutton-multiple"
And I wait
And I scrolldown
And I press "Add Tabs"
......@@ -412,7 +412,7 @@ So that the "Landing page" will show up having paragrpahs of different types
And I switch to main frame
And I should see "Components"
And I fill in "Tab 1" for "Tab Name"
And I Expand the select list "dropbutton-multiple"
And I Expand the "0" select list "dropbutton-multiple"
And I press "Add Simple"
And I wait
Then I should see "Tab Body"
......@@ -430,7 +430,7 @@ So that the "Landing page" will show up having paragrpahs of different types
And I wait
And I fill in "Test Landing page WebForm" for "Title"
And I fill in "Test Landing page description WebForm" for "Page description"
And I Expand the select list "dropbutton-multiple"
And I Expand the "0" select list "dropbutton-multiple"
And I wait
And I scrolldown
And I press "Add Webform"
......
Feature: Content Structure Features - Landing Pages - Varbase text and image paragraphs.
As a logged in user with a permission to mange Landing pages
I want to be able to create a new Landing page that will look like this page https://www.getopensocial.com/features
So that the "Landing page" will look like this page https://www.getopensocial.com/features
@javascript @local @development
Scenario: Check if a user with a permission to manage "Landing page" content type create a new Landing page that will look like this page https://www.getopensocial.com/features
Given I am a logged in user with the "test_site_admin" user
When I go to "node/add/landing_page"
And I wait
And I fill in "Open Social Features" for "Title"
And I fill in "Greenpeace Greenwire social network spurs 600% increase in volunteering" for "Page description"
# Add Simple text centered
And I Expand the "0" select list "dropbutton-multiple"
And I wait
And I scrolldown
And I press "Add Simple"
And I wait for AJAX to finish
And I fill in the rich text editor field "Text" with "Open Social allows people to collaborate, organise and find the right talent at the right moment. It is especially suitable for volunteer communities within NGO organisations and to replace existing (proprietary) intranets"
When I select all text in "Text" field
And I click on "justifycenter" command button in the rich text editor field "Text"
And I wait
And I press "Save"
Then I should see "Open Social allows people to collaborate, organise and find the right talent at the right moment. It is especially suitable for volunteer communities within NGO organisations and to replace existing (proprietary) intranets" in the "p" element with the "class" attribute set to "text-align-center"
# Add Text and Image -> image to the right
When I click "Edit"
And I wait
And I scrolldown
And I Expand the "1" select list "dropbutton-multiple"
And I wait
And I press "Add Text and image"
And I wait for AJAX to finish
And I fill in the rich text editor field "Text" with "Activity streams The activity stream gives all of your users a personalized overview of your community Our algorithms ensure you only see updates that are relevant to you. For example; if someone likes your post or comments in a group you are following, this will be shown in your timeline Our personalized activity stream is central to all the interactions of individual community members. A lively and engaging timeline will keep your users coming back for more"
When I select all text in "Text" field
And I click on "justifycenter" command button in the rich text editor field "Text"
And I wait
And I click "Image"
Then I press the "Select an image" button
And I wait for AJAX to finish
When the image media browser should be open
And I switch to iframe "entity_browser_iframe_image_browser"
And I fill in "Embed Flag Earth" for "Search keywords"
And I press the "Search" button
And I wait for AJAX to finish
Then I should see image with the "Embed Flag Earth all earth in space" title text
When I double click on the image with the "Embed Flag Earth all earth in space" title text
And I switch to main frame
And I wait
Then I Expand the field "styling-settings"
And I select "Grey light" from "Background Color"
And I click "Content settings"
And I select "Right" from "Image position"
And I press "Save"
Then I should see the "0" "wrapper" with "align2left" class
# Add Text and Image -> image to the left
When I click "Edit"
And I wait
And I scrolldown
And I Expand the "2" select list "dropbutton-multiple"
And I wait
And I press "Add Text and image"
And I wait for AJAX to finish
And I fill in the rich text editor field "Text" with "Events Events connect your on- and offline experiences Your community members can enroll to both private and public events. Event managers set the location and date and control visibility settings. Users can follow events and post comments to keep the discussion rolling or organize their own Events bridge the gap between the on- and offline engagement of your community members. Getting people aligned along common interests ensures the long term health of your community. This makes events a critical part of any successful community building effort"
When I select all text in "Text" field
And I click on "justifycenter" command button in the rich text editor field "Text"
And I wait
And I click "Image"
Then I press the "Select an image" button
And I wait for AJAX to finish
When the image media browser should be open
And I switch to iframe "entity_browser_iframe_image_browser"
And I fill in "Embed Flag Earth" for "Search keywords"
And I press the "Search" button
And I wait for AJAX to finish
Then I should see image with the "Embed Flag Earth all earth in space" title text
When I double click on the image with the "Embed Flag Earth all earth in space" title text
And I switch to main frame
And I wait
Then I Expand the field "styling-settings"
And I click "Content settings"
And I select "Medium" from "Width"
And I select "Left" from "Image position"
And I press "Save"
Then I should see the "1" "wrapper" with "align2right" class
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment