1
|
|
|
/// <reference types="Cypress" /> |
2
|
|
|
|
3
|
|
|
import CategoryPageObject from '../../../support/pages/module/sw-category.page-object'; |
4
|
|
|
|
5
|
|
|
describe('Product Search: Test crud operations', () => { |
6
|
|
|
before(() => { |
7
|
|
|
cy.onlyOnFeature('FEATURE_NEXT_10552'); |
|
|
|
|
8
|
|
|
}); |
9
|
|
|
|
10
|
|
|
beforeEach(() => { |
11
|
|
|
cy.setToInitialState() |
|
|
|
|
12
|
|
|
.then(() => { |
13
|
|
|
cy.loginViaApi(); |
|
|
|
|
14
|
|
|
}) |
15
|
|
|
.then(() => { |
16
|
|
|
cy.openInitialPage(`${Cypress.env('admin')}#/sw/settings/search/index`); |
|
|
|
|
17
|
|
|
}); |
18
|
|
|
}); |
19
|
|
|
|
20
|
|
|
it('@base @settings: create search configuration for search behaviour', () => { |
21
|
|
|
// Request we want to wait for later |
22
|
|
|
cy.server(); |
|
|
|
|
23
|
|
|
cy.route({ |
24
|
|
|
url: '/api/v*/product-search-config/*', |
25
|
|
|
method: 'patch' |
26
|
|
|
}).as('saveData'); |
27
|
|
|
|
28
|
|
|
// Make sure that everything need to load first. |
29
|
|
|
cy.wait(3000); |
30
|
|
|
|
31
|
|
|
// Change value of Minimal search term length |
32
|
|
|
cy.get('.sw-settings-search__search-behaviour-term-length input').clear().type('10'); |
33
|
|
|
|
34
|
|
|
// Check for Or Behaviour option |
35
|
|
|
cy.get('input[type="radio"]#sw-field--searchBehaviourConfigs-andLogic-1').check(); |
36
|
|
|
|
37
|
|
|
cy.get('.sw-settings-search__button-save').click(); |
38
|
|
|
|
39
|
|
|
// Verify save search config method |
40
|
|
|
cy.wait('@saveData').then((xhr) => { |
41
|
|
|
expect(xhr).to.have.property('status', 204); |
42
|
|
|
}); |
43
|
|
|
}); |
44
|
|
|
|
45
|
|
|
it('@base @settings: create search configuration for search behaviour bases on another language', () => { |
46
|
|
|
const page = new CategoryPageObject(); |
47
|
|
|
// Request we want to wait for later |
48
|
|
|
cy.server(); |
|
|
|
|
49
|
|
|
cy.route({ |
50
|
|
|
url: '/api/v*/product-search-config/*', |
51
|
|
|
method: 'patch' |
52
|
|
|
}).as('saveData'); |
53
|
|
|
|
54
|
|
|
// Make sure that everything need to load first. |
55
|
|
|
cy.wait(3000); |
56
|
|
|
|
57
|
|
|
// Choose German language |
58
|
|
|
page.changeTranslation('Deutsch', 0); |
59
|
|
|
|
60
|
|
|
// change value of Minimal search term length |
61
|
|
|
cy.get('.sw-settings-search__search-behaviour-term-length input').clear().type('19'); |
62
|
|
|
|
63
|
|
|
// Check for Or Behaviour option |
64
|
|
|
cy.get('input[type="radio"]#sw-field--searchBehaviourConfigs-andLogic-1').check(); |
65
|
|
|
|
66
|
|
|
cy.get('.sw-settings-search__button-save').click(); |
67
|
|
|
|
68
|
|
|
// Verify save search config method |
69
|
|
|
cy.wait('@saveData').then((xhr) => { |
70
|
|
|
expect(xhr).to.have.property('status', 204); |
71
|
|
|
}); |
72
|
|
|
}); |
73
|
|
|
}); |
74
|
|
|
|
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.