graphdb-workbench-tests 3.3.0-TR5 → 3.3.0

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 (41) hide show
  1. package/e2e-legacy/explore/visual-graph/graphs-config.spec.js +4 -4
  2. package/e2e-legacy/explore/visual-graph/visual.graph.spec.js +1 -1
  3. package/e2e-legacy/guides/connectors/connectors-guide.spec.js +12 -1
  4. package/e2e-legacy/guides/create-similarity-index/create-similarity-index-guide.spec.js +74 -0
  5. package/e2e-legacy/guides/download-guide-resource/download-guide-resource-guide.js +55 -0
  6. package/e2e-legacy/guides/ttyg/conversation/ttyg-conversation-guide.spec.js +88 -0
  7. package/e2e-legacy/help/guides/guides-autostart.spec.js +93 -0
  8. package/e2e-legacy/import/import-server-files.spec.js +2 -2
  9. package/e2e-legacy/import/import-user-data.spec.js +2 -2
  10. package/e2e-legacy/repository/ontop-repository.spec.js +1 -1
  11. package/e2e-legacy/repository/url-with-repository-id-parameter.spec.js +155 -0
  12. package/e2e-legacy/setup/jdbc/jdbc-create.spec.js +4 -4
  13. package/e2e-legacy/setup/users-and-access/user-and-access.spec.js +82 -71
  14. package/e2e-legacy/sparql-editor/saved-query/share-query.spec.js +4 -1
  15. package/e2e-legacy/ttyg/chat-panel.spec.js +5 -1
  16. package/fixtures/guides/connectors/lucene-connector-guide.json +14 -0
  17. package/fixtures/guides/create-similarity-index/create-similarity-index-guide.json +36 -0
  18. package/fixtures/guides/download-guide-resource/download-guide-resource-guide.json +25 -0
  19. package/fixtures/guides/download-resource.ttl +629 -0
  20. package/fixtures/guides/ttyg/conversation/ttyg-conversation-guide.json +26 -0
  21. package/fixtures/ttyg/chats/explain-response-3.json +12 -0
  22. package/npm-shrinkwrap.json +422 -427
  23. package/package.json +3 -3
  24. package/steps/explore/similarity-index-create-steps.js +5 -3
  25. package/steps/explore/similarity-indexes-steps.js +4 -0
  26. package/steps/guides/guide-dialog-steps.js +5 -0
  27. package/steps/guides/guide-steps.js +17 -0
  28. package/steps/home-steps.js +4 -0
  29. package/steps/import/import-steps.js +1 -1
  30. package/steps/main-menu-steps.js +4 -0
  31. package/steps/modal-dialog-steps.js +9 -0
  32. package/steps/repository-steps.js +5 -1
  33. package/steps/resource/resource-steps.js +2 -2
  34. package/steps/ttyg/chat-panel-steps.js +19 -1
  35. package/steps/ttyg/ttyg-agent-settings-modal.steps.js +8 -0
  36. package/steps/yasgui/yasgui-loader.js +3 -3
  37. package/stubs/guides/guides-stubs.js +19 -1
  38. package/support/connector-commands.js +1 -1
  39. package/support/user-commands.js +9 -4
  40. /package/e2e-legacy/help/guides/{star-wars-interactive-guide.js → star-wars-interactive-guide.spec.js} +0 -0
  41. /package/e2e-legacy/setup/sparql-template/{sparql-template-create.js → sparql-template-create.spec.js} +0 -0
@@ -189,7 +189,7 @@ describe('Graphs config', () => {
189
189
  // When I click on cancel
190
190
  VisualGraphSteps.cancelSaveConfig();
191
191
  // Then I expect to be redirected to configs list view
192
- cy.url().should('eq', Cypress.config('baseUrl') + '/graphs-visualizations');
192
+ cy.url().should('include', Cypress.config('baseUrl') + '/graphs-visualizations');
193
193
  });
194
194
 
195
195
  it('Should not allow config creation without a name', () => {
@@ -349,7 +349,7 @@ describe('Graphs config', () => {
349
349
  // When I click cancel without changing the query
350
350
  VisualGraphSteps.cancelSaveConfig();
351
351
  // Then I expect to be redirected to configs list without confirmation
352
- cy.url().should('eq', Cypress.config('baseUrl') + '/graphs-visualizations');
352
+ cy.url().should('include', Cypress.config('baseUrl') + '/graphs-visualizations');
353
353
  // And I open it for edit
354
354
  VisualGraphSteps.editConfig(graphConfigName);
355
355
  checkEditorWithQuery(QUERY_START);
@@ -372,7 +372,7 @@ describe('Graphs config', () => {
372
372
  ModalDialogSteps.clickOnConfirmButton();
373
373
  // Then I expect to be redirected to configs list page
374
374
  ModalDialogSteps.getDialog().should('not.exist');
375
- cy.url().should('eq', Cypress.config('baseUrl') + '/graphs-visualizations');
375
+ cy.url().should('include', Cypress.config('baseUrl') + '/graphs-visualizations');
376
376
  });
377
377
 
378
378
  it('Should prevent leaving with confirmation when expand query is changed', () => {
@@ -454,7 +454,7 @@ function saveGraphConfig(graphConfigName) {
454
454
  // Then I expect a success notification
455
455
  ApplicationSteps.getSuccessNotifications().should('be.visible');
456
456
  // And I should be redirected to configs list view
457
- cy.url().should('eq', Cypress.config('baseUrl') + '/graphs-visualizations');
457
+ cy.url().should('include', Cypress.config('baseUrl') + '/graphs-visualizations');
458
458
  // And the new config should be present in the list
459
459
  VisualGraphSteps.getGraphConfig(graphConfigName).should('be.visible');
460
460
  }
@@ -84,7 +84,7 @@ describe('Visual graph screen validation', () => {
84
84
  VisualGraphSteps.verifyPageLoaded();
85
85
  VisualGraphSteps.searchForResourceAndOpen(VALID_RESOURCE, VALID_RESOURCE);
86
86
  // Verify redirection to existing visual graph
87
- cy.url().should('match', /USRegion$/);
87
+ cy.url().should('include', 'USRegion');
88
88
  });
89
89
 
90
90
  it('Test default graph state', () => {
@@ -80,7 +80,7 @@ describe('Connectors guide', () => {
80
80
  cy.wait('@getGuides');
81
81
  GuideSteps.runFirstGuide();
82
82
  });
83
- it.only('Should test Lucene connector steps', () => {
83
+ it('Should test Lucene connector steps', () => {
84
84
  GuideDialogSteps.assertDialogWithTitleIsVisible('Lucene connector');
85
85
  GuideDialogSteps.assertDialogWithContentIsVisible('The Lucene Connector in GraphDB enables extremely fast keyword and faceted (aggregation) searches. Unlike traditional setups where indexing is handled externally, this connector stays automatically synchronized with your repository data, ensuring accurate and up-to-date search results at all times.');
86
86
  GuideDialogSteps.clickOnNextButton();
@@ -125,6 +125,17 @@ describe('Connectors guide', () => {
125
125
  GuideDialogSteps.assertDialogWithContentIsVisible('The Facet option specifies whether the field is available for faceted searches in Lucene. Managed by the facet option (boolean, true by default).');
126
126
  GuideDialogSteps.clickOnNextButton();
127
127
 
128
+ GuideDialogSteps.assertDialogWithTitleIsVisible('Lucene connector');
129
+ GuideDialogSteps.assertDialogWithContentIsVisible('This lucene connector configuration contains multiple field mappings. They determine which values are searchable, filterable, or retrievable during query execution.');
130
+ GuideDialogSteps.clickOnNextButton();
131
+
132
+ GuideDialogSteps.assertDialogWithTitleIsVisible('Lucene connector');
133
+ GuideDialogSteps.assertDialogWithContentIsVisible('For more information please visit GraphDB documentation');
134
+ GuideDialogSteps.getContentLink()
135
+ .should('have.attr', 'href')
136
+ .and('include', 'my-custom-link.html');
137
+ GuideDialogSteps.clickOnNextButton();
138
+
128
139
  GuideDialogSteps.assertDialogWithTitleIsVisible('Lucene connector');
129
140
  GuideDialogSteps.assertDialogWithContentIsVisible('The Languages option defines which RDF literal languages are mapped to the connector. You can provide a list of language ranges to include specific languages, or an empty range to include literals without a language tag.');
130
141
  GuideDialogSteps.clickOnNextButton();
@@ -0,0 +1,74 @@
1
+ import {GuideSteps} from '../../../steps/guides/guide-steps.js';
2
+ import {GuideDialogSteps} from '../../../steps/guides/guide-dialog-steps.js';
3
+ import {MainMenuSteps} from '../../../steps/main-menu-steps.js';
4
+ import {GuidesStubs} from '../../../stubs/guides/guides-stubs.js';
5
+ import {SimilarityIndexCreateSteps} from '../../../steps/explore/similarity-index-create-steps.js';
6
+ import {SimilarityIndexesSteps} from '../../../steps/explore/similarity-indexes-steps.js';
7
+
8
+ describe('Create similarity index guide steps', () => {
9
+ const FILE_TO_IMPORT = 'wine.rdf'
10
+ let repositoryId;
11
+
12
+ beforeEach(() => {
13
+ repositoryId = 'create-similarity-index-guide-' + Date.now();
14
+ GuidesStubs.stubCreateSimilarityIndexGuide();
15
+ cy.createRepository({id: repositoryId});
16
+ cy.importServerFile(repositoryId, FILE_TO_IMPORT);
17
+ cy.presetRepository(repositoryId);
18
+
19
+ GuideSteps.visit();
20
+ GuideSteps.verifyGuidesListExists();
21
+ cy.wait('@getGuides');
22
+ GuideSteps.runFirstGuide()
23
+ });
24
+
25
+ afterEach(() => {
26
+ cy.deleteRepository(repositoryId);
27
+ });
28
+
29
+ it('Should create similarity index', () => {
30
+ GuideDialogSteps.assertDialogWithTitleIsVisible('Create Similarity index — 1/8');
31
+ GuideDialogSteps.assertDialogWithContentIsVisible('The following steps show how to create a Similarity index for your dataset.');
32
+ GuideDialogSteps.clickOnNextButton();
33
+
34
+ GuideDialogSteps.assertDialogWithTitleIsVisible('Create Similarity index — 2/8');
35
+ GuideDialogSteps.assertDialogWithContentIsVisible('Click on the Explore menu.');
36
+ MainMenuSteps.clickOnExplore();
37
+
38
+ GuideDialogSteps.assertDialogWithTitleIsVisible('Create Similarity index — 3/8');
39
+ GuideDialogSteps.assertDialogWithContentIsVisible('Click on the Similarity menu.');
40
+ MainMenuSteps.clickOnSubmenuSimilarity();
41
+
42
+ GuideDialogSteps.assertDialogWithTitleIsVisible('Create Similarity index — 4/8');
43
+ GuideDialogSteps.assertDialogWithContentIsVisible('Click the link to start creating a new Similarity index');
44
+ SimilarityIndexesSteps.clickCreateButton();
45
+
46
+ GuideDialogSteps.assertDialogWithTitleIsVisible('Create Similarity index — 5/8');
47
+ GuideDialogSteps.assertDialogWithContentIsVisible('Type a name for the index. You will refer to it later.');
48
+ SimilarityIndexCreateSteps.typeSimilarityIndexName('new-similarity-index');
49
+ GuideDialogSteps.clickOnNextButton();
50
+
51
+ GuideDialogSteps.assertDialogWithTitleIsVisible('Create Similarity index — 6/8');
52
+ GuideDialogSteps.assertDialogWithContentIsVisible('Click the button to create the Similarity index.')
53
+ SimilarityIndexCreateSteps.create();
54
+
55
+ GuideDialogSteps.assertDialogWithTitleIsVisible('Create Similarity index — 8/8');
56
+ GuideDialogSteps.assertDialogWithContentIsVisible('Wait for index to be created')
57
+ GuideDialogSteps.clickOnNextButton();
58
+
59
+ GuideDialogSteps.assertDialogWithTitleIsVisible('Select by index name');
60
+ GuideDialogSteps.assertDialogWithContentIsVisible('In the Existing Indexes table, you can now see the new-similarity-index which is the similarity index we created with the previous query.')
61
+ GuideDialogSteps.clickOnNextButton();
62
+
63
+ GuideDialogSteps.assertDialogWithTitleIsVisible('Select by row index 0 (first row)');
64
+ GuideDialogSteps.assertDialogWithContentIsVisible('In the Existing Indexes table, you can now see the created index.')
65
+ GuideDialogSteps.clickOnNextButton();
66
+
67
+ GuideDialogSteps.assertDialogWithTitleIsVisible('Select default index 0 (first row)');
68
+ GuideDialogSteps.assertDialogWithContentIsVisible('In the Existing Indexes table, you can now see the created index.')
69
+ GuideDialogSteps.clickOnNextButton();
70
+
71
+ GuideDialogSteps.clickOnCloseButton();
72
+ GuideDialogSteps.assertDialogIsClosed();
73
+ });
74
+ });
@@ -0,0 +1,55 @@
1
+ import {GuideSteps} from '../../../steps/guides/guide-steps.js';
2
+ import {GuideDialogSteps} from '../../../steps/guides/guide-dialog-steps.js';
3
+ import {GuidesStubs} from '../../../stubs/guides/guides-stubs.js';
4
+
5
+ describe('Download guide resource guide steps', () => {
6
+ let repositoryId;
7
+ const resourcePath = 'file-path';
8
+ const resourceFile = 'file.ttl';
9
+ const guideRepositoryId = 'test-repo';
10
+
11
+ beforeEach(() => {
12
+ repositoryId = 'download-guide-resource-guide-' + Date.now();
13
+ GuidesStubs.stubDownloadGuideResourceGuide();
14
+ cy.createRepository({id: repositoryId});
15
+ cy.presetRepository(repositoryId);
16
+
17
+ GuidesStubs.stubDownloadResource(resourcePath, resourceFile);
18
+
19
+ GuideSteps.visit();
20
+ GuideSteps.verifyGuidesListExists();
21
+ cy.wait('@getGuides');
22
+ GuideSteps.runFirstGuide();
23
+ });
24
+
25
+ afterEach(() => {
26
+ cy.deleteRepository(repositoryId);
27
+ });
28
+
29
+ it('Should guide through download guide resource', () => {
30
+ GuideDialogSteps.assertDialogWithTitleIsVisible('Download guide resources');
31
+ GuideDialogSteps.assertDialogWithContentIsVisible('This guide requires a file to be downloaded.');
32
+ GuideDialogSteps.assertDialogWithContentIsVisible(`Please download ${resourceFile}.`);
33
+ GuideSteps.downloadResource();
34
+
35
+ cy.wait('@resource-download').then((interception) => {
36
+ expect(interception.response.statusCode).to.eq(200);
37
+ cy.readFile(`cypress/downloads/${resourceFile}`);
38
+ });
39
+
40
+ GuideDialogSteps.clickOnNextButton();
41
+
42
+ GuideDialogSteps.assertDialogWithTitleIsVisible('Download guide resource - with repositoryId');
43
+ GuideDialogSteps.assertDialogWithContentIsVisible('This guide requires a file to be downloaded.');
44
+ GuideDialogSteps.assertDialogWithContentIsVisible(`Please download ${resourceFile}.`);
45
+ GuideSteps.downloadResource(guideRepositoryId);
46
+
47
+ cy.wait('@resource-download').then((interception) => {
48
+ expect(interception.response.statusCode).to.eq(200);
49
+ cy.readFile(`cypress/downloads/${resourceFile}`);
50
+ });
51
+
52
+ GuideDialogSteps.clickOnCloseButton();
53
+ GuideDialogSteps.assertDialogIsClosed();
54
+ });
55
+ });
@@ -0,0 +1,88 @@
1
+ import {GuidesStubs} from "../../../../stubs/guides/guides-stubs.js";
2
+ import {TTYGStubs} from "../../../../stubs/ttyg/ttyg-stubs.js";
3
+ import {GuideSteps} from "../../../../steps/guides/guide-steps.js";
4
+ import {GuideDialogSteps} from "../../../../steps/guides/guide-dialog-steps.js";
5
+ import {TTYGViewSteps} from "../../../../steps/ttyg/ttyg-view-steps.js";
6
+ import {ChatPanelSteps} from "../../../../steps/ttyg/chat-panel-steps.js";
7
+ import {RepositoriesStubs} from "../../../../stubs/repositories/repositories-stubs.js";
8
+ import {TtygAgentSettingsModalSteps} from "../../../../steps/ttyg/ttyg-agent-settings-modal.steps.js";
9
+ import {BrowserStubs} from "../../../../stubs/browser-stubs.js";
10
+
11
+ describe('ttyg-conversation-guide', () => {
12
+ let repositoryId = 'starwars';
13
+
14
+ beforeEach(() => {
15
+ BrowserStubs.stubWindowOpen();
16
+ RepositoriesStubs.stubRepositories(0, '/repositories/get-ttyg-repositories.json');
17
+ RepositoriesStubs.stubBaseEndpoints(repositoryId);
18
+ cy.presetRepository(repositoryId);
19
+ GuidesStubs.stubTTYGConversationGuide();
20
+ TTYGStubs.stubAgentDefaultsGet();
21
+ TTYGStubs.stubChatsListGet();
22
+ TTYGStubs.stubAgentListGet();
23
+ TTYGStubs.stubChatGet();
24
+ TTYGStubs.stubCreateNewChat();
25
+ TTYGStubs.stubExplainResponse('/ttyg/chats/explain-response-3.json');
26
+
27
+ GuideSteps.visit();
28
+ GuideSteps.verifyGuidesListExists();
29
+
30
+ GuideSteps.runFirstGuide()
31
+ cy.wait('@getGuides');
32
+ cy.wait('@get-chat-list');
33
+ cy.wait('@get-agent-list');
34
+ cy.wait('@get-all-repositories');
35
+ cy.wait('@get-chat');
36
+ });
37
+
38
+ it('should select an agent and have a conversation', () => {
39
+ GuideDialogSteps.assertDialogWithTitleIsVisible('Select an agent — 1/5');
40
+ GuideDialogSteps.assertDialogWithContentIsVisible('To talk to your graph, you need to select an agent first');
41
+ GuideDialogSteps.clickOnNextButton();
42
+
43
+ GuideDialogSteps.assertDialogWithTitleIsVisible('Select an agent — 2/5');
44
+ GuideDialogSteps.assertDialogWithContentIsVisible('Click on the agents dropdown to see available agents');
45
+ TTYGViewSteps.openAgentsMenu();
46
+
47
+ GuideDialogSteps.assertDialogWithTitleIsVisible('Select an agent — 3/5');
48
+ GuideDialogSteps.assertDialogWithContentIsVisible('Click on you agent from the dropdown to select it');
49
+ TTYGViewSteps.selectAgent(0);
50
+
51
+ GuideDialogSteps.assertDialogWithTitleIsVisible('Conversation with the agent — 2/12');
52
+ GuideDialogSteps.assertDialogWithContentIsVisible('Click the button to create a new chat');
53
+ TTYGViewSteps.createANewChat();
54
+
55
+ const codeToType = 'Count all the web pages published in 2020? Provide five sample names.'
56
+
57
+ GuideDialogSteps.assertDialogWithTitleIsVisible('Ask the agent — 3/12');
58
+ GuideDialogSteps.assertDialogWithContentIsVisible(`Type "${codeToType}" in the input and press enter`);
59
+ ChatPanelSteps.typeQuestion(codeToType);
60
+ ChatPanelSteps.askQuestionWithEnter();
61
+
62
+ GuideDialogSteps.assertDialogWithTitleIsVisible('Ask the agent — 4/12');
63
+ GuideDialogSteps.assertDialogWithContentIsVisible(`Wait for the answer to be returned and explore it. When ready proceed by clicking next.`);
64
+ ChatPanelSteps.waitForLoaderToDisappear();
65
+ GuideDialogSteps.clickOnNextButton();
66
+
67
+ GuideDialogSteps.assertDialogWithTitleIsVisible('Ask the agent — 6/12');
68
+ GuideDialogSteps.assertDialogWithContentIsVisible(`Explain the answer by clicking on the 'Explain response' button.`);
69
+ TTYGViewSteps.clickOnExplainResponse(0);
70
+
71
+ GuideDialogSteps.assertDialogWithTitleIsVisible('Ask the agent — 7/12');
72
+ GuideDialogSteps.assertDialogWithContentIsVisible(`Wait for the answer to be returned and explore it. When ready proceed by clicking next.`);
73
+ ChatPanelSteps.waitForLoaderToDisappear();
74
+ GuideDialogSteps.clickOnNextButton();
75
+
76
+ GuideDialogSteps.assertDialogWithTitleIsVisible('Ask the agent — 9/12');
77
+ GuideDialogSteps.assertDialogWithContentIsVisible(`You can open the query in the SPARQL editor by clicking on 'Open in SPARQL editor' button. When you are ready, return to the page.`);
78
+ TtygAgentSettingsModalSteps.clickOpenQueryInSparqlEditor();
79
+
80
+ GuideDialogSteps.assertDialogWithTitleIsVisible('Ask the agent — 11/12');
81
+ GuideDialogSteps.assertDialogWithContentIsVisible(`You can ask the agent how it derived the answer by clicking on the button`);
82
+ TTYGViewSteps.clickOnHowDeliverAnswerButton();
83
+
84
+ GuideDialogSteps.assertDialogWithTitleIsVisible('Ask the agent — 12/12');
85
+ GuideDialogSteps.assertDialogWithContentIsVisible(`Wait for the answer to be returned and explore it. When ready proceed by clicking next.`);
86
+ GuideDialogSteps.clickOnCloseButton();
87
+ });
88
+ })
@@ -0,0 +1,93 @@
1
+ import {GuideSteps} from '../../../steps/guides/guide-steps';
2
+ import {GuideDialogSteps} from '../../../steps/guides/guide-dialog-steps.js';
3
+ import {LoginSteps} from '../../../steps/login-steps.js';
4
+ import HomeSteps from '../../../steps/home-steps.js';
5
+
6
+ describe('Guides autostart', () => {
7
+ const guideName = 'star-wars';
8
+
9
+ describe('With security disabled', () => {
10
+ it('Should autostart guide', () => {
11
+ // Given, I visit the home page with autostart guide parameter in URL
12
+ GuideSteps.autostartGuide(guideName);
13
+ // Then, I should see the guide
14
+ GuideSteps.assertPageNotInteractive();
15
+ GuideDialogSteps.assertDialogWithTitleIsVisible(`Welcome to`);
16
+ });
17
+ });
18
+
19
+ describe('With security enabled', () => {
20
+ beforeEach(() => {
21
+ cy.switchOnSecurity();
22
+ });
23
+
24
+ afterEach(() => {
25
+ cy.loginAsAdmin();
26
+ cy.switchOffSecurity(true);
27
+ });
28
+
29
+ context('admin', () => {
30
+ it('Should autostart guide with admin', () => {
31
+ // Given, I visit the home page with autostart guide parameter in URL
32
+ GuideSteps.autostartGuide(guideName);
33
+ // Then, I should see the login page and login with admin user
34
+ LoginSteps.loginWithUser('admin', 'root');
35
+ // Then, I should see the guide
36
+ GuideSteps.assertPageNotInteractive();
37
+ GuideDialogSteps.assertDialogWithTitleIsVisible(`Welcome to`);
38
+ });
39
+ });
40
+
41
+ context('repo manager', () => {
42
+ beforeEach(() => {
43
+ cy.loginAsAdmin();
44
+ cy.createUser({
45
+ username: 'repoManager',
46
+ password: 'root',
47
+ grantedAuthorities: ['ROLE_REPO_MANAGER', 'WRITE_REPO_*', 'READ_REPO_*'],
48
+ }, true);
49
+ });
50
+
51
+ afterEach(() => {
52
+ cy.deleteUser('repoManager', true);
53
+ });
54
+
55
+ it('Should autostart guide with repo manager', () => {
56
+ // Given, I visit the home page with autostart guide parameter in URL
57
+ GuideSteps.autostartGuide(guideName);
58
+ // Then, I should see the login page and login with repo manager user
59
+ LoginSteps.loginWithUser('repoManager', 'root');
60
+ // Then, I should see the guide
61
+ GuideSteps.assertPageNotInteractive();
62
+
63
+ GuideDialogSteps.assertDialogWithTitleIsVisible(`Welcome to`);
64
+ });
65
+ });
66
+
67
+ context('user', () => {
68
+ beforeEach(() => {
69
+ cy.loginAsAdmin();
70
+ cy.createUser({
71
+ username: 'user',
72
+ password: 'root',
73
+ grantedAuthorities: ['WRITE_REPO_*', 'READ_REPO_*'],
74
+ }, true);
75
+ });
76
+
77
+ afterEach(() => {
78
+ cy.deleteUser('user', true);
79
+ });
80
+
81
+ it('Should not autostart guide with user', () => {
82
+ // Given, I visit the home page with autostart guide parameter in URL
83
+ GuideSteps.autostartGuide(guideName);
84
+ // Then, I should see the login page and login with user
85
+ LoginSteps.loginWithUser('user', 'root');
86
+ // Then, I should not see the guide
87
+ HomeSteps.getTutorialPanel().should('be.visible');
88
+ GuideSteps.getGuidesModal().should('not.exist');
89
+ GuideDialogSteps.getModalDialog().should('not.exist');
90
+ });
91
+ });
92
+ });
93
+ });
@@ -28,7 +28,7 @@ describe('Import server files', () => {
28
28
  // When I switch to the server files tab
29
29
  ImportUserDataSteps.openServerFilesTab();
30
30
  // Then Server files tab should be active
31
- cy.url().should('include', '/import#server');
31
+ cy.url().should('include', '/import').and('include', '#server');
32
32
  ImportServerFilesSteps.getActiveTab().should('have.text', 'Server files');
33
33
  ImportServerFilesSteps.getResourcesTable().should('be.visible');
34
34
  });
@@ -37,7 +37,7 @@ describe('Import server files', () => {
37
37
  // When I visit the import page through a direct link to the server files tab
38
38
  cy.visit('/import#server');
39
39
  // Then Server files tab should be active
40
- cy.url().should('include', '/import#server');
40
+ cy.url().should('include', '/import').and('include', '#server');
41
41
  ImportServerFilesSteps.getActiveTab().should('have.text', 'Server files');
42
42
  ImportServerFilesSteps.getResourcesTable().should('be.visible');
43
43
  });
@@ -25,7 +25,7 @@ describe('Import user data', () => {
25
25
  // Given I have visited the import page
26
26
  ImportUserDataSteps.visit();
27
27
  // When the page is loaded
28
- cy.url().should('include', '/import#user');
28
+ cy.url().should('include', '/import').and('include', '#user');
29
29
  // Then I should see the user help icons
30
30
  ImportUserDataSteps.showPageInfoPopover();
31
31
  ImportUserDataSteps.getPageInfoPopoverTitle()
@@ -59,7 +59,7 @@ describe('Import user data', () => {
59
59
  ImportUserDataSteps.openServerFilesTabFromWarning();
60
60
  // Then I should see the server files tab
61
61
  ImportUserDataSteps.getActiveTab().should('have.text', 'Server files');
62
- cy.url().should('include', '/import#server');
62
+ cy.url().should('include', '/import').and('include', '#server');
63
63
  ImportUserDataSteps.getServerFilesTab().should('be.visible');
64
64
  // When I click on the API link in the warning
65
65
  ImportUserDataSteps.openUserDataTab();
@@ -187,7 +187,7 @@ describe('Ontop repositories', () => {
187
187
  // The Ontop repository should be created
188
188
  RepositorySteps.visit();
189
189
  // The repository list should contain the new repository, which can be activated
190
- RepositorySteps.clickRepositoryConnectionOffBtn(repositoryId);
190
+ RepositorySteps.activateRepository(repositoryId);
191
191
  // When the repository is restarted
192
192
  RepositorySteps.restartRepository(repositoryId);
193
193
  ModalDialogSteps.getDialogBody().should('contain', repositoryId);
@@ -0,0 +1,155 @@
1
+ import {ModalDialogSteps} from "../../steps/modal-dialog-steps";
2
+ import HomeSteps from '../../steps/home-steps.js';
3
+ import {RepositoryErrorsWidgetSteps} from '../../steps/widgets/repository-errors-widget-steps.js';
4
+ import {RepositorySteps} from '../../steps/repository-steps.js';
5
+ import {RepositorySelectorSteps} from '../../steps/repository-selector-steps.js';
6
+
7
+ describe('URL with Repository ID parameter', () => {
8
+ let repositoryId;
9
+ let secondRepositoryId;
10
+
11
+ describe('When repository is changed', () => {
12
+ beforeEach(() => {
13
+ repositoryId = 'repository-in-url-' + Date.now();
14
+ cy.createRepository({id: repositoryId});
15
+ secondRepositoryId = 'second-repository-in-url-' + Date.now();
16
+ cy.createRepository({id: secondRepositoryId});
17
+ cy.presetRepository(repositoryId);
18
+ })
19
+
20
+ afterEach(() => {
21
+ cy.deleteRepository(repositoryId);
22
+ cy.deleteRepository(secondRepositoryId);
23
+ });
24
+
25
+ it('should update URL', () => {
26
+ RepositorySteps.visit();
27
+ RepositorySteps.getActiveRepositoryRow().should('contain', repositoryId);
28
+ RepositorySelectorSteps.getSelectedRepository().should('contain', repositoryId);
29
+ cy.url().should('include', 'repositoryId=' + repositoryId);
30
+
31
+ RepositorySelectorSteps.selectRepository(secondRepositoryId);
32
+
33
+ RepositorySteps.getActiveRepositoryRow().should('contain', secondRepositoryId);
34
+ RepositorySelectorSteps.getSelectedRepository().should('contain', secondRepositoryId);
35
+ cy.url().should('include', 'repositoryId=' + secondRepositoryId);
36
+
37
+ RepositorySteps.activateRepository(repositoryId);
38
+
39
+ RepositorySteps.getActiveRepositoryRow().should('contain', repositoryId);
40
+ RepositorySelectorSteps.getSelectedRepository().should('contain', repositoryId);
41
+ cy.url().should('include', 'repositoryId=' + repositoryId);
42
+ });
43
+ });
44
+
45
+ describe('When there is no active repository and no repository in URL', () => {
46
+ // 1. active repo no, repo in url no -> no action - just show repo selector
47
+ it('should show repository selector with no repository selected', () => {
48
+ HomeSteps.visit();
49
+ RepositoryErrorsWidgetSteps.getWidget().should('be.visible');
50
+ cy.url().should('not.include', 'repositoryId=');
51
+ HomeSteps.getSelectedRepository().should('contain', 'No accessible repositories');
52
+ // no modal dialog should be shown
53
+ ModalDialogSteps.getDialog().should('not.exist');
54
+ })
55
+ })
56
+
57
+ describe('When there is no active repository and repository in URL is present', () => {
58
+ beforeEach(() => {
59
+ repositoryId = 'repository-in-url-' + Date.now();
60
+ cy.createRepository({id: repositoryId});
61
+ })
62
+
63
+ afterEach(() => {
64
+ cy.deleteRepository(repositoryId);
65
+ });
66
+
67
+ // 2. active repo no, repo in url yes, url repo exists -> set active repo same as the url
68
+ it('should set active repository to the one in URL if it exists', () => {
69
+ HomeSteps.visitWithRepositoryInUrl(repositoryId);
70
+ RepositoryErrorsWidgetSteps.getWidget().should('not.exist');
71
+ cy.url().should('include', 'repositoryId=' + repositoryId);
72
+ HomeSteps.getSelectedRepository().should('contain', repositoryId);
73
+ });
74
+
75
+ // 3. active repo no, repo in url yes, url repo missing -> show warning, keep url
76
+ it('should show warning if repository in URL does not exist', () => {
77
+ HomeSteps.visitWithRepositoryInUrl('mising-repo');
78
+ RepositoryErrorsWidgetSteps.getWidget().should('be.visible');
79
+ HomeSteps.getSelectedRepository().should('contain', 'Choose repository');
80
+ ModalDialogSteps.getModalAlert().should('be.visible');
81
+ ModalDialogSteps.getDialogBody().should('contain', 'The repository "mising-repo" specified in the URL does not exist. Please select an existing repository.');
82
+ ModalDialogSteps.close();
83
+ cy.url().should('include', 'repositoryId=mising-repo');
84
+ });
85
+ });
86
+
87
+ describe('When there is an active repository and no repository in URL', () => {
88
+ beforeEach(() => {
89
+ repositoryId = 'repository-in-url-' + Date.now();
90
+ cy.createRepository({id: repositoryId});
91
+ cy.presetRepository(repositoryId);
92
+ })
93
+
94
+ afterEach(() => {
95
+ cy.deleteRepository(repositoryId);
96
+ cy.deleteRepository(secondRepositoryId);
97
+ });
98
+
99
+ // 4. active repo yes, repo in url no -> update url
100
+ it('should update URL to include active repository', () => {
101
+ HomeSteps.visit();
102
+ RepositoryErrorsWidgetSteps.getWidget().should('be.hidden');
103
+ cy.url().should('include', 'repositoryId=' + repositoryId);
104
+ HomeSteps.getSelectedRepository().should('contain', repositoryId);
105
+ });
106
+
107
+ // 5. active repo yes, repo in url yes, url repo exists -> show confirmation, update active repo on confirmation
108
+ it('should show confirmation and update active repository if repository in URL exists', () => {
109
+ secondRepositoryId = 'second-repository-in-url-' + Date.now();
110
+ cy.createRepository({id: secondRepositoryId});
111
+ HomeSteps.visitWithRepositoryInUrl(secondRepositoryId);
112
+ cy.url().should('include', 'repositoryId=' + secondRepositoryId);
113
+ HomeSteps.getSelectedRepository().should('contain', repositoryId);
114
+ HomeSteps.getView().should('be.visible');
115
+ HomeSteps.getActiveRepositoryWidget().should('be.visible');
116
+ RepositoryErrorsWidgetSteps.getWidget().should('be.hidden');
117
+ ModalDialogSteps.getDialog().should('be.visible');
118
+ ModalDialogSteps.getDialogBody().should('contain', `Active repository will be changed to "${secondRepositoryId}". Do you want to proceed?`);
119
+ ModalDialogSteps.confirm();
120
+ ModalDialogSteps.getDialog().should('not.exist');
121
+ HomeSteps.getSelectedRepository().should('contain', secondRepositoryId);
122
+ cy.url().should('include', 'repositoryId=' + secondRepositoryId);
123
+ });
124
+
125
+ // 5. active repo yes, repo in url yes, url repo exists -> show confirmation, keep active repo on reject
126
+ it('should show confirmation and keep active repository if repository in URL exists but user rejects', () => {
127
+ // active repo yes, repo in url yes, url repo exists -> show confirmation, update active repo
128
+ secondRepositoryId = 'second-repository-in-url-' + Date.now();
129
+ cy.createRepository({id: secondRepositoryId});
130
+ HomeSteps.visitWithRepositoryInUrl(secondRepositoryId);
131
+ cy.url().should('include', 'repositoryId=' + secondRepositoryId);
132
+ HomeSteps.getSelectedRepository().should('contain', repositoryId);
133
+ HomeSteps.getView().should('be.visible');
134
+ HomeSteps.getActiveRepositoryWidget().should('be.visible');
135
+ RepositoryErrorsWidgetSteps.getWidget().should('be.hidden');
136
+ ModalDialogSteps.getDialog().should('be.visible');
137
+ ModalDialogSteps.getDialogBody().should('contain', `Active repository will be changed to "${secondRepositoryId}". Do you want to proceed?`);
138
+ ModalDialogSteps.cancel();
139
+ ModalDialogSteps.getDialog().should('not.exist');
140
+ HomeSteps.getSelectedRepository().should('contain', repositoryId);
141
+ cy.url().should('include', 'repositoryId=' + repositoryId);
142
+ });
143
+
144
+ // 6. active repo yes, repo in url yes, url repo missing-> show warning, keep the active repo
145
+ it('should show warning if repository in URL does not exist and keep active repository', () => {
146
+ HomeSteps.visitWithRepositoryInUrl('mising-repo');
147
+ cy.url().should('include', 'repositoryId=mising-repo');
148
+ ModalDialogSteps.getModalAlert().should('be.visible');
149
+ ModalDialogSteps.clickOKButton();
150
+ ModalDialogSteps.getModalAlert().should('not.exist');
151
+ HomeSteps.getSelectedRepository().should('contain', repositoryId);
152
+ cy.url().should('include', 'repositoryId=' + repositoryId);
153
+ });
154
+ });
155
+ });
@@ -6,7 +6,7 @@ import {ModalDialogSteps, VerifyConfirmationDialogOptions} from "../../../steps/
6
6
  import {YasqeSteps} from "../../../steps/yasgui/yasqe-steps";
7
7
  import {MainMenuSteps} from "../../../steps/main-menu-steps";
8
8
  import {RepositorySelectorSteps} from "../../../steps/repository-selector-steps";
9
- import {YasguiLoader} from "../../../steps/yasgui/yasgui-loader";
9
+ import {ApplicationSteps} from "../../../steps/application-steps.js";
10
10
 
11
11
  const FILE_TO_IMPORT = '200-row-allianz.ttl';
12
12
  const DEFAULT_QUERY = 'PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>\n' +
@@ -64,7 +64,7 @@ describe('JDBC configuration', () => {
64
64
  JdbcCreateSteps.clickOnPreviewButton();
65
65
 
66
66
  // Then I expect to see loader,
67
- YasguiLoader.verifyMessage('Preview of first 100 rows of table', 1);
67
+ ApplicationSteps.geLoader().should('contain', 'Preview of first 100 rows of table');
68
68
  // and see the generated preview.
69
69
  YasrSteps.getResults().should('be.visible');
70
70
  });
@@ -324,6 +324,6 @@ function createVerifyConfirmationDialogOptions() {
324
324
  return new VerifyConfirmationDialogOptions()
325
325
  .setChangePageFunction(() => MainMenuSteps.clickOnMenuImport())
326
326
  .setConfirmationMessage('You have unsaved changes. Are you sure that you want to exit?')
327
- .setVerifyCurrentUrl(() => cy.url().should('eq', `${Cypress.config('baseUrl')}/jdbc/configuration/create`))
328
- .setVerifyRedirectedUrl(() => cy.url().should('eq', `${Cypress.config('baseUrl')}/import#user`));
327
+ .setVerifyCurrentUrl(() => cy.url().should('include', `${Cypress.config('baseUrl')}/jdbc/configuration/create`))
328
+ .setVerifyRedirectedUrl(() => cy.url().should('include', '/import').and('include', '#user'));
329
329
  }