graphdb-workbench-tests 3.3.1 → 3.4.0-dynamic-guides-test

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 (70) hide show
  1. package/cypress-flaky.config.js +2 -0
  2. package/cypress-legacy.config.js +2 -2
  3. package/cypress-security.config.js +3 -14
  4. package/e2e-flaky/import/import-server-files-operations.spec.js +1 -1
  5. package/e2e-flaky/import/import-user-data-batch-operations.spec.js +1 -1
  6. package/e2e-flaky/setup/sparql-template-create.js +3 -18
  7. package/e2e-flaky/sparql-editor/actions/execute-update-query.spec.js +2 -12
  8. package/e2e-flaky/sparql-editor/actions/share-query.spec.js +1 -7
  9. package/e2e-flaky/sparql-editor/yasr/table-plugin.spec.js +1 -6
  10. package/e2e-legacy/explore/visual-graph/visual.graph.spec.js +2 -7
  11. package/e2e-legacy/graphql/graphql-theme.spec.js +73 -0
  12. package/e2e-legacy/guides/execute-sparql-query/execute-sparql-query-guide.spec.js +92 -0
  13. package/e2e-legacy/guides/import-rdf-file/confirm-duplicate-rdf-file.spec.js +63 -0
  14. package/e2e-legacy/guides/import-rdf-file/import-rdf-file.spec.js +105 -0
  15. package/e2e-legacy/guides/main-menu/main-menu-guide.spec.js +302 -0
  16. package/e2e-legacy/guides/rdf-rank/rdf-rank-guide.spec.js +42 -0
  17. package/e2e-legacy/guides/table-graph-explore/table-graph-explore-guide.spec.js +167 -0
  18. package/e2e-legacy/guides/ttyg/conversation/ttyg-conversation-guide.spec.js +6 -2
  19. package/e2e-legacy/guides/ttyg/edit-agent/edit-ttyg-agent-guide.spec.js +87 -0
  20. package/e2e-legacy/guides/visual-graph/visual-graph-guide.spec.js +166 -0
  21. package/e2e-legacy/guides/welcome/welcome-guide.spec.js +36 -0
  22. package/e2e-legacy/help/guides/movies-interactive-guide.spec.js +47 -49
  23. package/e2e-legacy/import/import-server-files.spec.js +3 -1
  24. package/e2e-legacy/repository/repositories.spec.js +5 -2
  25. package/e2e-legacy/repository/url-with-repository-id-parameter.spec.js +26 -0
  26. package/e2e-legacy/resource/resource.spec.js +1 -6
  27. package/e2e-legacy/setup/aclmanagement/create-rule.spec.js +3 -0
  28. package/e2e-legacy/setup/connectors-lucene.spec.js +24 -8
  29. package/e2e-legacy/setup/users-and-access/user-and-access.spec.js +36 -0
  30. package/e2e-legacy/sparql-editor/actions/expand-results-over-sameas.spec.js +1 -1
  31. package/e2e-legacy/sparql-editor/actions/show-saved-queries.spec.js +1 -6
  32. package/e2e-legacy/sparql-editor/yasgui-tabs.spec.js +2 -12
  33. package/e2e-legacy/sparql-editor/yasr/pagination.spec.js +5 -18
  34. package/e2e-legacy/sparql-editor/yasr/table-plugin.spec.js +1 -6
  35. package/e2e-legacy/sparql-editor/yasr/toolbar/visual-graph-button.spec.js +1 -6
  36. package/e2e-legacy/ttyg/chat-list.spec.js +2 -12
  37. package/e2e-legacy/ttyg/create-agent.spec.js +8 -48
  38. package/e2e-legacy/ttyg/edit-agent.spec.js +2 -12
  39. package/e2e-security/repository/url-with-repository-id-parameter.spec.js +57 -0
  40. package/e2e-security/setup/users-and-access/turn-on-security-and-password-change.spec.js +4 -5
  41. package/fixtures/guides/execute-sparql-query/execute-sparql-query-guide.json +54 -0
  42. package/fixtures/guides/import-rdf-file/confirm-duplicate-rdf-file-guide.json +30 -0
  43. package/fixtures/guides/import-rdf-file/import-rdf-file-guide.json +21 -0
  44. package/fixtures/guides/main-menu/main-menu-guide.json +98 -0
  45. package/fixtures/guides/rdf-rank/rdf-rank-guide.json +18 -0
  46. package/fixtures/guides/table-graph-explore/table-graph-explore-guide.json +51 -0
  47. package/fixtures/guides/table-graph-explore/table-graph-explore-without-substeps-guide.json +25 -0
  48. package/fixtures/guides/ttyg/edit-ttyg-agent/edit-ttyg-agent-guide.json +22 -0
  49. package/fixtures/guides/visual-graph/visual-graph-guide.json +85 -0
  50. package/fixtures/guides/welcome/welcome-guide.json +18 -0
  51. package/npm-shrinkwrap.json +317 -263
  52. package/package.json +1 -1
  53. package/steps/base-steps.js +4 -0
  54. package/steps/error-page-steps.js +9 -0
  55. package/steps/graphql/playground-editor-steps.js +46 -0
  56. package/steps/guides/guide-dialog-steps.js +4 -0
  57. package/steps/import/import-resource-message-dialog.js +1 -1
  58. package/steps/login-steps.js +4 -0
  59. package/steps/main-menu-steps.js +12 -0
  60. package/steps/repository-steps.js +2 -2
  61. package/steps/setup/acl-management-steps.js +4 -0
  62. package/steps/setup/user-and-access-steps.js +14 -6
  63. package/steps/sparql-steps.js +13 -1
  64. package/steps/visual-graph-steps.js +17 -1
  65. package/steps/yasgui/yasqe-steps.js +29 -4
  66. package/steps/yasgui/yasr-steps.js +4 -0
  67. package/stubs/guides/guides-stubs.js +41 -1
  68. package/stubs/security-stubs.js +4 -0
  69. package/stubs/ttyg/ttyg-stubs.js +2 -4
  70. package/support/e2e-security.js +9 -0
