Passed
Push — master ( 37e336...5cb54f )
by Christian
12:38 queued 11s
created

src/Storefront/Resources/app/storefront/test/e2e/cypress/integration/breadcrumb/breadcrumb.spec.js   A

Complexity

Total Complexity 9
Complexity/F 1

Size

Lines of Code 75
Function Count 9

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 49
dl 0
loc 75
rs 10
c 0
b 0
f 0
wmc 9
mnd 0
bc 0
fnc 9
bpm 0
cpm 1
noi 10
1
describe('Test if breadcrumb works correctly', () => {
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
                cy.searchViaAdminApi({
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
                    endpoint: 'category',
7
                    data: {
8
                        field: 'name',
9
                        value: 'Home'
10
                    }
11
                }).then(({id: categoryId}) => {
0 ignored issues
show
Unused Code introduced by
The parameter id is not used and could be removed.

This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.

Loading history...
12
                    cy.createCategoryFixture({
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...
13
                        name: 'Test category 1',
14
                        type: 'folder',
15
                        parentId: categoryId,
0 ignored issues
show
Bug introduced by
The variable categoryId seems to be never declared. If this is a global, consider adding a /** global: categoryId */ 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...
16
                        children: [
17
                            {
18
                                name: 'Sub 1',
19
                                type: 'page'
20
                            }
21
                        ]
22
                    });
23
24
                    cy.createCategoryFixture({
25
                        name: 'Test category 2',
26
                        type: 'page',
27
                        parentId: categoryId,
28
                        children: [
29
                            {
30
                                name: 'Sub 2',
31
                                type: 'page'
32
                            }
33
                        ]
34
                    });
35
36
                    cy.createCategoryFixture({
37
                        name: 'Test category 3',
38
                        type: 'link',
39
                        parentId: categoryId,
40
                        children: [
41
                            {
42
                                name: 'Sub 3',
43
                                type: 'page'
44
                            }
45
                        ]
46
                    });
47
                });
48
            }).then(() => {
49
                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...
50
            });
51
    });
52
53
    it('@breadcrumb: Check if correct category types are clickable', () => {
54
        cy.get('.nav-link.main-navigation-link').contains('Test category 1').trigger('mouseenter').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...
55
            cy.get('.navigation-flyout-content').should('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...
56
            cy.get('.nav-link.navigation-flyout-link').contains('Sub 1').click();
57
58
            cy.get('.cms-breadcrumb .breadcrumb-container').contains('Test category 1').should('have.prop', 'tagName' ).should('eq', 'DIV');
59
        });
60
61
        cy.get('.nav-link.main-navigation-link').contains('Test category 2').trigger('mouseenter').then(() => {
62
            cy.get('.navigation-flyout-content').should('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...
63
            cy.get('.nav-link.navigation-flyout-link').contains('Sub 2').click();
64
65
            cy.get('.cms-breadcrumb .breadcrumb-container').contains('Test category 2').should('have.prop', 'tagName' ).should('eq', 'A');
66
        });
67
68
        cy.get('.nav-link.main-navigation-link').contains('Test category 3').trigger('mouseenter').then(() => {
69
            cy.get('.navigation-flyout-content').should('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...
70
            cy.get('.nav-link.navigation-flyout-link').contains('Sub 3').click();
71
72
            cy.get('.cms-breadcrumb .breadcrumb-container').contains('Test category 3').should('have.prop', 'tagName' ).should('eq', 'A');
73
        });
74
    });
75
});
76