mirror of
https://github.com/Sylius/Sylius.git
synced 2026-07-14 09:02:12 +00:00
Enable tests for placing orders as impersonated shop users and for picking up cart created in UI in the api (#17035)
| Q | A |-----------------|----- | Branch? | 2.0 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Related tickets | n/a | License | MIT
This commit is contained in:
commit
06c6fe06f9
9 changed files with 21 additions and 16 deletions
4
.github/workflows/ci_e2e-custom.yaml
vendored
4
.github/workflows/ci_e2e-custom.yaml
vendored
|
|
@ -104,10 +104,10 @@ jobs:
|
|||
run: vendor/bin/behat --colors --strict --no-interaction -vvv -f progress --tags="@cli&&~@todo" --suite-tags="@cli" || vendor/bin/behat --strict --no-interaction -vvv -f progress --tags="@cli&&~@todo" --suite-tags="@cli" --rerun
|
||||
|
||||
- name: Run non-UI Behat
|
||||
run: vendor/bin/behat --colors --strict --no-interaction -vvv -f progress --tags="~@todo&&~@cli" --suite-tags="@api,@domain,@hybrid" || vendor/bin/behat --colors --strict --no-interaction -vvv -f progress --tags="~@todo&&~@cli" --suite-tags="@api,@domain,@hybrid" --rerun
|
||||
run: vendor/bin/behat --colors --strict --no-interaction -vvv -f progress --tags="~@todo&&~@cli" --suite-tags="@api,@domain" || vendor/bin/behat --colors --strict --no-interaction -vvv -f progress --tags="~@todo&&~@cli" --suite-tags="@api,@domain" --rerun
|
||||
|
||||
- name: Run non-JS Behat
|
||||
run: vendor/bin/behat --colors --strict --no-interaction -vvv -f progress --tags="~@javascript&&~@mink:chromedriver&&~@todo&&~@cli" --suite-tags="@ui" || vendor/bin/behat --strict --no-interaction -vvv -f progress --tags="~@javascript&&~@mink:chromedriver&&~@todo&&~@cli" --suite-tags="@ui" --rerun
|
||||
run: vendor/bin/behat --colors --strict --no-interaction -vvv -f progress --tags="~@javascript&&~@mink:chromedriver&&~@todo&&~@cli" --suite-tags="@hybrid,@ui" || vendor/bin/behat --strict --no-interaction -vvv -f progress --tags="~@javascript&&~@mink:chromedriver&&~@todo&&~@cli" --suite-tags="@hybrid,@ui" --rerun
|
||||
|
||||
- name: Upload logs
|
||||
uses: actions/upload-artifact@v3
|
||||
|
|
|
|||
4
.github/workflows/ci_e2e-mariadb.yaml
vendored
4
.github/workflows/ci_e2e-mariadb.yaml
vendored
|
|
@ -109,10 +109,10 @@ jobs:
|
|||
run: vendor/bin/behat --colors --strict --no-interaction -vvv -f progress --tags="@cli&&~@todo" --suite-tags="@cli" || vendor/bin/behat --strict --no-interaction -vvv -f progress --tags="@cli&&~@todo" --suite-tags="@cli" --rerun
|
||||
|
||||
- name: Run non-UI Behat
|
||||
run: vendor/bin/behat --colors --strict --no-interaction -vvv -f progress --tags="~@todo&&~@cli" --suite-tags="@api,@domain,@hybrid" || vendor/bin/behat --colors --strict --no-interaction -vvv -f progress --tags="~@todo&&~@cli" --suite-tags="@api,@domain,@hybrid" --rerun
|
||||
run: vendor/bin/behat --colors --strict --no-interaction -vvv -f progress --tags="~@todo&&~@cli" --suite-tags="@api,@domain" || vendor/bin/behat --colors --strict --no-interaction -vvv -f progress --tags="~@todo&&~@cli" --suite-tags="@api,@domain" --rerun
|
||||
|
||||
- name: Run non-JS Behat
|
||||
run: vendor/bin/behat --colors --strict --no-interaction -vvv -f progress --tags="~@javascript&&~@mink:chromedriver&&~@todo&&~@cli" --suite-tags="@ui" || vendor/bin/behat --strict --no-interaction -vvv -f progress --tags="~@javascript&&~@mink:chromedriver&&~@todo&&~@cli" --suite-tags="@ui" --rerun
|
||||
run: vendor/bin/behat --colors --strict --no-interaction -vvv -f progress --tags="~@javascript&&~@mink:chromedriver&&~@todo&&~@cli" --suite-tags="@hybrid,@ui" || vendor/bin/behat --strict --no-interaction -vvv -f progress --tags="~@javascript&&~@mink:chromedriver&&~@todo&&~@cli" --suite-tags="@hybrid,@ui" --rerun
|
||||
|
||||
- name: Upload logs
|
||||
uses: actions/upload-artifact@v3
|
||||
|
|
|
|||
8
.github/workflows/ci_e2e-mysql.yaml
vendored
8
.github/workflows/ci_e2e-mysql.yaml
vendored
|
|
@ -114,10 +114,10 @@ jobs:
|
|||
run: vendor/bin/behat --colors --strict --no-interaction -vvv -f progress --tags="@cli&&~@todo" --suite-tags="@cli" || vendor/bin/behat --strict --no-interaction -vvv -f progress --tags="@cli&&~@todo" --suite-tags="@cli" --rerun
|
||||
|
||||
- name: Run non-UI Behat
|
||||
run: vendor/bin/behat --colors --strict --no-interaction -vvv -f progress --tags="~@todo&&~@cli" --suite-tags="@api,@domain,@hybrid" || vendor/bin/behat --colors --strict --no-interaction -vvv -f progress --tags="~@todo&&~@cli" --suite-tags="@api,@domain,@hybrid" --rerun
|
||||
run: vendor/bin/behat --colors --strict --no-interaction -vvv -f progress --tags="~@todo&&~@cli" --suite-tags="@api,@domain" || vendor/bin/behat --colors --strict --no-interaction -vvv -f progress --tags="~@todo&&~@cli" --suite-tags="@api,@domain" --rerun
|
||||
|
||||
- name: Run non-JS Behat
|
||||
run: vendor/bin/behat --colors --strict --no-interaction -vvv -f progress --tags="~@javascript&&~@mink:chromedriver&&~@todo&&~@cli" --suite-tags="@ui" || vendor/bin/behat --strict --no-interaction -vvv -f progress --tags="~@javascript&&~@mink:chromedriver&&~@todo&&~@cli" --suite-tags="@ui" --rerun
|
||||
run: vendor/bin/behat --colors --strict --no-interaction -vvv -f progress --tags="~@javascript&&~@mink:chromedriver&&~@todo&&~@cli" --suite-tags="@hybrid,@ui" || vendor/bin/behat --strict --no-interaction -vvv -f progress --tags="~@javascript&&~@mink:chromedriver&&~@todo&&~@cli" --suite-tags="@hybrid,@ui" --rerun
|
||||
|
||||
- name: Upload logs
|
||||
uses: actions/upload-artifact@v3
|
||||
|
|
@ -195,7 +195,7 @@ jobs:
|
|||
chrome_version: stable
|
||||
|
||||
- name: Run Behat (Chromedriver)
|
||||
run: vendor/bin/behat --colors --strict --no-interaction -vvv -f progress --tags="@mink:chromedriver&&~@todo&&~@cli" --suite-tags="@ui" || vendor/bin/behat --colors --strict --no-interaction -vvv -f progress --tags="@mink:chromedriver&&~@todo&&~@cli" --suite-tags="@ui" --rerun || vendor/bin/behat --colors --strict --no-interaction -vvv -f progress --tags="@mink:chromedriver&&~@todo&&~@cli" --suite-tags="@ui" --rerun
|
||||
run: vendor/bin/behat --colors --strict --no-interaction -vvv -f progress --tags="@mink:chromedriver&&~@todo&&~@cli" --suite-tags="@hybrid,@ui" || vendor/bin/behat --colors --strict --no-interaction -vvv -f progress --tags="@mink:chromedriver&&~@todo&&~@cli" --suite-tags="@hybrid,@ui" --rerun || vendor/bin/behat --colors --strict --no-interaction -vvv -f progress --tags="@mink:chromedriver&&~@todo&&~@cli" --suite-tags="@hybrid,@ui" --rerun
|
||||
|
||||
- name: Upload logs
|
||||
uses: actions/upload-artifact@v3
|
||||
|
|
@ -276,7 +276,7 @@ jobs:
|
|||
run: vendor/bin/bdi detect drivers
|
||||
|
||||
- name: Run Behat (Panther)
|
||||
run: vendor/bin/behat --colors --strict --no-interaction -vvv -f progress --tags="@javascript&&~@todo&&~@cli" --suite-tags="@ui" || vendor/bin/behat --colors --strict --no-interaction -vvv -f progress --tags="@javascript&&~@todo&&~@cli" --suite-tags="@ui" --rerun || vendor/bin/behat --colors --strict --no-interaction -vvv -f progress --tags="@javascript&&~@todo&&~@cli" --suite-tags="@ui" --rerun
|
||||
run: vendor/bin/behat --colors --strict --no-interaction -vvv -f progress --tags="@javascript&&~@todo&&~@cli" --suite-tags="@hybrid,@ui" || vendor/bin/behat --colors --strict --no-interaction -vvv -f progress --tags="@javascript&&~@todo&&~@cli" --suite-tags="@hybrid,@ui" --rerun || vendor/bin/behat --colors --strict --no-interaction -vvv -f progress --tags="@javascript&&~@todo&&~@cli" --suite-tags="@hybrid,@ui" --rerun
|
||||
|
||||
- name: Upload logs
|
||||
uses: actions/upload-artifact@v3
|
||||
|
|
|
|||
4
.github/workflows/ci_e2e-pgsql.yaml
vendored
4
.github/workflows/ci_e2e-pgsql.yaml
vendored
|
|
@ -108,10 +108,10 @@ jobs:
|
|||
run: vendor/bin/behat --colors --strict --no-interaction -vvv -f progress --tags="@cli&&~@todo" --suite-tags="@cli" || vendor/bin/behat --strict --no-interaction -vvv -f progress --tags="@cli&&~@todo" --suite-tags="@cli" --rerun
|
||||
|
||||
- name: Run non-UI Behat
|
||||
run: vendor/bin/behat --colors --strict --no-interaction -vvv -f progress --tags="~@todo&&~@cli&&~@no-postgres" --suite-tags="@api,@domain,@hybrid" || vendor/bin/behat --colors --strict --no-interaction -vvv -f progress --tags="~@todo&&~@cli&&~@no-postgres" --suite-tags="@api,@domain,@hybrid" --rerun
|
||||
run: vendor/bin/behat --colors --strict --no-interaction -vvv -f progress --tags="~@todo&&~@cli&&~@no-postgres" --suite-tags="@api,@domain" || vendor/bin/behat --colors --strict --no-interaction -vvv -f progress --tags="~@todo&&~@cli&&~@no-postgres" --suite-tags="@api,@domain" --rerun
|
||||
|
||||
- name: Run non-JS Behat
|
||||
run: vendor/bin/behat --colors --strict --no-interaction -vvv -f progress --tags="~@javascript&&~@mink:chromedriver&&~@todo&&~@cli&&~@no-postgres" --suite-tags="@ui" || vendor/bin/behat --strict --no-interaction -vvv -f progress --tags="~@javascript&&~@mink:chromedriver&&~@todo&&~@cli&&~@no-postgres" --suite-tags="@ui" --rerun
|
||||
run: vendor/bin/behat --colors --strict --no-interaction -vvv -f progress --tags="~@javascript&&~@mink:chromedriver&&~@todo&&~@cli&&~@no-postgres" --suite-tags="@hybrid,@ui" || vendor/bin/behat --strict --no-interaction -vvv -f progress --tags="~@javascript&&~@mink:chromedriver&&~@todo&&~@cli&&~@no-postgres" --suite-tags="@hybrid,@ui" --rerun
|
||||
|
||||
- name: Upload logs
|
||||
uses: actions/upload-artifact@v3
|
||||
|
|
|
|||
4
.github/workflows/ci_e2e-unstable.yaml
vendored
4
.github/workflows/ci_e2e-unstable.yaml
vendored
|
|
@ -70,10 +70,10 @@ jobs:
|
|||
run: vendor/bin/behat --colors --strict --no-interaction -vvv -f progress --tags="@cli&&~@todo" --suite-tags="@cli" || vendor/bin/behat --strict --no-interaction -vvv -f progress --tags="@cli&&~@todo" --suite-tags="@cli" --rerun
|
||||
|
||||
- name: Run non-UI Behat
|
||||
run: vendor/bin/behat --colors --strict --no-interaction -vvv -f progress --tags="~@todo&&~@cli" --suite-tags="@api,@domain,@hybrid" || vendor/bin/behat --colors --strict --no-interaction -vvv -f progress --tags="~@todo&&~@cli" --suite-tags="@api,@domain,@hybrid" --rerun
|
||||
run: vendor/bin/behat --colors --strict --no-interaction -vvv -f progress --tags="~@todo&&~@cli" --suite-tags="@api,@domain" || vendor/bin/behat --colors --strict --no-interaction -vvv -f progress --tags="~@todo&&~@cli" --suite-tags="@api,@domain" --rerun
|
||||
|
||||
- name: Run non-JS Behat
|
||||
run: vendor/bin/behat --colors --strict --no-interaction -vvv -f progress --tags="~@javascript&&~@mink:chromedriver&&~@todo&&~@cli" --suite-tags="@ui" || vendor/bin/behat --strict --no-interaction -vvv -f progress --tags="~@javascript&&~@mink:chromedriver&&~@todo&&~@cli" --suite-tags="@ui" --rerun
|
||||
run: vendor/bin/behat --colors --strict --no-interaction -vvv -f progress --tags="~@javascript&&~@mink:chromedriver&&~@todo&&~@cli" --suite-tags="@hybrid,@ui" || vendor/bin/behat --strict --no-interaction -vvv -f progress --tags="~@javascript&&~@mink:chromedriver&&~@todo&&~@cli" --suite-tags="@hybrid,@ui" --rerun
|
||||
|
||||
- name: Upload logs
|
||||
uses: actions/upload-artifact@v3
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ Feature: Placing an order as impersonated shop users
|
|||
And there is a customer "Tanith Low" identified by an email "tanith.low@london.uk" and a password "tanithlow"
|
||||
And I am logged in as an administrator
|
||||
|
||||
@no-api @ui @mink:chromedriver
|
||||
@no-api @ui @javascript
|
||||
Scenario: Placing an order as an impersonated shop user
|
||||
When I view details of the customer "tanith.low@london.uk"
|
||||
And I impersonate them
|
||||
|
|
@ -24,7 +24,7 @@ Feature: Placing an order as impersonated shop users
|
|||
And I browse orders of a customer "tanith.low@london.uk"
|
||||
Then I should see a single order in the list
|
||||
|
||||
@no-api @todo-ui
|
||||
@no-api @ui @javascript
|
||||
Scenario: Placing an order as an impersonated shop user when the shop user was already logged
|
||||
When I sign in with email "john.doe@london.uk" and password "johndoe"
|
||||
And I view details of the customer "tanith.low@london.uk"
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ Feature: Continuing to process the cart picked up in the web store, in the API
|
|||
And the store has a product "Apple's Polishing Cloth"
|
||||
And I am a logged in customer on the web store and in the API
|
||||
|
||||
@todo-hybrid @javascript
|
||||
@hybrid @javascript
|
||||
Scenario: Picking up the shopping cart on the web store and resuming it using API
|
||||
When I add "Apple's Polishing Cloth" to the cart on the web store
|
||||
And I check items in my cart using API
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ declare(strict_types=1);
|
|||
namespace Sylius\Behat\Page\Admin\Customer;
|
||||
|
||||
use FriendsOfBehat\PageObjectExtension\Page\SymfonyPage;
|
||||
use Sylius\Behat\Service\DriverHelper;
|
||||
|
||||
class ShowPage extends SymfonyPage implements ShowPageInterface
|
||||
{
|
||||
|
|
@ -86,6 +87,9 @@ class ShowPage extends SymfonyPage implements ShowPageInterface
|
|||
|
||||
public function impersonate(): void
|
||||
{
|
||||
if (DriverHelper::isJavascript($this->getDriver())) {
|
||||
$this->getElement('actions_button')->click();
|
||||
}
|
||||
$this->getElement('impersonate_button')->click();
|
||||
}
|
||||
|
||||
|
|
@ -122,6 +126,7 @@ class ShowPage extends SymfonyPage implements ShowPageInterface
|
|||
protected function getDefinedElements(): array
|
||||
{
|
||||
return array_merge(parent::getDefinedElements(), [
|
||||
'actions_button' => '[data-test-customer-actions]',
|
||||
'customer_email' => '[data-test-customer-email]',
|
||||
'customer_name' => '[data-test-customer-fullname]',
|
||||
'customer_phone_number' => '[data-test-customer-phone]',
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<div class="col-12 col-md-auto ms-auto">
|
||||
<div class="dropdown">
|
||||
<button type="button" class="btn dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
|
||||
<button type="button" class="btn dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false" {{ sylius_test_html_attribute('customer-actions') }}>
|
||||
{{ 'sylius.ui.actions'|trans }}
|
||||
</button>
|
||||
<div class="dropdown-menu">
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue