Skip to content

Commit

Permalink
Remove admin queue tests (#123)
Browse files Browse the repository at this point in the history
  • Loading branch information
lruozzi9 committed Aug 29, 2022
1 parent 71d94aa commit b95095c
Show file tree
Hide file tree
Showing 10 changed files with 6 additions and 173 deletions.
3 changes: 0 additions & 3 deletions features/enqueuing_products.feature
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ Feature: Enqueuing products
When I browse products
And I schedule an Akeneo PIM import for the "Braided hat m" product
Then I should be notified that it has been successfully enqueued
And I should see 1, not imported, item in the Akeneo queue items list

@ui
Scenario: Enqueuing a product already enqueued
Expand All @@ -50,7 +49,6 @@ Feature: Enqueuing products
When I browse products
And I schedule an Akeneo PIM import for the "Braided hat l" product
Then I should be notified that it has been already enqueued
And I should see 1, not imported, item in the Akeneo queue items list

@ui
Scenario: Enqueuing a configurable product
Expand All @@ -61,4 +59,3 @@ Feature: Enqueuing products
When I browse products
And I schedule an Akeneo PIM import for the "Braided hat" product
Then I should be notified that it has been successfully enqueued
And I should see 3, not imported, items in the Akeneo queue items list
44 changes: 0 additions & 44 deletions features/managing_queue_items/browsing_queue_items.feature

This file was deleted.

29 changes: 0 additions & 29 deletions features/managing_queue_items/deleting_queue_items.feature

This file was deleted.

25 changes: 0 additions & 25 deletions src/Menu/AdminMenuListener.php

This file was deleted.

4 changes: 0 additions & 4 deletions src/Resources/config/services.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,6 @@
<tag name="kernel.event_subscriber" />
</service>

<service id="webgriffe_sylius_akeneo.event_listener.admin_menu_listener" class="Webgriffe\SyliusAkeneoPlugin\Menu\AdminMenuListener">
<tag name="kernel.event_listener" event="sylius.menu.admin.main" method="addAdminMenuItems" />
</service>

<!-- Product Importer -->
<service id="webgriffe_sylius_akeneo.product.taxons_resolver" class="Webgriffe\SyliusAkeneoPlugin\Product\AlreadyExistingTaxonsResolver">
<argument type="service" id="sylius.repository.taxon" />
Expand Down
11 changes: 5 additions & 6 deletions tests/Behat/Context/Ui/Admin/ManagingProductsContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,17 @@
use Sylius\Behat\Service\Helper\JavaScriptTestHelperInterface;
use Sylius\Behat\Service\NotificationCheckerInterface;
use Sylius\Component\Core\Model\ProductInterface;
use Tests\Webgriffe\SyliusAkeneoPlugin\Behat\Page\Admin\QueueItem\IndexPageInterface as QueueItemsIndexPageInterface;
use Webmozart\Assert\Assert;

final class ManagingProductsContext implements Context
{
private const SCHEDULE_AKENEO_PIM_IMPORT = 'Schedule Akeneo PIM import';

/**
* ProductItems constructor.
*/
public function __construct(private IndexPageInterface $indexPage, private JavaScriptTestHelperInterface $testHelper, private NotificationCheckerInterface $notificationChecker, private QueueItemsIndexPageInterface $queueItemsIndexPage)
{
public function __construct(
private IndexPageInterface $indexPage,
private JavaScriptTestHelperInterface $testHelper,
private NotificationCheckerInterface $notificationChecker
) {
}

/**
Expand Down
4 changes: 1 addition & 3 deletions tests/Behat/Context/Ui/Admin/ManagingQueueItems.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@

use Behat\Behat\Context\Context;
use Sylius\Behat\Service\SharedStorageInterface;
use Tests\Webgriffe\SyliusAkeneoPlugin\Behat\Page\Admin\QueueItem\IndexPageInterface;
use Webgriffe\SyliusAkeneoPlugin\Entity\QueueItemInterface;
use Webmozart\Assert\Assert;

final class ManagingQueueItems implements Context
{
public function __construct(private IndexPageInterface $indexPage, private SharedStorageInterface $sharedStorage)
public function __construct(private SharedStorageInterface $sharedStorage)
{
}

Expand Down
37 changes: 0 additions & 37 deletions tests/Behat/Page/Admin/QueueItem/IndexPage.php
Original file line number Diff line number Diff line change
@@ -1,37 +0,0 @@
<?php

declare(strict_types=1);

namespace Tests\Webgriffe\SyliusAkeneoPlugin\Behat\Page\Admin\QueueItem;

use Sylius\Behat\Page\Admin\Crud\IndexPage as BaseIndexPage;

class IndexPage extends BaseIndexPage implements IndexPageInterface
{
public function chooseImportedFilter(string $imported): void
{
$this->getElement('filter_imported')->selectOption($imported);
}

public function specifyImporterFilter(string $importer): void
{
$this->getElement('filter_importer')->setValue($importer);
}

public function specifyIdentifierFilter(string $identifier): void
{
$this->getElement('filter_identifier')->setValue($identifier);
}

protected function getDefinedElements(): array
{
return array_merge(
parent::getDefinedElements(),
[
'filter_imported' => '#criteria_imported',
'filter_importer' => '#criteria_akeneoEntity_value',
'filter_identifier' => '#criteria_akeneoIdentifier_value',
],
);
}
}
16 changes: 0 additions & 16 deletions tests/Behat/Page/Admin/QueueItem/IndexPageInterface.php

This file was deleted.

6 changes: 0 additions & 6 deletions tests/Behat/Resources/services.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,13 @@
<service id="webgriffe_sylius_akeneo.behat.context.system.datetime" class="Tests\Webgriffe\SyliusAkeneoPlugin\Behat\Context\System\DateTimeContext" />

<service id="webgriffe_sylius_akeneo.behat.context.ui.admin.managing_queue_items" class="Tests\Webgriffe\SyliusAkeneoPlugin\Behat\Context\Ui\Admin\ManagingQueueItems">
<argument type="service" id="webgriffe_sylius_akeneo.behat.page.admin.queue_item.index" />
<argument type="service" id="sylius.behat.shared_storage" />
</service>

<service id="webgriffe_sylius_akeneo.behat.context.ui.admin.managing_products" class="Tests\Webgriffe\SyliusAkeneoPlugin\Behat\Context\Ui\Admin\ManagingProductsContext">
<argument type="service" id="sylius.behat.page.admin.product.index" />
<argument type="service" id="sylius.behat.java_script_test_helper" />
<argument type="service" id="sylius.behat.notification_checker" />
<argument type="service" id="webgriffe_sylius_akeneo.behat.page.admin.queue_item.index" />
</service>

<service id="webgriffe_sylius_akeneo.behat.page.admin.queue_item.index" parent="sylius.behat.page.admin.crud.index" class="Tests\Webgriffe\SyliusAkeneoPlugin\Behat\Page\Admin\QueueItem\IndexPage" public="false">
<argument type="string">webgriffe_sylius_akeneo_admin_queue_item_index</argument>
</service>
</services>
</container>

0 comments on commit b95095c

Please sign in to comment.