graphdb-workbench-tests 3.1.0-WBM-9 → 3.1.0-plugins1

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 (71) hide show
  1. package/.nycrc +10 -0
  2. package/cypress-legacy.config.js +9 -1
  3. package/cypress-security.config.js +40 -0
  4. package/cypress.config.js +3 -1
  5. package/e2e-flaky/import/import-user-data-url.spec.js +63 -0
  6. package/e2e-legacy/explore/graphs-overview/graphs.overview.spec.js +1 -1
  7. package/e2e-legacy/graphql/filter-graphql-endpoints-on-management-view.spec.js +1 -4
  8. package/e2e-legacy/graphql/graphql-endpoint-management-view.spec.js +4 -4
  9. package/e2e-legacy/graphql/import-graphql-endpoint-definitions.spec.js +1 -10
  10. package/e2e-legacy/home/cookie-policy.spec.js +78 -59
  11. package/e2e-legacy/home/documentation-link.spec.js +31 -33
  12. package/e2e-legacy/home/google-analytics.spec.js +4 -6
  13. package/e2e-legacy/home/rdf-resource-search.spec.js +106 -138
  14. package/e2e-legacy/home/view-resource-autocomplete.spec.js +28 -15
  15. package/e2e-legacy/import/import-user-data-url.spec.js +0 -23
  16. package/e2e-legacy/import/import-user-data.spec.js +1 -2
  17. package/e2e-legacy/monitor/global-operation-statuses-component.spec.js +13 -9
  18. package/e2e-legacy/repository/repositories.spec.js +6 -6
  19. package/e2e-legacy/setup/autocomplete/autocomplete.spec.js +3 -4
  20. package/e2e-legacy/setup/jdbc/jdbc-create.spec.js +2 -2
  21. package/e2e-legacy/setup/sparql-template/sparql-template-create.js +10 -3
  22. package/e2e-legacy/setup/users-and-access/user-and-access.spec.js +38 -9
  23. package/e2e-legacy/sparql-editor/saved-query/edit-query.spec.js +3 -6
  24. package/e2e-legacy/sparql-editor/saved-query/share-query.spec.js +2 -2
  25. package/e2e-legacy/ttyg/agent-list.spec.js +37 -2
  26. package/e2e-legacy/ttyg/chat-list.spec.js +1 -2
  27. package/e2e-legacy/ttyg/clone-agent.spec.js +1 -0
  28. package/e2e-legacy/ttyg/create-agent.spec.js +7 -6
  29. package/e2e-legacy/ttyg/edit-agent.spec.js +69 -9
  30. package/e2e-legacy/ttyg/ttyg-initial-state-with-selected-repository.spec.js +4 -2
  31. package/e2e-legacy/ttyg/ttyg-permission.spec.js +28 -20
  32. package/e2e-security/setup/home/cookie-policy.spec.js +64 -0
  33. package/e2e-security/setup/users-and-access/create-user-permissions.spec.js +184 -0
  34. package/e2e-security/setup/users-and-access/graphql-user.spec.js +123 -0
  35. package/e2e-security/setup/users-and-access/repo-admin-role.spec.js +69 -0
  36. package/e2e-security/setup/users-and-access/turn-on-security-and-password-change.spec.js +87 -0
  37. package/e2e-security/setup/users-and-access/user-and-access.spec.js +87 -0
  38. package/e2e-security/setup/users-and-access/users-and-access-initial-state.spec.js +38 -0
  39. package/fixtures/repositories/free-access.json +13 -0
  40. package/fixtures/ttyg/agent/get-agent-defaults-assistant-api.json +44 -0
  41. package/fixtures/ttyg/agent/get-agent-defaults.json +2 -0
  42. package/npm-shrinkwrap.json +7574 -1775
  43. package/package.json +9 -3
  44. package/plugins/index.js +1 -0
  45. package/steps/base-steps.js +4 -0
  46. package/steps/error-steps.js +4 -7
  47. package/steps/graphql/graphql-endpoint-management-steps.js +1 -1
  48. package/steps/home-steps.js +57 -32
  49. package/steps/import/import-steps.js +2 -2
  50. package/steps/login-steps.js +11 -0
  51. package/steps/main-menu-steps.js +13 -6
  52. package/steps/operations-statuses-component-steps.js +5 -10
  53. package/steps/rdf-resource-search-steps.js +55 -0
  54. package/steps/repository-steps.js +1 -0
  55. package/steps/setup/autocomplete-steps.js +4 -0
  56. package/steps/setup/settings-steps.js +18 -0
  57. package/steps/setup/user-and-access-steps.js +24 -2
  58. package/steps/ttyg/ttyg-agent-settings-modal.steps.js +74 -11
  59. package/steps/ttyg/ttyg-view-steps.js +19 -4
  60. package/steps/widgets/active-repository-widget-steps.js +4 -0
  61. package/steps/yasgui/yasr-steps.js +4 -0
  62. package/stubs/browser-stubs.js +21 -0
  63. package/stubs/environment-stubs.js +9 -1
  64. package/stubs/repositories/repositories-stubs.js +4 -0
  65. package/stubs/security-stubs.js +4 -0
  66. package/stubs/ttyg/ttyg-stubs.js +18 -2
  67. package/support/e2e.js +2 -1
  68. package/support/repository-commands.js +14 -1
  69. package/e2e-flaky/setup/users-and-access/security-and-free-access.spec.js +0 -57
  70. package/e2e-flaky/ttyg/ttyg-permission.spec.js +0 -67
  71. package/fixtures/locale-en.json +0 -3361
@@ -1,15 +1,16 @@
1
1
  import HomeSteps from '../../steps/home-steps';
2
+ import {RdfResourceSearchSteps} from "../../steps/rdf-resource-search-steps";
3
+ import ImportSteps from "../../steps/import/import-steps";
4
+ import {BaseSteps} from "../../steps/base-steps";
5
+ import {BrowserStubs} from "../../stubs/browser-stubs";
2
6
 
3
7
  const FILE_TO_IMPORT = 'wine.rdf';
4
8
 
5
- /**
6
- * TODO: Fix me. Broken due to migration (The issue GDB-11314 not implemented)
7
- */
8
- describe.skip('RDF resource search', () => {
9
+ describe('RDF resource search', () => {
9
10
  let repositoryId;
10
11
  beforeEach(() => {
11
12
  cy.viewport(1280, 1000);
12
- repositoryId = '23repo' + Date.now();
13
+ repositoryId = 'rdf-resource-search-' + Date.now();
13
14
  cy.createRepository({id: repositoryId});
14
15
  cy.initializeRepository(repositoryId);
15
16
  cy.enableAutocomplete(repositoryId);
@@ -21,160 +22,127 @@ describe.skip('RDF resource search', () => {
21
22
 
22
23
  it('Search button should not be present when no repo is selected', () => {
23
24
  HomeSteps.visitAndWaitLoader();
24
- // Given the page has loaded the license label (otherwise locally test passes after the loader disappears and before other elements are rendered)
25
- HomeSteps.getLicenseAsLabel().should('be.visible');
26
- cy.get('.search-rdf-btn').should('not.exist');
27
- cy.get('.search-rdf-input').should('not.exist');
25
+ RdfResourceSearchSteps.getComponent().should('not.exist');
28
26
  });
29
27
 
30
- it('Search should be made from home page search when repo is set and on home page', () => {
31
- // When I visit home page with selected repository
28
+ it('Search should only be triggered from the home page when a repository is selected', () => {
29
+ // When: I visit home page with selected repository
32
30
  cy.presetRepository(repositoryId);
33
31
  HomeSteps.visitAndWaitLoader();
34
- // Search rdf button should be visible
35
- cy.get('.search-rdf-btn').should('be.visible');
36
- // When I click the button
37
- HomeSteps.doNotOpenRdfSearchBoxButFocusResourceSearch();
38
- // I should be able to type some text in the input on home page
39
- cy.get('#search-resource-input-home > #search-resource-box > input').type('hasPos');
40
- // And the autocomplete dropdown should become visible
41
- cy.get('#search-resource-input-home > #auto-complete-results-wrapper').should('be.visible');
42
- // // When I click the close button
43
- cy.get('#search-resource-input-home > #search-resource-box > .clear-icon').click();
44
- // // The input should be cleared
45
- cy.get('#search-resource-input-home > #search-resource-box > input').should('have.value', '');
32
+ // And: I click the button
33
+ RdfResourceSearchSteps.clickOnShowViewResourceMessageButton();
34
+ // Then: I should be able to type some text in the input on home page
35
+ HomeSteps.getRdfResourceSearchInput().type('hasPos');
36
+ // And: the autocomplete dropdown should become visible
37
+ HomeSteps.getAutocompleteResultsContainer().should('be.visible');
38
+ // When: I click the close button
39
+ HomeSteps.closeRdfResourceSearchBox();
40
+ // The input should be cleared
41
+ HomeSteps.getRdfResourceSearchInput().should('have.value', '');
46
42
  });
47
43
 
48
- it('Search should be present when repo is set', () => {
49
- // When I visit not home page with selected repository
44
+ it('should be visible when a repository is selected and the user is not on the Home page', () => {
45
+ // When: There is a repository selected and I visit a page other than home.
50
46
  cy.presetRepository(repositoryId);
51
- cy.visit('/graphs');
52
- cy.get('.ot-splash').should('not.be.visible');
53
- cy.get('.ot-loader-new-content').should('not.exist');
54
- // Search rdf button should be visible
55
- cy.get('.search-rdf-btn').should('be.visible');
56
- // When I click the button
57
- HomeSteps.openRdfSearchBox();
58
- // I should be able to type some text in the input
59
- cy.get('.search-rdf-input search-resource-input .view-res-input').type('hasPos');
60
- // And the autocomplete dropdown should become visible
61
- cy.get('.search-rdf-input #auto-complete-results-wrapper').should('be.visible');
62
- // When I click the close button
63
- cy.get('.close-rdf-search-btn').click();
64
- // The input should not be cleared
65
- cy.get('.search-rdf-input search-resource-input .view-res-input').should('have.value', 'hasPos');
66
- // And the search bar should hide and not be visible
67
- cy.get('.search-rdf-input').should('not.be.visible');
68
- // And the suggestions list should not be visible
69
- cy.get('.search-rdf-input #auto-complete-results-wrapper').should('not.be.visible');
70
- // And the search button should be visible
71
- cy.get('.search-rdf-btn').should('be.visible');
72
- // When I open again the search box
73
- HomeSteps.openRdfSearchBox();
74
- // The input should have value 'hasPos'
75
- cy.get('.search-rdf-input search-resource-input .view-res-input').should('have.value', 'hasPos');
76
- // And dropdown should be visible
77
- cy.get('.search-rdf-input #auto-complete-results-wrapper').should('be.visible');
78
- // When I press 'escape'
79
- cy.get('.search-rdf-input search-resource-input .view-res-input').type('{esc}');
80
- // Search box should not be visible
81
- cy.get('.search-rdf-input').should('not.be.visible');
47
+ ImportSteps.visit();
48
+ // Then: Search rdf button should be visible
49
+ RdfResourceSearchSteps.getOpenButton().should('be.visible');
50
+
51
+ // When: I click the button
52
+ RdfResourceSearchSteps.openRdfSearchBox();
53
+ // Then: I should be able to type some text in the input
54
+ RdfResourceSearchSteps.getRDFResourceSearchInput().type('hasPos');
55
+ // And: the autocomplete dropdown should become visible
56
+ RdfResourceSearchSteps.getAutocompleteResults().should('be.visible');
57
+
58
+ // When: I close the RDF search box
59
+ RdfResourceSearchSteps.closeRDFSearchBox();
60
+ // And: open again the search box
61
+ RdfResourceSearchSteps.openRdfSearchBox();
62
+ // Then: The input should have value 'hasPos'
63
+ RdfResourceSearchSteps.getRDFResourceSearchInput().should('have.value', 'hasPos');
64
+ // And: the autocomplete dropdown should become visible
65
+ RdfResourceSearchSteps.getAutocompleteResults().should('be.visible');
66
+
67
+ // When: I press 'escape'
68
+ BaseSteps.typeEscapeKey();
69
+ // Then: Search box should not be visible
70
+ RdfResourceSearchSteps.getRDFResourceSearchInput().should('not.be.visible');
82
71
  });
83
72
 
84
73
  it('Search should be persisted on page reload', () => {
85
- // Given I've selected a repository and visit the page
74
+ // Given: There is a repository selected and I visit a page other than home.
86
75
  cy.presetRepository(repositoryId);
87
- cy.visit('/graphs', {
88
- onBeforeLoad(win) {
89
- cy.stub(win, 'open').as('window.open');
90
- }
91
- });
92
- cy.get('.ot-splash').should('not.be.visible');
93
- cy.get('.ot-loader-new-content').should('not.exist');
94
- // Search rdf button should be visible
95
- cy.get('.search-rdf-btn').should('be.visible');
96
- // When I click the button
97
- HomeSteps.openRdfSearchBox();
98
- // I should be able to type some text in the input
99
- cy.get('.search-rdf-input search-resource-input .view-res-input')
100
- .type('hasPos').then(() => {
101
- // When I select option from suggestions
102
- cy.get(".search-rdf-input #auto-complete-results-wrapper p")
103
- .contains('hasPos')
104
- .click()
105
- .then(() => {
106
- // Search result should be opened in new window
107
- cy.get('@window.open').should('be.calledWith', 'resource?uri=http%3A%2F%2Fwww.w3.org%2Fns%2Forg%23hasPost');
108
- });
109
- });
110
-
111
- // When I revisit the home page
112
- cy.visit('/graphs');
113
- // When I open again the search box
114
- HomeSteps.openRdfSearchBox();
115
- // The input should have value 'hasPos' from previous search
116
- cy.get('.search-rdf-input search-resource-input .view-res-input').should('have.value', 'hasPos');
117
- // And dropdown should be visible
118
- cy.get('.search-rdf-input #auto-complete-results-wrapper').should('be.visible');
119
- // When I press 'escape'
120
- cy.get('.search-rdf-input search-resource-input .view-res-input')
121
- .type('{esc}')
76
+ ImportSteps.visit();
77
+ BrowserStubs.stubWindowOpen();
78
+ // When: I open the search resource component
79
+ RdfResourceSearchSteps.openRdfSearchBox();
80
+ //Then: I should be able to type some text in the input
81
+ RdfResourceSearchSteps.getRDFResourceSearchInput().type('hasPos')
122
82
  .then(() => {
123
- // Search box should not be visible
124
- cy.get('.search-rdf-input').should('not.be.visible');
83
+ // When: I select option from suggestions
84
+ RdfResourceSearchSteps.clickOnAutocompleteSuggestionByPartialText('hasPos')
85
+ .then(() => {
86
+ // Then: Search result should be opened in new window
87
+ cy.get(BrowserStubs.WINDOW_OPEN_ALIAS()).should('have.been.calledWithMatch', `resource?uri=http%3A%2F%2Fwww.w3.org%2Fns%2Forg%23hasPost`, "_blank");
88
+ });
125
89
  });
90
+
91
+ // When: I revisit the home page
92
+ ImportSteps.visit();
93
+ // And: I open again the search box
94
+ RdfResourceSearchSteps.openRdfSearchBox();
95
+ // Then: The input should have value 'hasPos' from previous search
96
+ RdfResourceSearchSteps.getRDFResourceSearchInput().should('have.value', 'hasPos');
97
+ // And: the autocomplete dropdown should become visible
98
+ RdfResourceSearchSteps.getAutocompleteResults().should('be.visible');
99
+
100
+ // When: I press 'escape'
101
+ BaseSteps.typeEscapeKey();
102
+ // Then: Search box should not be visible
103
+ RdfResourceSearchSteps.getRDFResourceSearchInput().should('not.be.visible');
126
104
  });
127
105
 
128
106
  it('Should test RDF resource search box', () => {
129
- //Prepare repository and import data.
107
+ // Given: I have a repository with RDF data
130
108
  cy.presetRepository(repositoryId);
131
109
  cy.importServerFile(repositoryId, FILE_TO_IMPORT);
110
+ // And: I visit the home page
132
111
  HomeSteps.visitAndWaitLoader();
133
112
 
134
- //Verify that the main resource search box is focused
135
- getRDFResourceSearchBox().click();
136
- cy.focused().should('have.attr', 'placeholder', 'Search RDF resources...');
113
+ // When: I click on the RDF resource search button
114
+ RdfResourceSearchSteps.clickOnShowViewResourceMessageButton();
115
+ // Then: The input for RDF resource search should be visible (This is the legacy component used prior to the migration)
116
+ HomeSteps.getRdfResourceSearchInput().should('have.attr', 'placeholder', 'Search RDF resources...')
117
+ .and('be.focused');
137
118
 
138
119
  //Navigate away from the Homepage, to be able to test the new resource search box
139
- cy.visit('/graphs', {
140
- onBeforeLoad(win) {
141
- cy.stub(win, 'open').as('window.open');
142
- }
143
- });
144
-
145
- cy.get('.ot-splash').should('not.be.visible');
146
- cy.get('.ot-loader-new-content').should('not.exist');
147
-
148
- getRDFResourceSearchBox().click();
149
- //Verify that the new resource search box is focused
150
- cy.focused().should('have.attr', 'placeholder', 'Search RDF resources...');
151
-
152
- //Verify autocomplete suggestions count
153
- cy.focused().then(() => {
154
- cy.get('#search-resource-box input')
155
- .should('be.visible')
156
- .type('Dry');
157
- cy.get('#auto-complete-results-wrapper')
158
- .should('be.visible')
159
- .children()
160
- .should('have.length', 7);
161
- });
162
-
163
- //Test table and visual buttons.
164
- cy.get("#auto_0").should('be.visible').click();
165
- // Search result should be opened in new window
166
- cy.get('@window.open').should('be.calledWith', 'resource?uri=http%3A%2F%2Fwww.w3.org%2FTR%2F2003%2FPR-owl-guide-20031209%2Fwine%23Dry');
167
-
168
- getVisualButton().click();
169
- cy.get("#auto_0").should('be.visible').click();
170
- cy.get('@window.open').should('be.calledWith', 'graphs-visualizations?uri=http%3A%2F%2Fwww.w3.org%2FTR%2F2003%2FPR-owl-guide-20031209%2Fwine%23Dry');
120
+ HomeSteps.visitAndWaitLoader();
121
+ BrowserStubs.stubWindowOpen();
122
+ // When: I click on the RDF resource search button
123
+ RdfResourceSearchSteps.clickOnShowViewResourceMessageButton();
124
+ // Then: The input for RDF resource search should be visible (This is the legacy component used prior to the migration)
125
+ HomeSteps.getRdfResourceSearchInput().should('have.attr', 'placeholder', 'Search RDF resources...')
126
+ .and('be.focused');
127
+
128
+ // When: I type some text in the input
129
+ HomeSteps.getRdfResourceSearchInput().type('Dry');
130
+ // Then: The autocomplete results should be visible
131
+ HomeSteps.getAutocompleteSuggestion().should('be.visible')
132
+ .and('have.length', 7);
133
+
134
+ // When: The table display button is active
135
+ HomeSteps.getTableDisplayButton().click();
136
+ // And: click on some suggestion
137
+ HomeSteps.getAutocompleteSuggestionByPartialText('http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#').click();
138
+ // Then: The clicked suggestion should be opened in new window
139
+ cy.get(BrowserStubs.WINDOW_OPEN_ALIAS()).should('have.been.calledWithMatch', `resource?uri=http%3A%2F%2Fwww.w3.org%2FTR%2F2003%2FPR-owl-guide-20031209%2Fwine%23Dry`);
140
+
141
+ // When: The visual display button is active
142
+ HomeSteps.getVisualDisplayButton().click();
143
+ // And: click on some suggestion
144
+ HomeSteps.getAutocompleteSuggestionByPartialText('http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#').click();
145
+ // Then: The clicked suggestion should be opened in new window
146
+ cy.get(BrowserStubs.WINDOW_OPEN_ALIAS()).should('have.been.calledWithMatch', `graphs-visualizations?uri=http%3A%2F%2Fwww.w3.org%2FTR%2F2003%2FPR-owl-guide-20031209%2Fwine%23Dry`);
171
147
  });
172
148
  });
173
-
174
- function getRDFResourceSearchBox() {
175
- return cy.get('rdf-resource-search').should('be.visible');
176
- }
177
-
178
- function getVisualButton() {
179
- return cy.get('.display-type-visual-btn').should('be.visible');
180
- }
@@ -1,4 +1,5 @@
1
1
  import HomeSteps from '../../steps/home-steps';
2
+ import {BrowserStubs} from "../../stubs/browser-stubs";
2
3
 
3
4
  describe('View resource autocomplete', () => {
4
5
 
@@ -9,12 +10,20 @@ describe('View resource autocomplete', () => {
9
10
  'foaf:name "Green Goblin" .\n';
10
11
  const GOBLIN_URI = 'http://example.org/#green-goblin';
11
12
 
13
+ let repositoryId;
14
+
12
15
  beforeEach(() => {
13
16
  cy.viewport(1280, 1000);
17
+ repositoryId = 'view-resource-autocomplete-' + Date.now();
18
+ cy.createRepository({id: repositoryId});
19
+ BrowserStubs.stubWindowOpen();
20
+ });
21
+
22
+ afterEach(() => {
23
+ cy.deleteRepository(repositoryId);
14
24
  });
15
25
 
16
26
  it('Test homepage autocomplete when it is enabled', () => {
17
- const repositoryId = HomeSteps.createRepo();
18
27
  HomeSteps.selectRepo(repositoryId);
19
28
 
20
29
  // Type an invalid resource
@@ -24,21 +33,27 @@ describe('View resource autocomplete', () => {
24
33
  cy.importRDFTextSnippet(repositoryId, FOAT_SNIPPET);
25
34
  cy.enableAutocomplete(repositoryId);
26
35
 
27
- HomeSteps.visitAndWaitLoader(true).then((el) => el)
28
- .then(() => HomeSteps.getAutocompleteDisplayTypeButton('table').click())
29
- .then(() => HomeSteps.autocompleteText('Green', GOBLIN_URI))
30
- .then(() => HomeSteps.getAutocompleteResultElement(GOBLIN_URI).click())
31
- .then(() => // Search result should be opened in new window
32
- cy.get('@window.open').should('be.calledWith', 'resource?uri=http%3A%2F%2Fexample.org%2F%23green-goblin'))
33
- .then(() => HomeSteps.getAutocompleteDisplayTypeButton('visual').click())
34
- .then(() => HomeSteps.getAutocompleteResultElement(GOBLIN_URI).click())
35
- .then(() => // Search result should be opened in new window
36
- cy.get('@window.open').should('be.calledWith', 'graphs-visualizations?uri=http%3A%2F%2Fexample.org%2F%23green-goblin'));
37
- cy.deleteRepository(repositoryId);
36
+ HomeSteps.visitAndWaitLoader();
37
+ BrowserStubs.stubWindowOpen();
38
+
39
+ // When: The table display button is active
40
+ HomeSteps.getAutocompleteDisplayTypeButton('table').click();
41
+ // And: select an autocomplete suggestion
42
+ HomeSteps.autocompleteText('Green', GOBLIN_URI)
43
+ HomeSteps.autocompleteText('Green', GOBLIN_URI)
44
+ HomeSteps.getAutocompleteResultElement(GOBLIN_URI).click()
45
+ // Then: The clicked suggestion should be opened in new window
46
+ cy.get(BrowserStubs.WINDOW_OPEN_ALIAS()).should('be.calledWith', 'resource?uri=http%3A%2F%2Fexample.org%2F%23green-goblin');
47
+
48
+ // When: The visual display button is active
49
+ HomeSteps.getAutocompleteDisplayTypeButton('visual').click();
50
+ // And: select an autocomplete suggestion
51
+ HomeSteps.getAutocompleteResultElement(GOBLIN_URI).click()
52
+ // Then: clicked suggestion should be opened in new window
53
+ cy.get(BrowserStubs.WINDOW_OPEN_ALIAS()).should('be.calledWith', 'graphs-visualizations?uri=http%3A%2F%2Fexample.org%2F%23green-goblin')
38
54
  });
39
55
 
40
56
  it('should not suggest resources in "View resources" when autocomplete is not enabled', () => {
41
- const repositoryId = HomeSteps.createRepo();
42
57
  cy.importRDFTextSnippet(repositoryId, FOAT_SNIPPET);
43
58
 
44
59
  HomeSteps.visitAndWaitLoader();
@@ -46,7 +61,5 @@ describe('View resource autocomplete', () => {
46
61
 
47
62
  HomeSteps.getAutocompleteInput().type('Green');
48
63
  HomeSteps.noAutocompleteToast();
49
-
50
- cy.deleteRepository(repositoryId);
51
64
  });
52
65
  });
@@ -77,27 +77,4 @@ describe('Import user data: URL import', () => {
77
77
  ImportSettingsDialogSteps.import();
78
78
  ImportUserDataSteps.checkImportedResource(0, IMPORT_URL);
79
79
  });
80
-
81
- it('should import JSON-LD file via URL with correct request body', () => {
82
- ImportUserDataSteps.stubPostJSONLDFromURL(repositoryId);
83
- ImportUserDataSteps.openImportURLDialog(IMPORT_JSONLD_URL);
84
- ImportUserDataSteps.selectRDFFormat(JSONLD_FORMAT);
85
- ImportUserDataSteps.clickImportUrlButton();
86
- ImportSettingsDialogSteps.import();
87
- cy.wait('@postJsonldUrl').then((xhr) => {
88
- expect(xhr.request.body.name).to.eq('https://example.com/0007-context.jsonld');
89
- expect(xhr.request.body.data).to.eq('https://example.com/0007-context.jsonld');
90
- expect(xhr.request.body.type).to.eq('url');
91
- expect(xhr.request.body.hasContextLink).to.be.true;
92
- });
93
- });
94
-
95
- it('should show error on invalid JSON-LD URL', () => {
96
- ImportUserDataSteps.stubPostJSONLDFromURL();
97
- ImportUserDataSteps.openImportURLDialog(IMPORT_JSONLD_URL);
98
- ImportUserDataSteps.selectRDFFormat(JSONLD_FORMAT);
99
- ImportUserDataSteps.clickImportUrlButton();
100
- ImportSettingsDialogSteps.import();
101
- ImportUserDataSteps.checkImportedResource(0, IMPORT_JSONLD_URL, 'https://example.com/0007-context.jsonld');
102
- });
103
80
  });
@@ -21,8 +21,7 @@ describe('Import user data', () => {
21
21
  cy.deleteRepository(repositoryId);
22
22
  });
23
23
 
24
- // TODO: Fix me. Broken due to migration (Error: unknown)
25
- it.skip('Should load user data import tab by default', () => {
24
+ it('Should load user data import tab by default', () => {
26
25
  // Given I have visited the import page
27
26
  ImportUserDataSteps.visit();
28
27
  // When the page is loaded
@@ -2,11 +2,9 @@ import HomeSteps from "../../steps/home-steps";
2
2
  import {OperationsStatusesComponentSteps} from "../../steps/operations-statuses-component-steps";
3
3
  import {GlobalOperationsStatusesStub} from "../../stubs/global-operations-statuses-stub";
4
4
  import {ImportUserDataSteps} from "../../steps/import/import-user-data-steps";
5
+ import {BrowserStubs} from "../../stubs/browser-stubs";
5
6
 
6
- /**
7
- * TODO: Fix me. Broken due to migration (The issue GDB-11318 is not implemented)
8
- */
9
- describe.skip('Operations Status Component', () => {
7
+ describe('Operations Status Component', () => {
10
8
 
11
9
  const repositoryId = 'backup-and-restore-' + Date.now();
12
10
  beforeEach(() => {
@@ -75,7 +73,7 @@ describe.skip('Operations Status Component', () => {
75
73
  OperationsStatusesComponentSteps.openOperationStatusesDialog();
76
74
  // When I click on "Running query" operation element.
77
75
  // Then I expect to be redirected to "Query and Update monitoring" view.
78
- OperationsStatusesComponentSteps.checkOperationElementUrl('monitor/queries', 3);
76
+ checkOperationElementUrl('monitor/queries', 3);
79
77
  // Then I expect "Global Operations Component" to still be displayed.
80
78
  OperationsStatusesComponentSteps.getOperationsStatusesComponent().should('exist');
81
79
  });
@@ -90,7 +88,7 @@ describe.skip('Operations Status Component', () => {
90
88
  OperationsStatusesComponentSteps.openOperationStatusesDialog();
91
89
  // When I click on "Running updates" operation element.
92
90
  // Then I expect to be redirected to "Query and Update monitoring" view.
93
- OperationsStatusesComponentSteps.checkOperationElementUrl('monitor/queries', 4);
91
+ checkOperationElementUrl('monitor/queries', 4);
94
92
  // Then I expect "Global Operations Component" to still be displayed.
95
93
  OperationsStatusesComponentSteps.getOperationsStatusesComponent().should('exist');
96
94
  });
@@ -105,7 +103,7 @@ describe.skip('Operations Status Component', () => {
105
103
  OperationsStatusesComponentSteps.openOperationStatusesDialog();
106
104
  // When I click on "Running imports" operation element.
107
105
  // Then I expect to be redirected to "Query and Update monitoring" view.
108
- OperationsStatusesComponentSteps.checkOperationElementUrl('import', 2);
106
+ checkOperationElementUrl('import', 2);
109
107
  // Then I expect "Global Operations Component" to still be displayed.
110
108
  OperationsStatusesComponentSteps.getOperationsStatusesComponent().should('exist');
111
109
  });
@@ -120,7 +118,7 @@ describe.skip('Operations Status Component', () => {
120
118
  OperationsStatusesComponentSteps.openOperationStatusesDialog();
121
119
  // When I click on "Creating backup" operation element.
122
120
  // Then I expect to be redirected to "Backup and Restore" view.
123
- OperationsStatusesComponentSteps.checkOperationElementUrl('monitor/backup-and-restore', 1);
121
+ checkOperationElementUrl('monitor/backup-and-restore', 1);
124
122
  // Then I expect "Global Operations Component" to still be displayed.
125
123
  OperationsStatusesComponentSteps.getOperationsStatusesComponent().should('exist');
126
124
 
@@ -136,9 +134,15 @@ describe.skip('Operations Status Component', () => {
136
134
  OperationsStatusesComponentSteps.openOperationStatusesDialog();
137
135
  // When I click on "Unavailable nodes" operation element.
138
136
  // Then I expect to be redirected to "Cluster Monitoring" view.
139
- OperationsStatusesComponentSteps.checkOperationElementUrl('cluster', 0);
137
+ checkOperationElementUrl('cluster', 0);
140
138
  // Then I expect "Global Operations Component" to still be displayed.
141
139
  OperationsStatusesComponentSteps.getOperationsStatusesComponent().should('exist');
142
140
 
143
141
  });
142
+
143
+ function checkOperationElementUrl(expectedUrl, operationIndex = 0) {
144
+ BrowserStubs.spyNavigateToUrl();
145
+ OperationsStatusesComponentSteps.getOperationStatuses().eq(operationIndex).click();
146
+ cy.get(BrowserStubs.NAVIGATE_TO_URL_ALIAS()).should('have.been.calledWithMatch', expectedUrl)
147
+ }
144
148
  });
@@ -499,19 +499,19 @@ describe('Repositories', () => {
499
499
  ModalDialogSteps.verifyDialogBody('Changing the repository ID is a dangerous operation since it renames the repository folder and enforces repository shutdown.');
500
500
  });
501
501
 
502
- it('should NOT allow restart of LOCAL repository from EDIT PAGE, if node is in cluster', () => {
502
+ it('should allow restart of LOCAL repository from EDIT PAGE, if node is in cluster', () => {
503
503
  // Given I create a repository
504
504
  cy.createRepository({id: repositoryId});
505
505
  // When I set the node in a cluster
506
506
  GlobalOperationsStatusesStub.stubGlobalOperationsStatusesResponse(repositoryId);
507
507
  // Then go to the local repository's edit page
508
508
  RepositorySteps.visitEditPage(repositoryId);
509
- // I expect the repository restart checkbox button to be disabled
509
+ // I expect the repository restart checkbox button to be enabled
510
510
  RepositorySteps.getEditViewRestartButton().should('be.visible');
511
- RepositorySteps.getEditViewRestartButton().should('be.disabled');
511
+ RepositorySteps.getEditViewRestartButton().should('not.be.disabled');
512
512
  });
513
513
 
514
- it('should NOT allow restart of LOCAL repositories from REPOSITORIES PAGE, if node is in cluster', () => {
514
+ it('should allow restart of LOCAL repositories from REPOSITORIES PAGE, if node is in cluster', () => {
515
515
  // Given I create a repository
516
516
  cy.createRepository({id: repositoryId});
517
517
  // When I set the node in a cluster
@@ -519,9 +519,9 @@ describe('Repositories', () => {
519
519
  ClusterStubs.stubClusterNodeStatus();
520
520
  // Then go to the repositories page
521
521
  RepositorySteps.visit();
522
- // I expect the local repository's restart button to be disabled
522
+ // I expect the local repository's restart button to be enabled
523
523
  RepositorySteps.getRepositoryRestartButton(repositoryId).should('be.visible');
524
- RepositorySteps.getRepositoryRestartButton(repositoryId).should('be.disabled');
524
+ RepositorySteps.getRepositoryRestartButton(repositoryId).should('not.be.disabled');
525
525
  });
526
526
 
527
527
  it('should ALLOW restart of REMOTE repositories from REPOSITORIES PAGE, if node is in cluster', () => {
@@ -45,10 +45,9 @@ describe('Autocomplete ', () => {
45
45
  .and('not.be.disabled');
46
46
 
47
47
  // Should have default labels
48
- AutocompleteSteps.getAutocompleteLabels()
49
- .should('be.visible')
50
- .find('.wb-autocomplete-labels-row')
51
- .should('have.length', 1)
48
+ AutocompleteSteps.getAutocompleteLabels().should('be.visible')
49
+
50
+ AutocompleteSteps.getLabelRows().should('have.length', 1)
52
51
  .and('contain', 'http://www.w3.org/2000/01/rdf-schema#label');
53
52
 
54
53
  // Enable autocomplete and verify status is OK (possible slow operation)
@@ -17,8 +17,8 @@ const DEFAULT_QUERY = 'PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>\n' +
17
17
  ' # The following placeholder must be present in the query\n' +
18
18
  ' #!filter\n' +
19
19
  '}';
20
- // TODO: Fix me. Broken due to migration (Error: unknown)
21
- describe.skip('JDBC configuration', () => {
20
+
21
+ describe('JDBC configuration', () => {
22
22
 
23
23
  let repositoryId;
24
24
  let secondRepositoryId;
@@ -6,8 +6,7 @@ import {RepositorySelectorSteps} from "../../../steps/repository-selector-steps"
6
6
  import {SparqlTemplatesSteps} from "../../../steps/setup/sparql-templates-steps";
7
7
  import {ImportUserDataSteps} from "../../../steps/import/import-user-data-steps";
8
8
 
9
- // TODO: Fix me. Broken due to migration (Error: unknown)
10
- describe.skip('SPARQL create template', () => {
9
+ describe('SPARQL create template', () => {
11
10
 
12
11
  let repositoryId;
13
12
  let secondRepositoryId;
@@ -18,15 +17,16 @@ describe.skip('SPARQL create template', () => {
18
17
  cy.presetRepository(repositoryId);
19
18
  secondRepositoryId = 'sparql-templates-second-repo' + Date.now();
20
19
  cy.createRepository({id: secondRepositoryId});
21
- SparqlCreateUpdateSteps.visit();
22
20
  });
23
21
 
24
22
  afterEach(() => {
23
+ cy.unsetRepository();
25
24
  cy.deleteRepository(repositoryId);
26
25
  cy.deleteRepository(secondRepositoryId);
27
26
  });
28
27
 
29
28
  it('should has error message described that template id is required', () => {
29
+ SparqlCreateUpdateSteps.visit();
30
30
  // When I visit 'Sparql create template' view,
31
31
  // and click on "Save" button without to fill template id.
32
32
  SparqlCreateUpdateSteps.clickOnSaveButton();
@@ -36,6 +36,7 @@ describe.skip('SPARQL create template', () => {
36
36
  });
37
37
 
38
38
  it('should has error message described that template id is invalid', () => {
39
+ SparqlCreateUpdateSteps.visit();
39
40
  // When I visit 'Sparql create template' view,
40
41
  // and fill an invalid template id,
41
42
  const invalidTemplateName = 'invalid-template-id';
@@ -48,6 +49,7 @@ describe.skip('SPARQL create template', () => {
48
49
  });
49
50
 
50
51
  it('should has error message described that query mode is invalid', () => {
52
+ SparqlCreateUpdateSteps.visit();
51
53
  // When I visit 'Sparql create template' view,
52
54
  // and fill valid template id.
53
55
  SparqlCreateUpdateSteps.typeTemplateId('http://test');
@@ -63,6 +65,7 @@ describe.skip('SPARQL create template', () => {
63
65
  });
64
66
 
65
67
  it('should navigate to other view if there are no changes', () => {
68
+ SparqlCreateUpdateSteps.visit();
66
69
  // When I visit 'Sparql create template' view,
67
70
  // and navigate to other view.
68
71
  ImportUserDataSteps.visitUserImport(repositoryId);
@@ -72,6 +75,7 @@ describe.skip('SPARQL create template', () => {
72
75
  });
73
76
 
74
77
  it('should confirm me before navigate when template id is changed', () => {
78
+ SparqlCreateUpdateSteps.visit();
75
79
  // When I visit 'Sparql create template' view,
76
80
  // and set template id.
77
81
  SparqlCreateUpdateSteps.typeTemplateId('http://test');
@@ -105,6 +109,7 @@ describe.skip('SPARQL create template', () => {
105
109
  });
106
110
 
107
111
  it('should not change the view if I am creating a new sparql template and change the repository', () => {
112
+ SparqlCreateUpdateSteps.visit();
108
113
  // When I visit 'Sparql create template' view,
109
114
  // make some changes.
110
115
  SparqlCreateUpdateSteps.typeTemplateId('http://test');
@@ -117,6 +122,7 @@ describe.skip('SPARQL create template', () => {
117
122
  });
118
123
 
119
124
  it('Should redirect to templates catalog view when repository is changed', () => {
125
+ SparqlCreateUpdateSteps.visit();
120
126
  // When I visit 'Sparql create template' view
121
127
  // When I change the repository.
122
128
  RepositorySelectorSteps.selectRepository(secondRepositoryId);
@@ -126,6 +132,7 @@ describe.skip('SPARQL create template', () => {
126
132
  });
127
133
 
128
134
  it('should ask for confirmation when try to save sparql template with already existing template id', () => {
135
+ SparqlCreateUpdateSteps.visit();
129
136
  // When I visit 'Sparql create template' view,
130
137
  // create a SPARQL template
131
138
  const templateName = 'http://' + Date.now();