Skip to content

Commit

Permalink
Merge pull request #262 from magento-falcons/MAGETWO-56240
Browse files Browse the repository at this point in the history
[Falcons] Sprint 2 delivery
  • Loading branch information
Yaroslav Onischenko authored Aug 22, 2016
2 parents eacac63 + 691e362 commit 4df438c
Show file tree
Hide file tree
Showing 43 changed files with 1,205 additions and 444 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
// Updater pages
//@import '../../../updater/styles/less/pages/_common.less';
//@import '../../../updater/styles/less/pages/_home.less';
//@import '../../../updater/styles/less/pages/_component-manager.less';
//@import '../../../updater/styles/less/pages/_extension-manager.less';
//@import '../../../updater/styles/less/pages/_login.less';

//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,64 @@
margin-top: .3rem;
}

.extensions-information {
margin-bottom: 5rem;

h3 {
font-size: @base__font-size;
margin-bottom: 1.3rem;
}

.message {
margin-bottom: @indent__m;

&:before {
margin-top: 0;
top: 1.8rem;
}
}

.extensions-container {
padding: 0 @indent__base;
}

.list {
margin-bottom: @indent__s;

select {
cursor: pointer;

&:disabled {
background: @color-gray80;
cursor: default;
}
}

.extension-delete {
&:extend(.abs-action-delete all);
font-size: 1.7rem;
padding-top: 0;
}
}
}

.delete-modal-wrap {
padding: 0 4% @indent__xl;

h3 {
.lib-font-size(34);
display: inline-block;
font-weight: @font-weight__light;
margin: 0 0 @indent__base;
padding: .9rem 0 0;
vertical-align: top;
}

.actions {
padding: @indent__l 0 0;
}
}

//
// Mobile
// _____________________________________________
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,26 @@
}
}
}

&._tooltip {
background: transparent;
margin: 0px 0px 8px 5px;

a {
width: 21px;

&:hover {
text-decoration: none;
}

&:before {
color: @color-tertiary;
content: @icon-help__content;
font-family: @icons__font-family;
font-size: @component-indicator__size;
}
}
}
}

