Passed
Push — master ( 4e7eba...59b4f0 )
by Christian
12:52 queued 11s
created

src/Administration/Resources/app/administration/test/e2e/cypress/integration/general/sw-profile/edit.spec.js   A

Complexity

Total Complexity 8
Complexity/F 1

Size

Lines of Code 77
Function Count 8

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 54
dl 0
loc 77
rs 10
c 0
b 0
f 0
wmc 8
mnd 0
bc 0
fnc 8
bpm 0
cpm 1
noi 8
1
/// <reference types="Cypress" />
2
3
describe('Profile module', () => {
4
    beforeEach(() => {
5
        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...
6
            .then(() => {
7
                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...
8
                    .then(() => {
9
                        cy.openInitialPage(`${Cypress.env('admin')}#/sw/profile/index`);
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...
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...
10
                    });
11
            });
12
    });
13
14
    it('@base @general: profile change email', () => {
15
        cy.get('#sw-field--email')
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...
16
            .should('be.visible')
17
            .click()
18
            .clear()
19
            .type('[email protected]');
20
21
        cy.get('.sw-profile__save-action')
22
            .should('be.visible')
23
            .click();
24
25
        // expect modal to be open
26
        cy.get('.sw-modal')
27
            .should('be.visible');
28
        cy.get('.sw-modal__title')
29
            .contains('Enter your current password to confirm');
30
31
        cy.get('.sw-modal__footer > .sw-button--primary')
32
            .should('be.disabled');
33
34
        cy.get('.sw-modal__body input[name="sw-field--confirm-password"]')
35
            .should('be.visible')
36
            .typeAndCheck('shopware');
37
38
        cy.get('.sw-modal__footer > .sw-button--primary > .sw-button__content')
39
            .should('not.be.disabled')
40
            .click()
41
            .then(() => {
42
                cy.get('.sw-modal')
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...
43
                    .should('not.be.visible');
44
45
                cy.get('#sw-field--email')
46
                    .should('be.visible')
47
                    .should('have.value', '[email protected]');
48
            });
49
    });
50
51
    it('@general: profile raise a notification for invalid authentication', () => {
52
        cy.get('.sw-profile__save-action')
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...
53
            .should('be.visible')
54
            .click();
55
56
        // expect modal to be open
57
        cy.get('.sw-modal')
58
            .should('be.visible');
59
        cy.get('.sw-modal__title')
60
            .contains('Enter your current password to confirm');
61
62
        cy.get('.sw-modal__footer > .sw-button--primary')
63
            .should('be.disabled');
64
65
        cy.get('.sw-modal__body input[name="sw-field--confirm-password"]')
66
            .should('be.visible')
67
            .typeAndCheck('erawpohs');
68
69
        cy.get('.sw-modal__footer > .sw-button--primary > .sw-button__content')
70
            .should('not.be.disabled')
71
            .click()
72
            .then(() => {
73
                cy.get('.sw-modal')
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...
74
                    .should('be.visible');
75
76
                cy.awaitAndCheckNotification('Please submit your current password correctly.');
77
            });
78
    });
79
});
80