graphdb-workbench-tests 3.3.1 → 3.3.2-RC2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/e2e-legacy/graphql/graphql-theme.spec.js +73 -0
  2. package/e2e-legacy/guides/main-menu/main-menu-guide.spec.js +302 -0
  3. package/e2e-legacy/guides/ttyg/conversation/ttyg-conversation-guide.spec.js +6 -2
  4. package/e2e-legacy/guides/ttyg/edit-agent/edit-ttyg-agent-guide.spec.js +87 -0
  5. package/e2e-legacy/home/cookie-policy/cookie-policy.spec.js +182 -0
  6. package/e2e-legacy/import/import-server-files.spec.js +3 -1
  7. package/e2e-legacy/repository/repositories.spec.js +5 -2
  8. package/e2e-legacy/repository/url-with-repository-id-parameter.spec.js +25 -0
  9. package/e2e-legacy/setup/users-and-access/user-and-access.spec.js +36 -0
  10. package/e2e-security/repository/url-with-repository-id-parameter.spec.js +57 -0
  11. package/e2e-security/setup/home/cookie-policy.spec.js +232 -6
  12. package/fixtures/guides/main-menu/main-menu-guide.json +98 -0
  13. package/fixtures/guides/ttyg/edit-ttyg-agent/edit-ttyg-agent-guide.json +22 -0
  14. package/npm-shrinkwrap.json +2 -2
  15. package/package.json +1 -1
  16. package/steps/base-steps.js +4 -0
  17. package/steps/cookie-policy/cookie-consent-banner-steps.js +21 -0
  18. package/steps/cookie-policy/cookie-policy-modal.steps.js +56 -0
  19. package/steps/error-page-steps.js +9 -0
  20. package/steps/graphql/playground-editor-steps.js +46 -0
  21. package/steps/header-steps.js +13 -0
  22. package/steps/home-steps.js +0 -20
  23. package/steps/import/import-resource-message-dialog.js +1 -1
  24. package/steps/login-steps.js +5 -0
  25. package/steps/main-menu-steps.js +12 -0
  26. package/steps/repository-steps.js +2 -2
  27. package/steps/setup/settings-steps.js +1 -1
  28. package/steps/setup/user-and-access-steps.js +14 -6
  29. package/steps/shared-modal-dialog-steps.js +45 -0
  30. package/steps/visual-graph-steps.js +1 -1
  31. package/stubs/guides/guides-stubs.js +8 -0
  32. package/stubs/security-stubs.js +8 -0
  33. package/stubs/ttyg/ttyg-stubs.js +2 -4
  34. package/support/e2e-security.js +9 -0
  35. package/support/settings-commands.js +18 -2
  36. package/e2e-legacy/home/cookie-policy.spec.js +0 -108
