Skip to content
Snippets Groups Projects
Commit 6ec45414 authored by Rajab Natshah's avatar Rajab Natshah
Browse files

Issue #3120794: Fix Automated Functional Acceptance tests

parent e1097b48
No related branches found
No related tags found
No related merge requests found
......@@ -61,6 +61,28 @@ default:
browser: 'chrome'
# browser: 'phantomjs'
nativeEvents: true
marionette: true
browserName: chrome
version: "*"
extra_capabilities:
chromeOptions:
w3c: false
chrome:
switches:
# - "--headless"
- "--disable-web-security"
- "--DNS-prefetch-disable"
- "--whitelisted-ips"
- "--start-maximized"
- "--disable-translate"
- "--ignore-certificate-errors"
- "--test-type"
- "--disable-dev-shm-usage"
- "--disable-extensions"
- "incognito"
- "enable-precise-memory-info"
- "js-flags=--expose-gc"
- "no-sandbox"
base_url: 'http://127.0.0.1:8080'
# browser_name: 'firefox'
browser_name: 'chrome'
......
......@@ -282,7 +282,7 @@ class VarbaseContext extends RawDrupalContext implements SnippetAcceptingContext
* Varbase Context #varbase.
*
* Example 1: When I press the "Apply" button under the editor media browser
* Example 2: When I press the "Submit" button under the editor media browser.
* Example 2: And I press the "Submit" button under the editor media browser.
*
* @When /^I press (?:|the )"([^"]*)" button under the editor media browser$/
*/
......@@ -925,7 +925,7 @@ class VarbaseContext extends RawDrupalContext implements SnippetAcceptingContext
if (preg_match($regex, $actual)) {
$found = TRUE;
break;
break;
}
}
if (!$found) {
......@@ -969,7 +969,7 @@ class VarbaseContext extends RawDrupalContext implements SnippetAcceptingContext
if (preg_match($regex, $actual)) {
$found = TRUE;
$element->click();
break;
break;
}
}
if (!$found) {
......@@ -1491,7 +1491,7 @@ JS;
*/
public function theMediaBrowserIsOpen($entityBrowserIframeId) {
if (!$this->getSession()->getPage()->find('css', '.ui-dialog.ui-widget-content')) {
throw new Exception('The media browser failed to open.');
throw new \Exception('The media browser failed to open.');
}
if (!$this->getSession()->getPage()->find('css', "#$entityBrowserIframeId")) {
......@@ -1583,4 +1583,17 @@ JS;
return $element->getAttribute($attributeName);
}
/**
* Select a paragraph component.
*
* Varbase Context #varbase.
*
* Example 1: When I select the "Drupal block" paragraph component
* Example 2: And I select the "Modal" paragraph component
*
* @When /^I select (?:|the )"([^"]*)" paragraph component$/
*/
public function iSelectTheParagraphComponent($value) {
$this->getSession()->getPage()->find('xpath', '//*[contains(@class, "paragraphs-add-dialog") and contains(@class, "ui-dialog-content")]//*[contains(@name, "'. $value . '")]')->click();
}
}
......@@ -40,11 +40,11 @@ So that the "Landing page" will show up having paragrpahs of different types
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 wait for AJAX to finish
And I wait for 5 seconds
And I wait for 1 second
And I press "+ Add"
And I wait for AJAX to finish
And I wait for 5 seconds
And I press "Drupal Block"
And I wait for 1 second
And I select the "bp_block" paragraph component
And I wait for AJAX to finish
Then I should see "Block"
When I select "Site branding" from "Block"
......@@ -61,11 +61,11 @@ So that the "Landing page" will show up having paragrpahs of different types
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 wait for AJAX to finish
And I wait for 5 seconds
And I wait for 1 second
And I press "+ Add"
And I wait for AJAX to finish
And I wait for 5 seconds
And I press "Columns (Equal)"
And I wait for 1 second
And I select the "bp_columns" paragraph component
And I wait for AJAX to finish
And I press "Save"
And I wait
......@@ -79,11 +79,11 @@ So that the "Landing page" will show up having paragrpahs of different types
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 wait for AJAX to finish
And I wait for 5 seconds
And I wait for 1 second
And I press "+ Add"
And I wait for AJAX to finish
And I wait for 5 seconds
And I press "Columns (Two Uneven)"
And I wait for 1 second
And I select the "bp_columns_two_uneven" paragraph component
And I wait for AJAX to finish
And I press "Save"
And I wait
......@@ -97,18 +97,18 @@ So that the "Landing page" will show up having paragrpahs of different types
And I fill in "Test Landing page Modal" for "Title"
And I fill in "Test Landing page description Modal" for "Page description"
And I wait for AJAX to finish
And I wait for 5 seconds
And I wait for 1 second
And I press "+ Add"
And I wait for AJAX to finish
And I wait for 5 seconds
And I press "Modal"
And I wait for 1 second
And I select the "bp_modal" paragraph component
And I wait for AJAX to finish
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 press "Add Component"
And I wait for AJAX to finish
And I press "field_lp_paragraphs_0_subform_bp_modal_body_bp_simple_add_more"
And I select the "bp_simple" paragraph component
And I wait
Then I should see "Modal body"
And I fill in the rich text editor field "Text" with "Modal Body test"
......@@ -126,11 +126,11 @@ So that the "Landing page" will show up having paragrpahs of different types
And I fill in "Test Landing page Rich Text" for "Title"
And I fill in "Test Landing page description Rich Text" for "Page description"
And I wait for AJAX to finish
And I wait for 5 seconds
And I wait for 1 second
And I press "+ Add"
And I wait for AJAX to finish
And I wait for 5 seconds
And I press "Rich Text"
And I wait for 1 second
And I select the "bp_simple" paragraph component
And I wait for AJAX to finish
Then I should see "Components"
When I fill in the rich text editor field "Text" with "Rich Text test"
......@@ -147,17 +147,17 @@ So that the "Landing page" will show up having paragrpahs of different types
And I fill in "Test Landing page Tabs" for "Title"
And I fill in "Test Landing page description Tabs" for "Page description"
And I wait for AJAX to finish
And I wait for 5 seconds
And I wait for 1 second
And I press "+ Add"
And I wait for AJAX to finish
And I wait for 5 seconds
And I press "Tabs"
And I wait for 1 second
And I select the "bp_tabs" paragraph component
And I wait for AJAX to finish
Then I should see "Components"
When I fill in "Tab 1" for "Tab name"
And I press "Add Component"
And I wait for AJAX to finish
And I press "field_lp_paragraphs_0_subform_bp_tab_section_0_subform_bp_tab_section_body_bp_simple_add_more"
And I select the "bp_simple" paragraph component
And I wait
Then I should see "Tab body"
And I fill in the rich text editor field "Text" with "Tab 1 - Body test"
......@@ -174,11 +174,11 @@ So that the "Landing page" will show up having paragrpahs of different types
And I fill in "Test Landing page WebForm" for "Title"
And I fill in "Test Landing page description WebForm" for "Page description"
And I wait for AJAX to finish
And I wait for 5 seconds
And I wait for 1 second
And I press "+ Add"
And I wait for AJAX to finish
And I wait for 5 seconds
And I press "Webform"
And I wait for 1 second
And I select the "bp_webform" paragraph component
And I wait for AJAX to finish
Then I should see "Components"
When I select "Contact" from "Webform"
......
......@@ -33,48 +33,50 @@ So that the "Landing page" will have text and images in right and left view.
# Add Rich text centered
And I wait for AJAX to finish
And I wait for 5 seconds
And I wait for 1 second
And I press "+ Add"
And I wait for AJAX to finish
And I wait for 5 seconds
And I press "Rich Text"
And I wait for 1 second
And I select the "bp_simple" paragraph component
And I wait for AJAX to finish
And I fill in the rich text editor field "Text" with "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur tortor diam, interdum in quam in, vehicula varius sem. Sed eu augue diam. Proin elementum bibendum tristique. Nam at ante sem. Mauris suscipit felis eget orci porttitor, feugiat viverra elit commodo. Proin quis erat laoreet, tempor nisl nec, varius quam. Maecenas malesuada est sollicitudin euismod posuere."
And I fill in the rich text editor field "Text" with "Lorem ipsum dolor sit amet1, consectetur adipiscing elit. Curabitur tortor diam, interdum in quam in, vehicula varius sem. Sed eu augue diam. Proin elementum bibendum tristique. Nam at ante sem. Mauris suscipit felis eget orci porttitor, feugiat viverra elit commodo. Proin quis erat laoreet, tempor nisl nec, varius quam. Maecenas malesuada est sollicitudin euismod posuere."
And 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"
And I wait
Then I should see "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur tortor diam, interdum in quam in, vehicula varius sem. Sed eu augue diam. Proin elementum bibendum tristique. Nam at ante sem. Mauris suscipit felis eget orci porttitor, feugiat viverra elit commodo. Proin quis erat laoreet, tempor nisl nec, varius quam. Maecenas malesuada est sollicitudin euismod posuere." in the "p" element with the "class" attribute set to "text-align-center"
Then I should see "Rich Text"
# Add Text and Image -> image to the right
#
# When I go to "admin/content"
# And I wait
# Then I should see "Content"
# When I fill in "Test landing page title for text and image paragraphs" for "Title"
# And I press the "Filter" button
# And I wait
# Then I should see "Test landing page title for text and image paragraphs"
# When I click "Edit" in the "Test landing page title for text and image paragraphs" row
# And I wait
# Then I should see "Test landing page title for text and image paragraphs"
# And I wait
# And I scrolldown
# And I wait for AJAX to finish
# And I wait
# And I press "+ Add"
# And I wait for AJAX to finish
# And I wait
# And I press "Text and image"
# And I wait for AJAX to finish
# And I fill in the rich text editor field "Text" with "In eros ipsum, mattis vitae vulputate eu, blandit non risus. Maecenas ultricies volutpat massa id hendrerit. Phasellus magna quam, lacinia sed justo pulvinar, tristique finibus felis. Quisque in sagittis tellus. Curabitur in est at quam maximus elementum. Pellentesque interdum tincidunt nisl, ac efficitur elit aliquam id. Integer egestas neque ut risus tincidunt semper."
# And 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"
# And I wait for AJAX to finish
# Then I should see "Select Image(s)"
# And I press "Save"
# And I wait
# Then I should see the "0" "wrapper" with "align2left" class
When I press "+ Add"
And I wait for AJAX to finish
And I wait for 1 second
And I select the "text_and_image" paragraph component
And I wait for AJAX to finish
And I wait 5s
Then I should see "Text and image"
When I press "field_lp_paragraphs_1_subform_field_image_entity_browser_entity_browser"
And I wait for AJAX to finish
And I wait 5s
Then the "entity_browser_iframe_image_browser" media browser should be open
When I switch to iframe "entity_browser_iframe_image_browser"
And I wait 5s
Then I should see "Media name"
When I fill in "Flag Earth" for "Media name"
And I press the "Search" button
And wait max of 5s
Then I should see image with the "Flag Earth all earth in space" title text
When I double click on the image with the "Flag Earth all earth in space" title text
And I wait for AJAX to finish
And wait max of 5s
And I switch to parent
And I wait for AJAX to finish
And wait max of 5s
When I click "Text"
And I fill in the rich text editor field "Text" with "In eros ipsum, mattis vitae vulputate eu, blandit non risus. Maecenas ultricies volutpat massa id hendrerit. Phasellus magna quam, lacinia sed justo pulvinar, tristique finibus felis. Quisque in sagittis tellus. Curabitur in est at quam maximus elementum. Pellentesque interdum tincidunt nisl, ac efficitur elit aliquam id. Integer egestas neque ut risus tincidunt semper."
And 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"
And I wait
Then I should see "In eros ipsum, mattis vitae vulputate eu, blandit"
And I should see image with the "Flag Earth all earth in space" title text
......@@ -10,11 +10,10 @@ I want to be able to clone an entity.
And I fill in "Test Clone landing page" for "Title"
And I fill in "Test landing page description text" for "Page description"
And I wait for AJAX to finish
And I wait for 5 seconds
And I wait for 1 second
And I press "+ Add"
And I wait for AJAX to finish
And I wait for 5 seconds
And I press "Modal"
And I select the "bp_modal" paragraph component
And I wait for AJAX to finish
Then I should see "Components"
When I fill in "Modal button" for "Modal button text"
......@@ -24,7 +23,7 @@ I want to be able to clone an entity.
And I press "Add Component"
And I wait for AJAX to finish
And I wait
And I press "field_lp_paragraphs_0_subform_bp_modal_body_bp_simple_add_more"
And I select the "bp_simple" paragraph component
And I wait
Then I should see "Modal body"
And I fill in the rich text editor field "Text" with "Modal Body test"
......
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