Passed
Push — master ( c91dc3...4188a0 )
by Christian
14:57 queued 10s
created

src/Administration/Resources/app/administration/test/e2e/cypress/integration/settings/sw-settings-login-registration/sw-settings-login-registration.spec.js   A

Complexity

Total Complexity 8
Complexity/F 1.14

Size

Lines of Code 48
Function Count 7

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 30
dl 0
loc 48
rs 10
c 0
b 0
f 0
wmc 8
mnd 1
bc 1
fnc 7
bpm 0.1428
cpm 1.1428
noi 7
1
describe('Login / Registration: Test show operations on templates', () => {
2
    beforeEach(() => {
3
        cy.setToInitialState()
0 ignored issues
show
Bug introduced by
The variable cy seems to be never declared. If this is a global, consider adding a /** global: cy */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
4
            .then(() => {
5
                return cy.loginViaApi();
0 ignored issues
show
Bug introduced by
The variable cy seems to be never declared. If this is a global, consider adding a /** global: cy */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
6
            })
7
            .then(() => {
8
                cy.openInitialPage(`${Cypress.env('admin')}#/sw/settings/login/registration/index`);
0 ignored issues
show
Bug introduced by
The variable cy seems to be never declared. If this is a global, consider adding a /** global: cy */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
Bug introduced by
The variable Cypress seems to be never declared. If this is a global, consider adding a /** global: Cypress */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
9
            });
10
    });
11
12
    it('@settings: General (all sales channels)', () => {
13
        cy.window().then((win) => {
0 ignored issues
show
Bug introduced by
The variable cy seems to be never declared. If this is a global, consider adding a /** global: cy */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
14
            if (!win.Shopware.Feature.isActive('FEATURE_NEXT_10555')) {
15
                return;
16
            }
17
18
            // Request we want to wait for later
19
            cy.server();
0 ignored issues
show
Bug introduced by
The variable cy seems to be never declared. If this is a global, consider adding a /** global: cy */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
20
            cy.route({
21
                url: `${Cypress.env('apiPath')}/_action/system-config/batch`,
0 ignored issues
show
Bug introduced by
The variable Cypress seems to be never declared. If this is a global, consider adding a /** global: Cypress */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
22
                method: 'post'
23
            }).as('saveSettings');
24
25
            cy.get('.sw-system-config__card--0 .sw-card__title').contains('General (all sales channels)');
26
27
            cy.get('input[name="core.systemWideLoginRegistration.isCustomerBoundToSalesChannel"]').scrollIntoView();
28
            cy.get('input[name="core.systemWideLoginRegistration.isCustomerBoundToSalesChannel"]').should('be.visible');
29
30
            cy.get('input[name="core.systemWideLoginRegistration.isCustomerBoundToSalesChannel"]').click().should('have.value', 'on');
31
            cy.get('.smart-bar__content .sw-button--primary').click();
32
33
            cy.wait('@saveSettings').then((xhr) => {
34
                expect(xhr).to.have.property('status', 204);
35
            });
36
37
            cy.get('.sw-sales-channel-switch').scrollIntoView();
38
            cy.get('#salesChannelSelect')
39
                .typeSingleSelectAndCheck(
40
                    'Storefront',
41
                    '#salesChannelSelect'
42
                );
43
44
            cy.get('input[name="core.systemWideLoginRegistration.isCustomerBoundToSalesChannel"]').scrollIntoView();
45
            cy.get('input[name="core.systemWideLoginRegistration.isCustomerBoundToSalesChannel"]').should('have.value', 'on');
46
        });
47
    });
48
});
49