graphdb-workbench-tests 3.5.1-TR1 → 4.0.0-TR2
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.
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { defineConfig } from 'cypress';
|
|
2
|
+
import setupPlugins from './plugins/index.js';
|
|
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
|
+
export default defineConfig({
|
|
13
|
+
projectId: 'v35btb',
|
|
14
|
+
fixturesFolder: 'fixtures',
|
|
15
|
+
screenshotsFolder: 'report/screenshots',
|
|
16
|
+
videosFolder: 'report/videos',
|
|
17
|
+
video: true,
|
|
18
|
+
defaultCommandTimeout: 25000,
|
|
19
|
+
numTestsKeptInMemory: 10,
|
|
20
|
+
viewportWidth: 1600,
|
|
21
|
+
viewportHeight: 1200,
|
|
22
|
+
e2e: {
|
|
23
|
+
retries: {
|
|
24
|
+
runMode: 2,
|
|
25
|
+
openMode: 0
|
|
26
|
+
},
|
|
27
|
+
async setupNodeEvents(on, config) {
|
|
28
|
+
setupPlugins(on, config);
|
|
29
|
+
if (isCoverage) {
|
|
30
|
+
await loadCodeCoverage(on, config);
|
|
31
|
+
}
|
|
32
|
+
return config;
|
|
33
|
+
},
|
|
34
|
+
baseUrl: 'http://localhost:9000',
|
|
35
|
+
specPattern: 'e2e-legacy/guides/**/*.{js,jsx,ts,tsx}',
|
|
36
|
+
supportFile: 'support/e2e.js',
|
|
37
|
+
reporter: "cypress-multi-reporters",
|
|
38
|
+
reporterOptions: {
|
|
39
|
+
configFile: 'cypress-reporter-config.json'
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
env: {
|
|
43
|
+
set_default_user_data: true
|
|
44
|
+
}
|
|
45
|
+
});
|
|
@@ -9,8 +9,7 @@ import {GuidesStubs} from "../../../../stubs/guides/guides-stubs.js";
|
|
|
9
9
|
import {TTYGStubs} from "../../../../stubs/ttyg/ttyg-stubs.js";
|
|
10
10
|
import {RepositoriesStubs} from "../../../../stubs/repositories/repositories-stubs.js";
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
describe.skip('ttyg configure agent guide', () => {
|
|
12
|
+
describe('ttyg configure agent guide', () => {
|
|
14
13
|
let repositoryId;
|
|
15
14
|
|
|
16
15
|
beforeEach(() => {
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import {RepositorySteps} from "../../steps/repository-steps";
|
|
2
|
+
import {OntopRepositorySteps} from "../../steps/ontop-repository-steps";
|
|
3
|
+
import {ToasterSteps} from "../../steps/toaster-steps";
|
|
4
|
+
import {ModalDialogSteps} from "../../steps/modal-dialog-steps";
|
|
5
|
+
|
|
6
|
+
describe('Repository rename restrictions', () => {
|
|
7
|
+
|
|
8
|
+
let repositoryId;
|
|
9
|
+
let memberRepositoryId;
|
|
10
|
+
|
|
11
|
+
beforeEach(() => {
|
|
12
|
+
repositoryId = 'repo-' + Date.now();
|
|
13
|
+
memberRepositoryId = 'member-' + Date.now();
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
afterEach(() => {
|
|
17
|
+
cy.deleteRepository(repositoryId);
|
|
18
|
+
cy.deleteRepository(memberRepositoryId);
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it('should allow renaming of a GraphDB repository', () => {
|
|
22
|
+
// Given there is a GraphDB repository.
|
|
23
|
+
cy.createRepository({id: repositoryId});
|
|
24
|
+
|
|
25
|
+
// When I open its edit page.
|
|
26
|
+
RepositorySteps.visitEditPage(repositoryId);
|
|
27
|
+
|
|
28
|
+
// Then the repository id should be rendered as read only,
|
|
29
|
+
RepositorySteps.getGDBIdInput()
|
|
30
|
+
.should('have.value', repositoryId)
|
|
31
|
+
.and('be.disabled');
|
|
32
|
+
// and the action which unlocks the repository id field should be available.
|
|
33
|
+
RepositorySteps.getRepositoryIdEditElement().should('be.visible');
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
it('should not allow renaming of an Ontop repository', () => {
|
|
37
|
+
// Given there is an Ontop repository.
|
|
38
|
+
createOntopRepository(repositoryId);
|
|
39
|
+
|
|
40
|
+
// When I open its edit page.
|
|
41
|
+
RepositorySteps.visit();
|
|
42
|
+
RepositorySteps.editRepository(repositoryId);
|
|
43
|
+
|
|
44
|
+
// Then the repository id should be rendered as read only,
|
|
45
|
+
RepositorySteps.getGDBIdInput()
|
|
46
|
+
.should('have.value', repositoryId)
|
|
47
|
+
.and('be.disabled');
|
|
48
|
+
// and the action which unlocks the repository id field should not be available, because
|
|
49
|
+
// renaming is allowed only for GraphDB repositories.
|
|
50
|
+
RepositorySteps.getRepositoryIdEditElement().should('not.exist');
|
|
51
|
+
|
|
52
|
+
// When the repository id is changed despite the field being disabled,
|
|
53
|
+
forceChangeRepositoryId('renamed-' + repositoryId);
|
|
54
|
+
// and I try to save the configuration.
|
|
55
|
+
RepositorySteps.clickSaveEditedRepo();
|
|
56
|
+
|
|
57
|
+
// Then I expect to see an error message,
|
|
58
|
+
ToasterSteps.verifyError('Can not change the name of ontop repository');
|
|
59
|
+
// and the repository should keep its original id.
|
|
60
|
+
RepositorySteps.visit();
|
|
61
|
+
RepositorySteps.getRepositoryFromList(repositoryId).should('be.visible');
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
it('should not allow renaming of a FedX repository', () => {
|
|
65
|
+
// Given there is a FedX repository.
|
|
66
|
+
cy.createRepository({id: memberRepositoryId});
|
|
67
|
+
createFedxRepository(repositoryId, memberRepositoryId);
|
|
68
|
+
|
|
69
|
+
// When I open its edit page.
|
|
70
|
+
RepositorySteps.visit();
|
|
71
|
+
RepositorySteps.editRepository(repositoryId);
|
|
72
|
+
|
|
73
|
+
// Then the repository id should be rendered as read only,
|
|
74
|
+
RepositorySteps.getGDBIdInput()
|
|
75
|
+
.should('have.value', repositoryId)
|
|
76
|
+
.and('be.disabled');
|
|
77
|
+
// and the action which unlocks the repository id field should not be available, because
|
|
78
|
+
// renaming is allowed only for GraphDB repositories.
|
|
79
|
+
RepositorySteps.getRepositoryIdEditElement().should('not.exist');
|
|
80
|
+
|
|
81
|
+
// When I save the configuration.
|
|
82
|
+
RepositorySteps.getSaveRepositoryButton().click();
|
|
83
|
+
ModalDialogSteps.clickOnConfirmButton();
|
|
84
|
+
|
|
85
|
+
// Then the repository should keep its original id.
|
|
86
|
+
RepositorySteps.visit();
|
|
87
|
+
RepositorySteps.getRepositoryFromList(repositoryId).should('be.visible');
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Changes the repository id field although it is disabled in order to verify that the restriction is
|
|
92
|
+
* enforced by the controller too and not only by the view.
|
|
93
|
+
*
|
|
94
|
+
* @param {string} newRepositoryId The new repository id.
|
|
95
|
+
*/
|
|
96
|
+
const forceChangeRepositoryId = (newRepositoryId) => {
|
|
97
|
+
RepositorySteps.getGDBIdInput()
|
|
98
|
+
.clear({force: true})
|
|
99
|
+
.type(newRepositoryId, {force: true})
|
|
100
|
+
.should('have.value', newRepositoryId);
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
const createOntopRepository = (repositoryId) => {
|
|
104
|
+
OntopRepositorySteps.visitCreate();
|
|
105
|
+
RepositorySteps.typeRepositoryId(repositoryId);
|
|
106
|
+
OntopRepositorySteps.selectOracleDatabase();
|
|
107
|
+
OntopRepositorySteps.typeHostName('localhost');
|
|
108
|
+
OntopRepositorySteps.typePort(5423);
|
|
109
|
+
OntopRepositorySteps.typeDatabaseName('database-name');
|
|
110
|
+
OntopRepositorySteps.clickObdaFileUploadButton();
|
|
111
|
+
OntopRepositorySteps.uploadObdaFile('fixtures/ontop/university-complete.obda');
|
|
112
|
+
// Wait the OBDA edit button to become visible to ensure that the file is uploaded.
|
|
113
|
+
OntopRepositorySteps.getOBDAFileFieldEditButton().should('be.visible');
|
|
114
|
+
OntopRepositorySteps.clickOnCreateRepositoryButton();
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
const createFedxRepository = (repositoryId, memberRepositoryId) => {
|
|
118
|
+
RepositorySteps.visit();
|
|
119
|
+
RepositorySteps.createRepository();
|
|
120
|
+
RepositorySteps.createFedexRepositoryType();
|
|
121
|
+
RepositorySteps.typeRepositoryId(repositoryId);
|
|
122
|
+
RepositorySteps.selectFedexMember(memberRepositoryId);
|
|
123
|
+
RepositorySteps.saveRepository();
|
|
124
|
+
};
|
|
125
|
+
});
|
package/eslint.config.js
CHANGED
|
@@ -35,6 +35,11 @@ export default [
|
|
|
35
35
|
rules: {
|
|
36
36
|
...pluginJs.configs.recommended.rules,
|
|
37
37
|
...pluginCypress.configs.recommended.rules,
|
|
38
|
+
// Exclusive tests (.only) silently skip the rest of the suite, so they must never be committed.
|
|
39
|
+
'no-restricted-syntax': ['error', {
|
|
40
|
+
selector: "MemberExpression[computed=false][property.name='only'][object.name=/^(describe|context|it|specify|test|suite)$/]",
|
|
41
|
+
message: 'Exclusive tests are not allowed: remove ".only" before committing.'
|
|
42
|
+
}],
|
|
38
43
|
},
|
|
39
44
|
},
|
|
40
45
|
];
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "graphdb-workbench-tests",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0-TR2",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "graphdb-workbench-tests",
|
|
9
|
-
"version": "
|
|
9
|
+
"version": "4.0.0-TR2",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"devDependencies": {
|
|
12
12
|
"@bahmutov/cypress-code-coverage": "^2.7.2",
|
|
@@ -2082,9 +2082,9 @@
|
|
|
2082
2082
|
}
|
|
2083
2083
|
},
|
|
2084
2084
|
"node_modules/@eslint/eslintrc/node_modules/js-yaml": {
|
|
2085
|
-
"version": "4.3.
|
|
2086
|
-
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.3.
|
|
2087
|
-
"integrity": "sha512-
|
|
2085
|
+
"version": "4.3.0",
|
|
2086
|
+
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.3.0.tgz",
|
|
2087
|
+
"integrity": "sha512-1td788aAnnZ5qs7V2QIRl1owjtYpbKt749Y3xauqQgwIIGF/xXWz1wMTEBx5O3LK3lXLVuqXPdPxj2BoFHaW9Q==",
|
|
2088
2088
|
"dev": true,
|
|
2089
2089
|
"funding": [
|
|
2090
2090
|
{
|
|
@@ -7776,9 +7776,9 @@
|
|
|
7776
7776
|
}
|
|
7777
7777
|
},
|
|
7778
7778
|
"node_modules/mocha/node_modules/js-yaml": {
|
|
7779
|
-
"version": "4.3.
|
|
7780
|
-
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.3.
|
|
7781
|
-
"integrity": "sha512-
|
|
7779
|
+
"version": "4.3.0",
|
|
7780
|
+
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.3.0.tgz",
|
|
7781
|
+
"integrity": "sha512-1td788aAnnZ5qs7V2QIRl1owjtYpbKt749Y3xauqQgwIIGF/xXWz1wMTEBx5O3LK3lXLVuqXPdPxj2BoFHaW9Q==",
|
|
7782
7782
|
"dev": true,
|
|
7783
7783
|
"funding": [
|
|
7784
7784
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "graphdb-workbench-tests",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0-TR2",
|
|
4
4
|
"description": "Cypress tests for GraphDB workbench",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
"cy:open-legacy": "cypress open --config-file cypress-legacy.config.js",
|
|
11
11
|
"cy:open-security": "cypress open --config-file cypress-security.config.js",
|
|
12
12
|
"cy:open-flaky": "cypress open --config-file cypress-flaky.config.js",
|
|
13
|
-
"cy:guides": "cypress
|
|
13
|
+
"cy:open-guides": "cypress open --config-file cypress-guides.config.js",
|
|
14
|
+
"cy:run-guides": "cypress run --config-file cypress-guides.config.js",
|
|
14
15
|
"cy:run": "npm run cy:run-legacy && cypress run",
|
|
15
16
|
"cy:run:partial": "cypress run --config-file cypress-legacy.config.js --spec \"e2e-legacy/ttyg/**/*.spec.js\" --browser chrome",
|
|
16
17
|
"cy:run-legacy": "cypress run --config-file cypress-legacy.config.js --browser chrome",
|