@@ -0,0 +1,98 @@
1
+ [
2
+ {
3
+ "guideName": {
4
+ "en": "Main menu guide test"
5
+ },
6
+ "steps": [
7
+ {
8
+ "guideBlockName": "click-main-menu",
9
+ "options": {
10
+ "menu": "import",
11
+ "mainAction": "import-file",
12
+ "showIntro": true
13
+ }
14
+ },
15
+ {
16
+ "guideBlockName": "click-main-menu",
17
+ "options": {
18
+ "menu": "repositories",
19
+ "mainAction": "create-repository",
20
+ "showIntro": true
21
+ }
22
+ },
23
+ {
24
+ "guideBlockName": "click-main-menu",
25
+ "options": {
26
+ "menu": "class-hierarchy",
27
+ "mainAction": "class-hierarchy",
28
+ "showIntro": true
29
+ }
30
+ },
31
+ {
32
+ "guideBlockName": "click-main-menu",
33
+ "options": {
34
+ "menu": "class-relationships",
35
+ "mainAction": "class-relationships",
36
+ "showIntro": true
37
+ }
38
+ },
39
+ {
40
+ "guideBlockName": "click-main-menu",
41
+ "options": {
42
+ "menu": "visual-graph",
43
+ "mainAction": "visual-graph",
44
+ "showIntro": true
45
+ }
46
+ },
47
+ {
48
+ "guideBlockName": "click-main-menu",
49
+ "options": {
50
+ "menu": "similarity",
51
+ "mainAction": "create-similarity-index",
52
+ "showIntro": true
53
+ }
54
+ },
55
+ {
56
+ "guideBlockName": "click-main-menu",
57
+ "options": {
58
+ "menu": "sparql",
59
+ "mainAction": "execute-sparql-query",
60
+ "showIntro": true
61
+ }
62
+ },
63
+ {
64
+ "guideBlockName": "click-main-menu",
65
+ "options": {
66
+ "menu": "ttyg",
67
+ "mainAction": "create-ttyg-agent",
68
+ "showIntro": true
69
+ }
70
+ },
71
+ {
72
+ "guideBlockName": "click-main-menu",
73
+ "options": {
74
+ "menu": "autocomplete",
75
+ "mainAction": "enable-autocomplete",
76
+ "showIntro": true
77
+ }
78
+ },
79
+ {
80
+ "guideBlockName": "click-main-menu",
81
+ "options": {
82
+ "menu": "connectors",
83
+ "title": "Connectors"
84
+ }
85
+ },
86
+ {
87
+ "guideBlockName": "click-main-menu",
88
+ "options": {
89
+ "menu": "rdf-rank",
90
+ "title": "RDF Rank"
91
+ }
92
+ },
93
+ {
94
+ "guideBlockName": "guide-end"
95
+ }
96
+ ]
97
+ }
98
+ ]
@@ -0,0 +1,22 @@
1
+ [
2
+ {
3
+ "guideName": {
4
+ "en": "edit-ttyg-test-guide"
5
+ },
6
+ "steps": [
7
+ {
8
+ "guideBlockName": "edit-ttyg-agent",
9
+ "options": {
10
+ "methods": [
11
+ {
12
+ "guideBlockName": "sparql-search-method",
13
+ "options": {
14
+ "ontologyGraph": "http://example.com"
15
+ }
16
+ }
17
+ ]
18
+ }
19
+ }
20
+ ]
21
+ }
22
+ ]
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "graphdb-workbench-tests",
3
- "version": "3.3.1",
3
+ "version": "3.3.2-RC2",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "graphdb-workbench-tests",
9
- "version": "3.3.1",
9
+ "version": "3.3.2-RC2",
10
10
  "license": "Apache-2.0",
