@shopware-ag/acceptance-test-suite 2.3.10 → 2.3.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -15,6 +15,7 @@ This test suite is an extension to [Playwright](https://playwright.dev/) to easi
|
|
|
15
15
|
* [Actor Pattern](#actor-pattern)
|
|
16
16
|
* [Data Fixtures](#data-fixtures)
|
|
17
17
|
* [Code Contribution](#code-contribution)
|
|
18
|
+
* [Best practices](#best-practices)
|
|
18
19
|
|
|
19
20
|
## Installation
|
|
20
21
|
Start by creating your own [Playwright](https://playwright.dev/docs/intro) project.
|
|
@@ -374,4 +375,32 @@ If you create your own data fixtures make sure to import and merge them in your
|
|
|
374
375
|
## Code Contribution
|
|
375
376
|
You can contribute to this project via its [official repository](https://github.com/shopware/acceptance-test-suite/) on GitHub.
|
|
376
377
|
|
|
377
|
-
This project uses [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/). Please make sure to form your commits accordingly to the spec.
|
|
378
|
+
This project uses [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/). Please make sure to form your commits accordingly to the spec.
|
|
379
|
+
|
|
380
|
+
## Best practices
|
|
381
|
+
|
|
382
|
+
A good first read about this is the official [playwright best practices page](https://playwright.dev/docs/best-practices). It describes the most important practices which should also be followed when writing acceptance tests for Shopware.
|
|
383
|
+
|
|
384
|
+
The most important part is [test isolation](https://playwright.dev/docs/best-practices#make-tests-as-isolated-as-possible) which helps to prevent flaky behavior and enables the test to be run in parallel and on systems with an unknown state.
|
|
385
|
+
|
|
386
|
+
|
|
387
|
+
### Dos
|
|
388
|
+
|
|
389
|
+
- use fixtures or the [`TestDataService`](./src/services/TestDataService.ts)
|
|
390
|
+
- create all the data that is required for your test case. That includes sales channels, customers and users (the page fixtures handle most of the common use cases)
|
|
391
|
+
- if you need specific settings for your test, set it explicitly for the user/customer/sales channel
|
|
392
|
+
- directly jump to detail pages with the id of the entities you've created
|
|
393
|
+
- if that's no possible, use the search with a unique name to filter lists to just that single entity
|
|
394
|
+
|
|
395
|
+
### Don'ts
|
|
396
|
+
|
|
397
|
+
- do not expect lists/tables to only contain one item, leverage unique ids/names to open or find your entity instead
|
|
398
|
+
- same with helper functions, do not except to only get item back from the API. Always a unique criteria to the API call
|
|
399
|
+
- avoid unused fixtures: if you request a fixture but don't use any data from the fixture, the test or fixture should be refactored
|
|
400
|
+
- do not depend on implicit configuration and existing data. Examples:
|
|
401
|
+
- rules
|
|
402
|
+
- flows
|
|
403
|
+
- categories
|
|
404
|
+
- do not expect the shop to have the defaults en_GB and EUR
|
|
405
|
+
- do not change global settings (sales channel is ok, because it's created by us)
|
|
406
|
+
- basically everything in Settings that is not specific to a sales channel (tax, search, etc.)
|
package/dist/index.d.mts
CHANGED
|
@@ -460,7 +460,7 @@ declare class TestDataService {
|
|
|
460
460
|
/**
|
|
461
461
|
* Will delete all entities created by the data service via sync API.
|
|
462
462
|
*/
|
|
463
|
-
cleanUp(): Promise<playwright_core.APIResponse>;
|
|
463
|
+
cleanUp(): Promise<playwright_core.APIResponse | null>;
|
|
464
464
|
/**
|
|
465
465
|
* Convert a JS date object into a date-time compatible string.
|
|
466
466
|
*
|
package/dist/index.d.ts
CHANGED
|
@@ -460,7 +460,7 @@ declare class TestDataService {
|
|
|
460
460
|
/**
|
|
461
461
|
* Will delete all entities created by the data service via sync API.
|
|
462
462
|
*/
|
|
463
|
-
cleanUp(): Promise<playwright_core.APIResponse>;
|
|
463
|
+
cleanUp(): Promise<playwright_core.APIResponse | null>;
|
|
464
464
|
/**
|
|
465
465
|
* Convert a JS date object into a date-time compatible string.
|
|
466
466
|
*
|
package/dist/index.mjs
CHANGED