Passed
Push — master ( 878f88...929741 )
by Christian
15:02 queued 12s
created

src/Storefront/Resources/app/storefront/test/e2e/cypress/integration/cookie/cookie-bar.spec.js   A

Complexity

Total Complexity 5
Complexity/F 1

Size

Lines of Code 31
Function Count 5

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 5
eloc 19
mnd 0
bc 0
fnc 5
dl 0
loc 31
rs 10
bpm 0
cpm 1
noi 4
c 0
b 0
f 0
1
describe('Test if the cookie bar works correctly', () => {
2
    beforeEach(() => {
3
        cy.setToInitialState().then(() => {
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
            cy.visit('/');
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...
5
        });
6
    });
7
8
    it('Should accept all cookies when user clicks on accept all in cookie bar', () => {
9
        // should wait of cookieOffcanvas
10
        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...
11
        cy.route({
12
            url: '/cookie/offcanvas',
13
            method: 'get'
14
        }).as('cookieOffcanvas');
15
16
        cy.get('.cms-element-product-listing').should('be.visible');
17
        cy.get('.cookie-permission-container').should('be.visible');
18
19
        cy.get('.js-cookie-accept-all-button').should('be.visible')
20
            .click();
21
22
        cy.wait('@cookieOffcanvas').then(() => {
23
            cy.get('.offcanvas-cookie').should('not.be.visible');
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...
24
25
            cy.reload(true);
26
27
            cy.get('.cms-element-product-listing').should('be.visible');
28
            cy.get('.cookie-permission-container').should('not.be.visible');
29
        });
30
    });
31
});
32