Skip to content

Commit 6b5d77a

Browse files
committed
MAGETWO-56197: Write functional test for MAGETWO-47822
- Adding new functional test for verifying admin account sharing option availability.
1 parent 9e22e0a commit 6b5d77a

File tree

7 files changed

+45
-21
lines changed

7 files changed

+45
-21
lines changed
Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,26 @@
11
<?php
2-
2+
/**
3+
* Copyright © 2016 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
36
namespace Magento\Email\Test\Block\Adminhtml\Template\Edit;
47

58
use Magento\Mtf\Block\Form;
69
use Magento\Mtf\Client\Locator;
710

811
/**
9-
* Synonyms edit form in admin.
10-
*/
11-
/* this class needs to be created becuase we have a customized click on the 'Load' button, its not a standard click
12+
Click Load button in Email template form.
13+
this class needs to be created becuase we need a customized click on the 'Load' button, its not a standard click
1214
*/
1315
class TemplateForm extends Form
1416
{
15-
protected $loadButton = "#load";
17+
private $loadButton = "#load";
1618

19+
/**
20+
*
21+
*/
1722
public function clickLoadTemplate() {
18-
$element = $this->_rootElement->find($this->loadButton, Locator::SELECTOR_CSS); // find this element
19-
$element->click(); // perform the action
23+
$element = $this->_rootElement->find($this->loadButton, Locator::SELECTOR_CSS); // locate the Load button
24+
$element->click(); // click the load button
2025
}
2126
}

dev/tests/functional/tests/app/Magento/Email/Test/Block/Adminhtml/Template/Edit/TemplateForm.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
12
<mapping strict="1">
23
<fields>
34
<template_select>

dev/tests/functional/tests/app/Magento/Email/Test/Constraint/AssertEmailTemplateSuccessSaveMessage.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,10 @@
1010
*/
1111
class AssertEmailTemplateSuccessSaveMessage extends AbstractConstraint
1212
{
13+
const SUCCESS_MESSAGE = 'You saved the email template.';
14+
1315
/**
14-
* Check Success Save Message for Email Template.
15-
*
1616
* @param EmailTemplateIndex $emailTemplateIndex
17-
* @return void
1817
*/
1918
public function processAssert(EmailTemplateIndex $emailTemplateIndex)
2019
{

dev/tests/functional/tests/app/Magento/Email/Test/Page/Adminhtml/EmailTemplateIndex.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
/**
4+
* Copyright © 2016 Magento. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
28
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/etc/pages.xsd">
39
<page name="EmailTemplateIndex" area="Adminhtml" mca="admin/email_template/" module="Magento_Email">
410
<block name="pageActionsBlock" class="Magento\Backend\Test\Block\GridPageActions" locator=".page-main-actions" strategy="css selector"/>

dev/tests/functional/tests/app/Magento/Email/Test/Page/Adminhtml/EmailTemplateNew.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
/**
4+
* Copyright © 2016 Magento. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
28
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/etc/pages.xsd">
39
<page name="EmailTemplateNew" area="Adminhtml" mca="admin/email_template/new/" module="Magento_Email">
410
<block name="templateForm" class="Magento\Email\Test\Block\Adminhtml\Template\Edit\TemplateForm" locator="[id='page:main-container']" strategy="css selector" />

dev/tests/functional/tests/app/Magento/Email/Test/TestCase/CreateEmailTemplateEntityTest.php

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
<?php
2+
/**
3+
* Copyright © 2016 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
26

37
namespace Magento\Email\Test\TestCase;
48

59
use Magento\Mtf\TestCase\Injectable;
6-
use Magento\Search\Test\Fixture\Synonym;
710
use Magento\Email\Test\Page\Adminhtml\EmailTemplateIndex;
811
use Magento\Email\Test\Page\Adminhtml\EmailTemplateNew;
912
use Magento\Email\Test\Fixture\EmailTemplate;
13+
1014
/**
1115
* Steps:
1216
* 1. Log in to Admin.
@@ -15,14 +19,14 @@
1519
* 4. Select Email Template.
1620
* 5. Click the "Load Template" button.
1721
* 6. Enter Email Template name.
18-
* 7. Verify the email template saved successfully.
19-
*
22+
* 7. Click the "Save" button.
23+
* 8. Verify the email template saved successfully.
2024
* @group Email_(PS)
2125
* @ZephyrId MAGETWO-17155
2226
*/
27+
2328
class CreateEmailTemplateEntityTest extends Injectable
2429
{
25-
2630
/* tags */
2731
const MVP = 'yes';
2832
const DOMAIN = 'PS';
@@ -44,7 +48,7 @@ class CreateEmailTemplateEntityTest extends Injectable
4448
private $emailTemplateNew;
4549

4650
/**
47-
* Inject synonym pages.
51+
* Inject Email template pages.
4852
*
4953
* @param EmailTemplateIndex $EmailTemplateIndex
5054
* @param EmailTemplateNew $EmailTemplateNew
@@ -59,18 +63,15 @@ public function __inject(
5963
}
6064

6165
/**
62-
* Create Email Template test.
63-
*
64-
* @param Synonym $synonym
65-
* @return void
66+
* @param EmailTemplate $EmailTemplate
6667
*/
68+
6769
public function test(EmailTemplate $EmailTemplate)
6870
{
6971
$this->emailTemplateIndex->open();
7072
$this->emailTemplateIndex->getPageActionsBlock()->addNew();
7173
$this->emailTemplateNew->getTemplateForm()->fill($EmailTemplate);
7274
$this->emailTemplateNew->getTemplateForm()->clickLoadTemplate();
7375
$this->emailTemplateNew->getFormPageActions()->save();
74-
sleep(10);
7576
}
7677
}

dev/tests/functional/tests/app/Magento/Email/Test/TestCase/CreateEmailTemplateEntityTest.xml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
/**
4+
* Copyright © 2016 Magento. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
28
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd">
3-
<testCase name="Magento\Email\Test\TestCase\CreateEmailTemplateEntityTest" summary="Create Synonyms" ticketId="MAGETWO-123">
9+
<testCase name="Magento\Email\Test\TestCase\CreateEmailTemplateEntityTest" summary="Create new email template" ticketId="MAGETWO-17155">
410
<variation name="CreateEmailTemplateEntityTestVariation1" summary="Create Change Email template">
511
<data name="EmailTemplate/data/template_select" xsi:type="string">Change Email</data>
612
<data name="EmailTemplate/data/template_code" xsi:type="string">Test code_%isolation%</data>

0 commit comments

Comments
 (0)