mirror of
https://github.com/Sylius/Sylius.git
synced 2026-07-05 20:57:12 +00:00
Merge c5f8aba99c into cbb32838fb
This commit is contained in:
commit
5e2d5a592e
3 changed files with 16 additions and 4 deletions
|
|
@ -29,7 +29,7 @@ Feature: Sorting listed products from a taxon by position
|
||||||
And the store has a product "Ultimate Pug" in the "Soft Toys" taxon at 19th position
|
And the store has a product "Ultimate Pug" in the "Soft Toys" taxon at 19th position
|
||||||
And I am logged in as an administrator
|
And I am logged in as an administrator
|
||||||
|
|
||||||
@no-api @ui @mink:chromedriver @failing
|
@no-api @ui @mink:chromedriver
|
||||||
Scenario: Setting two products to position -1 on the non-last page
|
Scenario: Setting two products to position -1 on the non-last page
|
||||||
When I am browsing the 1st page of products from "Soft Toys" taxon
|
When I am browsing the 1st page of products from "Soft Toys" taxon
|
||||||
And I set the position of "Old pug" to "-1"
|
And I set the position of "Old pug" to "-1"
|
||||||
|
|
@ -48,7 +48,7 @@ Feature: Sorting listed products from a taxon by position
|
||||||
Then the one before last product on the list should have name "Pug XL" with position 18
|
Then the one before last product on the list should have name "Pug XL" with position 18
|
||||||
And the last product on the list should have name "Pug XS" with position 19
|
And the last product on the list should have name "Pug XS" with position 19
|
||||||
|
|
||||||
@no-api @ui @mink:chromedriver @failing
|
@no-api @ui @mink:chromedriver
|
||||||
Scenario: Setting two products to the already occupied position on the other page
|
Scenario: Setting two products to the already occupied position on the other page
|
||||||
When I am browsing the 1st page of products from "Soft Toys" taxon
|
When I am browsing the 1st page of products from "Soft Toys" taxon
|
||||||
And I set the position of "Old pug" to "15"
|
And I set the position of "Old pug" to "15"
|
||||||
|
|
@ -80,7 +80,7 @@ Feature: Sorting listed products from a taxon by position
|
||||||
And the 7th product on this page should be named "Pug Master"
|
And the 7th product on this page should be named "Pug Master"
|
||||||
And this product should be at position 16
|
And this product should be at position 16
|
||||||
|
|
||||||
@no-api @ui @mink:chromedriver @failing
|
@no-api @ui @mink:chromedriver
|
||||||
Scenario: Setting two products to the positions overflowing the max available position on the non-last page
|
Scenario: Setting two products to the positions overflowing the max available position on the non-last page
|
||||||
When I am browsing the 1st page of products from "Soft Toys" taxon
|
When I am browsing the 1st page of products from "Soft Toys" taxon
|
||||||
And I set the position of "Old pug" to "25"
|
And I set the position of "Old pug" to "25"
|
||||||
|
|
@ -107,7 +107,7 @@ Feature: Sorting listed products from a taxon by position
|
||||||
When I am browsing the 3rd page of products from "Soft Toys" taxon
|
When I am browsing the 3rd page of products from "Soft Toys" taxon
|
||||||
Then the last product on the list within this taxon should have name "Big pug"
|
Then the last product on the list within this taxon should have name "Big pug"
|
||||||
|
|
||||||
@api @ui @mink:chromedriver @failing
|
@api @ui @mink:chromedriver
|
||||||
Scenario: Product with position 0 is set as the first one
|
Scenario: Product with position 0 is set as the first one
|
||||||
When I am browsing products from "Soft Toys" taxon
|
When I am browsing products from "Soft Toys" taxon
|
||||||
And I set the position of "Young pug" to 0
|
And I set the position of "Young pug" to 0
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,8 @@ class IndexPerTaxonPage extends CrudIndexPage implements IndexPerTaxonPageInterf
|
||||||
|
|
||||||
public function setPositionOfProduct(string $productName, string $position): void
|
public function setPositionOfProduct(string $productName, string $position): void
|
||||||
{
|
{
|
||||||
|
$this->waitForSavePositionsController();
|
||||||
|
|
||||||
/** @var NodeElement $productsRow */
|
/** @var NodeElement $productsRow */
|
||||||
$productsRow = $this->getElement('table')->find('css', sprintf('tbody > tr:contains("%s")', $productName));
|
$productsRow = $this->getElement('table')->find('css', sprintf('tbody > tr:contains("%s")', $productName));
|
||||||
Assert::notNull($productsRow, 'There are no row with given product\'s name!');
|
Assert::notNull($productsRow, 'There are no row with given product\'s name!');
|
||||||
|
|
@ -51,6 +53,14 @@ class IndexPerTaxonPage extends CrudIndexPage implements IndexPerTaxonPageInterf
|
||||||
$productsRow->find('css', '.sylius-product-taxon-position')->setValue($position);
|
$productsRow->find('css', '.sylius-product-taxon-position')->setValue($position);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function waitForSavePositionsController(): void
|
||||||
|
{
|
||||||
|
$this->getSession()->wait(
|
||||||
|
5000,
|
||||||
|
'document.querySelector("[data-test-save-configuration-button][data-ready]") !== null',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
public function savePositions(): void
|
public function savePositions(): void
|
||||||
{
|
{
|
||||||
$saveConfigurationButton = $this->getElement('save_configuration_button');
|
$saveConfigurationButton = $this->getElement('save_configuration_button');
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,8 @@ export default class extends Controller {
|
||||||
document.querySelectorAll(this.inputSelectorValue).forEach(input => {
|
document.querySelectorAll(this.inputSelectorValue).forEach(input => {
|
||||||
input.addEventListener('change', (event) => this.handlePositionChange(event));
|
input.addEventListener('change', (event) => this.handlePositionChange(event));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.element.dataset.ready = 'true';
|
||||||
}
|
}
|
||||||
|
|
||||||
handlePositionChange(event) {
|
handlePositionChange(event) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue