graphdb-workbench-tests 2.5.1 → 2.6.0-RC1
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.
- package/fixtures/graphdb-import/resource-test-data.ttl +99 -0
- package/fixtures/graphql-editor/default-query-response.json +517 -0
- package/fixtures/guides/guides.json +764 -0
- package/fixtures/guides/movies.ttl +629 -0
- package/fixtures/guides/starwars.ttl +4384 -0
- package/fixtures/locale-en.json +44 -10
- package/fixtures/namespaces/ontotext-generated-namespace.json +22 -0
- package/fixtures/queries/empty-query-response.json +11 -0
- package/integration/cluster/cluster-management.spec.js +1 -2
- package/integration/explore/graphs.overview.spec.js +4 -2
- package/integration/explore/similariti-index-create.spec.js +333 -0
- package/integration/explore/similarity-index.spec.js +88 -0
- package/integration/explore/similarity.spec.js +180 -56
- package/integration/explore/visual-graph/graphs-config.spec.js +453 -0
- package/integration/explore/{visual.graph.spec.js → visual-graph/visual.graph.spec.js} +146 -347
- package/integration/guides/movies-interactive-guide.spec.js +73 -0
- package/integration/guides/star-wars-interactive-guide.js +60 -0
- package/integration/home/language-change.spec.js +3 -3
- package/integration/import/import.user.data.spec.js +2 -0
- package/integration/resource/resource.spec.js +357 -0
- package/integration/setup/aclmanagement/create-rule.spec.js +88 -11
- package/integration/setup/aclmanagement/delete-rule.spec.js +6 -4
- package/integration/setup/aclmanagement/edit-rule.spec.js +13 -8
- package/integration/setup/aclmanagement/render-rules.spec.js +4 -2
- package/integration/setup/aclmanagement/reorder-rules.spec.js +5 -3
- package/integration/setup/aclmanagement/revert-rules.spec.js +4 -3
- package/integration/setup/aclmanagement/scopes.spec.js +220 -0
- package/integration/setup/aclmanagement/update-rules.spec.js +17 -9
- package/integration/setup/jdbc-create.spec.js +330 -0
- package/integration/setup/jdbc.spec.js +78 -154
- package/integration/setup/my-settings.spec.js +9 -41
- package/integration/setup/sparql-template-create.js +150 -0
- package/integration/setup/sparql-templates.spec.js +82 -146
- package/integration/sparql-editor/actions/execute-query.spec.js +44 -0
- package/integration/sparql-editor/actions/expand-results-over-sameas.spec.js +136 -0
- package/integration/sparql-editor/actions/include-inferred-statements.spec.js +100 -0
- package/integration/sparql-editor/actions/inferred-sameas.spec.js +47 -0
- package/integration/sparql-editor/actions/save-query.spec.js +70 -0
- package/integration/sparql-editor/actions/show-saved-queries.spec.js +61 -0
- package/integration/sparql-editor/internationalization.spec.js +41 -0
- package/integration/sparql-editor/saved-query/abort-query.spec.js +51 -0
- package/integration/sparql-editor/saved-query/delete-query.spec.js +56 -0
- package/integration/sparql-editor/saved-query/edit-query.spec.js +68 -0
- package/integration/sparql-editor/saved-query/share-query.spec.js +78 -0
- package/integration/sparql-editor/sparql-editor.spec.js +55 -0
- package/integration/sparql-editor/yasgui-tabs.spec.js +107 -0
- package/integration/sparql-editor/yasr/download-as.spec.js +54 -0
- package/integration/sparql-editor/yasr/pagination.spec.js +234 -0
- package/integration/sparql-editor/yasr/table-plugin.spec.js +39 -0
- package/integration/sparql-editor/yasr/toolbar/visual-graph-button.spec.js +57 -0
- package/integration-flaky/explore/visual.graph.spec.js +3 -2
- package/integration-flaky/setup/sparql-template-create.js +139 -0
- package/integration-flaky/sparql-editor/actions/execute-update-query.spec.js +89 -0
- package/integration-flaky/sparql-editor/actions/share-query.spec.js +84 -0
- package/integration-flaky/sparql-editor/lucene-connector.spec.js +62 -0
- package/integration-flaky/sparql-editor/plugins/error-plugin.spec.js +83 -0
- package/integration-flaky/sparql-editor/yasr/table-plugin.spec.js +81 -0
- package/package.json +3 -1
- package/steps/application-steps.js +5 -0
- package/steps/autocomplete-steps.js +10 -0
- package/steps/error-steps.js +9 -0
- package/steps/explore/graphs-overview-steps.js +24 -0
- package/steps/explore/similarity-index-create-steps.js +113 -0
- package/steps/explore/similarity-indexes-steps.js +18 -0
- package/steps/guides/guide-dialog-steps.js +38 -0
- package/steps/guides/guide-steps.js +278 -0
- package/steps/guides/movies-guide-steps.js +241 -0
- package/steps/guides/star-wars-guide-steps.js +188 -0
- package/steps/import-steps.js +16 -0
- package/steps/language-selector-steps.js +22 -0
- package/steps/loader-steps.js +10 -0
- package/steps/lucene-connector-steps.js +43 -0
- package/steps/main-menu-steps.js +67 -0
- package/steps/repository-selector-steps.js +26 -0
- package/steps/repository-steps.js +4 -0
- package/steps/resource/resource-edit-steps.js +111 -0
- package/steps/resource/resource-steps.js +149 -0
- package/steps/setup/acl-management-steps.js +193 -35
- package/steps/setup/jdbc-create-steps.js +97 -0
- package/steps/setup/jdbc-steps.js +42 -0
- package/steps/setup/sparql-create-update-steps.js +55 -0
- package/steps/setup/sparql-templates-steps.js +38 -0
- package/steps/sparql-editor-steps.js +20 -0
- package/steps/sparql-steps.js +0 -6
- package/steps/visual-graph-steps.js +365 -6
- package/steps/yasgui/confirmation-dialog-steps.js +13 -0
- package/steps/yasgui/pagination-steps.js +47 -0
- package/steps/yasgui/plugin/error-plugin-steps.js +30 -0
- package/steps/yasgui/save-query-dialog.js +61 -0
- package/steps/yasgui/saved-queries-dialog.js +29 -0
- package/steps/yasgui/saved-query.js +25 -0
- package/steps/yasgui/share-saved-query-dialog.js +25 -0
- package/steps/yasgui/table-plugin-steps.js +29 -0
- package/steps/yasgui/yasgui-loader.js +10 -0
- package/steps/yasgui/yasgui-steps.js +191 -0
- package/steps/yasgui/yasqe-steps.js +187 -0
- package/steps/yasgui/yasr-steps.js +108 -0
- package/stubs/namespace-stubs.js +10 -0
- package/stubs/repositories-stub.js +58 -0
- package/stubs/security-stubs.js +69 -0
- package/stubs/yasgui/connectors-stubs.js +12 -0
- package/stubs/yasgui/query-stubs.js +253 -0
- package/support/index.js +3 -0
- package/support/repository-commands.js +5 -5
- package/support/sparql-commands.js +1 -1
- package/support/visual-graph-commands.js +25 -0
- package/integration/sparql/main.menu.spec.js +0 -232
- package/integration/sparql/sparql-error-handling.spec.js +0 -74
- package/integration/sparql/sparql-language-change.spec.js +0 -58
- package/integration/sparql/sparql-result-formating.spec.js +0 -84
- package/integration/sparql/sparql.menu.spec.js +0 -1253
- package/integration-flaky/setup/sparql-templates.spec.js +0 -125
- package/integration-flaky/sparql/sparql-language-change.spec.js +0 -45
- package/integration-flaky/sparql/sparql.menu.spec.js +0 -75
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import {GuideDialogSteps} from "../../steps/guides/guide-dialog-steps";
|
|
2
|
+
import {GuideSteps} from "../../steps/guides/guide-steps";
|
|
3
|
+
import {MoviesGuideSteps} from "../../steps/guides/movies-guide-steps";
|
|
4
|
+
|
|
5
|
+
const MOVIES_FILE_FOR_IMPORT = 'movies.ttl';
|
|
6
|
+
describe('Interactive guides', () => {
|
|
7
|
+
|
|
8
|
+
let repositoryId;
|
|
9
|
+
|
|
10
|
+
beforeEach(() => {
|
|
11
|
+
cy.intercept('/rest/guides', {fixture: '/guides/guides.json'}).as('getGuides');
|
|
12
|
+
repositoryId = 'movies';
|
|
13
|
+
cy.viewport(1880, 1000);
|
|
14
|
+
GuideSteps.visit();
|
|
15
|
+
cy.wait(['@getGuides']);
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
afterEach(() => {
|
|
19
|
+
cy.deleteRepository(repositoryId);
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
context('Describes "Movies" interactive guide', () => {
|
|
23
|
+
it('Tests movies interactive guide using "Next" button to the end', () => {
|
|
24
|
+
|
|
25
|
+
const stepAssertions = [
|
|
26
|
+
{assert: MoviesGuideSteps.assertExploreClassHierarchyStep1},
|
|
27
|
+
{assert: MoviesGuideSteps.assertExploreClassHierarchyStep2},
|
|
28
|
+
{assert: MoviesGuideSteps.assertExploreClassHierarchyStep3},
|
|
29
|
+
{assert: MoviesGuideSteps.assertExploreClassHierarchyStep4},
|
|
30
|
+
{assert: MoviesGuideSteps.assertExploreClassHierarchyStep5},
|
|
31
|
+
{assert: MoviesGuideSteps.assertExploreClassHierarchyStep6},
|
|
32
|
+
{assert: MoviesGuideSteps.assertExploreClassHierarchyStep7},
|
|
33
|
+
{assert: MoviesGuideSteps.assertClassHierarchyInstancesStep1},
|
|
34
|
+
{assert: MoviesGuideSteps.assertClassHierarchyInstancesStep2},
|
|
35
|
+
{assert: MoviesGuideSteps.assertClassHierarchyInstancesStep3},
|
|
36
|
+
{assert: MoviesGuideSteps.assertClassHierarchyInstancesStep4},
|
|
37
|
+
{assert: MoviesGuideSteps.assertClassHierarchyInstancesStep5},
|
|
38
|
+
// Forces the click because results are to many and dialog is not visible into the test.
|
|
39
|
+
{assert: MoviesGuideSteps.assertClassHierarchyInstancesStep6, forceButtonClick: true},
|
|
40
|
+
{assert: MoviesGuideSteps.assertClassHierarchyInstancesStep7, forceButtonClick: true},
|
|
41
|
+
{assert: MoviesGuideSteps.assertClassHierarchyInstancesStep8},
|
|
42
|
+
{assert: MoviesGuideSteps.assertExecuteSparqlQueryStep1},
|
|
43
|
+
{assert: MoviesGuideSteps.assertExecuteSparqlQueryStep2},
|
|
44
|
+
{assert: MoviesGuideSteps.assertExecuteSparqlQueryStep3},
|
|
45
|
+
{assert: MoviesGuideSteps.assertExecuteSparqlQueryStep4},
|
|
46
|
+
{assert: MoviesGuideSteps.assertExecuteSparqlQueryStep5},
|
|
47
|
+
{assert: MoviesGuideSteps.assertExecuteSparqlQueryStep6},
|
|
48
|
+
{assert: MoviesGuideSteps.assertExecuteSparqlQueryStep7},
|
|
49
|
+
{assert: MoviesGuideSteps.assertExecuteSparqlQueryStep8, forceButtonClick: true},
|
|
50
|
+
{assert: MoviesGuideSteps.assertExploreRDFStep1, forceButtonClick: true},
|
|
51
|
+
{assert: MoviesGuideSteps.assertExploreRDFStep2},
|
|
52
|
+
{assert: MoviesGuideSteps.assertExploreRDFStep3},
|
|
53
|
+
{assert: MoviesGuideSteps.assertExploreRDFStep4},
|
|
54
|
+
{assert: MoviesGuideSteps.assertExploreRDFStep5},
|
|
55
|
+
{assert: MoviesGuideSteps.assertExploreRDFStep6},
|
|
56
|
+
{assert: MoviesGuideSteps.assertExploreRDFStep7},
|
|
57
|
+
{assert: MoviesGuideSteps.assertExploreRDFStep8},
|
|
58
|
+
{assert: MoviesGuideSteps.assertExploreRDFStep9},
|
|
59
|
+
{assert: MoviesGuideSteps.assertExploreRDFStep10},
|
|
60
|
+
{assert: MoviesGuideSteps.assertSparqlQueryStep1},
|
|
61
|
+
{assert: MoviesGuideSteps.assertSparqlQueryStep2},
|
|
62
|
+
{assert: MoviesGuideSteps.assertSparqlQueryStep3},
|
|
63
|
+
{assert: MoviesGuideSteps.assertSparqlQueryStep4},
|
|
64
|
+
{assert: MoviesGuideSteps.assertSparqlQueryStep5},
|
|
65
|
+
{assert: MoviesGuideSteps.assertSparqlQueryStep6},
|
|
66
|
+
{assert: MoviesGuideSteps.assertSparqlQueryStep7}
|
|
67
|
+
];
|
|
68
|
+
|
|
69
|
+
const guideName = '3 The Movies database guide';
|
|
70
|
+
GuideSteps.runGuideTest(guideName, repositoryId, MOVIES_FILE_FOR_IMPORT, stepAssertions);
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
});
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import {GuideSteps} from "../../steps/guides/guide-steps";
|
|
2
|
+
import {StarWarsGuideSteps} from "../../steps/guides/star-wars-guide-steps";
|
|
3
|
+
|
|
4
|
+
const STAR_WARS_FILE_FOR_IMPORT = 'starwars.ttl';
|
|
5
|
+
describe('Describes "Starwars" interactive guide', () => {
|
|
6
|
+
|
|
7
|
+
let repositoryId;
|
|
8
|
+
|
|
9
|
+
beforeEach(() => {
|
|
10
|
+
cy.intercept('/rest/guides', {fixture: '/guides/guides.json'}).as('getGuides');
|
|
11
|
+
repositoryId = 'starwars';
|
|
12
|
+
cy.viewport(1880, 1000);
|
|
13
|
+
GuideSteps.visit();
|
|
14
|
+
cy.wait(['@getGuides']);
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
afterEach(() => {
|
|
18
|
+
cy.deleteRepository(repositoryId);
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it('should go through "Star wars" interactive guide', () => {
|
|
22
|
+
|
|
23
|
+
const guideName = '1 The Star Wars guide';
|
|
24
|
+
const allStepValidationFunctions = [
|
|
25
|
+
{assert: StarWarsGuideSteps.assertVisualGraphExploreStep1},
|
|
26
|
+
{assert: StarWarsGuideSteps.assertVisualGraphExploreStep2},
|
|
27
|
+
{assert: StarWarsGuideSteps.assertVisualGraphExploreStep3},
|
|
28
|
+
{assert: StarWarsGuideSteps.assertVisualGraphExploreSte4},
|
|
29
|
+
{assert: StarWarsGuideSteps.assertVisualGraphExploreSte5},
|
|
30
|
+
{assert: StarWarsGuideSteps.assertVisualGraphExploreSte6},
|
|
31
|
+
{assert: StarWarsGuideSteps.assertSte30},
|
|
32
|
+
{assert: StarWarsGuideSteps.assertSte31},
|
|
33
|
+
{assert: StarWarsGuideSteps.assertSte32},
|
|
34
|
+
{assert: StarWarsGuideSteps.assertSte33},
|
|
35
|
+
{assert: StarWarsGuideSteps.assertSte34},
|
|
36
|
+
{assert: StarWarsGuideSteps.assertVisualGraphPropertiesStep1},
|
|
37
|
+
{assert: StarWarsGuideSteps.assertVisualGraphPropertiesStep2},
|
|
38
|
+
{assert: StarWarsGuideSteps.assertVisualGraphPropertiesStep3},
|
|
39
|
+
{assert: StarWarsGuideSteps.assertVisualGraphPropertiesStep4},
|
|
40
|
+
{assert: StarWarsGuideSteps.assertVisualGraphPropertiesStep5},
|
|
41
|
+
{assert: StarWarsGuideSteps.assertVisualGraphPropertiesStep6},
|
|
42
|
+
{assert: StarWarsGuideSteps.assertStep41},
|
|
43
|
+
{assert: StarWarsGuideSteps.assertStep42},
|
|
44
|
+
{assert: StarWarsGuideSteps.assertStep43},
|
|
45
|
+
{assert: StarWarsGuideSteps.assertExecuteSparqlQueryStep1},
|
|
46
|
+
{assert: StarWarsGuideSteps.assertExecuteSparqlQueryStep2},
|
|
47
|
+
{assert: StarWarsGuideSteps.assertExecuteSparqlQueryStep3},
|
|
48
|
+
{assert: StarWarsGuideSteps.assertExecuteSparqlQueryStep4},
|
|
49
|
+
{assert: StarWarsGuideSteps.assertExecuteSparqlQueryStep5},
|
|
50
|
+
{assert: StarWarsGuideSteps.assertExecuteSparqlQueryStep6},
|
|
51
|
+
{assert: StarWarsGuideSteps.assertExecuteSparqlQueryStep7},
|
|
52
|
+
{assert: StarWarsGuideSteps.assertExecuteSparqlQueryStep8},
|
|
53
|
+
{assert: StarWarsGuideSteps.assertExecuteSparqlQueryStep9},
|
|
54
|
+
{assert: StarWarsGuideSteps.assertExecuteSparqlQueryStep10},
|
|
55
|
+
{assert: StarWarsGuideSteps.assertExecuteSparqlQueryStep11}
|
|
56
|
+
];
|
|
57
|
+
|
|
58
|
+
GuideSteps.runGuideTest(guideName, repositoryId, STAR_WARS_FILE_FOR_IMPORT, allStepValidationFunctions);
|
|
59
|
+
});
|
|
60
|
+
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import HomeSteps from '../../steps/home-steps';
|
|
2
|
-
import
|
|
2
|
+
import {LanguageSelectorSteps} from "../../steps/language-selector-steps";
|
|
3
3
|
|
|
4
4
|
describe('Home screen language validation', () => {
|
|
5
5
|
let repositoryId;
|
|
@@ -13,7 +13,7 @@ describe('Home screen language validation', () => {
|
|
|
13
13
|
cy.deleteRepository(repositoryId);
|
|
14
14
|
|
|
15
15
|
// Change the language back to English
|
|
16
|
-
|
|
16
|
+
LanguageSelectorSteps.switchToEn();
|
|
17
17
|
});
|
|
18
18
|
|
|
19
19
|
context('Language change label checks', () => {
|
|
@@ -33,7 +33,7 @@ describe('Home screen language validation', () => {
|
|
|
33
33
|
HomeSteps.getSavedSparqlQueriesAsLabel().should('have.text', 'Saved SPARQL queries');
|
|
34
34
|
HomeSteps.getLicenseAsLabel().should('have.text', 'License');
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
LanguageSelectorSteps.switchToFr();
|
|
37
37
|
|
|
38
38
|
// The text in the labels should change
|
|
39
39
|
HomeSteps.getViewResourceAsLabel().should('have.text', 'Voir la ressource');
|
|
@@ -290,6 +290,8 @@ describe('Import screen validation - user data', () => {
|
|
|
290
290
|
//verifies that the data has been inserted in the given graph and that the new data has replaced the old one.
|
|
291
291
|
function verifyGraphData(graphName, s, p, o, c, checkForReplacedData, oldData) {
|
|
292
292
|
cy.visit('/graphs');
|
|
293
|
+
// wait a bit to give chance page loaded.
|
|
294
|
+
cy.wait(1000);
|
|
293
295
|
cy.get(`#export-graphs td a:contains(${graphName})`).click();
|
|
294
296
|
cy.get(`.uri-cell:contains(${s})`).should('be.visible');
|
|
295
297
|
cy.get(`.uri-cell:contains(${p})`).should('be.visible');
|
|
@@ -0,0 +1,357 @@
|
|
|
1
|
+
import HomeSteps from "../../steps/home-steps";
|
|
2
|
+
import {ResourceSteps} from "../../steps/resource/resource-steps";
|
|
3
|
+
import {QueryStubs} from "../../stubs/yasgui/query-stubs";
|
|
4
|
+
import {VisualGraphSteps} from "../../steps/visual-graph-steps";
|
|
5
|
+
import {SparqlEditorSteps} from "../../steps/sparql-editor-steps";
|
|
6
|
+
import {YasqeSteps} from "../../steps/yasgui/yasqe-steps";
|
|
7
|
+
import {YasrSteps} from "../../steps/yasgui/yasr-steps";
|
|
8
|
+
import {YasguiSteps} from "../../steps/yasgui/yasgui-steps";
|
|
9
|
+
|
|
10
|
+
const FILE_TO_IMPORT = 'resource-test-data.ttl';
|
|
11
|
+
const SUBJECT_RESOURCE = 'http:%2F%2Fexample.com%2Fontology%23CustomerLoyalty';
|
|
12
|
+
const SUBJECT_RESOURCE_SHORT_URI = 'http://example.com/ontology#CustomerLoyalty';
|
|
13
|
+
const PREDICATE_SOURCE = 'http:%2F%2Fwww.w3.org%2F2000%2F01%2Frdf-schema%23subClassOf';
|
|
14
|
+
const CONTEXT_EXPLICIT = 'http://www.ontotext.com/explicit';
|
|
15
|
+
const OBJECT_RESOURCE = 'http:%2F%2Fexample.com%2Fontology%23Metric';
|
|
16
|
+
const IMPLICIT_EXPLICIT_RESOURCE = 'http:%2F%2Fwww.w3.org%2F1999%2F02%2F22-rdf-syntax-ns%23type';
|
|
17
|
+
const TRIPLE_RESOURCE = '%3C%3C%3Chttp:%2F%2Fexample.com%2Fresource%2Fperson%2FW6J1827%3E%20%3Chttp:%2F%2Fexample.com%2Fontology%23hasAddress%3E%20%3Chttp:%2F%2Fexample.com%2Fresource%2Fperson%2FW6J1827%2Faddress%3E%3E%3E';
|
|
18
|
+
|
|
19
|
+
describe('Resource view', () => {
|
|
20
|
+
let repositoryId;
|
|
21
|
+
beforeEach(() => {
|
|
22
|
+
repositoryId = 'repository-' + Date.now();
|
|
23
|
+
cy.createRepository({id: repositoryId});
|
|
24
|
+
cy.presetRepository(repositoryId);
|
|
25
|
+
cy.importServerFile(repositoryId, FILE_TO_IMPORT);
|
|
26
|
+
HomeSteps.visitAndWaitLoader();
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
afterEach(() => {
|
|
30
|
+
cy.deleteRepository(repositoryId);
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
it('should open resource view with active role tab depend on url role parameter', () => {
|
|
34
|
+
ResourceSteps.getAllRoles().forEach((role) => {
|
|
35
|
+
ResourceSteps.visit(`uri=${SUBJECT_RESOURCE}&role=${role}`);
|
|
36
|
+
ResourceSteps.verifyActiveRoleTab(role);
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
it('should open subject tab if role parameter is miss', () => {
|
|
41
|
+
ResourceSteps.visit(`uri=${SUBJECT_RESOURCE}&role=subject`);
|
|
42
|
+
ResourceSteps.verifyActiveRoleTab('subject');
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
it('should results contains/"not contains" depends on blank node flag', () => {
|
|
46
|
+
// When I load a resource that takes part in a triple with a blank node.
|
|
47
|
+
ResourceSteps.visit(`uri=${PREDICATE_SOURCE}&role=subject`);
|
|
48
|
+
|
|
49
|
+
// When I click on "predicate" tab.
|
|
50
|
+
ResourceSteps.selectPredicateRole();
|
|
51
|
+
|
|
52
|
+
// Then I expect to see all triples including this with blank node.
|
|
53
|
+
YasrSteps.getResults().should('have.length', 6);
|
|
54
|
+
|
|
55
|
+
// When I turn off showing of blank nodes.
|
|
56
|
+
ResourceSteps.clickOnShowBlankNodesButton();
|
|
57
|
+
|
|
58
|
+
// Then I expect to see all triples including this with blank node.
|
|
59
|
+
YasrSteps.getResults().should('have.length', 5);
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
it('should navigate to visual graph view', () => {
|
|
63
|
+
// When I am on resource view and page loaded a resource.
|
|
64
|
+
ResourceSteps.visit(`uri=${SUBJECT_RESOURCE}&role=subject`);
|
|
65
|
+
|
|
66
|
+
// When I click on "Visual graph" button.
|
|
67
|
+
ResourceSteps.clickOnVisualGraphButton();
|
|
68
|
+
|
|
69
|
+
// Then I expect to be redirected to explore graph view.
|
|
70
|
+
VisualGraphSteps.verifyUrl();
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
it('should displays results depends on explicit/implicit dropdown', () => {
|
|
74
|
+
// When I am on resource view and page loaded a resource that has triplets in explicit and implicit context,
|
|
75
|
+
ResourceSteps.visit(`uri=${IMPLICIT_EXPLICIT_RESOURCE}&role=all`);
|
|
76
|
+
|
|
77
|
+
// Then I expect to see all triples of explicit context, because default value of the dropdown is "Explicit only".
|
|
78
|
+
YasrSteps.getResults().should('have.length', 24);
|
|
79
|
+
YasrSteps.getResultLink(0, 4).should('contain', CONTEXT_EXPLICIT);
|
|
80
|
+
|
|
81
|
+
// When I chose to display implicit only.
|
|
82
|
+
ResourceSteps.selectImplicitOnlyInference();
|
|
83
|
+
|
|
84
|
+
// Then I expect triples of implicit context to be displayed only.
|
|
85
|
+
YasrSteps.getResults().should('have.length', 67);
|
|
86
|
+
|
|
87
|
+
// When I chose to display both context.
|
|
88
|
+
ResourceSteps.selectExplicitAndImplicitInference();
|
|
89
|
+
|
|
90
|
+
// Then I expect the triples of both context to be displayed.
|
|
91
|
+
YasrSteps.getResults().should('have.length', 91);
|
|
92
|
+
|
|
93
|
+
// When I chose to display explicit context only.
|
|
94
|
+
ResourceSteps.selectExplicitOnlyInference();
|
|
95
|
+
|
|
96
|
+
// Then I expect triples of explicit context to be displayed only.
|
|
97
|
+
YasrSteps.getResults().should('have.length', 24);
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
context('Same as', () => {
|
|
101
|
+
|
|
102
|
+
it('should display sameAs button when is enabled by user settings', () => {
|
|
103
|
+
// When I am on resource view and page loaded a resource that has triplets in explicit and implicit context,
|
|
104
|
+
ResourceSteps.visit(`uri=${IMPLICIT_EXPLICIT_RESOURCE}&role=all`);
|
|
105
|
+
|
|
106
|
+
// Then I expect same as button to not be displayed.
|
|
107
|
+
ResourceSteps.getSameAsButton().should('not.exist');
|
|
108
|
+
|
|
109
|
+
// When I select implicit context.
|
|
110
|
+
ResourceSteps.selectImplicitOnlyInference();
|
|
111
|
+
|
|
112
|
+
// Then I expect same as button to be displayed.
|
|
113
|
+
ResourceSteps.getSameAsButton().should('exist');
|
|
114
|
+
|
|
115
|
+
// When I select both contexts.
|
|
116
|
+
ResourceSteps.selectExplicitAndImplicitInference();
|
|
117
|
+
|
|
118
|
+
// Then I expect same as button to be displayed.
|
|
119
|
+
ResourceSteps.getSameAsButton().should('exist');
|
|
120
|
+
|
|
121
|
+
// When I select explicit context.
|
|
122
|
+
ResourceSteps.selectExplicitOnlyInference();
|
|
123
|
+
|
|
124
|
+
// Then I expect same as button to be displayed.
|
|
125
|
+
ResourceSteps.getSameAsButton().should('not.exist');
|
|
126
|
+
}
|
|
127
|
+
);
|
|
128
|
+
|
|
129
|
+
it('should the "sameAs" button be enabled when "infer" and "sameAs" are set to true in the user settings', () => {
|
|
130
|
+
// When I inference and same as are enabled.
|
|
131
|
+
QueryStubs.stubInferAndSameAsDefaults(true, true);
|
|
132
|
+
ResourceSteps.visit(`uri=${IMPLICIT_EXPLICIT_RESOURCE}&role=all`);
|
|
133
|
+
ResourceSteps.selectImplicitOnlyInference();
|
|
134
|
+
|
|
135
|
+
// Then I expect sameAs button is on.
|
|
136
|
+
ResourceSteps.verifySameAsEnable();
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
it('should the "sameAs" button be disable when "infer" is set to true and "sameAs" is set to false in the user settings', () => {
|
|
140
|
+
// When I inference and same as are enabled.
|
|
141
|
+
QueryStubs.stubInferAndSameAsDefaults(true, false);
|
|
142
|
+
ResourceSteps.visit(`uri=${IMPLICIT_EXPLICIT_RESOURCE}&role=all`);
|
|
143
|
+
ResourceSteps.selectImplicitOnlyInference();
|
|
144
|
+
|
|
145
|
+
// Then I expect sameAs is off.
|
|
146
|
+
ResourceSteps.verifySameAsDisable();
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
it('should the "sameAs" button be disable when "infer" is set to false and "sameAs" is set to true in the user settings', () => {
|
|
150
|
+
// When I inference and same as are enabled.
|
|
151
|
+
QueryStubs.stubInferAndSameAsDefaults(false, true);
|
|
152
|
+
ResourceSteps.visit(`uri=${IMPLICIT_EXPLICIT_RESOURCE}&role=all`);
|
|
153
|
+
ResourceSteps.selectImplicitOnlyInference();
|
|
154
|
+
|
|
155
|
+
// Then I expect sameAs is off.
|
|
156
|
+
ResourceSteps.verifySameAsDisable();
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
it('should the "sameAs" button be disable when "infer" and "sameAs" are set to false in the user settings', () => {
|
|
160
|
+
// When I inference and same as are enabled.
|
|
161
|
+
QueryStubs.stubInferAndSameAsDefaults(false, false);
|
|
162
|
+
ResourceSteps.visit(`uri=${IMPLICIT_EXPLICIT_RESOURCE}&role=all`);
|
|
163
|
+
ResourceSteps.selectImplicitOnlyInference();
|
|
164
|
+
|
|
165
|
+
// Then I expect sameAs is off.
|
|
166
|
+
ResourceSteps.verifySameAsDisable();
|
|
167
|
+
});
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
context('Role tabs', () => {
|
|
171
|
+
|
|
172
|
+
it('should list the triples of a resource used as subject', () => {
|
|
173
|
+
// When I am on resource view,
|
|
174
|
+
// and page loaded a resource that is used as subject,
|
|
175
|
+
ResourceSteps.visit(`uri=${SUBJECT_RESOURCE}&role=subject`);
|
|
176
|
+
|
|
177
|
+
// Then I expect to see only one result because the resource has only one triplet as subject.
|
|
178
|
+
YasrSteps.getResults().should('have.length', 1);
|
|
179
|
+
YasrSteps.getResultLink(0, 1).should('contain', SUBJECT_RESOURCE_SHORT_URI);
|
|
180
|
+
YasrSteps.getResultLink(0, 2).should('contain', 'rdfs:subClassOf');
|
|
181
|
+
YasrSteps.getResultLink(0, 3).should('contain', 'http://example.com/ontology#Metric');
|
|
182
|
+
YasrSteps.getResultLink(0, 4).should('contain', CONTEXT_EXPLICIT);
|
|
183
|
+
|
|
184
|
+
// When I click on "predicate" tab.
|
|
185
|
+
ResourceSteps.selectPredicateRole();
|
|
186
|
+
|
|
187
|
+
// Then I expect to not see any triplets because the resource is not used as predicate.
|
|
188
|
+
YasrSteps.getNoDataElement().should('be.visible');
|
|
189
|
+
|
|
190
|
+
// When I click on "object" tab.
|
|
191
|
+
ResourceSteps.selectObjectRole();
|
|
192
|
+
// Then I expect to see all triples where the resource is object.
|
|
193
|
+
YasrSteps.getResults().should('have.length', 1);
|
|
194
|
+
YasrSteps.getResultLink(0, 1).should('contain', 'http://example.com/resource/person/W6J1827/customerLoyalty');
|
|
195
|
+
YasrSteps.getResultLink(0, 2).should('contain', 'rdf:type');
|
|
196
|
+
YasrSteps.getResultLink(0, 3).should('contain', SUBJECT_RESOURCE_SHORT_URI);
|
|
197
|
+
YasrSteps.getResultLink(0, 4).should('contain', CONTEXT_EXPLICIT);
|
|
198
|
+
|
|
199
|
+
// When I click on "context" tab.
|
|
200
|
+
ResourceSteps.selectContextRole();
|
|
201
|
+
|
|
202
|
+
// Then I expect to see empty results because this resource has not triples as context.
|
|
203
|
+
YasrSteps.getNoDataElement().should('exist');
|
|
204
|
+
|
|
205
|
+
// When I click on "all" tab.
|
|
206
|
+
ResourceSteps.selectAllRole();
|
|
207
|
+
|
|
208
|
+
// Then I expect to see all triples of subject without mater of its role.
|
|
209
|
+
YasrSteps.getResults().should('have.length', 2);
|
|
210
|
+
|
|
211
|
+
YasrSteps.getResultLink(0, 1).should('contain', SUBJECT_RESOURCE_SHORT_URI);
|
|
212
|
+
YasrSteps.getResultLink(0, 2).should('contain', 'rdfs:subClassOf');
|
|
213
|
+
YasrSteps.getResultLink(0, 3).should('contain', 'http://example.com/ontology#Metric');
|
|
214
|
+
YasrSteps.getResultLink(0, 4).should('contain', CONTEXT_EXPLICIT);
|
|
215
|
+
|
|
216
|
+
YasrSteps.getResultLink(1, 1).should('contain', 'http://example.com/resource/person/W6J1827/customerLoyalty');
|
|
217
|
+
YasrSteps.getResultLink(1, 2).should('contain', 'rdf:type');
|
|
218
|
+
YasrSteps.getResultLink(1, 3).should('contain', SUBJECT_RESOURCE_SHORT_URI);
|
|
219
|
+
YasrSteps.getResultLink(1, 4).should('contain', CONTEXT_EXPLICIT);
|
|
220
|
+
});
|
|
221
|
+
|
|
222
|
+
it('should list the triples of a resource used as predicate', () => {
|
|
223
|
+
// When I load resource that is predicate.
|
|
224
|
+
ResourceSteps.visit(`uri=${PREDICATE_SOURCE}&role=subject`);
|
|
225
|
+
|
|
226
|
+
// Then I expect to see empty results because this resource has not triples as subject.
|
|
227
|
+
YasrSteps.getNoDataElement().should('be.visible');
|
|
228
|
+
|
|
229
|
+
// When I click on "predicate" tab.
|
|
230
|
+
ResourceSteps.selectPredicateRole();
|
|
231
|
+
|
|
232
|
+
// Then I expect to see all triples where resource is predicate .
|
|
233
|
+
YasrSteps.getResults().should('have.length', 6);
|
|
234
|
+
|
|
235
|
+
// When I click on "object" tab.
|
|
236
|
+
ResourceSteps.selectObjectRole();
|
|
237
|
+
|
|
238
|
+
// Then I expect to empty result because the resource has not triples as object.
|
|
239
|
+
YasrSteps.getNoDataElement().should('be.visible');
|
|
240
|
+
|
|
241
|
+
// When I click on "context" tab.
|
|
242
|
+
ResourceSteps.selectContextRole();
|
|
243
|
+
|
|
244
|
+
// Then I expect to empty result because the resource has not triples as context.
|
|
245
|
+
YasrSteps.getNoDataElement().should('be.visible');
|
|
246
|
+
|
|
247
|
+
// When I click on "all" tab.
|
|
248
|
+
ResourceSteps.selectAllRole();
|
|
249
|
+
|
|
250
|
+
// Then I expect to see all triples of subject without mater of its role.
|
|
251
|
+
YasrSteps.getResults().should('have.length', 6);
|
|
252
|
+
});
|
|
253
|
+
|
|
254
|
+
it('should list the triples of a resource used as object', () => {
|
|
255
|
+
// When I load resource that is used as object.
|
|
256
|
+
ResourceSteps.visit(`uri=${OBJECT_RESOURCE}&role=subject`);
|
|
257
|
+
|
|
258
|
+
// Then I expect to see empty results because this resource has not triples as subject.
|
|
259
|
+
YasrSteps.getNoDataElement().should('be.visible');
|
|
260
|
+
|
|
261
|
+
// When I click on "predicate" tab.
|
|
262
|
+
ResourceSteps.selectPredicateRole();
|
|
263
|
+
|
|
264
|
+
// Then I expect to see empty results because this resource has not triples as predicate.
|
|
265
|
+
YasrSteps.getNoDataElement().should('be.visible');
|
|
266
|
+
|
|
267
|
+
// When I click on "object" tab.
|
|
268
|
+
ResourceSteps.selectObjectRole();
|
|
269
|
+
|
|
270
|
+
// Then I expect to see all triples of resource without mater of its role.
|
|
271
|
+
YasrSteps.getResults().should('have.length', 6);
|
|
272
|
+
|
|
273
|
+
// When I click on "context" tab.
|
|
274
|
+
ResourceSteps.selectContextRole();
|
|
275
|
+
|
|
276
|
+
// Then I expect to empty result because the resource has not triples as context.
|
|
277
|
+
YasrSteps.getNoDataElement().should('exist');
|
|
278
|
+
|
|
279
|
+
// When I click on "all" tab.
|
|
280
|
+
ResourceSteps.selectAllRole();
|
|
281
|
+
|
|
282
|
+
// Then I expect to see all triples of resource without mater of its role.
|
|
283
|
+
YasrSteps.getResults().should('have.length', 6);
|
|
284
|
+
});
|
|
285
|
+
|
|
286
|
+
it('should list the triples of a resource used as context', () => {
|
|
287
|
+
// When I load resource that is used as context.
|
|
288
|
+
ResourceSteps.visit(`uri=${CONTEXT_EXPLICIT}&role=subject`);
|
|
289
|
+
|
|
290
|
+
|
|
291
|
+
// Then I expect to see empty results because this resource has not triples as subject.
|
|
292
|
+
YasrSteps.getNoDataElement().should('be.visible');
|
|
293
|
+
|
|
294
|
+
// When I click on "predicate" tab.
|
|
295
|
+
ResourceSteps.selectPredicateRole();
|
|
296
|
+
|
|
297
|
+
// Then I expect to see empty results because this resource has not triples as predicate.
|
|
298
|
+
YasrSteps.getNoDataElement().should('be.visible');
|
|
299
|
+
|
|
300
|
+
// When I click on "object" tab.
|
|
301
|
+
ResourceSteps.selectObjectRole();
|
|
302
|
+
|
|
303
|
+
// Then I expect to empty result because the resource has not triples as object.
|
|
304
|
+
YasrSteps.getNoDataElement().should('be.visible');
|
|
305
|
+
|
|
306
|
+
// When I click on "context" tab.
|
|
307
|
+
ResourceSteps.selectContextRole();
|
|
308
|
+
|
|
309
|
+
// Then I expect to see all triples of resource without mater of its role,
|
|
310
|
+
YasrSteps.getResults().should('have.length', 86);
|
|
311
|
+
// and inference dropdown should be disabled.
|
|
312
|
+
ResourceSteps.getInferenceSelectElement().should('be.disabled');
|
|
313
|
+
|
|
314
|
+
// When I click on "all" tab.
|
|
315
|
+
ResourceSteps.selectAllRole();
|
|
316
|
+
|
|
317
|
+
// Then I expect to see all triples of resource without mater of its role.
|
|
318
|
+
YasrSteps.getResults().should('have.length', 86);
|
|
319
|
+
});
|
|
320
|
+
});
|
|
321
|
+
|
|
322
|
+
context('Triple resource', () => {
|
|
323
|
+
|
|
324
|
+
it('should show triple resource', () => {
|
|
325
|
+
// When I visit resource view with triple resource.
|
|
326
|
+
ResourceSteps.visit(`triple=${TRIPLE_RESOURCE}&role=subject`);
|
|
327
|
+
|
|
328
|
+
// Then I expect resource link to exist.
|
|
329
|
+
ResourceSteps.getTripleResourceLink().should('contain.text', '<<<W6J1827> <hasAddress> <address>>>');
|
|
330
|
+
|
|
331
|
+
// When I click on the link.
|
|
332
|
+
ResourceSteps.clickOnTripleResourceLink();
|
|
333
|
+
|
|
334
|
+
// Then I expect to see sparql query view,
|
|
335
|
+
SparqlEditorSteps.verifyUrl();
|
|
336
|
+
YasguiSteps.getTabs().should('have.length', 2);
|
|
337
|
+
// and a describe query to be present
|
|
338
|
+
YasqeSteps.getActiveTabQuery().should('contain', 'describe <<<http://example.com/resource/person/W6J1827> <http://example.com/ontology#hasAddress> <http://example.com/resource/person/W6J1827/address>>>');
|
|
339
|
+
|
|
340
|
+
// When I visit resource view with triple resource.
|
|
341
|
+
ResourceSteps.visit(`triple=${TRIPLE_RESOURCE}&role=subject`);
|
|
342
|
+
|
|
343
|
+
// Then I expect target link to exist.
|
|
344
|
+
ResourceSteps.getTargetLink().should('contain.text', '<<<http://example.com/resource/person/W6J1827> <http://example.com/ontology#hasAddress> <http://example.com/resource/person/W6J1827/address>>>');
|
|
345
|
+
|
|
346
|
+
// When I click on the link.
|
|
347
|
+
ResourceSteps.clickOnTripleResourceLink();
|
|
348
|
+
|
|
349
|
+
// Then I expect to see sparql query view,
|
|
350
|
+
SparqlEditorSteps.verifyUrl();
|
|
351
|
+
YasguiSteps.getTabs().should('have.length', 2);
|
|
352
|
+
// and a describe query to be present
|
|
353
|
+
YasqeSteps.getActiveTabQuery().should('contain', 'describe <<<http://example.com/resource/person/W6J1827> <http://example.com/ontology#hasAddress> <http://example.com/resource/person/W6J1827/address>>>');
|
|
354
|
+
YasguiSteps.getCurrentTab().should('contain', 'Unnamed 1');
|
|
355
|
+
});
|
|
356
|
+
});
|
|
357
|
+
});
|