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
@@ -1,108 +0,0 @@
1
- import HomeSteps from '../../steps/home-steps';
2
- import {SecurityStubs} from '../../stubs/security-stubs';
3
- import {SettingsSteps} from '../../steps/setup/settings-steps';
4
- import {LicenseStubs} from '../../stubs/license-stubs';
5
-
6
- Cypress.env('set_default_user_data', false);
7
-
8
- describe('Cookie policy', () => {
9
- beforeEach(() => {
10
- cy.setCookieConsent(undefined);
11
- cy.viewport(1280, 1000);
12
- LicenseStubs.stubFreeLicense();
13
- });
14
-
15
- afterEach(() => cy.setCookieConsent(true));
16
-
17
- context('should show', () => {
18
- it('Should show consent popup to user', () => {
19
- HomeSteps.visitInProdMode();
20
- HomeSteps.getCookieConsentPopup().should('exist').and('be.visible');
21
- // When I click on the link
22
- HomeSteps.clickCookiePolicyLink();
23
- // Then I see the cookie policy
24
- HomeSteps.getCookiePolicyModal().should('exist').and('be.visible');
25
- });
26
-
27
- it('Should show cookie policy to user in user settings', () => {
28
- SettingsSteps.visitInProdMode();
29
- SettingsSteps.getCookiePolicyButton().should('exist').and('be.visible');
30
-
31
- // When I click on the link
32
- SettingsSteps.clickCookiePolicyLink();
33
- // Then I see the cookie policy
34
- SettingsSteps.getCookiePolicyModal().should('exist').and('be.visible');
35
- });
36
-
37
- it('Should save consent in user settings', () => {
38
- HomeSteps.visitInProdMode();
39
- SecurityStubs.stubUpdateUserData('admin');
40
-
41
- // When I click Agree button
42
- HomeSteps.clickAgreeButton();
43
-
44
- // I expect to save cookie consent in user settings
45
- cy.wait('@updateUser').then((xhr) => {
46
- expect(xhr.request.body.appSettings).to.include({
47
- DEFAULT_INFERENCE: true,
48
- DEFAULT_VIS_GRAPH_SCHEMA: true,
49
- DEFAULT_SAMEAS: true,
50
- IGNORE_SHARED_QUERIES: false,
51
- EXECUTE_COUNT: true
52
- });
53
-
54
- // Assert COOKIE_CONSENT properties, excluding updatedAt
55
- expect(xhr.request.body.appSettings.COOKIE_CONSENT).to.include({
56
- policyAccepted: true
57
- });
58
-
59
- // Assert that updatedAt is present, is a number, and is a reasonable timestamp
60
- const updatedAt = xhr.request.body.appSettings.COOKIE_CONSENT.updatedAt;
61
- expect(updatedAt).to.exist;
62
- expect(updatedAt).to.be.a('number');
63
-
64
- // Check that updatedAt is within 1 hour of the current time
65
- const oneHourInMilliseconds = 60 * 60 * 1000;
66
- const now = Date.now();
67
- expect(updatedAt).to.be.within(now - oneHourInMilliseconds, now + oneHourInMilliseconds);
68
- });
69
- });
70
-
71
- it('Should set cookies for tracking when accepted', () => {
72
- cy.intercept('PATCH', `/rest/security/users/admin`).as('updateUser');
73
- HomeSteps.visitInProdMode();
74
-
75
- // When I click Agree button
76
- HomeSteps.clickAgreeButton();
77
-
78
- // I expect to save cookie consent in user settings
79
- // There are two requests one from the new shared component and one in the legacy
80
- cy.wait('@updateUser');
81
- cy.wait('@updateUser');
82
-
83
- // Check if the GA tracking script is set correctly in the head
84
- cy.document()
85
- .get('head script')
86
- .should("have.attr", "src")
87
- .should('include', 'https://www.googletagmanager.com/gtm.js?id=GTM-WBP6C6Z4');
88
-
89
- // Check if the installation ID cookie is set correctly
90
- cy.getCookie('_wb').then((cookie) => {
91
- expect(cookie).to.exist;
92
- expect(cookie.value).to.match(/^WB1\.[a-zA-Z0-9\-]+\.\d+$/); // Check the cookie structure: WB1.<installationId>.<timestamp>
93
- });
94
- })
95
- })
96
-
97
- context('should not show', () => {
98
- it('Should NOT show consent popup to user when tracking is not applicable', () => {
99
- HomeSteps.visitInDevMode();
100
- HomeSteps.getCookieConsentPopup().should('not.exist');
101
- });
102
-
103
- it('Should NOT show cookie policy to user when tracking is not applicable', () => {
104
- SettingsSteps.visitInDevMode();
105
- SettingsSteps.getCookiePolicyButton().should('not.exist');
106
- });
107
- });
108
- });