@@ -9,6 +9,8 @@ export default defineConfig({
9
9
  video: true,
10
10
  defaultCommandTimeout: 25000,
11
11
  numTestsKeptInMemory: 10,
12
+ viewportWidth: 1600,
13
+ viewportHeight: 1200,
12
14
  e2e: {
13
15
  retries: {
14
16
  runMode: 2,
@@ -17,8 +17,8 @@ export default defineConfig({
17
17
  video: true,
18
18
  defaultCommandTimeout: 25000,
19
19
  numTestsKeptInMemory: 10,
20
- viewportWidth: 1280,
21
- viewportHeight: 720,
20
+ viewportWidth: 1600,
21
+ viewportHeight: 1200,
22
22
  e2e: {
23
23
  retries: {
24
24
  runMode: 2,
@@ -1,14 +1,6 @@
1
1
  import { defineConfig } from 'cypress';
2
2
  import setupPlugins from './plugins/index.js';
3
3
 
4
- const isCoverage = process.env.COVERAGE === 'true';
5
-
6
- const loadCodeCoverage = async (on, config) => {
7
- const mod = await import('@bahmutov/cypress-code-coverage/plugin');
8
- const plugin = ('default' in mod) ? mod.default : mod;
9
- plugin(on, config);
10
- };
11
-
12
4
  export default defineConfig({
13
5
  projectId: 'v35btb',
14
6
  fixturesFolder: 'fixtures',
@@ -17,8 +9,8 @@ export default defineConfig({
17
9
  video: true,
18
10
  defaultCommandTimeout: 25000,
19
11
  numTestsKeptInMemory: 10,
20
- viewportWidth: 1280,
21
- viewportHeight: 720,
12
+ viewportWidth: 1600,
13
+ viewportHeight: 1200,
22
14
  e2e: {
23
15
  retries: {
24
16
  runMode: 2,
@@ -28,14 +20,11 @@ export default defineConfig({
28
20
  // You may want to clean this up later by importing these.
29
21
  async setupNodeEvents(on, config) {
30
22
  setupPlugins(on, config);
31
- if (isCoverage) {
32
- await loadCodeCoverage(on, config);
33
- }
34
23
  return config;
35
24
  },
36
25
  baseUrl: 'http://localhost:9000',
37
26
  specPattern: 'e2e-security/**/*.{js,jsx,ts,tsx}',
38
- supportFile: 'support/e2e.js',
27
+ supportFile: 'support/e2e-security.js',
39
28
  reporter: "cypress-multi-reporters",
40
29
  reporterOptions: {
41
30
  configFile: 'cypress-reporter-config.json'
@@ -1,7 +1,7 @@
1
1
  import {ImportServerFilesSteps} from "../../steps/import/import-server-files-steps";
2
2
  import {ImportSettingsDialogSteps} from "../../steps/import/import-settings-dialog-steps";
3
3
 
4
- describe('Import server files - Operations', {retries: {runMode: 2}}, () => {
4
+ describe('Import server files - Operations', () => {
5
5
 
6
6
  let repositoryId;
7
7
 
@@ -14,7 +14,7 @@ const jsonld = JSON.stringify({
14
14
  "ab:email": "richard491@hotmail.com"
15
15
  });
16
16
 
17
- describe('Import user data: Batch operations', {retries: {runMode: 2}}, () => {
17
+ describe('Import user data: Batch operations', () => {
18
18
 
19
19
  let repositoryId;
20
20
  const testFiles = [
@@ -26,12 +26,7 @@ describe('SPARQL create template', () => {
26
26
  cy.deleteRepository(secondRepositoryId);
27
27
  });
28
28
 
29
- it('should has error message described that query is invalid', {
30
- retries: {
31
- runMode: 1,
32
- openMode: 0
33
- }
34
- }, () => {
29
+ it('should has error message described that query is invalid', () => {
35
30
  // When I visit 'Sparql create template' view,
36
31
  // and fill valid template id.
37
32
  SparqlCreateUpdateSteps.typeTemplateId('http://test');
@@ -48,12 +43,7 @@ describe('SPARQL create template', () => {
48
43
  /**
49
44
  * TODO: Fix me. Broken due to migration (Repository selector changed)
50
45
  */
51
- it.skip('should display confirm dialog I am updating a sparql template and change the repository', {
52
- retries: {
53
- runMode: 1,
54
- openMode: 0
55
- }
56
- }, () => {
46
+ it.skip('should display confirm dialog I am updating a sparql template and change the repository', () => {
57
47
  // When I visit 'Sparql create template' view,
58
48
  // create a SPARQL template
59
49
  const templateId = 'http://' + Date.now();
@@ -119,12 +109,7 @@ describe('SPARQL create template', () => {
119
109
  /**
120
110
  * TODO: Fix me. Broken due to migration (Changes in main menu)
121
111
  */
122
- it.skip('should confirm me before navigate when query is changed', {
123
- retries: {
124
- runMode: 1,
125
- openMode: 0
126
- }
127
- }, () => {
112
+ it.skip('should confirm me before navigate when query is changed', () => {
128
113
  // When I visit 'Sparql create template' view,
129
114
  // and change the query in ontotext-yasgui editor.
130
115
  // When I fill non update query (select for example).
@@ -22,12 +22,7 @@ describe('Execute of update query', () => {
22
22
  cy.deleteRepository(repositoryId);
23
23
  });
24
24
 
25
- it('should display properly result message info when insert 2 statements', {
26
- retries: {
27
- runMode: 1,
28
- openMode: 0
29
- }
30
- }, () => {
25
+ it('should display properly result message info when insert 2 statements', () => {
31
26
  // When I execute insert query which adds 2 results
32
27
  YasqeSteps.pasteQuery(
33
28
  'PREFIX : <http://bedrock/> ' +
@@ -56,12 +51,7 @@ describe('Execute of update query', () => {
56
51
  TablePluginSteps.getQueryResultInfo().contains('The number of statements did not change.');
57
52
  });
58
53
 
59
- it('should display result message info which describes that two statements are removed', {
60
- retries: {
61
- runMode: 1,
62
- openMode: 0
63
- }
64
- }, () => {
54
+ it('should display result message info which describes that two statements are removed', () => {
65
55
  // When I visit a page with "ontotext-yasgui-web-component" in it,
66
56
  // and selected repository has some inserted statements.
67
57
  YasqeSteps.pasteQuery(
@@ -47,13 +47,7 @@ describe('Share query', () => {
47
47
  ApplicationSteps.getSuccessNotifications().should('be.visible');
48
48
  });
49
49
 
50
- it('Should be able to open a share link in a new editor tab',
51
- {
52
- retries: {
53
- runMode: 1,
54
- openMode: 0
55
- }
56
- }, () => {
50
+ it('Should be able to open a share link in a new editor tab',() => {
57
51
  // Given I have opened the sparql editor
58
52
  YasguiSteps.getTabs().should('have.length', 1);
59
53
  // When I get the shareable link for current query
@@ -35,12 +35,7 @@ describe.skip('Yasr Table plugin', () => {
35
35
  YasrSteps.getCopyResourceLink(28, 2).should('be.visible');
36
36
  });
37
37
 
38
- it('Should be able to copy a link', {
39
- retries: {
40
- runMode: 1,
41
- openMode: 0
42
- }
43
- }, () => {
38
+ it('Should be able to copy a link', () => {
44
39
  // When I execute a query which returns results of type is uri.
45
40
  QueryStubs.stubDefaultQueryResponse();
46
41
  YasqeSteps.executeQuery();
@@ -28,7 +28,7 @@ describe('Visual graph screen validation', () => {
28
28
 
29
29
  context('Embedded', () => {
30
30
  it('Should not show main manu, header and footer in embedded mode', () => {
31
- cy.visit('/graphs-visualizations?uri=http:%2F%2Fwww.w3.org%2FTR%2F2003%2FPR-owl-guide-20031209%2Fwine%23Chardonnay&embedded')
31
+ cy.visit('/graphs-visualizations?uri=http:%2F%2Fwww.w3.org%2FTR%2F2003%2FPR-owl-guide-20031209%2Fwine%23Chardonnay&embedded');
32
32
  VisualGraphSteps.verifyPageLoaded();
33
33
  MainMenuSteps.getMainMenu().should('not.exist');
34
34
  HomeSteps.getPageFooter().should('not.exist');
@@ -66,12 +66,7 @@ describe('Visual graph screen validation', () => {
66
66
  ApplicationSteps.getErrorNotifications().should('be.visible').and('contain', 'Invalid IRI');
67
67
  });
68
68
 
69
- it('Test search for a valid resource', {
70
- retries: {
71
- openMode: 0,
72
- runMode: 1,
73
- },
74
- }, () => {
69
+ it('Test search for a valid resource', () => {
75
70
  AutocompleteStubs.spyAutocompleteStatus();
76
71
  VisualGraphSteps.visit();
77
72
  // Verify autocomplete is ON, because sometimes in CI it is OFF and fails when searching for Resource
@@ -0,0 +1,73 @@
1
+ import {PlaygroundEditorSteps} from "../../steps/graphql/playground-editor-steps.js";
2
+ import {GraphqlPlaygroundSteps} from "../../steps/graphql/graphql-playground-steps.js";
3
+
4
+ describe('Graphiql Editor Themes', () => {
5
+ let repositoryId;
6
+ const THEME_PERSISTENCE_KEY = 'ls.workbench-settings';
7
+
8
+ beforeEach(() => {
9
+ repositoryId = 'graphiql-editor-themes-' + Date.now();
10
+ cy.createRepository({id: repositoryId});
11
+ cy.presetRepository(repositoryId);
12
+ cy.importServerFile(repositoryId, 'swapi-dataset.ttl');
13
+ cy.uploadGraphqlSchema(repositoryId, 'graphql/soml/swapi-schema.yaml', 'swapi');
14
+ cy.uploadGraphqlSchema(repositoryId, 'graphql/soml/swapi-schema-planets.yaml', 'swapi-planets');
15
+ });
16
+
17
+ afterEach(() => {
18
+ cy.deleteRepository(repositoryId);
19
+ });
20
+
21
+ it('should apply the default theme if theme is not persisted in local store', () => {
22
+ // GIVEN: I have opened the workbench and no theme is persisted in local storage.
23
+
24
+ // WHEN: I visit the GraphQL Playground page
25
+ GraphqlPlaygroundSteps.visit();
26
+ // THEN: the default "graphiql" theme class should be applied to the CodeMirror instances.
27
+ verifyTheme('graphiql');
28
+ });
29
+
30
+ it('should apply the light theme if the light theme is persisted in local store', () => {
31
+ // GIVEN: I have opened the workbench and the light theme is persisted in local storage.
32
+ cy.setLocalStorage(THEME_PERSISTENCE_KEY, JSON.stringify({"theme":"default-theme","mode":"light"}));
33
+
34
+ // WHEN: I visit the GraphQL Playground page
35
+ GraphqlPlaygroundSteps.visit();
36
+ // THEN: the default "graphiql" theme class should be applied to the CodeMirror instances.
37
+ verifyTheme('graphiql');
38
+ });
39
+
40
+ it('should apply the moxer theme if the dark theme is persisted in local store', () => {
41
+ // GIVEN: I have opened the workbench and the dark theme is persisted in local storage.
42
+ cy.setLocalStorage(THEME_PERSISTENCE_KEY, JSON.stringify({"theme":"default-theme","mode":"dark"}));
43
+
44
+ /// WHEN: I visit the GraphQL Playground page
45
+ GraphqlPlaygroundSteps.visit();
46
+ // THEN: the "moxer" theme class should be applied to the CodeMirror instances.
47
+ verifyTheme('moxer');
48
+ });
49
+
50
+ it('should not change the theme if the active endpoint is changed', () => {
51
+ // GIVEN: I have opened the workbench and the dark theme is persisted in local storage.
52
+ cy.setLocalStorage(THEME_PERSISTENCE_KEY, JSON.stringify({"theme":"default-theme","mode":"dark"}));
53
+ /// AND: I visit the GraphQL Playground page
54
+ GraphqlPlaygroundSteps.visit();
55
+ //the "moxer" theme class should be applied to the CodeMirror instances.
56
+ verifyTheme('moxer');
57
+
58
+ // WHEN: I change the active endpoint
59
+ GraphqlPlaygroundSteps.selectEndpoint('swapi-planets');
60
+
61
+ // THEN: the theme should not change, and the "moxer" theme class should still be applied to the CodeMirror instances.
62
+ verifyTheme('moxer');
63
+ });
64
+
65
+ const verifyTheme = (theme) => {
66
+ PlaygroundEditorSteps.getResponseCodeMirror().should('have.class', `cm-s-${theme}`);
67
+ PlaygroundEditorSteps.getGraphiqlEditorsCodeMirror().should('have.class', `cm-s-${theme}`);
68
+ PlaygroundEditorSteps.openVariables();
69
+ PlaygroundEditorSteps.getActiveGraphiqlEditorToolCodeMirror().should('have.class', `cm-s-${theme}`);
70
+ PlaygroundEditorSteps.openHeaders();
71
+ PlaygroundEditorSteps.getActiveGraphiqlEditorToolCodeMirror().should('have.class', `cm-s-${theme}`);
72
+ }
73
+ });
@@ -0,0 +1,92 @@
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 SparqlSteps from '../../../steps/sparql-steps.js';
6
+ import {YasqeSteps} from '../../../steps/yasgui/yasqe-steps.js';
7
+ import {YasrSteps} from '../../../steps/yasgui/yasr-steps.js';
8
+
9
+ describe('Execute SPARQL query guide steps', () => {
10
+ let repositoryId;
11
+ const FILE_TO_IMPORT = 'swapi-dataset.ttl';
12
+
13
+ beforeEach(() => {
14
+ repositoryId = 'execute-sparql-query-guide-' + Date.now();
15
+ GuidesStubs.stubExecuteSparqlQueryGuide();
16
+ cy.createRepository({id: repositoryId});
17
+ cy.presetRepository(repositoryId);
18
+ cy.importServerFile(repositoryId, FILE_TO_IMPORT);
19
+
20
+ GuideSteps.visit();
21
+ GuideSteps.verifyGuidesListExists();
22
+ cy.wait('@getGuides');
23
+ GuideSteps.runFirstGuide();
24
+ });
25
+
26
+ afterEach(() => {
27
+ cy.deleteRepository(repositoryId);
28
+ });
29
+
30
+ it('Should execute SPARQL query', () => {
31
+ GuideDialogSteps.assertDialogWithTitleIsVisible('Execute SPARQL query — 1/5');
32
+ GuideDialogSteps.assertDialogWithContentIsVisible('The following steps show how to use the SPARQL Query & Update view to execute queries.');
33
+ GuideDialogSteps.clickOnNextButton();
34
+
35
+ GuideDialogSteps.assertDialogWithTitleIsVisible('Execute SPARQL query — 2/5');
36
+ GuideDialogSteps.assertDialogWithContentIsVisible('Click on the SPARQL menu.');
37
+ MainMenuSteps.clickOnSparqlMenu();
38
+
39
+ GuideDialogSteps.assertDialogWithTitleIsVisible('Execute SPARQL query — 3/5');
40
+ GuideDialogSteps.assertDialogWithContentIsVisible('Enter the following SPARQL query: ');
41
+ GuideDialogSteps.assertDialogWithContentIsVisible('Extra content for query.');
42
+ GuideDialogSteps.copyQueryToEditor();
43
+ YasqeSteps.verifyQueryTyped("PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>\n select * where { \n\t?s rdfs:label ?o .\n} limit 3 ")
44
+ GuideDialogSteps.clickOnNextButton();
45
+
46
+ GuideDialogSteps.assertDialogWithTitleIsVisible('Execute SPARQL query — 4/5');
47
+ GuideDialogSteps.assertDialogWithContentIsVisible('Click on the Run button.');
48
+ YasqeSteps.forceExecuteQuery();
49
+
50
+ GuideDialogSteps.assertDialogWithTitleIsVisible('Execute SPARQL query — 5/5');
51
+ GuideDialogSteps.assertDialogWithContentIsVisible('The table shows the results from executing the query.');
52
+ GuideDialogSteps.assertDialogWithContentIsVisible('Extra content for result.');
53
+ GuideDialogSteps.clickOnNextButton();
54
+
55
+ GuideDialogSteps.assertDialogWithTitleIsVisible('SPARQL Query & Update');
56
+ GuideDialogSteps.assertDialogWithContentIsVisible('Some extra explain content');
57
+ GuideDialogSteps.clickOnNextButton();
58
+
59
+ GuideDialogSteps.assertDialogWithTitleIsVisible('SPARQL Query & Update');
60
+ GuideDialogSteps.assertDialogWithContentIsVisible('Click on the rdf:type IRI to explore it.');
61
+ YasrSteps.clickOnResource(0, 1);
62
+ cy.url().should('include', '/resource?uri=https:%2F%2Fswapi.co%2Fresource%2Fplanet%2F25');
63
+ YasrSteps.getResults().should('have.length', 10);
64
+
65
+ GuideDialogSteps.assertDialogWithTitleIsVisible('Execute SPARQL query — 1/5');
66
+ GuideDialogSteps.assertDialogWithContentIsVisible('The following steps show how to use the SPARQL Query & Update view to execute queries.');
67
+ GuideDialogSteps.clickOnNextButton();
68
+
69
+ GuideDialogSteps.assertDialogWithTitleIsVisible('Execute SPARQL query — 2/5');
70
+ GuideDialogSteps.assertDialogWithContentIsVisible('Click on the SPARQL menu.');
71
+ MainMenuSteps.clickOnSparqlMenu();
72
+
73
+ GuideDialogSteps.assertDialogWithTitleIsVisible('SPARQL Query & Update — 3/5');
74
+ GuideDialogSteps.assertDialogWithContentIsVisible('Enter the following SPARQL query:');
75
+ GuideDialogSteps.assertDialogWithContentIsVisible('The query constructs a graph of films and their characters from the Star Wars API.');
76
+ GuideDialogSteps.copyQueryToEditor();
77
+ YasqeSteps.verifyQueryTyped("PREFIX voc: <https://swapi.co/vocabulary/>\nPREFIX swapi: <https://swapi.co/resource/>\n\nCONSTRUCT {\n?film swapi:hasCharacter ?person .\n}\nWHERE {\n?film a voc:Film ;\nvoc:character ?person .\n}")
78
+ GuideDialogSteps.clickOnNextButton();
79
+
80
+ GuideDialogSteps.assertDialogWithTitleIsVisible('SPARQL Query & Update — 4/5');
81
+ GuideDialogSteps.assertDialogWithContentIsVisible('Click on the Run button.');
82
+ YasqeSteps.forceExecuteQuery();
83
+
84
+ GuideDialogSteps.assertDialogWithTitleIsVisible('SPARQL Query & Update — 5/5');
85
+ GuideDialogSteps.assertDialogWithContentIsVisible('Click on the Visual button.');
86
+ SparqlSteps.visualizeConstructQuery();
87
+ cy.url().should('include', '/graphs-visualizations');
88
+
89
+ GuideDialogSteps.clickOnCloseButton();
90
+ GuideDialogSteps.assertDialogIsClosed();
91
+ });
92
+ });
@@ -0,0 +1,63 @@
1
+ import {GuidesStubs} from "../../../stubs/guides/guides-stubs.js";
2
+ import {GuideSteps} from "../../../steps/guides/guide-steps.js";
3
+ import {GuideDialogSteps} from "../../../steps/guides/guide-dialog-steps.js";
4
+ import ImportSteps from "../../../steps/import/import-steps.js";
5
+ import {ImportUserDataSteps} from "../../../steps/import/import-user-data-steps.js";
6
+ import {ImportSettingsDialogSteps} from "../../../steps/import/import-settings-dialog-steps.js";
7
+ import {MainMenuSteps} from "../../../steps/main-menu-steps.js";
8
+ import {FileOverwriteDialogSteps} from "../../../steps/import/file-overwrite-dialog-steps.js";
9
+
10
+ describe('Confirm duplicate RDF file', () => {
11
+ const GUIDE_RESOURCE_FILE = 'starwars.ttl';
12
+ let repositoryId;
13
+
14
+ beforeEach(() => {
15
+ repositoryId = 'confirm-duplicate-rdf-file-guide-step-' + Date.now();
16
+ GuidesStubs.stubConfirmDuplicatedRDFFileGuide();
17
+ cy.createRepository({id: repositoryId});
18
+ cy.presetRepository(repositoryId);
19
+
20
+ GuideSteps.visit();
21
+ GuideSteps.verifyGuidesListExists();
22
+ cy.wait('@getGuides');
23
+ GuideSteps.runFirstGuide()
24
+ });
25
+
26
+ afterEach(() => {
27
+ cy.deleteRepository(repositoryId);
28
+ });
29
+
30
+ it('Should display an additional step that prompts the user to override the already imported file', () => {
31
+ // GIVEN: I have already uploaded an RDF file with the same name as the guide's rdf file.
32
+ ImportSteps.selectFile(`fixtures/guides/${GUIDE_RESOURCE_FILE}`);
33
+ GuideDialogSteps.assertDialogWithTitleIsVisible('Import file');
34
+ GuideDialogSteps.assertDialogWithContentIsVisible('Click on the Import button.');
35
+ ImportSettingsDialogSteps.import();
36
+ ImportUserDataSteps.checkImportedResource(0, GUIDE_RESOURCE_FILE);
37
+
38
+ // WHEN: I run a guide that includes the Import RDF File step.
39
+ GuideDialogSteps.assertDialogWithTitleIsVisible('Import file — 1/6');
40
+ GuideDialogSteps.assertDialogWithContentIsVisible('The following steps show how to use the Import view to import data from a file.');
41
+ GuideDialogSteps.clickOnNextButton();
42
+
43
+ GuideDialogSteps.assertDialogWithTitleIsVisible('Import file — 2/6');
44
+ GuideDialogSteps.assertDialogWithContentIsVisible('Click on the Import menu.');
45
+ MainMenuSteps.clickOnMenuImport();
46
+
47
+ GuideDialogSteps.assertDialogWithTitleIsVisible('Import file — 3/6');
48
+ GuideDialogSteps.assertDialogWithContentIsVisible('Click on the Upload RDF files button and choose a file with the name starwars.ttl.');
49
+ ImportSteps.selectFile(`fixtures/guides/${GUIDE_RESOURCE_FILE}`);
50
+
51
+ // THEN: I should see an additional step that prompts me to override the already imported file.
52
+ GuideDialogSteps.assertDialogWithTitleIsVisible('Import file — 4/6');
53
+ GuideDialogSteps.assertDialogWithContentIsVisible('Click on the Yes button to override the existing file.');
54
+
55
+ // WHEN: The user confirms the override.
56
+ FileOverwriteDialogSteps.overwrite();
57
+
58
+ // THEN: The guide should continue with the import step.
59
+ GuideDialogSteps.assertDialogWithTitleIsVisible('Import file — 5/6');
60
+ GuideDialogSteps.assertDialogWithContentIsVisible('Click on the Import button.');
61
+ GuideDialogSteps.clickOnNextButton();
62
+ });
63
+ });
@@ -0,0 +1,105 @@
1
+ import {GuidesStubs} from "../../../stubs/guides/guides-stubs.js";
2
+ import {GuideSteps} from "../../../steps/guides/guide-steps.js";
3
+ import {GuideDialogSteps} from "../../../steps/guides/guide-dialog-steps.js";
4
+ import ImportSteps from "../../../steps/import/import-steps.js";
5
+ import {ToasterSteps} from "../../../steps/toaster-steps.js";
6
+ import {MainMenuSteps} from "../../../steps/main-menu-steps.js";
7
+ import {ImportSettingsDialogSteps} from "../../../steps/import/import-settings-dialog-steps.js";
8
+
9
+ describe('Import RDF file', () => {
10
+ const GUIDE_RESOURCE_FILE = 'starwars.ttl';
11
+ const WRONG_GUIDE_RESOURCE_FILE = 'movies.ttl';
12
+ let repositoryId;
13
+
14
+ beforeEach(() => {
15
+ repositoryId = 'import-rdf-file-guide-step-' + Date.now();
16
+ GuidesStubs.stubImportRDFFileGuide();
17
+ cy.createRepository({id: repositoryId});
18
+ cy.presetRepository(repositoryId);
19
+
20
+ GuideSteps.visit();
21
+ GuideSteps.verifyGuidesListExists();
22
+ cy.wait('@getGuides');
23
+ GuideSteps.runFirstGuide()
24
+ });
25
+
26
+ afterEach(() => {
27
+ cy.deleteRepository(repositoryId);
28
+ });
29
+
30
+ it('Should import an RDF file (User interaction)', () => {
31
+ // GIVEN: I start a guide that includes the Import RDF File step.
32
+ GuideDialogSteps.assertDialogWithTitleIsVisible('Import file — 1/6');
33
+ GuideDialogSteps.assertDialogWithContentIsVisible('The following steps show how to use the Import view to import data from a file.');
34
+ GuideDialogSteps.clickOnNextButton();
35
+
36
+ GuideDialogSteps.assertDialogWithTitleIsVisible('Import file — 2/6');
37
+ GuideDialogSteps.assertDialogWithContentIsVisible('Click on the Import menu.');
38
+ MainMenuSteps.clickOnMenuImport();
39
+
40
+ GuideDialogSteps.assertDialogWithTitleIsVisible('Import file — 3/6');
41
+ GuideDialogSteps.assertDialogWithContentIsVisible('Click on the Upload RDF files button and choose a file with the name starwars.ttl.');
42
+
43
+ // WHEN: I try to upload a wrong RDF file.
44
+ ImportSteps.selectFile(`fixtures/guides/${WRONG_GUIDE_RESOURCE_FILE}`);
45
+
46
+ // THEN: An error message should be displayed.
47
+ ToasterSteps.verifyError(`The uploaded file does not match the expected resource. Please upload ${GUIDE_RESOURCE_FILE}.`)
48
+ // AND: The guide should still be on the same step.
49
+ GuideDialogSteps.assertDialogWithTitleIsVisible('Import file');
50
+ GuideDialogSteps.assertDialogWithContentIsVisible(`Click on the Upload RDF files button and choose a file with the name ${GUIDE_RESOURCE_FILE}.`);
51
+
52
+ // WHEN: I upload the correct RDF file.
53
+ ImportSteps.selectFile(`fixtures/guides/${GUIDE_RESOURCE_FILE}`);
54
+
55
+ // THEN: I expect the guide to continue.
56
+ GuideDialogSteps.assertDialogWithTitleIsVisible('Import file — 5/6');
57
+ GuideDialogSteps.assertDialogWithContentIsVisible('Click on the Import button.');
58
+ ImportSettingsDialogSteps.import();
59
+
60
+ GuideDialogSteps.assertDialogWithTitleIsVisible('Import file — 6/6');
61
+ GuideDialogSteps.assertDialogWithContentIsVisible('Wait until import finished.');
62
+ GuideDialogSteps.clickOnNextButton();
63
+
64
+ GuideDialogSteps.assertDialogWithTitleIsVisible('End of guide');
65
+ GuideDialogSteps.assertDialogWithContentIsVisible('This guide has ended.');
66
+ });
67
+
68
+ it('Should import an RDF file (Next flow)', () => {
69
+ // GIVEN: I start a guide that includes the Import RDF File step.
70
+ GuideDialogSteps.assertDialogWithTitleIsVisible('Import file — 1/6');
71
+ GuideDialogSteps.assertDialogWithContentIsVisible('The following steps show how to use the Import view to import data from a file.');
72
+ GuideDialogSteps.clickOnNextButton();
73
+
74
+ GuideDialogSteps.assertDialogWithTitleIsVisible('Import file — 2/6');
75
+ GuideDialogSteps.assertDialogWithContentIsVisible('Click on the Import menu.');
76
+ GuideDialogSteps.clickOnNextButton();
77
+
78
+ GuideDialogSteps.assertDialogWithTitleIsVisible('Import file — 3/6');
79
+ GuideDialogSteps.assertDialogWithContentIsVisible('Click on the Upload RDF files button and choose a file with the name starwars.ttl.');
80
+
81
+ // WHEN: I try to continue with the guide without selecting an RDF file.
82
+ GuideDialogSteps.clickOnNextButton();
83
+
84
+ // THEN: An error message should be displayed.
85
+ ToasterSteps.verifyError(`Upload the file ${GUIDE_RESOURCE_FILE} first`);
86
+ // AND: The guide should still be on the same step.
87
+ GuideDialogSteps.assertDialogWithTitleIsVisible('Import file');
88
+ GuideDialogSteps.assertDialogWithContentIsVisible(`Click on the Upload RDF files button and choose a file with the name ${GUIDE_RESOURCE_FILE}.`);
89
+
90
+ // WHEN: I upload the correct RDF file.
91
+ ImportSteps.selectFile(`fixtures/guides/${GUIDE_RESOURCE_FILE}`);
92
+
93
+ // THEN: I expect the guide to continue.
94
+ GuideDialogSteps.assertDialogWithTitleIsVisible('Import file — 5/6');
95
+ GuideDialogSteps.assertDialogWithContentIsVisible('Click on the Import button.');
96
+ GuideDialogSteps.clickOnNextButton();
97
+
98
+ GuideDialogSteps.assertDialogWithTitleIsVisible('Import file — 6/6');
99
+ GuideDialogSteps.assertDialogWithContentIsVisible('Wait until import finished.');
100
+ GuideDialogSteps.clickOnNextButton();
101
+
102
+ GuideDialogSteps.assertDialogWithTitleIsVisible('End of guide');
103
+ GuideDialogSteps.assertDialogWithContentIsVisible('This guide has ended.');
104
+ });
105
+ });