graphdb-workbench-tests 3.0.2 → 3.1.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/.editorconfig +17 -0
- package/.nycrc +10 -0
- package/cypress-flaky.config.js +15 -4
- package/cypress-legacy.config.js +40 -0
- package/cypress-security.config.js +40 -0
- package/cypress.config.js +8 -4
- package/{integration-flaky → e2e-flaky}/explore/visual.graph.spec.js +4 -1
- package/{integration-flaky → e2e-flaky}/import/import-server-files-operations.spec.js +1 -1
- package/e2e-flaky/import/import-user-data-url.spec.js +63 -0
- package/{integration-flaky → e2e-flaky}/setup/sparql-template-create.js +9 -2
- package/{integration-flaky → e2e-flaky}/sparql-editor/yasr/table-plugin.spec.js +2 -1
- package/{integration → e2e-legacy}/cluster/edit-cluster-nodes-modal.spec.js +44 -0
- package/e2e-legacy/explore/class-hierarchy/class-hierarchy-with-selected-repository-without-class-hierarchy.spec.js +42 -0
- package/e2e-legacy/explore/class-hierarchy/class-hierarchy-with-selected-repository.spec.js +43 -0
- package/e2e-legacy/explore/class-hierarchy/class-hierarchy-without-selected-repository.spec.js +30 -0
- package/{integration/explore → e2e-legacy/explore/class-hierarchy}/class.hierarchy.spec.js +1 -1
- package/e2e-legacy/explore/class-relationships/class-relationships-repository-with-data.spec.js +42 -0
- package/e2e-legacy/explore/class-relationships/class-relationships-with-selected-repository.spec.js +39 -0
- package/e2e-legacy/explore/class-relationships/class-relationships-without-selected-repository.spec.js +21 -0
- package/{integration/explore/class.relationships.spec.js → e2e-legacy/explore/class-relationships/class-relationships.spec.js} +18 -50
- package/{integration/explore → e2e-legacy/explore/graphs-overview}/graphs.overview.spec.js +4 -4
- package/e2e-legacy/explore/graphs-overview/initial-state/graphs-overview-with-selected-repository.spec.js +44 -0
- package/e2e-legacy/explore/graphs-overview/initial-state/graphs-overview-without-selected-repository.spec.js +32 -0
- package/e2e-legacy/explore/similarity-index/similarity-index-with-repository.spec.js +38 -0
- package/e2e-legacy/explore/similarity-index/similarity-index-without-repository.spec.js +21 -0
- package/{integration → e2e-legacy}/explore/visual-graph/graphs-config.spec.js +1 -6
- package/e2e-legacy/explore/visual-graph/visual-graph-with-selected-repository.js +38 -0
- package/e2e-legacy/explore/visual-graph/visual-graph-without-selected-repository.js +21 -0
- package/{integration → e2e-legacy}/explore/visual-graph/visual.graph.spec.js +2 -7
- package/{integration → e2e-legacy}/graphql/create-graphql-endpoint.spec.js +0 -2
- package/{integration → e2e-legacy}/graphql/edit-graphql-enpoint.spec.js +1 -1
- package/{integration → e2e-legacy}/graphql/filter-graphql-endpoints-on-management-view.spec.js +1 -1
- package/e2e-legacy/graphql/graphql-endpoint management-without-selected-repository.spec.js +21 -0
- package/{integration → e2e-legacy}/graphql/graphql-endpoint-management-view.spec.js +4 -4
- package/e2e-legacy/graphql/graphql-endpoint-management-with-endpoints.spec.js +43 -0
- package/e2e-legacy/graphql/graphql-endpoint-management-with-selected-repository.spec.jsx +39 -0
- package/e2e-legacy/graphql/graphql-playground-with-endpoints.spec.js +40 -0
- package/e2e-legacy/graphql/graphql-playground-with-selected-repository.spec.js +38 -0
- package/e2e-legacy/graphql/graphql-playground-without-selected-repository.spec.js +22 -0
- package/{integration → e2e-legacy}/graphql/graphql-playground.spec.js +1 -1
- package/{integration → e2e-legacy}/graphql/import-graphql-endpoint-definitions.spec.js +0 -6
- package/e2e-legacy/help/guides/guides-with-repository.spec.js +32 -0
- package/e2e-legacy/help/guides/guides-without-repository.spec.js +20 -0
- package/{integration → e2e-legacy/help}/guides/movies-interactive-guide.spec.js +3 -3
- package/{integration → e2e-legacy/help}/guides/star-wars-interactive-guide.js +3 -2
- package/e2e-legacy/help/rest-api-documentatio/rest-api-documentation-with-repository.spec.js +32 -0
- package/e2e-legacy/help/rest-api-documentatio/rest-api-documentation-without-repository.spec.js +20 -0
- package/e2e-legacy/help/system-information/system-information-with-repository.spec.js +32 -0
- package/e2e-legacy/help/system-information/system-information-without-repository.spec.js +20 -0
- package/e2e-legacy/home/cookie-policy.spec.js +108 -0
- package/e2e-legacy/home/documentation-link.spec.js +61 -0
- package/{integration → e2e-legacy}/home/google-analytics.spec.js +4 -6
- package/e2e-legacy/home/home-page-with-selected-repository.spec.js +69 -0
- package/e2e-legacy/home/home-page-without-repositories.spec.js +87 -0
- package/e2e-legacy/home/home-page-without-selected-repository.spec.js +59 -0
- package/{integration → e2e-legacy}/home/language-change.spec.js +2 -2
- package/e2e-legacy/home/rdf-resource-search.spec.js +148 -0
- package/e2e-legacy/home/view-resource-autocomplete.spec.js +65 -0
- package/{integration → e2e-legacy}/import/import-user-data-file-upload.spec.js +16 -10
- package/{integration → e2e-legacy}/import/import-user-data-text-snippet.spec.js +0 -2
- package/{integration → e2e-legacy}/import/import-user-data-url.spec.js +0 -23
- package/{integration → e2e-legacy}/import/import-user-data.spec.js +9 -2
- package/e2e-legacy/import/initial-state/import-page-with-selected-repositor.js +51 -0
- package/e2e-legacy/import/initial-state/import-page-with-selected-repository-without-imported-files.js +45 -0
- package/e2e-legacy/import/initial-state/import-page-without-selected-repository.spec.js +28 -0
- package/e2e-legacy/license/license-with-repository.spec.js +113 -0
- package/e2e-legacy/license/license-without-repository.spec.js +103 -0
- package/{integration → e2e-legacy}/license/license.spec.js +4 -4
- package/e2e-legacy/monitor/backup-and-restore/backup-and-restore-with-repository.spec.js +36 -0
- package/e2e-legacy/monitor/backup-and-restore/backup-and-restore-without-repository.spec.js +25 -0
- package/{integration/monitor/monitor.backup-and-restore.spec.js → e2e-legacy/monitor/backup-and-restore/backup-and-restore.spec.js} +2 -2
- package/{integration → e2e-legacy}/monitor/global-operation-statuses-component.spec.js +12 -5
- package/e2e-legacy/monitor/query-and-updates/queries-and-updates-with-repository.spec.js +39 -0
- package/e2e-legacy/monitor/query-and-updates/queries-and-updates-without-repository.spec.js +21 -0
- package/{integration/monitor → e2e-legacy/monitor/system}/monitor.resources.spec.js +3 -2
- package/e2e-legacy/monitor/system/system-monitoring-with-repository.spec.js +32 -0
- package/e2e-legacy/monitor/system/system-monitoring-without-repository.spec.js +20 -0
- package/{integration → e2e-legacy}/repository/repositories.spec.js +34 -45
- package/{integration → e2e-legacy}/resource/resource.spec.js +16 -1
- package/e2e-legacy/setup/aclmanagement/acl-management-with-selected repository.spec.js +40 -0
- package/e2e-legacy/setup/aclmanagement/acl-management-without-repositories.spec.js +21 -0
- package/{integration → e2e-legacy}/setup/aclmanagement/create-rule.spec.js +1 -0
- package/e2e-legacy/setup/autocomplete/autocomplete-with-repository.spec.js +40 -0
- package/e2e-legacy/setup/autocomplete/autocomplete-without-repository.spec.js +27 -0
- package/{integration/setup → e2e-legacy/setup/autocomplete}/autocomplete.spec.js +5 -6
- package/e2e-legacy/setup/cluster/cluster-initial-state-with-cluster.spec.js +34 -0
- package/e2e-legacy/setup/cluster/cluster-initial-state-without-cluster.spec.js +25 -0
- package/e2e-legacy/setup/connectors/connectors-initial-state-with-selected-repository.spec.js +41 -0
- package/e2e-legacy/setup/connectors/connectors-initial-state-without-repositories.spec.js +21 -0
- package/e2e-legacy/setup/jdbc/jdbc-with-repository.spec.js +39 -0
- package/e2e-legacy/setup/jdbc/jdbc-without-repository.spec.js +27 -0
- package/e2e-legacy/setup/namespaces/namespaces-with-repository.spec.js +44 -0
- package/e2e-legacy/setup/namespaces/namespaces-without-repository.spec.js +27 -0
- package/{integration/setup → e2e-legacy/setup/namespaces}/namespaces.spec.js +6 -5
- package/e2e-legacy/setup/plugins/plugins-with-repository.spec.js +38 -0
- package/e2e-legacy/setup/plugins/plugins-without-repository.spec.js +28 -0
- package/{integration/setup → e2e-legacy/setup/plugins}/plugins.spec.js +3 -3
- package/e2e-legacy/setup/rdf-rank/rdf-rank-with-repository.spec.js +40 -0
- package/e2e-legacy/setup/rdf-rank/rdf-rank-without-repository.spec.js +30 -0
- package/{integration/setup → e2e-legacy/setup/rdf-rank}/rdf-rank.spec.js +1 -1
- package/e2e-legacy/setup/repositories/repositories-view-with-repositories.spec.js +40 -0
- package/e2e-legacy/setup/repositories/repositories-view-without-repositories.spec.js +28 -0
- package/e2e-legacy/setup/settings/my-settings-initial-state.spec.js +86 -0
- package/{integration/setup → e2e-legacy/setup/settings}/my-settings.spec.js +5 -75
- package/{integration/setup → e2e-legacy/setup/sparql-template}/sparql-template-create.js +16 -8
- package/e2e-legacy/setup/sparql-template/sparql-template-with-repository.spec.js +39 -0
- package/e2e-legacy/setup/sparql-template/sparql-template-without-repository.spec.js +29 -0
- package/{integration/setup → e2e-legacy/setup/sparql-template}/sparql-templates.spec.js +4 -4
- package/{integration/setup → e2e-legacy/setup/users-and-access}/user-and-access.spec.js +53 -19
- package/e2e-legacy/setup/users-and-access/users-and-access-initial-state.spec.js +25 -0
- package/{integration → e2e-legacy}/sparql-editor/actions/inferred-sameas.spec.js +3 -1
- package/{integration → e2e-legacy}/sparql-editor/saved-query/edit-query.spec.js +3 -3
- package/{integration → e2e-legacy}/sparql-editor/saved-query/readonly-query.spec.js +7 -13
- package/{integration → e2e-legacy}/sparql-editor/saved-query/share-query.spec.js +2 -0
- package/e2e-legacy/sparql-editor/sparql-page-with-selected-repository.spec.js +33 -0
- package/e2e-legacy/sparql-editor/sparql-page-without-selected-repository.spec.js +26 -0
- package/{integration → e2e-legacy}/ttyg/agent-list.spec.js +52 -0
- package/{integration → e2e-legacy}/ttyg/agent-select-menu.spec.js +24 -0
- package/{integration → e2e-legacy}/ttyg/chat-panel.spec.js +29 -3
- package/{integration → e2e-legacy}/ttyg/clone-agent.spec.js +1 -0
- package/{integration → e2e-legacy}/ttyg/create-agent.spec.js +7 -6
- package/{integration → e2e-legacy}/ttyg/create-chat.spec.js +3 -1
- package/e2e-legacy/ttyg/edit-agent.spec.js +169 -0
- package/e2e-legacy/ttyg/ttyg-initial-state-with-configured-api-key.spec.js +46 -0
- package/e2e-legacy/ttyg/ttyg-initial-state-with-selected-repository.spec.js +45 -0
- package/e2e-legacy/ttyg/ttyg-initial-state-without-repositories.spec.js +21 -0
- package/{integration-flaky → e2e-legacy}/ttyg/ttyg-permission.spec.js +25 -15
- package/{integration → e2e-legacy}/ttyg/ttyg-view.spec.js +1 -0
- package/e2e-security/setup/home/cookie-policy.spec.js +64 -0
- package/e2e-security/setup/users-and-access/create-user-permissions.spec.js +184 -0
- package/e2e-security/setup/users-and-access/graphql-user.spec.js +123 -0
- package/e2e-security/setup/users-and-access/repo-admin-role.spec.js +69 -0
- package/e2e-security/setup/users-and-access/turn-on-security-and-password-change.spec.js +87 -0
- package/e2e-security/setup/users-and-access/user-and-access.spec.js +87 -0
- package/e2e-security/setup/users-and-access/users-and-access-initial-state.spec.js +38 -0
- package/fixtures/locale-en.json +62 -19
- package/fixtures/repositories/free-access.json +13 -0
- package/fixtures/ttyg/agent/get-agent-defaults-assistant-api.json +44 -0
- package/fixtures/ttyg/agent/get-agent-defaults.json +2 -0
- package/fixtures/ttyg/agent/get-agent-list-with-incompatible-agents.json +79 -0
- package/fixtures/ttyg/chats/ask-question.json +12 -2
- package/fixtures/ttyg/chats/get-chat.json +6 -1
- package/npm-shrinkwrap.json +9356 -3815
- package/package.json +48 -42
- package/plugins/index.js +3 -2
- package/steps/application-steps.js +1 -1
- package/steps/base-steps.js +21 -0
- package/steps/class-views-steps.js +16 -0
- package/steps/cluster/cluster-page-steps.js +12 -2
- package/steps/error-steps.js +15 -3
- package/steps/explore/class-relationships-steps.js +64 -0
- package/steps/explore/graphs-overview-steps.js +21 -1
- package/steps/explore/similarity-indexes-steps.js +12 -2
- package/steps/graphql/graphql-endpoint-management-steps.js +2 -2
- package/steps/guides/guide-steps.js +20 -1
- package/steps/home-steps.js +158 -48
- package/steps/import/import-steps.js +11 -15
- package/steps/import/import-user-data-steps.js +4 -0
- package/steps/language-selector-steps.js +2 -2
- package/steps/license-steps.js +91 -9
- package/steps/login-steps.js +14 -3
- package/steps/main-menu-steps.js +207 -15
- package/steps/modal-dialog-steps.js +20 -0
- package/steps/monitoring/backup-and-restore-steps.js +9 -3
- package/steps/monitoring/queries-and-updates-steps.js +20 -0
- package/steps/monitoring/system-monitoring-steps.js +40 -0
- package/steps/operations-statuses-component-steps.js +5 -10
- package/steps/rdf-resource-search-steps.js +55 -0
- package/steps/repository-selector-steps.js +3 -3
- package/steps/repository-steps.js +18 -12
- package/steps/resource/resource-steps.js +4 -0
- package/steps/rest-api-documentation-steps.js +15 -0
- package/steps/setup/autocomplete-steps.js +17 -6
- package/steps/setup/connectors-steps.js +19 -0
- package/steps/setup/jdbc-steps.js +18 -4
- package/steps/setup/namespace-steps.js +9 -6
- package/steps/setup/plugins-steps.js +11 -4
- package/steps/setup/rdf-rank-steps.js +22 -4
- package/steps/setup/settings-steps.js +100 -1
- package/steps/setup/sparql-templates-steps.js +19 -1
- package/steps/setup/user-and-access-steps.js +33 -3
- package/steps/system-information-steps.js +70 -0
- package/steps/ttyg/chat-panel-steps.js +1 -1
- package/steps/ttyg/ttyg-agent-settings-modal.steps.js +82 -23
- package/steps/ttyg/ttyg-view-steps.js +74 -8
- package/steps/visual-graph-steps.js +4 -0
- package/steps/widgets/active-repository-widget-steps.js +29 -0
- package/steps/widgets/license-widget-steps.js +9 -0
- package/steps/widgets/repository-errors-widget-steps.js +21 -0
- package/steps/widgets/saved-sparql-queries-widget-steps.js +9 -0
- package/steps/yasgui/yasr-steps.js +4 -0
- package/stubs/autocomplete/autocomplete-stubs.js +7 -0
- package/stubs/browser-stubs.js +21 -0
- package/stubs/environment-stubs.js +9 -1
- package/stubs/license-stubs.js +51 -0
- package/stubs/repositories/repositories-stubs.js +8 -0
- package/stubs/repositories-stub.js +6 -6
- package/stubs/saved-queries-stubs.js +5 -0
- package/stubs/security-stubs.js +4 -0
- package/stubs/ttyg/ttyg-stubs.js +19 -6
- package/support/commands.js +19 -0
- package/support/{index.js → e2e.js} +2 -1
- package/support/repository-commands.js +20 -4
- package/Dockerfile +0 -11
- package/integration/explore/similarity-index/similarity-index-create.spec.js +0 -333
- package/integration/explore/similarity-index/similarity-index.spec.js +0 -88
- package/integration/explore/similarity-index/similarity.spec.js +0 -628
- package/integration/home/cookie-policy.spec.js +0 -90
- package/integration/home/documentation-link.spec.js +0 -60
- package/integration/home/language-selector.spec.js +0 -19
- package/integration/home/rdf-resource-search.spec.js +0 -177
- package/integration/home/view-resource-autocomplete.spec.js +0 -52
- package/integration/home/workbench.home.spec.js +0 -30
- package/integration/monitor/monitor.queries.spec.js +0 -31
- package/integration/ttyg/edit-agent.spec.js +0 -99
- package/integration-flaky/setup/users-and-access/security-and-free-access.spec.js +0 -54
- package/{integration-flaky → e2e-flaky}/import/import-user-data-batch-operations.spec.js +0 -0
- package/{integration-flaky → e2e-flaky}/import/import.server.files.spec.js +0 -0
- package/{integration-flaky → e2e-flaky}/sparql-editor/actions/execute-update-query.spec.js +0 -0
- package/{integration-flaky → e2e-flaky}/sparql-editor/actions/share-query.spec.js +0 -0
- package/{integration-flaky → e2e-flaky}/sparql-editor/lucene-connector.spec.js +0 -0
- package/{integration-flaky → e2e-flaky}/sparql-editor/plugins/error-plugin.spec.js +0 -0
- package/{integration → e2e-legacy}/cluster/cluster-configuration/cluster-configuration-multi-region.spec.js +0 -0
- package/{integration → e2e-legacy}/cluster/cluster-configuration/cluster-configuration-nodes.spec.js +0 -0
- package/{integration → e2e-legacy}/cluster/cluster-configuration/cluster-configuration-properties.spec.js +0 -0
- package/{integration → e2e-legacy}/cluster/cluster-configuration/cluster-configuration.spec.js +0 -0
- package/{integration → e2e-legacy}/cluster/cluster-legend.spec.js +0 -0
- package/{integration → e2e-legacy}/cluster/cluster-states.spec.js +0 -0
- package/{integration → e2e-legacy}/explore/visual-graph/visual-graph-node-labels.spec.js +0 -0
- package/{integration → e2e-legacy}/graphql/activate-deactivate-graphql-endpoint.spec.js +0 -0
- package/{integration → e2e-legacy}/graphql/delete-graphql-endpoint.spec.js +0 -0
- package/{integration → e2e-legacy}/graphql/export-graphql-endpoint-definition.spec.js +0 -0
- package/{integration → e2e-legacy}/graphql/set-default-graphql-endpoint.spec.js +0 -0
- package/{integration/help → e2e-legacy/help/system-information}/system-information.spec.js +0 -0
- package/{integration → e2e-legacy}/home/create-repository.spec.js +0 -0
- package/{integration → e2e-legacy}/import/import-server-files-batch-operations.spec.js +0 -0
- package/{integration → e2e-legacy}/import/import-server-files.spec.js +0 -0
- package/{integration → e2e-legacy}/import/import-user-data-settings-dialog.spec.js +0 -0
- package/{integration → e2e-legacy}/import/import-view.spec.js +0 -0
- package/{integration → e2e-legacy}/repository/attach-remote-location.spec.js +1 -1
- /package/{integration → e2e-legacy}/repository/ontop-repository.spec.js +0 -0
- /package/{integration → e2e-legacy}/repository/repository-commands.spec.js +0 -0
- /package/{integration → e2e-legacy}/setup/aclmanagement/delete-rule.spec.js +0 -0
- /package/{integration → e2e-legacy}/setup/aclmanagement/edit-rule.spec.js +0 -0
- /package/{integration → e2e-legacy}/setup/aclmanagement/render-rules.spec.js +0 -0
- /package/{integration → e2e-legacy}/setup/aclmanagement/reorder-rules.spec.js +0 -0
- /package/{integration → e2e-legacy}/setup/aclmanagement/revert-rules.spec.js +0 -0
- /package/{integration → e2e-legacy}/setup/aclmanagement/scopes.spec.js +0 -0
- /package/{integration → e2e-legacy}/setup/aclmanagement/update-rules.spec.js +0 -0
- /package/{integration → e2e-legacy}/setup/connectors-lucene.spec.js +0 -0
- /package/{integration → e2e-legacy}/setup/jdbc/jdbc-create.spec.js +0 -0
- /package/{integration → e2e-legacy}/setup/jdbc/jdbc.spec.js +0 -0
- /package/{integration → e2e-legacy}/sparql-editor/actions/execute-query.spec.js +0 -0
- /package/{integration → e2e-legacy}/sparql-editor/actions/expand-results-over-sameas.spec.js +0 -0
- /package/{integration → e2e-legacy}/sparql-editor/actions/include-inferred-statements.spec.js +0 -0
- /package/{integration → e2e-legacy}/sparql-editor/actions/save-query.spec.js +0 -0
- /package/{integration → e2e-legacy}/sparql-editor/actions/show-saved-queries.spec.js +0 -0
- /package/{integration → e2e-legacy}/sparql-editor/internationalization.spec.js +0 -0
- /package/{integration → e2e-legacy}/sparql-editor/saved-query/abort-query.spec.js +0 -0
- /package/{integration → e2e-legacy}/sparql-editor/saved-query/delete-query.spec.js +0 -0
- /package/{integration → e2e-legacy}/sparql-editor/sparql-editor.spec.js +0 -0
- /package/{integration → e2e-legacy}/sparql-editor/yasgui-tabs.spec.js +0 -0
- /package/{integration → e2e-legacy}/sparql-editor/yasr/download-as.spec.js +0 -0
- /package/{integration → e2e-legacy}/sparql-editor/yasr/pagination.spec.js +0 -0
- /package/{integration → e2e-legacy}/sparql-editor/yasr/table-plugin.spec.js +0 -0
- /package/{integration → e2e-legacy}/sparql-editor/yasr/toolbar/visual-graph-button.spec.js +0 -0
- /package/{integration → e2e-legacy}/ttyg/chat-list.spec.js +0 -0
- /package/{integration → e2e-legacy}/ttyg/delete-agent.spec.js +0 -0
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import {RepositoriesStubs} from "../../stubs/repositories/repositories-stubs";
|
|
2
2
|
import {RepositoriesStub} from "../../stubs/repositories-stub";
|
|
3
|
-
import {UserAndAccessSteps} from "../../steps/setup/user-and-access-steps";
|
|
4
3
|
import {TTYGStubs} from "../../stubs/ttyg/ttyg-stubs";
|
|
5
4
|
import {TTYGViewSteps} from "../../steps/ttyg/ttyg-view-steps";
|
|
6
5
|
import {LoginSteps} from "../../steps/login-steps";
|
|
6
|
+
import {SecurityStubs} from "../../stubs/security-stubs";
|
|
7
|
+
import {RepositorySelectorSteps} from "../../steps/repository-selector-steps";
|
|
7
8
|
|
|
9
|
+
const REPOSITORY_ID = 'starwars';
|
|
8
10
|
const USER_WITH_ROLE_USER = 'ttyg_user';
|
|
9
11
|
const USER_WITH_ROLE_REPO_MANAGER = 'ttyg_repo_manager';
|
|
10
12
|
const USER_ADMINISTRATOR = 'admin';
|
|
@@ -14,37 +16,41 @@ const DISABLED = false;
|
|
|
14
16
|
|
|
15
17
|
describe('TTYG permissions', () => {
|
|
16
18
|
|
|
17
|
-
|
|
18
19
|
before(() => {
|
|
19
|
-
|
|
20
|
-
RepositoriesStub.stubBaseEndpoints('starwars');
|
|
21
|
-
cy.presetRepository('starwars');
|
|
20
|
+
cy.loginAsAdmin();
|
|
22
21
|
cy.createUser({username: USER_WITH_ROLE_USER, password: PASSWORD});
|
|
23
22
|
cy.createUser({
|
|
24
23
|
username: USER_WITH_ROLE_REPO_MANAGER,
|
|
25
24
|
password: PASSWORD,
|
|
26
25
|
grantedAuthorities: ["ROLE_REPO_MANAGER", "WRITE_REPO_*", "READ_REPO_*"]
|
|
27
26
|
});
|
|
28
|
-
|
|
29
|
-
UserAndAccessSteps.toggleSecurity();
|
|
27
|
+
cy.switchOnSecurity();
|
|
30
28
|
});
|
|
31
29
|
|
|
30
|
+
beforeEach(() => {
|
|
31
|
+
SecurityStubs.spyOnAuthenticatedUser();
|
|
32
|
+
RepositoriesStubs.stubRepositories(0, '/repositories/get-ttyg-repositories.json');
|
|
33
|
+
RepositoriesStub.stubBaseEndpoints(REPOSITORY_ID);
|
|
34
|
+
})
|
|
35
|
+
|
|
32
36
|
after(() => {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
cy.
|
|
37
|
-
cy.deleteUser(USER_WITH_ROLE_REPO_MANAGER);
|
|
37
|
+
cy.loginAsAdmin();
|
|
38
|
+
cy.deleteUser(USER_WITH_ROLE_USER, true);
|
|
39
|
+
cy.deleteUser(USER_WITH_ROLE_REPO_MANAGER, true);
|
|
40
|
+
cy.switchOffSecurity(true);
|
|
38
41
|
});
|
|
39
42
|
|
|
40
|
-
it('should disable all buttons that can modify the agent', () => {
|
|
41
|
-
|
|
43
|
+
it('should disable all buttons that can modify the agent when user is with ROLE_USER', () => {
|
|
42
44
|
// When I log in with a user who has the ROLE_USER role, I expect all buttons modifying the agent to be disabled.
|
|
43
45
|
verifyCanCreateAgentForFirstTime(USER_WITH_ROLE_USER, PASSWORD, DISABLED);
|
|
46
|
+
});
|
|
44
47
|
|
|
48
|
+
it('should enable all buttons that can modify the agent when user is with role ROLE_REPO_MANAGER', () => {
|
|
45
49
|
// When I log in with a user who has the ROLE_REPO_MANAGER role, I expect all buttons modifying the agent to be enabled.
|
|
46
50
|
verifyCanCreateAgentForFirstTime(USER_WITH_ROLE_REPO_MANAGER, PASSWORD, ENABLED);
|
|
51
|
+
});
|
|
47
52
|
|
|
53
|
+
it('should enable all buttons that can modify the agent when user is admin', () => {
|
|
48
54
|
// When I log in with a user who is administrator, I expect all buttons modifying the agent to be enabled.
|
|
49
55
|
verifyCanCreateAgentForFirstTime(USER_ADMINISTRATOR, PASSWORD, ENABLED);
|
|
50
56
|
});
|
|
@@ -53,7 +59,12 @@ describe('TTYG permissions', () => {
|
|
|
53
59
|
const shouldBe = enable ? 'be.enabled' : 'be.disabled';
|
|
54
60
|
TTYGStubs.stubAgentListGet('/ttyg/agent/get-agent-list-0.json');
|
|
55
61
|
TTYGViewSteps.visit();
|
|
62
|
+
cy.url().should('include', '/login');
|
|
63
|
+
cy.wait('@get-authenticated-user');
|
|
64
|
+
cy.wait('@get-authenticated-user');
|
|
65
|
+
cy.wait('@get-authenticated-user');
|
|
56
66
|
LoginSteps.loginWithUser(user, password);
|
|
67
|
+
RepositorySelectorSteps.selectRepository(REPOSITORY_ID);
|
|
57
68
|
TTYGViewSteps.getCreateFirstAgentButton().should(shouldBe);
|
|
58
69
|
TTYGStubs.stubChatsListGet();
|
|
59
70
|
TTYGStubs.stubAgentListGet();
|
|
@@ -62,6 +73,5 @@ describe('TTYG permissions', () => {
|
|
|
62
73
|
TTYGViewSteps.getCreateAgentButton().should(shouldBe);
|
|
63
74
|
TTYGViewSteps.getEditCurrentAgentButton().should(shouldBe);
|
|
64
75
|
TTYGViewSteps.getToggleAgentsSidebarButton().should(shouldBe);
|
|
65
|
-
LoginSteps.logout();
|
|
66
76
|
}
|
|
67
77
|
});
|
|
@@ -4,6 +4,7 @@ import {RepositoriesStubs} from "../../stubs/repositories/repositories-stubs";
|
|
|
4
4
|
import {ApplicationSteps} from "../../steps/application-steps";
|
|
5
5
|
import {RepositoriesStub} from "../../stubs/repositories-stub";
|
|
6
6
|
|
|
7
|
+
// TODO: Fix me. Broken due to migration (Error: unknown)
|
|
7
8
|
describe('TTYG view', () => {
|
|
8
9
|
|
|
9
10
|
const repositoryId = 'starwars';
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import {UserAndAccessSteps} from "../../../steps/setup/user-and-access-steps";
|
|
2
|
+
import {LicenseStubs} from "../../../stubs/license-stubs";
|
|
3
|
+
import {LoginSteps} from "../../../steps/login-steps";
|
|
4
|
+
import {ModalDialogSteps} from "../../../steps/modal-dialog-steps";
|
|
5
|
+
import HomeSteps from "../../../steps/home-steps";
|
|
6
|
+
|
|
7
|
+
Cypress.env('set_default_user_data', false);
|
|
8
|
+
|
|
9
|
+
describe('Cookie policy', () => {
|
|
10
|
+
|
|
11
|
+
let repository;
|
|
12
|
+
|
|
13
|
+
beforeEach(() => {
|
|
14
|
+
cy.loginAsAdmin().then(() => {
|
|
15
|
+
cy.switchOffFreeAccess(true);
|
|
16
|
+
cy.switchOffSecurity(true);
|
|
17
|
+
});
|
|
18
|
+
cy.setDefaultUserData(false);
|
|
19
|
+
LicenseStubs.stubFreeLicense();
|
|
20
|
+
repository = 'cypress-test-cookie-policy-security-' + Date.now();
|
|
21
|
+
cy.createRepository({id: repository});
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
afterEach(() => {
|
|
25
|
+
cy.deleteRepository(repository, true);
|
|
26
|
+
cy.loginAsAdmin().then(() => {
|
|
27
|
+
cy.switchOffFreeAccess(true);
|
|
28
|
+
cy.switchOffSecurity(true);
|
|
29
|
+
cy.setDefaultUserData();
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
it('should show the consent popup if free access is on and the user is on the login page', () => {
|
|
34
|
+
// Given: Security is enabled and free access is on
|
|
35
|
+
UserAndAccessSteps.visitInProdMode();
|
|
36
|
+
UserAndAccessSteps.toggleSecurity();
|
|
37
|
+
LoginSteps.loginWithUser('admin', 'root');
|
|
38
|
+
// And: Free access is enabled
|
|
39
|
+
UserAndAccessSteps.getFreeAccessSwitchInput().should('not.be.checked');
|
|
40
|
+
UserAndAccessSteps.toggleFreeAccess();
|
|
41
|
+
UserAndAccessSteps.clickFreeWriteAccessRepo(repository);
|
|
42
|
+
ModalDialogSteps.clickOKButton();
|
|
43
|
+
|
|
44
|
+
// When: The user visits the login page
|
|
45
|
+
LoginSteps.visitInProdMode();
|
|
46
|
+
// Then: The cookie policy popup should be shown
|
|
47
|
+
HomeSteps.getCookieConsentPopup().should('exist').and('be.visible');
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
it('should not show the consent popup if free access is off and the user is on the login page', () => {
|
|
51
|
+
// Given: Security is enabled and free access is off
|
|
52
|
+
UserAndAccessSteps.visitInProdMode();
|
|
53
|
+
UserAndAccessSteps.toggleSecurity();
|
|
54
|
+
LoginSteps.loginWithUser('admin', 'root');
|
|
55
|
+
UserAndAccessSteps.getFreeAccessSwitchInput().should('not.be.checked');
|
|
56
|
+
|
|
57
|
+
// When: The user logs out and visits the login page
|
|
58
|
+
LoginSteps.logout();
|
|
59
|
+
// Then: The cookie policy popup should not be shown
|
|
60
|
+
HomeSteps.getCookieConsentPopup().should('not.exist');
|
|
61
|
+
LoginSteps.visitInProdMode();
|
|
62
|
+
HomeSteps.getCookieConsentPopup().should('not.exist');
|
|
63
|
+
});
|
|
64
|
+
});
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { MainMenuSteps } from "../../../steps/main-menu-steps";
|
|
2
|
+
import {UserAndAccessSteps} from "../../../steps/setup/user-and-access-steps";
|
|
3
|
+
import { LoginSteps } from "../../../steps/login-steps";
|
|
4
|
+
import {ToasterSteps} from "../../../steps/toaster-steps";
|
|
5
|
+
import {YasqeSteps} from "../../../steps/yasgui/yasqe-steps";
|
|
6
|
+
import {YasrSteps} from "../../../steps/yasgui/yasr-steps";
|
|
7
|
+
|
|
8
|
+
describe('User Management – Creation, Validation, Permissions & Deletion', () => {
|
|
9
|
+
let repositoryId;
|
|
10
|
+
const testPassword = 'P@ssw0rd123!';
|
|
11
|
+
const testUsername = `testuser-${Date.now()}`;
|
|
12
|
+
|
|
13
|
+
beforeEach(() => {
|
|
14
|
+
// Create and initialize a fresh repository for isolation
|
|
15
|
+
repositoryId = `repo-${Date.now()}`;
|
|
16
|
+
cy.createRepository({ id: repositoryId });
|
|
17
|
+
cy.presetRepository(repositoryId);
|
|
18
|
+
cy.initializeRepository(repositoryId);
|
|
19
|
+
|
|
20
|
+
// Navigate to Users & Access
|
|
21
|
+
UserAndAccessSteps.visit();
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
afterEach(() => {
|
|
25
|
+
// Clean up repository
|
|
26
|
+
cy.deleteRepository(repositoryId);
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
describe('Create a new user – validation', () => {
|
|
30
|
+
beforeEach(() => {
|
|
31
|
+
UserAndAccessSteps.clickCreateNewUserButton();
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it('should show error when username is empty', () => {
|
|
35
|
+
UserAndAccessSteps.typePassword(testPassword);
|
|
36
|
+
UserAndAccessSteps.typeConfirmPasswordField(testPassword);
|
|
37
|
+
UserAndAccessSteps.clickReadAccessRepo(repositoryId);
|
|
38
|
+
UserAndAccessSteps.clickWriteAccessRepo(repositoryId);
|
|
39
|
+
UserAndAccessSteps.confirmUserCreate();
|
|
40
|
+
UserAndAccessSteps.getUserFieldError('username').should('be.visible').and('contain.text', 'Enter username!');
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
it('should show error when passwords are empty', () => {
|
|
44
|
+
UserAndAccessSteps.typeUsername(testUsername);
|
|
45
|
+
UserAndAccessSteps.confirmUserCreate();
|
|
46
|
+
UserAndAccessSteps.getUserFieldError('password').should('be.visible').and('contain.text', 'Enter password!');
|
|
47
|
+
UserAndAccessSteps.getUserFieldError('confirmPassword').should('be.visible').and('contain.text', 'Confirm password!');
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
it('should show error when passwords do not match', () => {
|
|
51
|
+
UserAndAccessSteps.typeUsername(testUsername);
|
|
52
|
+
UserAndAccessSteps.typePassword(testPassword);
|
|
53
|
+
UserAndAccessSteps.typeConfirmPasswordField('Different123!');
|
|
54
|
+
UserAndAccessSteps.clickReadAccessRepo(repositoryId);
|
|
55
|
+
UserAndAccessSteps.clickWriteAccessRepo(repositoryId);
|
|
56
|
+
UserAndAccessSteps.confirmUserCreate();
|
|
57
|
+
UserAndAccessSteps.getUserFieldError('confirmPassword').should('be.visible').and('contain.text', 'Confirm password!');
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
it('should show error when username duplicates existing one', () => {
|
|
61
|
+
UserAndAccessSteps.typeUsername('user');
|
|
62
|
+
UserAndAccessSteps.typePassword(testPassword);
|
|
63
|
+
UserAndAccessSteps.typeConfirmPasswordField(testPassword);
|
|
64
|
+
UserAndAccessSteps.clickReadAccessRepo(repositoryId);
|
|
65
|
+
UserAndAccessSteps.clickWriteAccessRepo(repositoryId);
|
|
66
|
+
UserAndAccessSteps.confirmUserCreate();
|
|
67
|
+
|
|
68
|
+
cy.url().should('include', '/users');
|
|
69
|
+
UserAndAccessSteps.clickCreateNewUserButton();
|
|
70
|
+
UserAndAccessSteps.typeUsername('user');
|
|
71
|
+
UserAndAccessSteps.typePassword(testPassword);
|
|
72
|
+
UserAndAccessSteps.typeConfirmPasswordField(testPassword);
|
|
73
|
+
UserAndAccessSteps.clickWriteAccessRepo(repositoryId);
|
|
74
|
+
UserAndAccessSteps.confirmUserCreate();
|
|
75
|
+
|
|
76
|
+
ToasterSteps.verifyError('An account with the given username already exists.');
|
|
77
|
+
cy.deleteUser('user');
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
it('should show error when no repository read access is given', () => {
|
|
81
|
+
UserAndAccessSteps.typeUsername(testUsername);
|
|
82
|
+
UserAndAccessSteps.typePassword(testPassword);
|
|
83
|
+
UserAndAccessSteps.typeConfirmPasswordField(testPassword);
|
|
84
|
+
UserAndAccessSteps.confirmUserCreate();
|
|
85
|
+
UserAndAccessSteps.getRepositoryRightsError().should('be.visible').and('contain.text', 'Users should have rights to at least one repository!');
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
it('should show error when custom role is too short', () => {
|
|
89
|
+
UserAndAccessSteps.typeUsername(testUsername);
|
|
90
|
+
UserAndAccessSteps.typePassword(testPassword);
|
|
91
|
+
UserAndAccessSteps.typeConfirmPasswordField(testPassword);
|
|
92
|
+
UserAndAccessSteps.addTextToCustomRoleField('a');
|
|
93
|
+
UserAndAccessSteps.clickReadAccessRepo(repositoryId);
|
|
94
|
+
UserAndAccessSteps.clickWriteAccessRepo(repositoryId);
|
|
95
|
+
UserAndAccessSteps.getCustomRoleFieldError().should('be.visible').and('contain.text', 'Must be at least 2 symbols long');
|
|
96
|
+
});
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
describe('Create a new user – read/write access', () => {
|
|
100
|
+
const rwUsername = `rwuser-${Date.now()}`;
|
|
101
|
+
|
|
102
|
+
afterEach(() =>{
|
|
103
|
+
cy.loginAsAdmin();
|
|
104
|
+
cy.switchOffSecurity(true);
|
|
105
|
+
cy.deleteUser(rwUsername);
|
|
106
|
+
})
|
|
107
|
+
|
|
108
|
+
it('should create, login, and verify permissions', () => {
|
|
109
|
+
UserAndAccessSteps.clickCreateNewUserButton();
|
|
110
|
+
UserAndAccessSteps.typeUsername(rwUsername);
|
|
111
|
+
UserAndAccessSteps.typePassword(testPassword);
|
|
112
|
+
UserAndAccessSteps.typeConfirmPasswordField(testPassword);
|
|
113
|
+
UserAndAccessSteps.clickReadAccessRepo(repositoryId);
|
|
114
|
+
UserAndAccessSteps.clickWriteAccessRepo(repositoryId);
|
|
115
|
+
UserAndAccessSteps.getWriteAccessForRepo(repositoryId).should('be.checked');
|
|
116
|
+
UserAndAccessSteps.confirmUserCreate();
|
|
117
|
+
UserAndAccessSteps.toggleSecurity();
|
|
118
|
+
|
|
119
|
+
LoginSteps.loginWithUser(rwUsername, testPassword);
|
|
120
|
+
// RepositorySteps.selectRepoFromDropdown(repositoryId);
|
|
121
|
+
MainMenuSteps.clickOnSparqlMenu();
|
|
122
|
+
|
|
123
|
+
YasqeSteps.clearEditor();
|
|
124
|
+
const prefix = 'PREFIX ex: <http://example.org/>\n';
|
|
125
|
+
const query = 'INSERT DATA {\n' +
|
|
126
|
+
'ex:greeting ex:text "Hello, world!" .\n' +
|
|
127
|
+
'}';
|
|
128
|
+
cy.pasteIntoCodeMirror('.CodeMirror', prefix + query);
|
|
129
|
+
YasqeSteps.executeQueryWithoutWaiteResult();
|
|
130
|
+
// Verify read access
|
|
131
|
+
YasrSteps.getResponseInfo()
|
|
132
|
+
.should('not.have.class', 'hidden')
|
|
133
|
+
.should('not.have.class', 'empty')
|
|
134
|
+
.should('be.visible')
|
|
135
|
+
.should('contain.text', 'Added 1 statements.');
|
|
136
|
+
|
|
137
|
+
LoginSteps.logout();
|
|
138
|
+
});
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
describe('Create a new user – read only access', () => {
|
|
142
|
+
const roUsername = `rouser-${Date.now()}`;
|
|
143
|
+
|
|
144
|
+
afterEach(() =>{
|
|
145
|
+
cy.loginAsAdmin();
|
|
146
|
+
cy.switchOffSecurity(true);
|
|
147
|
+
cy.deleteUser(roUsername);
|
|
148
|
+
})
|
|
149
|
+
|
|
150
|
+
it('should create, login, and verify read-only', () => {
|
|
151
|
+
UserAndAccessSteps.clickCreateNewUserButton();
|
|
152
|
+
UserAndAccessSteps.typeUsername(roUsername);
|
|
153
|
+
UserAndAccessSteps.typePassword(testPassword);
|
|
154
|
+
UserAndAccessSteps.typeConfirmPasswordField(testPassword);
|
|
155
|
+
UserAndAccessSteps.clickReadAccessRepo(repositoryId);
|
|
156
|
+
UserAndAccessSteps.getReadAccessForRepo(repositoryId).should('be.checked');
|
|
157
|
+
UserAndAccessSteps.getWriteAccessForRepo(repositoryId).should('not.be.checked');
|
|
158
|
+
UserAndAccessSteps.confirmUserCreate();
|
|
159
|
+
UserAndAccessSteps.toggleSecurity();
|
|
160
|
+
|
|
161
|
+
LoginSteps.loginWithUser(roUsername, testPassword);
|
|
162
|
+
MainMenuSteps.clickOnSparqlMenu();
|
|
163
|
+
|
|
164
|
+
YasqeSteps.clearEditor();
|
|
165
|
+
const prefix = 'PREFIX ex: <http://example.org/>\n';
|
|
166
|
+
const query = 'INSERT DATA {\n' +
|
|
167
|
+
'ex:greeting ex:text "Hello, world!" .\n' +
|
|
168
|
+
'}';
|
|
169
|
+
cy.pasteIntoCodeMirror('.CodeMirror', prefix + query);
|
|
170
|
+
// Verify no write access
|
|
171
|
+
YasqeSteps.executeErrorQuery();
|
|
172
|
+
|
|
173
|
+
YasqeSteps.clearEditor();
|
|
174
|
+
const readQuery = 'select * where {\n' +
|
|
175
|
+
'?s ?p ?o .\n' +
|
|
176
|
+
'} limit 100';
|
|
177
|
+
cy.pasteIntoCodeMirror('.CodeMirror', readQuery);
|
|
178
|
+
// Verify read accessorQuery();
|
|
179
|
+
YasqeSteps.executeQuery();
|
|
180
|
+
|
|
181
|
+
LoginSteps.logout();
|
|
182
|
+
});
|
|
183
|
+
});
|
|
184
|
+
});
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import {UserAndAccessSteps} from "../../../steps/setup/user-and-access-steps";
|
|
2
|
+
import {LoginSteps} from "../../../steps/login-steps";
|
|
3
|
+
import {GraphqlPlaygroundSteps} from "../../../steps/graphql/graphql-playground-steps";
|
|
4
|
+
import {RepositorySteps} from "../../../steps/repository-steps";
|
|
5
|
+
|
|
6
|
+
describe('GraphQL-only User – Playground Access & Mutation Restriction', () => {
|
|
7
|
+
let repositoryId;
|
|
8
|
+
const gqlUsername = `gqluser-${Date.now()}`;
|
|
9
|
+
const testPassword = 'P@ssw0rd123!';
|
|
10
|
+
const readQuery = `
|
|
11
|
+
query StarshipById {
|
|
12
|
+
starship(ID: "https://swapi.co/resource/starship/9") {
|
|
13
|
+
name
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
`;
|
|
17
|
+
const mutation = `
|
|
18
|
+
mutation CreateHuman {
|
|
19
|
+
create_Human(
|
|
20
|
+
objects: [
|
|
21
|
+
{
|
|
22
|
+
id: "file:/test/onto/vocabulary/Human1",
|
|
23
|
+
rdfs_label: "New human with specific iri id"
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
) {
|
|
27
|
+
human { id }
|
|
28
|
+
affected_objects { ids }
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
`;
|
|
32
|
+
|
|
33
|
+
beforeEach(() => {
|
|
34
|
+
repositoryId = `repo-${Date.now()}`;
|
|
35
|
+
cy.createRepository({ id: repositoryId });
|
|
36
|
+
cy.presetRepository(repositoryId);
|
|
37
|
+
cy.importServerFile(repositoryId, 'swapi-dataset.ttl');
|
|
38
|
+
cy.uploadGraphqlSchema(repositoryId, 'graphql/soml/swapi-schema.yaml', 'swapi');
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
afterEach(() => {
|
|
42
|
+
cy.loginAsAdmin();
|
|
43
|
+
cy.switchOffSecurity(true);
|
|
44
|
+
cy.deleteUser(gqlUsername);
|
|
45
|
+
cy.deleteRepository(repositoryId);
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
it('should see only the assigned repo, block SPARQL, allow GraphQL read and forbid writes, and hide create-repo everywhere', () => {
|
|
49
|
+
UserAndAccessSteps.visit();
|
|
50
|
+
UserAndAccessSteps.clickCreateNewUserButton();
|
|
51
|
+
UserAndAccessSteps.typeUsername(gqlUsername);
|
|
52
|
+
UserAndAccessSteps.typePassword(testPassword);
|
|
53
|
+
UserAndAccessSteps.typeConfirmPasswordField(testPassword);
|
|
54
|
+
UserAndAccessSteps.clickReadAccessRepo(repositoryId);
|
|
55
|
+
UserAndAccessSteps.clickGraphqlAccessRepo(repositoryId);
|
|
56
|
+
UserAndAccessSteps.confirmUserCreate();
|
|
57
|
+
|
|
58
|
+
UserAndAccessSteps.toggleSecurity();
|
|
59
|
+
|
|
60
|
+
// Log in as GraphQL-only user
|
|
61
|
+
LoginSteps.loginWithUser(gqlUsername, testPassword);
|
|
62
|
+
RepositorySteps.selectRepoFromDropdown(repositoryId);
|
|
63
|
+
// Verify only the assigned repository appears in endpoints
|
|
64
|
+
GraphqlPlaygroundSteps.visit();
|
|
65
|
+
GraphqlPlaygroundSteps.getView().should('be.visible');
|
|
66
|
+
GraphqlPlaygroundSteps.getQueryEditor().should('be.visible');
|
|
67
|
+
GraphqlPlaygroundSteps.getSelectedEndpoint().should('have.text', 'swapi');
|
|
68
|
+
// And I can execute a query on the countries endpoint
|
|
69
|
+
GraphqlPlaygroundSteps.setInEditor(readQuery);
|
|
70
|
+
// And I execute the query
|
|
71
|
+
GraphqlPlaygroundSteps.executeQuery();
|
|
72
|
+
// Then I get expected result
|
|
73
|
+
GraphqlPlaygroundSteps.getResponse().should('contain', '"name": "Death Star"');
|
|
74
|
+
|
|
75
|
+
// Execute the create_Human mutation → expect errors
|
|
76
|
+
GraphqlPlaygroundSteps.setInEditor(mutation);
|
|
77
|
+
GraphqlPlaygroundSteps.executeQuery();
|
|
78
|
+
GraphqlPlaygroundSteps.getResponse().should('contain.text', 'errors');
|
|
79
|
+
LoginSteps.logout();
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
it('should allow GraphQL mutation and hide SPARQL/Import/Create-repo menus', () => {
|
|
83
|
+
UserAndAccessSteps.visit();
|
|
84
|
+
UserAndAccessSteps.clickCreateNewUserButton();
|
|
85
|
+
UserAndAccessSteps.typeUsername(gqlUsername);
|
|
86
|
+
UserAndAccessSteps.typePassword(testPassword);
|
|
87
|
+
UserAndAccessSteps.typeConfirmPasswordField(testPassword);
|
|
88
|
+
UserAndAccessSteps.clickReadAccessRepo(repositoryId);
|
|
89
|
+
UserAndAccessSteps.clickWriteAccessRepo(repositoryId);
|
|
90
|
+
UserAndAccessSteps.clickGraphqlAccessRepo(repositoryId);
|
|
91
|
+
UserAndAccessSteps.confirmUserCreate();
|
|
92
|
+
|
|
93
|
+
UserAndAccessSteps.toggleSecurity();
|
|
94
|
+
|
|
95
|
+
// Log in as the new user
|
|
96
|
+
LoginSteps.loginWithUser(gqlUsername, testPassword);
|
|
97
|
+
|
|
98
|
+
// Select the repo in the navbar
|
|
99
|
+
RepositorySteps.selectRepoFromDropdown(repositoryId);
|
|
100
|
+
|
|
101
|
+
// Visit GraphQL Playground
|
|
102
|
+
GraphqlPlaygroundSteps.visit();
|
|
103
|
+
GraphqlPlaygroundSteps.getView().should('be.visible');
|
|
104
|
+
GraphqlPlaygroundSteps.getQueryEditor().should('be.visible');
|
|
105
|
+
GraphqlPlaygroundSteps.getSelectedEndpoint().should('have.text', 'swapi');
|
|
106
|
+
|
|
107
|
+
// Execute a read query to verify read access
|
|
108
|
+
GraphqlPlaygroundSteps.setInEditor(readQuery);
|
|
109
|
+
GraphqlPlaygroundSteps.executeQuery();
|
|
110
|
+
GraphqlPlaygroundSteps.getResponse()
|
|
111
|
+
.should('contain.text', '"name": "Death Star"');
|
|
112
|
+
|
|
113
|
+
// Execute the mutation and expect success
|
|
114
|
+
GraphqlPlaygroundSteps.setInEditor(mutation);
|
|
115
|
+
GraphqlPlaygroundSteps.executeQuery();
|
|
116
|
+
GraphqlPlaygroundSteps.getResponse()
|
|
117
|
+
.should('contain.text', 'data')
|
|
118
|
+
.and('contain.text', 'create_Human')
|
|
119
|
+
.and('contain.text', 'affected_objects');
|
|
120
|
+
|
|
121
|
+
LoginSteps.logout();
|
|
122
|
+
});
|
|
123
|
+
});
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import {UserAndAccessSteps} from "../../../steps/setup/user-and-access-steps";
|
|
2
|
+
import {LoginSteps} from "../../../steps/login-steps";
|
|
3
|
+
import {YasqeSteps} from "../../../steps/yasgui/yasqe-steps";
|
|
4
|
+
import {YasrSteps} from "../../../steps/yasgui/yasr-steps";
|
|
5
|
+
import {MainMenuSteps} from "../../../steps/main-menu-steps";
|
|
6
|
+
import HomeSteps from "../../../steps/home-steps";
|
|
7
|
+
import {ActiveRepositoryWidgetSteps} from "../../../steps/widgets/active-repository-widget-steps";
|
|
8
|
+
|
|
9
|
+
describe('Repository Admin – Permissions and Access Control', () => {
|
|
10
|
+
const repoAdminUsername = `repoadmin-${Date.now()}`;
|
|
11
|
+
const password = 'Admin123!';
|
|
12
|
+
let repositoryId;
|
|
13
|
+
|
|
14
|
+
beforeEach(() => {
|
|
15
|
+
repositoryId = `repo-${Date.now()}`;
|
|
16
|
+
cy.createRepository({ id: repositoryId });
|
|
17
|
+
cy.presetRepository(repositoryId);
|
|
18
|
+
cy.initializeRepository(repositoryId);
|
|
19
|
+
|
|
20
|
+
UserAndAccessSteps.visit();
|
|
21
|
+
UserAndAccessSteps.clickCreateNewUserButton();
|
|
22
|
+
UserAndAccessSteps.typeUsername(repoAdminUsername);
|
|
23
|
+
UserAndAccessSteps.typePassword(password);
|
|
24
|
+
UserAndAccessSteps.typeConfirmPasswordField(password);
|
|
25
|
+
UserAndAccessSteps.selectRoleRadioButton('#roleRepoAdmin');
|
|
26
|
+
|
|
27
|
+
UserAndAccessSteps.getReadAccessForRepo('*').should('be.checked').and('be.disabled');
|
|
28
|
+
UserAndAccessSteps.getWriteAccessForRepo('*').should('be.checked').and('be.disabled');
|
|
29
|
+
|
|
30
|
+
UserAndAccessSteps.confirmUserCreate();
|
|
31
|
+
UserAndAccessSteps.toggleSecurity();
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
afterEach(() => {
|
|
35
|
+
cy.loginAsAdmin();
|
|
36
|
+
cy.switchOffSecurity(true);
|
|
37
|
+
cy.deleteUser(repoAdminUsername);
|
|
38
|
+
cy.deleteRepository(repositoryId);
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
it('Repository admin has correct access and restrictions', () => {
|
|
42
|
+
LoginSteps.loginWithUser(repoAdminUsername, password);
|
|
43
|
+
|
|
44
|
+
// SPARQL – read access
|
|
45
|
+
MainMenuSteps.clickOnSparqlMenu();
|
|
46
|
+
|
|
47
|
+
YasqeSteps.getEditor().should('be.visible');
|
|
48
|
+
YasqeSteps.executeQuery();
|
|
49
|
+
|
|
50
|
+
// SPARQL – write access
|
|
51
|
+
YasqeSteps.clearEditor();
|
|
52
|
+
const prefix = 'PREFIX ex: <http://example.org/>\n';
|
|
53
|
+
const query = 'INSERT DATA {\n' +
|
|
54
|
+
'ex:greeting ex:text "Hello, world!" .\n' +
|
|
55
|
+
'}';
|
|
56
|
+
cy.pasteIntoCodeMirror('.CodeMirror', prefix + query);
|
|
57
|
+
YasqeSteps.executeQueryWithoutWaiteResult();
|
|
58
|
+
// Verify read access
|
|
59
|
+
YasrSteps.getResponseInfo()
|
|
60
|
+
.should('not.have.class', 'hidden')
|
|
61
|
+
.should('not.have.class', 'empty')
|
|
62
|
+
.should('be.visible')
|
|
63
|
+
.should('contain.text', 'Added 1 statements.');
|
|
64
|
+
|
|
65
|
+
// Create repo button on homepage should be visible
|
|
66
|
+
HomeSteps.visit();
|
|
67
|
+
ActiveRepositoryWidgetSteps.getImportLink().scrollIntoView().should('be.visible').and('not.be.disabled');
|
|
68
|
+
});
|
|
69
|
+
});
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import {MainMenuSteps} from "../../../steps/main-menu-steps";
|
|
2
|
+
import {UserAndAccessSteps} from "../../../steps/setup/user-and-access-steps";
|
|
3
|
+
import {LoginSteps} from "../../../steps/login-steps";
|
|
4
|
+
import {ToasterSteps} from "../../../steps/toaster-steps";
|
|
5
|
+
|
|
6
|
+
describe('Turn on Security', () => {
|
|
7
|
+
|
|
8
|
+
beforeEach(() => {
|
|
9
|
+
cy.loginAsAdmin();
|
|
10
|
+
cy.switchOnSecurity();
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
afterEach(() =>{
|
|
14
|
+
cy.loginAsAdmin();
|
|
15
|
+
cy.switchOffSecurity(true);
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
it('should enable security and show login screen with only Help accessible', () => {
|
|
19
|
+
// Navigate to Users & Access
|
|
20
|
+
UserAndAccessSteps.visit();
|
|
21
|
+
// Verify we are redirected to login page
|
|
22
|
+
cy.url().should('include', '/login');
|
|
23
|
+
MainMenuSteps.getMenuHelp().should('not.exist');
|
|
24
|
+
MainMenuSteps.getMenuExplore().should('not.exist');
|
|
25
|
+
MainMenuSteps.getMenuMonitoring().should('not.exist');
|
|
26
|
+
MainMenuSteps.getMenuSetup().should('not.exist');
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
it('should reject wrong credentials and accept admin/root', () => {
|
|
30
|
+
// Attempt login with invalid credentials
|
|
31
|
+
LoginSteps.visitLoginPage();
|
|
32
|
+
LoginSteps.loginWithUser('wrongUser', 'wrongPass');
|
|
33
|
+
// Expect error message
|
|
34
|
+
ToasterSteps.verifyError('Wrong credentials');
|
|
35
|
+
|
|
36
|
+
// Login with correct admin credentials
|
|
37
|
+
LoginSteps.visitLoginPage();
|
|
38
|
+
LoginSteps.loginWithUser('admin', 'root');
|
|
39
|
+
cy.url().should('include', '/');
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
it('should change admin password and enforce new credentials', () => {
|
|
43
|
+
// Navigate to Users & Access after login
|
|
44
|
+
UserAndAccessSteps.visit();
|
|
45
|
+
// Verify we are redirected to login page
|
|
46
|
+
cy.url().should('include', '/login');
|
|
47
|
+
LoginSteps.loginWithUser('admin', 'root');
|
|
48
|
+
|
|
49
|
+
// Open edit page for admin user
|
|
50
|
+
UserAndAccessSteps.openEditUserPage('admin');
|
|
51
|
+
|
|
52
|
+
// Change password to a new value
|
|
53
|
+
let newPassword = 'MyNewP@ssw0rd!';
|
|
54
|
+
UserAndAccessSteps.typePassword(newPassword);
|
|
55
|
+
UserAndAccessSteps.typeConfirmPasswordField(newPassword);
|
|
56
|
+
UserAndAccessSteps.confirmUserEdit();
|
|
57
|
+
|
|
58
|
+
// Log out
|
|
59
|
+
LoginSteps.logout();
|
|
60
|
+
cy.url().should('include', '/login');
|
|
61
|
+
|
|
62
|
+
// Attempt login with old password
|
|
63
|
+
LoginSteps.loginWithUser('admin', 'root');
|
|
64
|
+
ToasterSteps.verifyError('Wrong credentials');
|
|
65
|
+
|
|
66
|
+
// Attempt login with new password
|
|
67
|
+
LoginSteps.visitLoginPage();
|
|
68
|
+
LoginSteps.loginWithUser('admin', newPassword);
|
|
69
|
+
UserAndAccessSteps.visit();
|
|
70
|
+
// Open edit page for admin user
|
|
71
|
+
UserAndAccessSteps.openEditUserPage('admin');
|
|
72
|
+
newPassword = 'root';
|
|
73
|
+
UserAndAccessSteps.typePassword(newPassword);
|
|
74
|
+
UserAndAccessSteps.typeConfirmPasswordField(newPassword);
|
|
75
|
+
UserAndAccessSteps.confirmUserEdit();
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
it('should show toaster when after logging out', () => {
|
|
79
|
+
UserAndAccessSteps.visit();
|
|
80
|
+
LoginSteps.loginWithUser('admin', 'root');
|
|
81
|
+
// Log out
|
|
82
|
+
LoginSteps.logout();
|
|
83
|
+
cy.url().should('include', '/login');
|
|
84
|
+
// Verify toaster message
|
|
85
|
+
ToasterSteps.verifySuccess('Signed out');
|
|
86
|
+
})
|
|
87
|
+
});
|