Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Js validation: added support for multiple option of Flag and Brand items
- Loading branch information
Boris Brtáň
committed
Jun 19, 2018
1 parent
b9d633e
commit d04c194
Showing
4 changed files
with
68 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
...se/tests/ShopBundle/Acceptance/acceptance/AdminProductSaveFormWithEmptyParametersCest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
namespace Tests\ShopBundle\Acceptance\acceptance; | ||
|
||
use Tests\ShopBundle\Acceptance\acceptance\PageObject\Admin\LoginPage; | ||
use Tests\ShopBundle\Acceptance\acceptance\PageObject\Admin\ProductEditPage; | ||
use Tests\ShopBundle\Test\Codeception\AcceptanceTester; | ||
|
||
class php | ||
{ | ||
public function testSaveForm( | ||
AcceptanceTester $me, | ||
LoginPage $loginPage, | ||
ProductEditPage $productEditPage | ||
) { | ||
$me->wantTo('not able to save invalid form'); | ||
$loginPage->loginAsAdmin(); | ||
|
||
$productEditPage->saveInvalidForm(5); | ||
$productEditPage->assertSaveFormErrorBoxVisible(); | ||
|
||
$productEditPage->cleanUpWorkspaceAfterChanges(); | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
project-base/tests/ShopBundle/Acceptance/acceptance/PageObject/Admin/ProductEditPage.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
namespace Tests\ShopBundle\Acceptance\acceptance\PageObject\Admin; | ||
|
||
use Facebook\WebDriver\WebDriverBy; | ||
use Tests\ShopBundle\Acceptance\acceptance\PageObject\AbstractPage; | ||
|
||
class ProductEditPage extends AbstractPage | ||
{ | ||
/** | ||
* @param int $productId | ||
*/ | ||
public function saveInvalidForm($productId) | ||
{ | ||
$this->tester->amOnPage('/admin/product/edit/' . $productId); | ||
// scroll to have the button visible because of the fixed bars | ||
$this->tester->scrollTo(['css' => '.js-parameters-item-add'], null, -300); | ||
$this->tester->clickByCss('.js-parameters-item-add'); | ||
$this->tester->clickByText('Save changes'); | ||
} | ||
|
||
public function cleanUpWorkspaceAfterChanges() | ||
{ | ||
$this->tester->amOnPage('/admin/'); | ||
$this->tester->acceptPopup(); | ||
} | ||
|
||
public function assertSaveFormErrorBoxVisible() | ||
{ | ||
$this->tester->see('Please check the entered values.'); | ||
} | ||
|
||
} |