Skip to content

Commit

Permalink
NTR: add sanity filter to cypress tests
Browse files Browse the repository at this point in the history
  • Loading branch information
boxblinkracer committed Oct 13, 2023
1 parent c6cbb90 commit 3c4eb04
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 32 deletions.
23 changes: 11 additions & 12 deletions tests/Cypress/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@

## Easy Testing

Running Cypress tests is easy!
Just install it by using the built in makefile commands
and either open your tests in the Cypress UI, or run them directly from your CLI.


### Installation

This folder contains a `makefile` with all required commands.
Expand All @@ -15,8 +13,8 @@ Run the installation command to install Cypress and all its dependencies on your
make install
```


### Cypress UI

If you want to run your Cypress UI, just open it with the following command.
Please note, because this is an Open Source project, we cannot include a
shop URL in the configuration. Therefore you need to provide it on your own.
Expand All @@ -28,17 +26,18 @@ make open-ui shopware=6.3 url=https://my-local-or-remote-domain
```

### Run in CLI

You can also use the CLI command to run Cypress on your machine or directly in your build pipeline.
Cypress will then test your local or remote shop with the tests of the provided Shopware version.

```ruby
make run shopware=6.x url=https://my-local-or-remote-domain
```


### Tags

You can run a subsegment of tests by providing tags when running Cypress.
These tags need to exist in the title of a test.
These tags need to exist in the title of a test.
We recommend the prefix @, su like '@core'.

```ruby
Expand All @@ -48,20 +47,20 @@ make run shopware=6.x url=https://my-local-or-remote-domain tags='@core @smoke'
Here is a list of currently allowed tags.
Please use them if appropriate.


| Tag | Description |
|-------| --- |
| @core | Indicates that the test does not require a Mollie API key. These tests will also run in the PR pipeline before something is merged. |

| Tag | Description |
|---------|-------------------------------------------------------------------------------------------------------------------------------------|
| @core | Indicates that the test does not require a Mollie API key. These tests will also run in the PR pipeline before something is merged. |
| @sanity | Just a few payment and flow tests to see if it still works. |

### TestRail Integration

This Cypress project integrates with our TestRail project.
TestRail is a software to manage test cases keep track on their statuses.

You could, in theory, configure your own TestRail credentials (Cypress.env.json), but unfortunately the mapped test cases
You could, in theory, configure your own TestRail credentials (Cypress.env.json), but unfortunately the mapped test
cases
will not match your IDs, so it will probably not work. This is only for our QA team at the moment.


### Troubleshooting

Shopware 6.4.4.0 introduced LAX cookies.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,23 +40,23 @@ const device = devices.getFirstDevice();


const payments = [
{caseId: 'C4101', key: 'credit-card', name: 'Card'},
{caseId: 'C4111', key: 'paypal', name: 'PayPal'},
{caseId: 'C466903', key: 'billie', name: 'Billie'},
{caseId: 'C4114', key: 'klarnapaynow', name: 'Pay now'},
{caseId: 'C4115', key: 'klarnapaylater', name: 'Pay later'},
{caseId: 'C4117', key: 'klarnasliceit', name: 'Slice it'},
{caseId: 'C4118', key: 'ideal', name: 'iDEAL'},
{caseId: 'C4116', key: 'sofort', name: 'SOFORT'},
{caseId: 'C4120', key: 'eps', name: 'eps'},
{caseId: 'C4122', key: 'giropay', name: 'Giropay'},
{caseId: 'C4123', key: 'mistercash', name: 'Bancontact'},
{caseId: 'C4125', key: 'przelewy24', name: 'Przelewy24'},
{caseId: 'C4126', key: 'kbc', name: 'KBC'},
{caseId: 'C4128', key: 'banktransfer', name: 'Banktransfer'},
{caseId: 'C4127', key: 'belfius', name: 'Belfius'},
{caseId: 'C4121', key: 'giftcard', name: 'Gift cards'},
{caseId: 'C4143', key: 'voucher', name: 'Voucher'},
{caseId: 'C4101', key: 'credit-card', name: 'Card', sanity: false},
{caseId: 'C4111', key: 'paypal', name: 'PayPal', sanity: true},
{caseId: 'C466903', key: 'billie', name: 'Billie', sanity: false},
{caseId: 'C4114', key: 'klarnapaynow', name: 'Pay now', sanity: false},
{caseId: 'C4115', key: 'klarnapaylater', name: 'Pay later', sanity: false},
{caseId: 'C4117', key: 'klarnasliceit', name: 'Slice it', sanity: false},
{caseId: 'C4118', key: 'ideal', name: 'iDEAL', sanity: false},
{caseId: 'C4116', key: 'sofort', name: 'SOFORT', sanity: false},
{caseId: 'C4120', key: 'eps', name: 'eps', sanity: false},
{caseId: 'C4122', key: 'giropay', name: 'Giropay', sanity: false},
{caseId: 'C4123', key: 'mistercash', name: 'Bancontact', sanity: false},
{caseId: 'C4125', key: 'przelewy24', name: 'Przelewy24', sanity: false},
{caseId: 'C4126', key: 'kbc', name: 'KBC', sanity: false},
{caseId: 'C4128', key: 'banktransfer', name: 'Banktransfer', sanity: false},
{caseId: 'C4127', key: 'belfius', name: 'Belfius', sanity: false},
{caseId: 'C4121', key: 'giftcard', name: 'Gift cards', sanity: false},
{caseId: 'C4143', key: 'voucher', name: 'Voucher', sanity: false},
// unfortunately address and product prices need to match, so we cannot do in3 automatically for now
// {caseId: '', key: 'in3', name: 'in3'},
];
Expand All @@ -82,7 +82,9 @@ context("Checkout Tests", () => {
context(devices.getDescription(device), () => {
payments.forEach(payment => {

it(payment.caseId + ': Pay with ' + payment.name, () => {
const sanityString = (payment.sanity) ? ' @sanity' : '';

it(payment.caseId + ': Pay with ' + payment.name + sanityString, () => {

scenarioDummyBasket.execute();

Expand Down
2 changes: 1 addition & 1 deletion tests/Cypress/cypress/e2e/storefront/refund/refund.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ context("Order Refunds", () => {

context(devices.getDescription(device), () => {

it('C4046: Create full refund and cancel it', () => {
it('C4046: Create full refund and cancel it @sanity', () => {

createOrderAndOpenAdmin();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ context("Order Shipping", () => {

context(devices.getDescription(device), () => {

it('C4039: Full Shipping in Administration', () => {
it('C4039: Full Shipping in Administration @sanity', () => {

createOrderAndOpenAdmin(2, 1);

Expand Down

0 comments on commit 3c4eb04

Please sign in to comment.