11
11
  "devDependencies": {
12
12
  "@bahmutov/cypress-code-coverage": "^2.7.2",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "graphdb-workbench-tests",
3
- "version": "3.3.1",
3
+ "version": "3.3.2-RC2",
4
4
  "description": "Cypress tests for GraphDB workbench",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -22,4 +22,8 @@ export class BaseSteps {
22
22
  static getUrl() {
23
23
  return cy.url();
24
24
  }
25
+
26
+ static validateUrl(url) {
27
+ this.getUrl().should('include', url);
28
+ }
25
29
  }
@@ -0,0 +1,21 @@
1
+ export class CookieConsentBannerSteps {
2
+ static getCookieConsentBanner() {
3
+ return cy.get('.cookie-consent-banner');
4
+ }
5
+
6
+ static getCookieConsentButton() {
7
+ return this.getCookieConsentBanner().find('button');
8
+ }
9
+
10
+ static giveCookieConsent() {
11
+ return this.getCookieConsentButton().click();
12
+ }
13
+
14
+ static getCookiePolicyLink() {
15
+ return cy.get('.cookie-consent-content a');
16
+ }
17
+
18
+ static clickCookiePolicyLink() {
19
+ return this.getCookiePolicyLink().click();
20
+ }
21
+ }
@@ -0,0 +1,56 @@
1
+ import {SharedModalDialogSteps} from '../shared-modal-dialog-steps';
2
+
3
+ export class CookiePolicyModalSteps extends SharedModalDialogSteps {
4
+ static getDialogComponent(cssClass = '.cookie-policy-modal') {
5
+ return super.getDialogComponent(cssClass);
6
+ }
7
+
8
+ static getStatisticCookiesToggle() {
9
+ return this.getBody().find('.statistic-cookies-toggle .toggle-switch');
10
+ }
11
+
12
+ static getStatisticCookiesCheckbox() {
13
+ return this.getStatisticCookiesToggle().find('input');
14
+ }
15
+
16
+ static toggleStatisticCookies() {
17
+ this.getStatisticCookiesToggle().click();
18
+ // Wait here is intentional because there is a debounce before the checkbox state is updated
19
+ // eslint-disable-next-line cypress/no-unnecessary-waiting
20
+ cy.wait(500);
21
+ }
22
+
23
+ static getThirdPartyCookiesToggle() {
24
+ return this.getBody().find('.third-party-cookies-toggle .toggle-switch');
25
+ }
26
+
27
+ static getThirdPartyCookiesCheckbox() {
28
+ return this.getThirdPartyCookiesToggle().find('input');
29
+ }
30
+
31
+ static toggleThirdPartyCookies() {
32
+ this.getThirdPartyCookiesToggle().click();
33
+ // Wait here is intentional because there is a debounce before the checkbox state is updated
34
+ // eslint-disable-next-line cypress/no-unnecessary-waiting
35
+ cy.wait(500);
36
+ }
37
+
38
+ static closeDialog() {
39
+ this.getFooter().find('.close-btn').click();
40
+ }
41
+
42
+ /**
43
+ * Validates the cookie policy dialog by checking the visibility of the dialog and the state of the checkboxes for
44
+ * analytic and third party cookies.
45
+ * @param {boolean} expectedStatisticChecked
46
+ * @param {boolean} expectedThirdPartyChecked
47
+ */
48
+ static validateCookiePolicyDialog(expectedStatisticChecked, expectedThirdPartyChecked) {
49
+ // I should see the cookie policy
50
+ CookiePolicyModalSteps.getDialogComponent().should('be.visible');
51
+ CookiePolicyModalSteps.getBody().should('be.visible');
52
+ // And I expect to see that analytic and third party cookies are allowed
53
+ CookiePolicyModalSteps.getStatisticCookiesCheckbox().should(expectedStatisticChecked ? 'be.checked' : 'not.be.checked');
54
+ CookiePolicyModalSteps.getThirdPartyCookiesCheckbox().should(expectedThirdPartyChecked ? 'be.checked' : 'not.be.checked');
55
+ }
56
+ }
@@ -0,0 +1,9 @@
1
+ export class ErrorPageSteps {
2
+ static visit404() {
3
+ cy.visit('/404');
4
+ }
5
+
6
+ static get404Page() {
7
+ return cy.get('app-not-found-page');
8
+ }
9
+ }
@@ -0,0 +1,46 @@
1
+ export class PlaygroundEditorSteps {
2
+
3
+ static getResponse() {
4
+ return cy.get('.graphiql-response');
5
+ }
6
+
7
+ static getResponseCodeMirror() {
8
+ return PlaygroundEditorSteps.getResponse().find('.CodeMirror');
9
+ }
10
+
11
+ static getGraphiqlEditors() {
12
+ return cy.get('.graphiql-editors');
13
+ }
14
+
15
+ static getGraphiqlEditorsCodeMirror() {
16
+ return PlaygroundEditorSteps.getGraphiqlEditors().find('.CodeMirror');
17
+ }
18
+
19
+ static getGraphiqlEditorTools() {
20
+ return cy.get('.graphiql-editor-tools');
21
+ }
22
+
23
+ static getGraphiqlEditorTool() {
24
+ return cy.get('.graphiql-editor-tool');
25
+ }
26
+
27
+ static getVariablesBtn() {
28
+ return PlaygroundEditorSteps.getGraphiqlEditorTools().find('button[data-name="variables"]');
29
+ }
30
+
31
+ static openVariables() {
32
+ PlaygroundEditorSteps.getVariablesBtn().click();
33
+ }
34
+
35
+ static getHeadersBtn() {
36
+ return PlaygroundEditorSteps.getGraphiqlEditorTools().find('button[data-name="headers"]');
37
+ }
38
+
39
+ static openHeaders() {
40
+ PlaygroundEditorSteps.getHeadersBtn().click();
41
+ }
42
+
43
+ static getActiveGraphiqlEditorToolCodeMirror() {
44
+ return PlaygroundEditorSteps.getGraphiqlEditorTool().find('.graphiql-editor:not(.hidden) .CodeMirror');
45
+ }
46
+ }
@@ -6,4 +6,17 @@ export class HeaderSteps {
6
6
  static openHomePage() {
7
7
  HeaderSteps.getHeader().find('.home-page').click();
8
8
  }
9
+
10
+ static logout() {
11
+ this.getHeader().find('onto-user-menu').click();
12
+ cy.get('.onto-user-menu-dropdown')
13
+ .contains('Logout')
14
+ .first()
15
+ // Force the click because Cypress sometimes determines that the item has 0x0 dimensions
16
+ .click({force: true});
17
+ }
18
+
19
+ static login() {
20
+ this.getHeader().find('.onto-user-login').click();
21
+ }
9
22
  }
@@ -313,26 +313,6 @@ class HomeSteps extends BaseSteps {
313
313
  return cy.get('#license-label-home');
314
314
  }
315
315
 
316
- static getCookieConsentPopup() {
317
- return cy.get('.cookie-consent-modal');
318
- }
319
-
320
- static getAgreeButton() {
321
- return HomeSteps.getCookieConsentPopup().find('button');
322
- }
323
-
324
- static clickAgreeButton() {
325
- return HomeSteps.getAgreeButton().click();
326
- }
327
-
328
- static getCookiePolicyLink() {
329
- return cy.get('.cookie-consent-content a');
330
- }
331
-
332
- static clickCookiePolicyLink() {
333
- return HomeSteps.getCookiePolicyLink().click();
334
- }
335
-
336
316
  static getCookiePolicyModal() {
337
317
  return cy.get('.cookie-policy-modal');
338
318
  }
@@ -14,7 +14,7 @@ export class ImportResourceMessageDialog extends ModalDialogSteps {
14
14
  }
15
15
 
16
16
  static getMessage() {
17
- return this.getDialogBody().find('.message');
17
+ return this.getDialogBody();
18
18
  }
19
19
 
20
20
  static getCopyToClipboard() {
@@ -18,6 +18,10 @@ export class LoginSteps {
18
18
  cy.visit(`/login?r=${returnURLEncoded}`);
19
19
  }
20
20
 
21
+ static getLoginPage() {
22
+ return cy.get('app-login');
23
+ }
24
+
21
25
  static navigateToLoginPage() {
22
26
  cy.get('onto-user-login').click();
23
27
  }
@@ -29,6 +33,7 @@ export class LoginSteps {
29
33
  cy.getByTestId('submit-btn').click();
30
34
  }
31
35
 
36
+ // TODO: Use the HeaderSteps.logout()
32
37
  static logout() {
33
38
  cy.get('onto-user-menu').click();
34
39
  cy.get('.onto-user-menu-dropdown')
@@ -95,6 +95,10 @@ export class MainMenuSteps {
95
95
 
96
96
  static clickOnVisualGraph() {
97
97
  this.clickOnExplore();
98
+ this.clickOnSubmenuVisualGraph();
99
+ }
100
+
101
+ static clickOnSubmenuVisualGraph() {
98
102
  this.getSubMenuButton('sub-menu-visual-graph').click();
99
103
  }
100
104
 
@@ -190,11 +194,19 @@ export class MainMenuSteps {
190
194
 
191
195
  static clickOnRDFRank() {
192
196
  this.clickOnMenuSetup();
197
+ this.clickOnSubmenuRDFRank();
198
+ }
199
+
200
+ static clickOnSubmenuRDFRank() {
193
201
  this.getSubMenuButton('sub-menu-rdf-rank').click();
194
202
  }
195
203
 
196
204
  static clickOnConnectors() {
197
205
  this.clickOnMenuSetup();
206
+ this.clickOnSubmenuConnectors();
207
+ }
208
+
209
+ static clickOnSubmenuConnectors() {
198
210
  this.getSubMenuButton('sub-menu-connectors').click();
199
211
  }
200
212
 
@@ -76,7 +76,7 @@ export class RepositorySteps extends BaseSteps {
76
76
  }
77
77
 
78
78
  static getRepositoryConnectionOffBtn(id) {
79
- return RepositorySteps.getRepositoryFromList(id).find('.ri-link-unlink');
79
+ return RepositorySteps.getRepositoryFromList(id).find('.icon-connection-off');
80
80
  }
81
81
 
82
82
  static activateRepository(id) {
@@ -84,7 +84,7 @@ export class RepositorySteps extends BaseSteps {
84
84
  }
85
85
 
86
86
  static getRepositoryConnectionOnBtn(id) {
87
- return RepositorySteps.getRepositoryFromList(id).find('.ri-link');
87
+ return RepositorySteps.getRepositoryFromList(id).find('.icon-connection-on');
88
88
  }
89
89
 
90
90
  static clickRepositoryIcon(repositoryId, selector) {
@@ -107,7 +107,7 @@ export class SettingsSteps {
107
107
  }
108
108
 
109
109
  static clickCookiePolicyLink() {
110
- return SettingsSteps.getCookiePolicyButton().click();
110
+ return this.getCookiePolicyButton().click();
111
111
  }
112
112
 
113
113
  static getCookiePolicyModal() {
@@ -13,6 +13,10 @@ export class UserAndAccessSteps {
13
13
  });
14
14
  }
15
15
 
16
+ static getUsersCatalogContainer() {
17
+ return cy.get('#wb-users');
18
+ }
19
+
16
20
  static getUrl() {
17
21
  return cy.url();
18
22
  }
@@ -105,6 +109,10 @@ export class UserAndAccessSteps {
105
109
  .closest('tr').as('user');
106
110
  }
107
111
 
112
+ static getUserCustomRoles(userRow) {
113
+ return cy.get(userRow).getByTestId('custom-roles').getByTestId('custom-role');
114
+ }
115
+
108
116
  static getUsernameField() {
109
117
  return cy.get('#wb-user-username');
110
118
  }
@@ -359,15 +367,15 @@ export class UserAndAccessSteps {
359
367
  }
360
368
 
361
369
  static clickFreeWriteAccessRepo(repoName) {
362
- const repoRow = cy.get('.repo-fields').contains(repoName).parent('.row');
363
- repoRow.scrollIntoView();
364
- repoRow.find('.write').realClick();
370
+ cy.get('.repo-fields').contains(repoName).parent('.row').as('row');
371
+ cy.get('@row').scrollIntoView();
372
+ cy.get('@row').find('.write').realClick();
365
373
  }
366
374
 
367
375
  static clickFreeGraphqlAccessRepo(repoName) {
368
- const repoRow = cy.get('.repo-fields').contains(repoName).parent('.row');
369
- repoRow.scrollIntoView();
370
- repoRow.find('.graphql').realClick();
376
+ cy.get('.repo-fields').contains(repoName).parent('.row').as('row');
377
+ cy.get('@row').scrollIntoView();
378
+ cy.get('@row').find('.graphql').realClick();
371
379
  }
372
380
 
373
381
  }
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Basic steps for interacting with the onto-dialog component. This class is designed to be extended by more specific
3
+ * dialog steps classes.
4
+ */
5
+ export class SharedModalDialogSteps {
6
+ /**
7
+ * Returns the onto-dialog element.
8
+ * This is the generic method to get the dialog element.
9
+ */
10
+ static getDialog() {
11
+ return cy.get('onto-dialog');
12
+ }
13
+
14
+ /**
15
+ * Returns a child component of the dialog based on the provided CSS class. The onto-dialog component is designed to
16
+ * be flexible and can contain be composed of various child components included in different slots: header, body,
17
+ * and footer.
18
+ * The purpose of this method is to allow selection of specific dialog in case there are multiple dialogs in the page.
19
+ * @param cssClass - The CSS class of the child component to retrieve. Defaults to '.dialog', which will return the
20
+ * dialog itself.
21
+ */
22
+ static getDialogComponent(cssClass = '.dialog') {
23
+ return cy.get(cssClass);
24
+ }
25
+
26
+ static getHeader() {
27
+ return this.getDialog().find('.dialog-header');
28
+ }
29
+
30
+ static getBody() {
31
+ return this.getDialog().find('.dialog-body');
32
+ }
33
+
34
+ static getFooter() {
35
+ return this.getDialog().find('.dialog-footer');
36
+ }
37
+
38
+ static getCloseButton() {
39
+ return this.getHeader().find('.close');
40
+ }
41
+
42
+ static close() {
43
+ this.getCloseButton().click();
44
+ }
45
+ }
@@ -133,7 +133,7 @@ export class VisualGraphSteps extends BaseSteps {
133
133
  }
134
134
 
135
135
  static getNodeLabel(nodeId) {
136
- return this.getNode(nodeId).find('.node-label-body');
136
+ return this.getNode(nodeId).find('.node-label-body div');
137
137
  }
138
138
 
139
139
  static getPredicates() {
@@ -15,6 +15,10 @@ export class GuidesStubs {
15
15
  GuidesStubs.stubWithFixture('../fixtures/guides/ttyg/conversation/ttyg-conversation-guide.json');
16
16
  }
17
17
 
18
+ static stubTTYGEditAgentGuide() {
19
+ GuidesStubs.stubWithFixture('../fixtures/guides/ttyg/edit-ttyg-agent/edit-ttyg-agent-guide.json');
20
+ }
21
+
18
22
  static stubClassHierarchyGuide() {
19
23
  GuidesStubs.stubWithFixture('../fixtures/guides/class-hierarchy/class-hierarchy-guide.json');
20
24
  }
@@ -39,6 +43,10 @@ export class GuidesStubs {
39
43
  GuidesStubs.stubWithFixture('../fixtures/guides/download-guide-resource/download-guide-resource-guide.json');
40
44
  }
41
45
 
46
+ static stubMainMenuGuide() {
47
+ GuidesStubs.stubWithFixture('../fixtures/guides/main-menu/main-menu-guide.json');
48
+ }
49
+
42
50
  static stubDownloadResource(resourcePath, resourceFile) {
43
51
  cy.intercept('GET', `/rest/guides/download/${resourcePath}/${resourceFile}`, {
44
52
  fixture: `guides/download-resource.ttl`,
@@ -10,12 +10,20 @@ export class SecurityStubs {
10
10
  }).as('security-get-admin');
11
11
  }
12
12
 
13
+ static spyOnUserCreate() {
14
+ cy.intercept('POST', 'rest/security/users/*').as('create-user');
15
+ }
16
+
13
17
  static stubInferAndSameAsDefaults() {
14
18
  cy.intercept('rest/security/all', (req) => {
15
19
  req.reply(SecurityStubs.getResponseSecurityEnabled());
16
20
  }).as('security-all');
17
21
  }
18
22
 
23
+ static spyOnUserUpdate(userName) {
24
+ cy.intercept('PATCH', `rest/security/users/${userName}`).as('updateUser');
25
+ }
26
+
19
27
  static stubUpdateUserData(userName) {
20
28
  cy.intercept('PATCH', `/rest/security/users/${userName}`, {
21
29
  statusCode: 200,
@@ -106,12 +106,10 @@ export class TTYGStubs extends Stubs {
106
106
  }).as('get-agent');
107
107
  }
108
108
 
109
- static stubAgentListGetError() {
109
+ static stubAgentListGetError(error = 'Internal Server Error') {
110
110
  cy.intercept('GET', '/rest/chat/agents', {
111
111
  statusCode: 500,
112
- response: {
113
- error: 'Internal Server Error'
114
- }
112
+ body: error
115
113
  }).as('get-agent-list-error');
116
114
  }
117
115
 
@@ -0,0 +1,9 @@
1
+ import './e2e';
2
+
3
+ beforeEach(() => {
4
+ cy.loginAsAdmin();
5
+ // Switch off security after each test to ensure that tests are independent and don't affect each other.
6
+ // For example, if security is enabled in one test, it can cause other tests that don't expect security to fail.
7
+ cy.switchOffSecurity(true);
8
+ cy.switchOffFreeAccess(true);
9
+ });
@@ -1,4 +1,12 @@
1
- Cypress.Commands.add('setDefaultUserData', (cookieConsent = true) => {
1
+ /**
2
+ * Sets the default user settings for the admin user, including cookie consent.
3
+ * @param {CookieConsent} cookieConsent - The value to set for cookie consent.
4
+ * - policyAccepted: boolean indicating whether the cookie policy has been accepted.
5
+ * - statistic: boolean indicating consent for statistical cookies.
6
+ * - thirdParty: boolean indicating consent for third-party cookies.
7
+ * - updatedAt: epoch timestamp of last update in seconds.
8
+ */
9
+ Cypress.Commands.add('setDefaultUserData', (cookieConsent) => {
2
10
  const defaultUserSettings = {
3
11
  'COOKIE_CONSENT': cookieConsent,
4
12
  'DEFAULT_SAMEAS': true,
@@ -19,7 +27,15 @@ Cypress.Commands.add('setDefaultUserData', (cookieConsent = true) => {
19
27
  });
20
28
  });
21
29
 
22
- Cypress.Commands.add('setCookieConsent', (cookieConsent) => {
30
+ /**
31
+ * Sets the cookie consent in user settings for the admin user.
32
+ * @param {CookieConsent} cookieConsent - The value to set for cookie consent.
33
+ * - policyAccepted: boolean indicating whether the cookie policy has been accepted.
34
+ * - statistic: boolean indicating consent for statistical cookies.
35
+ * - thirdParty: boolean indicating consent for third-party cookies.
36
+ * - updatedAt: epoch timestamp of last update in seconds.
37
+ */
38
+ Cypress.Commands.add('setCookieConsent', (cookieConsent ) => {
23
39
  const defaultUserSettings = {
24
40
  'COOKIE_CONSENT': cookieConsent
25
41
  };