.col-manager-item-name {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ abstract class AbstractGrid extends Block
*/
protected $extensionName = "//*[contains(text(), '%s')]";

/**
* Checkbox for select extension.
*
* @var string
*/
protected $extensionCheckbox = "//tr[td/*[contains(text(), '%s')]]//*[contains(@ng-checked, 'selectedExtension')]";

/**
* Find Extension on the grid by name.
*
Expand Down Expand Up @@ -85,4 +92,42 @@ protected function clickNextPageButton()

return false;
}

/**
* Select several extensions to install on grid.
*
* @param Extension[] $extensions
* @return Extension[]
*/
public function selectSeveralExtensions(array $extensions)
{
while (true) {
foreach ($extensions as $key => $extension) {
if ($this->isExtensionOnGrid($extension->getExtensionName())) {
$this->selectExtension($extension->getExtensionName());
unset($extensions[$key]);
}
}

if (empty($extensions) || !$this->clickNextPageButton()) {
break;
}
}

return $extensions;
}

/**
* Select extension on grid, check checkbox.
*
* @param string $extensionName
* @return void
*/
protected function selectExtension($extensionName)
{
$this->_rootElement->find(
sprintf($this->extensionCheckbox, $extensionName),
Locator::SELECTOR_XPATH
)->click();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ class Grid extends AbstractGrid
*/
protected $installButton = "//button[contains(@class, 'goInstall')]";

/**
* 'Review Updates' button that opens grid with extensions for update.
*
* @var string
*/
protected $updateButton = "//button[contains(@class, 'goUpdate')]";

/**
* Select action of extension on the grid.
*
Expand Down Expand Up @@ -80,6 +87,16 @@ public function clickInstallButton()
$this->_rootElement->find($this->installButton, Locator::SELECTOR_XPATH)->click();
}

/**
* Click 'Review Updates' button.
*
* @return void
*/
public function clickUpdateButton()
{
$this->_rootElement->find($this->updateButton, Locator::SELECTOR_XPATH)->click();
}

/**
* Click to uninstall button.
*
Expand Down Expand Up @@ -119,7 +136,7 @@ public function getVersion(Extension $extension)
* @param Extension $extension
* @return void
*/
public function clickUpdateButton(Extension $extension)
public function clickUpdateActionButton(Extension $extension)
{
$this->clickSelectActionButton($extension);
$button = $this->_rootElement->find(
Expand All @@ -137,6 +154,8 @@ public function clickUpdateButton(Extension $extension)
*/
public function findExtensionOnGrid(Extension $extension)
{
sleep(3);

$this->_rootElement->waitUntil(
function () {
$message = $this->_rootElement->find($this->notFoundMessage)->isVisible();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class InstallGrid extends AbstractGrid
{
/**
* "Install" button of extension.
*
*
* @var string
*/
protected $extensionInstall = "//tr[td/*[contains(text(), '%s')]]//*[contains(@class, 'action-wrap')]//button";
Expand All @@ -28,13 +28,6 @@ class InstallGrid extends AbstractGrid
*/
protected $extensionSelectVersion = "//tr[td/*[contains(text(), '%s')]]//*[contains(@id, 'selectedVersion')]";

/**
* Checkbox for select extension.
*
* @var string
*/
protected $extensionCheckbox = "//tr[td/*[contains(text(), '%s')]]//*[contains(@ng-checked, 'selectedExtension')]";

/**
* "Install All" button.
*
Expand Down Expand Up @@ -75,42 +68,4 @@ public function clickInstallAll()
{
$this->_rootElement->find($this->installAllButton, Locator::SELECTOR_CSS)->click();
}

/**
* Select several extensions to install on grid.
*
* @param Extension[] $extensions
* @return Extension[]
*/
public function selectSeveralExtensions(array $extensions)
{
while (true) {
foreach ($extensions as $key => $extension) {
if ($this->isExtensionOnGrid($extension->getExtensionName())) {
$this->selectExtension($extension->getExtensionName());
unset($extensions[$key]);
}
}

if (empty($extensions) || !$this->clickNextPageButton()) {
break;
}
}

return $extensions;
}

/**
* Select extension on grid, check checkbox.
*
* @param string $extensionName
* @return void
*/
protected function selectExtension($extensionName)
{
$this->_rootElement->find(
sprintf($this->extensionCheckbox, $extensionName),
Locator::SELECTOR_XPATH
)->click();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php
/**
* Copyright © 2016 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\Setup\Test\Block\Extension;

use Magento\Mtf\Client\Locator;
use Magento\Setup\Test\Fixture\Extension;

/**
* Class UpdateGrid
*
* Grid with extension updates.
*/
class UpdateGrid extends AbstractGrid
{
/**
* 'Update All' button.
*
* @var string
*/
protected $updateAllButton = "[ng-click*='updateAll']";

/**
* Grid that contains the list of extensions.
*
* @var string
*/
protected $dataGrid = '#updateExtensionGrid';

/**
* Click to update all button.
*
* @return void
*/
public function clickUpdateAllButton()
{
$this->_rootElement->find($this->updateAllButton, Locator::SELECTOR_CSS)->click();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

use Magento\Mtf\Block\Block;
use Magento\Mtf\Client\Locator;
use Magento\Setup\Test\Fixture\Extension;

/**
* Readiness block.
Expand All @@ -28,6 +29,34 @@ class Readiness extends Block
*/
protected $next = "[ng-click*='next']";

/**
* 'Try Again' button.
*
* @var string
*/
protected $tryAgain = "[ng-click*='forceReload']";

/**
* Trash Bin icon.
*
* @var string
*/
protected $removeExtension = '//li[contains(text(), \'%s\')]//button';
/**
* Remove button on modal.
*
* @var string
*/
protected $removeExtensionButtonOnModal = "[ng-click*='removeExtension']";

/**
* Remove popup modal.
*
* @var string
*/
protected $popupRemoveModal = '.modal-popup';

/**
* 'Completed!' message.
* [ng-switch-when="true"]
Expand Down Expand Up @@ -98,6 +127,41 @@ public function clickNext()
$this->_rootElement->find($this->next, Locator::SELECTOR_CSS)->click();
}

/**
* Click on 'Try Again' button.
*
* @return void
*/
public function clickTryAgain()
{
$this->_rootElement->find($this->tryAgain, Locator::SELECTOR_CSS)->click();
$this->waitForElementVisible($this->completedMessage, Locator::SELECTOR_CSS);
}

/**
* Click Trash Bin icon.
*
* @param Extension $extension
* @return void
*/
public function clickRemoveExtension(Extension $extension)
{
$removeExtension = sprintf($this->removeExtension, $extension->getExtensionName());

$this->_rootElement->find($removeExtension, Locator::SELECTOR_XPATH)->click();
}

/**
* Click Remove button on modal.
*
* @return void
*/
public function clickRemoveExtensionOnModal()
{
$this->_rootElement->find($this->removeExtensionButtonOnModal, Locator::SELECTOR_CSS)->click();
$this->waitForElementNotVisible($this->popupRemoveModal, Locator::SELECTOR_CSS);
}

/**
* Get Updater application check result.
*
Expand Down
Loading

0 comments on commit 4df438c

Please sign in to comment.