graphdb-workbench-tests 3.5.0-TR2 → 3.5.0-TR4
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/e2e-legacy/setup/aclmanagement/create-rule.spec.js +1 -1
- package/e2e-legacy/setup/aclmanagement/delete-rule.spec.js +1 -1
- package/e2e-legacy/setup/aclmanagement/edit-rule.spec.js +1 -1
- package/e2e-legacy/setup/aclmanagement/render-rules.spec.js +1 -1
- package/e2e-legacy/setup/aclmanagement/reorder-rules.spec.js +1 -1
- package/e2e-legacy/setup/aclmanagement/revert-rules.spec.js +1 -1
- package/e2e-legacy/setup/aclmanagement/scopes.spec.js +2 -2
- package/e2e-legacy/setup/aclmanagement/update-rules.spec.js +2 -2
- package/e2e-legacy/setup/jdbc/jdbc-create.spec.js +1 -1
- package/e2e-legacy/setup/users-and-access/user-and-access.spec.js +662 -338
- package/e2e-legacy/sparql-editor/saved-query/readonly-query.spec.js +1 -1
- package/e2e-legacy/ttyg/agent-select-menu.spec.js +7 -1
- package/e2e-legacy/ttyg/edit-agent.spec.js +2 -2
- package/e2e-legacy/ttyg/ttyg-permission.spec.js +2 -1
- package/e2e-security/setup/users-and-access/create-user-permissions.spec.js +15 -15
- package/e2e-security/setup/users-and-access/graphql-user.spec.js +3 -3
- package/e2e-security/setup/users-and-access/repo-admin-role.spec.js +2 -2
- package/eslint.config.js +1 -0
- package/npm-shrinkwrap.json +2 -2
- package/package.json +2 -2
- package/steps/application-steps.js +1 -1
- package/steps/deprecation-banner/deprecation-banner-steps.js +13 -0
- package/steps/main-menu-steps.js +5 -1
- package/steps/repository-steps.js +44 -3
- package/steps/setup/user-and-access-steps.js +81 -53
- package/steps/ttyg/ttyg-view-steps.js +3 -0
- package/stubs/security-stubs.js +4 -0
|
@@ -32,7 +32,7 @@ describe('Readonly saved query', () => {
|
|
|
32
32
|
});
|
|
33
33
|
|
|
34
34
|
it('Should not allow modifying a saved query if it is readonly', () => {
|
|
35
|
-
SparqlEditorSteps.visitSparqlEditorPage()
|
|
35
|
+
SparqlEditorSteps.visitSparqlEditorPage();
|
|
36
36
|
// Given: There is a public saved query created by a user.
|
|
37
37
|
LoginSteps.loginWithUser(USER_NAME, PASSWORD);
|
|
38
38
|
YasguiSteps.getYasgui().should('be.visible');
|
|
@@ -7,6 +7,10 @@ describe('TTYG agent select menu', () => {
|
|
|
7
7
|
|
|
8
8
|
const repositoryId = 'starwars';
|
|
9
9
|
|
|
10
|
+
beforeEach(() => {
|
|
11
|
+
cy.clearLocalStorage('ls.ttyg');
|
|
12
|
+
});
|
|
13
|
+
|
|
10
14
|
beforeEach(() => {
|
|
11
15
|
RepositoriesStubs.stubRepositories(0, '/repositories/get-ttyg-repositories.json');
|
|
12
16
|
RepositoriesStubs.stubBaseEndpoints(repositoryId);
|
|
@@ -52,7 +56,8 @@ describe('TTYG agent select menu', () => {
|
|
|
52
56
|
TTYGViewSteps.getAgentsDropdownMenu().should('be.visible');
|
|
53
57
|
});
|
|
54
58
|
|
|
55
|
-
|
|
59
|
+
// FIXME: The tests fails on GDB Build pipeline, but works locally. The problem is that there is a preselected agent in the dropdown and the label is not "Select an agent"
|
|
60
|
+
it.skip('Should be able to select agent from the menu', () => {
|
|
56
61
|
TTYGStubs.stubAgentListGet();
|
|
57
62
|
// Given I have opened the ttyg page
|
|
58
63
|
TTYGViewSteps.visit();
|
|
@@ -91,6 +96,7 @@ describe('TTYG agent select menu', () => {
|
|
|
91
96
|
TTYGViewSteps.triggerDeleteAgentActionMenu(0);
|
|
92
97
|
ModalDialogSteps.confirm();
|
|
93
98
|
ModalDialogSteps.getDialog().should('not.exist');
|
|
99
|
+
cy.wait('@delete-agent');
|
|
94
100
|
// TODO: the agents list filter brakes after deleting an agent!!!
|
|
95
101
|
TTYGViewSteps.selectAllAgentsFilter();
|
|
96
102
|
TTYGViewSteps.getAgents().should('have.length', 3);
|
|
@@ -145,8 +145,8 @@ describe('TTYG edit an agent', () => {
|
|
|
145
145
|
|
|
146
146
|
it('should show Context size if not openai-assistants API', () => {
|
|
147
147
|
// Open TTYG page and select first agent
|
|
148
|
-
TTYGViewSteps.visit();
|
|
149
148
|
TTYGStubs.stubForApiType('default');
|
|
149
|
+
TTYGViewSteps.visit();
|
|
150
150
|
cy.wait('@get-agent-list');
|
|
151
151
|
TTYGViewSteps.openAgentSettingsModalForAgent(0);
|
|
152
152
|
|
|
@@ -168,8 +168,8 @@ describe('TTYG edit an agent', () => {
|
|
|
168
168
|
|
|
169
169
|
it('should NOT show Context size if openai-assistants API', () => {
|
|
170
170
|
// Open TTYG page and select first agent
|
|
171
|
-
TTYGViewSteps.visit();
|
|
172
171
|
TTYGStubs.stubForApiType('assistants');
|
|
172
|
+
TTYGViewSteps.visit();
|
|
173
173
|
cy.wait('@get-agent-list');
|
|
174
174
|
TTYGViewSteps.openAgentSettingsModalForAgent(0);
|
|
175
175
|
// Then I should see the Context size field
|
|
@@ -13,7 +13,8 @@ const PASSWORD = 'root';
|
|
|
13
13
|
const ENABLED = true;
|
|
14
14
|
const DISABLED = false;
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
// FIXME: There is a problem with the loader not hiding. Problem is reproducable on GDB build on branch 11.4 (commit 0ebd95d6) with 3.4.1-RC1
|
|
17
|
+
describe.skip('TTYG permissions', () => {
|
|
17
18
|
|
|
18
19
|
before(() => {
|
|
19
20
|
cy.loginAsAdmin();
|
|
@@ -38,8 +38,8 @@ describe('User Management – Creation, Validation, Permissions & Deletion', ()
|
|
|
38
38
|
it('should show error when username is empty', () => {
|
|
39
39
|
UserAndAccessSteps.typePassword(testPassword);
|
|
40
40
|
UserAndAccessSteps.typeConfirmPasswordField(testPassword);
|
|
41
|
-
UserAndAccessSteps.
|
|
42
|
-
UserAndAccessSteps.
|
|
41
|
+
UserAndAccessSteps.toggleReadAccessForRepo(repositoryId);
|
|
42
|
+
UserAndAccessSteps.toggleWriteAccessForRepo(repositoryId);
|
|
43
43
|
UserAndAccessSteps.confirmUserCreate();
|
|
44
44
|
UserAndAccessSteps.getUserFieldError('username').should('be.visible').and('contain.text', 'Enter username!');
|
|
45
45
|
});
|
|
@@ -55,8 +55,8 @@ describe('User Management – Creation, Validation, Permissions & Deletion', ()
|
|
|
55
55
|
UserAndAccessSteps.typeUsername(testUsername);
|
|
56
56
|
UserAndAccessSteps.typePassword(testPassword);
|
|
57
57
|
UserAndAccessSteps.typeConfirmPasswordField('Different123!');
|
|
58
|
-
UserAndAccessSteps.
|
|
59
|
-
UserAndAccessSteps.
|
|
58
|
+
UserAndAccessSteps.toggleReadAccessForRepo(repositoryId);
|
|
59
|
+
UserAndAccessSteps.toggleWriteAccessForRepo(repositoryId);
|
|
60
60
|
UserAndAccessSteps.confirmUserCreate();
|
|
61
61
|
UserAndAccessSteps.getUserFieldError('confirmPassword').should('be.visible').and('contain.text', 'Confirm password!');
|
|
62
62
|
});
|
|
@@ -65,8 +65,8 @@ describe('User Management – Creation, Validation, Permissions & Deletion', ()
|
|
|
65
65
|
UserAndAccessSteps.typeUsername('user');
|
|
66
66
|
UserAndAccessSteps.typePassword(testPassword);
|
|
67
67
|
UserAndAccessSteps.typeConfirmPasswordField(testPassword);
|
|
68
|
-
UserAndAccessSteps.
|
|
69
|
-
UserAndAccessSteps.
|
|
68
|
+
UserAndAccessSteps.toggleReadAccessForRepo(repositoryId);
|
|
69
|
+
UserAndAccessSteps.toggleWriteAccessForRepo(repositoryId);
|
|
70
70
|
UserAndAccessSteps.confirmUserCreate();
|
|
71
71
|
|
|
72
72
|
cy.url().should('include', '/users');
|
|
@@ -74,7 +74,7 @@ describe('User Management – Creation, Validation, Permissions & Deletion', ()
|
|
|
74
74
|
UserAndAccessSteps.typeUsername('user');
|
|
75
75
|
UserAndAccessSteps.typePassword(testPassword);
|
|
76
76
|
UserAndAccessSteps.typeConfirmPasswordField(testPassword);
|
|
77
|
-
UserAndAccessSteps.
|
|
77
|
+
UserAndAccessSteps.toggleWriteAccessForRepo(repositoryId);
|
|
78
78
|
UserAndAccessSteps.confirmUserCreate();
|
|
79
79
|
|
|
80
80
|
// Using the toaster from the shared components which has different class names
|
|
@@ -96,8 +96,8 @@ describe('User Management – Creation, Validation, Permissions & Deletion', ()
|
|
|
96
96
|
UserAndAccessSteps.typePassword(testPassword);
|
|
97
97
|
UserAndAccessSteps.typeConfirmPasswordField(testPassword);
|
|
98
98
|
UserAndAccessSteps.addTextToCustomRoleField('a');
|
|
99
|
-
UserAndAccessSteps.
|
|
100
|
-
UserAndAccessSteps.
|
|
99
|
+
UserAndAccessSteps.toggleReadAccessForRepo(repositoryId);
|
|
100
|
+
UserAndAccessSteps.toggleWriteAccessForRepo(repositoryId);
|
|
101
101
|
UserAndAccessSteps.getCustomRoleFieldError().should('be.visible').and('contain.text', 'Must be at least 2 symbols long');
|
|
102
102
|
});
|
|
103
103
|
});
|
|
@@ -116,9 +116,9 @@ describe('User Management – Creation, Validation, Permissions & Deletion', ()
|
|
|
116
116
|
UserAndAccessSteps.typeUsername(rwUsername);
|
|
117
117
|
UserAndAccessSteps.typePassword(testPassword);
|
|
118
118
|
UserAndAccessSteps.typeConfirmPasswordField(testPassword);
|
|
119
|
-
UserAndAccessSteps.
|
|
120
|
-
UserAndAccessSteps.
|
|
121
|
-
UserAndAccessSteps.
|
|
119
|
+
UserAndAccessSteps.toggleReadAccessForRepo(repositoryId);
|
|
120
|
+
UserAndAccessSteps.toggleWriteAccessForRepo(repositoryId);
|
|
121
|
+
UserAndAccessSteps.validateWriteAccessForRepo(repositoryId, {checked: true});
|
|
122
122
|
UserAndAccessSteps.confirmUserCreate();
|
|
123
123
|
UserAndAccessSteps.toggleSecurity();
|
|
124
124
|
|
|
@@ -159,9 +159,9 @@ describe('User Management – Creation, Validation, Permissions & Deletion', ()
|
|
|
159
159
|
UserAndAccessSteps.typeUsername(roUsername);
|
|
160
160
|
UserAndAccessSteps.typePassword(testPassword);
|
|
161
161
|
UserAndAccessSteps.typeConfirmPasswordField(testPassword);
|
|
162
|
-
UserAndAccessSteps.
|
|
163
|
-
UserAndAccessSteps.
|
|
164
|
-
UserAndAccessSteps.
|
|
162
|
+
UserAndAccessSteps.toggleReadAccessForRepo(repositoryId);
|
|
163
|
+
UserAndAccessSteps.validateReadAccessForRepo(repositoryId, {checked: true});
|
|
164
|
+
UserAndAccessSteps.validateWriteAccessForRepo(repositoryId, {checked: false});
|
|
165
165
|
UserAndAccessSteps.confirmUserCreate();
|
|
166
166
|
UserAndAccessSteps.toggleSecurity();
|
|
167
167
|
|
|
@@ -51,7 +51,7 @@ describe('GraphQL-only User – Playground Access & Mutation Restriction', () =>
|
|
|
51
51
|
UserAndAccessSteps.typeUsername(gqlUsername);
|
|
52
52
|
UserAndAccessSteps.typePassword(testPassword);
|
|
53
53
|
UserAndAccessSteps.typeConfirmPasswordField(testPassword);
|
|
54
|
-
UserAndAccessSteps.
|
|
54
|
+
UserAndAccessSteps.toggleReadAccessForRepo(repositoryId);
|
|
55
55
|
UserAndAccessSteps.clickGraphqlAccessRepo(repositoryId);
|
|
56
56
|
UserAndAccessSteps.confirmUserCreate();
|
|
57
57
|
|
|
@@ -88,8 +88,8 @@ describe('GraphQL-only User – Playground Access & Mutation Restriction', () =>
|
|
|
88
88
|
UserAndAccessSteps.typeUsername(gqlUsername);
|
|
89
89
|
UserAndAccessSteps.typePassword(testPassword);
|
|
90
90
|
UserAndAccessSteps.typeConfirmPasswordField(testPassword);
|
|
91
|
-
UserAndAccessSteps.
|
|
92
|
-
UserAndAccessSteps.
|
|
91
|
+
UserAndAccessSteps.toggleReadAccessForRepo(repositoryId);
|
|
92
|
+
UserAndAccessSteps.toggleWriteAccessForRepo(repositoryId);
|
|
93
93
|
UserAndAccessSteps.clickGraphqlAccessRepo(repositoryId);
|
|
94
94
|
UserAndAccessSteps.confirmUserCreate();
|
|
95
95
|
|
|
@@ -24,8 +24,8 @@ describe('Repository Admin – Permissions and Access Control', () => {
|
|
|
24
24
|
UserAndAccessSteps.typeConfirmPasswordField(password);
|
|
25
25
|
UserAndAccessSteps.selectRoleRadioButton('#roleRepoAdmin');
|
|
26
26
|
|
|
27
|
-
UserAndAccessSteps.
|
|
28
|
-
UserAndAccessSteps.
|
|
27
|
+
UserAndAccessSteps.validateReadAccessForRepo('*', {checked: true, disabled: true});
|
|
28
|
+
UserAndAccessSteps.validateWriteAccessForRepo('*', {checked: true, disabled: true});
|
|
29
29
|
|
|
30
30
|
UserAndAccessSteps.confirmUserCreate();
|
|
31
31
|
UserAndAccessSteps.toggleSecurity();
|
package/eslint.config.js
CHANGED
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "graphdb-workbench-tests",
|
|
3
|
-
"version": "3.5.0-
|
|
3
|
+
"version": "3.5.0-TR4",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "graphdb-workbench-tests",
|
|
9
|
-
"version": "3.5.0-
|
|
9
|
+
"version": "3.5.0-TR4",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"devDependencies": {
|
|
12
12
|
"@bahmutov/cypress-code-coverage": "^2.7.2",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "graphdb-workbench-tests",
|
|
3
|
-
"version": "3.5.0-
|
|
3
|
+
"version": "3.5.0-TR4",
|
|
4
4
|
"description": "Cypress tests for GraphDB workbench",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"cy:open-flaky": "cypress open --config-file cypress-flaky.config.js",
|
|
13
13
|
"cy:guides": "cypress run --config-file cypress-legacy.config.js --spec \"e2e-legacy/guides/**/*.spec.js\" --browser chrome",
|
|
14
14
|
"cy:run": "npm run cy:run-legacy && cypress run",
|
|
15
|
-
"cy:run:partial": "cypress run --config-file cypress-legacy.config.js --spec \"e2e-legacy
|
|
15
|
+
"cy:run:partial": "cypress run --config-file cypress-legacy.config.js --spec \"e2e-legacy/ttyg/**/*.spec.js\" --browser chrome",
|
|
16
16
|
"cy:run-legacy": "cypress run --config-file cypress-legacy.config.js --browser chrome",
|
|
17
17
|
"cy:run-security": "cypress run --config-file cypress-security.config.js --browser chrome",
|
|
18
18
|
"cy:run-legacy:coverage": "cypress run --config-file cypress-legacy.config.js --browser chrome",
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export class DeprecationSteps {
|
|
2
|
+
static getDeprecationBanner() {
|
|
3
|
+
return cy.get('onto-deprecation-banner');
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
static getCloseButton() {
|
|
7
|
+
return DeprecationSteps.getDeprecationBanner().find('.close-button');
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
static closeBanner() {
|
|
11
|
+
DeprecationSteps.getCloseButton().click();
|
|
12
|
+
}
|
|
13
|
+
}
|
package/steps/main-menu-steps.js
CHANGED
|
@@ -53,7 +53,11 @@ export class MainMenuSteps {
|
|
|
53
53
|
|
|
54
54
|
static clickOnMenu(menuName) {
|
|
55
55
|
// Forced it because some element as "Explore" for example has CSS pointer-events: none
|
|
56
|
-
MainMenuSteps.getMenuButton(menuName).
|
|
56
|
+
MainMenuSteps.getMenuButton(menuName).realClick();
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
static getSubmenuFor(menuName) {
|
|
60
|
+
return MainMenuSteps.getMainMenu().contains('.menu-element', menuName).find('.sub-menu');
|
|
57
61
|
}
|
|
58
62
|
|
|
59
63
|
static clickOnSubmenuTriggerElement(menuName) {
|
|
@@ -3,13 +3,17 @@ import {BaseSteps} from "./base-steps.js";
|
|
|
3
3
|
|
|
4
4
|
export class RepositorySteps extends BaseSteps {
|
|
5
5
|
|
|
6
|
-
static visit() {
|
|
6
|
+
static visit(waitPageLoaded = true) {
|
|
7
7
|
cy.intercept('/rest/locations').as('getLocations');
|
|
8
8
|
cy.intercept(REPOSITORIES_URL + '/all').as('getRepositories');
|
|
9
9
|
cy.visit('/repository');
|
|
10
|
-
|
|
10
|
+
if (waitPageLoaded) {
|
|
11
|
+
RepositorySteps.waitLoader();
|
|
12
|
+
}
|
|
11
13
|
cy.wait('@getLocations');
|
|
12
|
-
|
|
14
|
+
if (waitPageLoaded) {
|
|
15
|
+
RepositorySteps.waitUntilRepositoriesPageIsLoaded();
|
|
16
|
+
}
|
|
13
17
|
}
|
|
14
18
|
|
|
15
19
|
static visitEditPage(repositoryId) {
|
|
@@ -62,6 +66,11 @@ export class RepositorySteps extends BaseSteps {
|
|
|
62
66
|
return this.getRepositoriesList().find('.repository.active');
|
|
63
67
|
}
|
|
64
68
|
|
|
69
|
+
static getRepositories() {
|
|
70
|
+
return RepositorySteps.getRepositoriesList()
|
|
71
|
+
.find('.repository');
|
|
72
|
+
}
|
|
73
|
+
|
|
65
74
|
static getRepositoryFromList(repository) {
|
|
66
75
|
RepositorySteps.waitLoader();
|
|
67
76
|
return RepositorySteps.getRepositoriesList()
|
|
@@ -105,6 +114,38 @@ export class RepositorySteps extends BaseSteps {
|
|
|
105
114
|
.click();
|
|
106
115
|
}
|
|
107
116
|
|
|
117
|
+
static getRepositoryActions(repositoryId) {
|
|
118
|
+
return RepositorySteps.getRepositoryFromList(repositoryId).find('.repository-actions');
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
static getCopyRepositoryButton(repositoryId) {
|
|
122
|
+
return RepositorySteps.getRepositoryActions(repositoryId).find('.copy-repository-btn');
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
static getEditRepositoryButton(repositoryId) {
|
|
126
|
+
return RepositorySteps.getRepositoryActions(repositoryId).find('.edit-repository-btn');
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
static getDownloadRepositoryConfigurationButton(repositoryId) {
|
|
130
|
+
return RepositorySteps.getRepositoryActions(repositoryId).find('.download-repository-config-btn');
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
static getRestartRepositoryButton(repositoryId) {
|
|
134
|
+
return RepositorySteps.getRepositoryActions(repositoryId).find('.restart-repository-btn');
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
static getDeleteRepositoryButton(repositoryId) {
|
|
138
|
+
return RepositorySteps.getRepositoryActions(repositoryId).find('.delete-repository-btn');
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
static getSetDefaultRepositoryButton(repositoryId) {
|
|
142
|
+
return RepositorySteps.getRepositoryActions(repositoryId).find('.pin-repository-btn');
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
static getPageButtons() {
|
|
146
|
+
return RepositorySteps.getRepositoriesPage().find('.btns-all');
|
|
147
|
+
}
|
|
148
|
+
|
|
108
149
|
static editRepository(repositoryId) {
|
|
109
150
|
RepositorySteps.clickRepositoryIcon(repositoryId, '.repository-actions .edit-repository-btn');
|
|
110
151
|
}
|
|
@@ -169,8 +169,12 @@ export class UserAndAccessSteps {
|
|
|
169
169
|
return cy.get('#user-repos');
|
|
170
170
|
}
|
|
171
171
|
|
|
172
|
-
static
|
|
173
|
-
|
|
172
|
+
static getRepositoryRightsLine(repoName) {
|
|
173
|
+
if (repoName === '*') {
|
|
174
|
+
return this.getRepositoryRightsList().find('.any-repo');
|
|
175
|
+
} else {
|
|
176
|
+
return this.getRepositoryRightsList().contains(repoName).parent('tr');
|
|
177
|
+
}
|
|
174
178
|
}
|
|
175
179
|
|
|
176
180
|
static getCustomRoleFieldError() {
|
|
@@ -186,7 +190,7 @@ export class UserAndAccessSteps {
|
|
|
186
190
|
}
|
|
187
191
|
|
|
188
192
|
static getRepositoryRightsError() {
|
|
189
|
-
return
|
|
193
|
+
return this.getRepositoryRightsList().find('[ng-show="repositoryCheckError"].form-control-feedback');
|
|
190
194
|
}
|
|
191
195
|
|
|
192
196
|
static getError() {
|
|
@@ -230,53 +234,17 @@ export class UserAndAccessSteps {
|
|
|
230
234
|
}
|
|
231
235
|
|
|
232
236
|
static clickGraphqlAccessAny() {
|
|
233
|
-
|
|
234
|
-
.contains('Any data repository')
|
|
235
|
-
.parent('tr')
|
|
237
|
+
this.getRepositoryRightsLine('*')
|
|
236
238
|
.find('.graphql')
|
|
237
239
|
.realClick();
|
|
238
240
|
}
|
|
239
241
|
|
|
240
242
|
static clickGraphqlAccessRepo(repoName) {
|
|
241
|
-
|
|
242
|
-
.contains(repoName)
|
|
243
|
-
.parent('tr')
|
|
243
|
+
this.getRepositoryRightsLine(repoName)
|
|
244
244
|
.find('.graphql')
|
|
245
245
|
.realClick();
|
|
246
246
|
}
|
|
247
247
|
|
|
248
|
-
static clickReadAccessAny() {
|
|
249
|
-
cy.get('#user-repos')
|
|
250
|
-
.contains('Any data repository')
|
|
251
|
-
.parent('tr')
|
|
252
|
-
.find('.read')
|
|
253
|
-
.realClick();
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
static clickReadAccessRepo(repoName) {
|
|
257
|
-
cy.get('#user-repos')
|
|
258
|
-
.contains(repoName)
|
|
259
|
-
.parent('tr')
|
|
260
|
-
.find('.read')
|
|
261
|
-
.realClick();
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
static clickWriteAccessAny() {
|
|
265
|
-
cy.get('#user-repos')
|
|
266
|
-
.contains('Any data repository')
|
|
267
|
-
.parent('tr')
|
|
268
|
-
.find('.write')
|
|
269
|
-
.realClick();
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
static clickWriteAccessRepo(repoName) {
|
|
273
|
-
cy.get('#user-repos')
|
|
274
|
-
.contains(repoName)
|
|
275
|
-
.parent('tr')
|
|
276
|
-
.find('.write')
|
|
277
|
-
.realClick();
|
|
278
|
-
}
|
|
279
|
-
|
|
280
248
|
static findUserRowAlias(username, aliasName = 'userRow') {
|
|
281
249
|
this.findUserInTable(username);
|
|
282
250
|
cy.get('@user').as(aliasName);
|
|
@@ -301,6 +269,10 @@ export class UserAndAccessSteps {
|
|
|
301
269
|
return cy.get(repoLineAlias).find('.ri-edit-line');
|
|
302
270
|
}
|
|
303
271
|
|
|
272
|
+
static findManageIconAlias(repoLineAlias) {
|
|
273
|
+
return cy.get(repoLineAlias).find('.ri-folder-settings-line');
|
|
274
|
+
}
|
|
275
|
+
|
|
304
276
|
static findGraphqlIconAlias(repoLineAlias) {
|
|
305
277
|
return cy.get(repoLineAlias).find('.icon-graphql');
|
|
306
278
|
}
|
|
@@ -308,41 +280,92 @@ export class UserAndAccessSteps {
|
|
|
308
280
|
static openEditUserPage(username) {
|
|
309
281
|
this.findUserInTable(username); // sets @user
|
|
310
282
|
cy.get('@user').find('.edit-user-btn').click();
|
|
283
|
+
cy.url().should('include', `/user/${username}`);
|
|
284
|
+
UserAndAccessSteps.getUsernameField().should('be.visible');
|
|
311
285
|
}
|
|
312
286
|
|
|
313
287
|
static confirmUserEdit() {
|
|
314
288
|
cy.get('#wb-user-submit').click();
|
|
315
289
|
}
|
|
316
290
|
|
|
291
|
+
static validateRightsForRepo(repoName, checkbox, expectedState) {
|
|
292
|
+
const {checked, disabled} = expectedState;
|
|
293
|
+
if (checked === true) {
|
|
294
|
+
checkbox.should('be.checked');
|
|
295
|
+
} else if (checked === false) {
|
|
296
|
+
checkbox.should('not.be.checked');
|
|
297
|
+
}
|
|
298
|
+
if (disabled === true) {
|
|
299
|
+
checkbox.should('be.disabled');
|
|
300
|
+
} else if (disabled === false) {
|
|
301
|
+
checkbox.should('not.be.disabled');
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
// ============= Read Access Toggles and Validations =============
|
|
306
|
+
|
|
317
307
|
static getReadAccessForRepo(repoName) {
|
|
318
|
-
|
|
319
|
-
return cy.get('#user-repos')
|
|
320
|
-
.contains(matchText)
|
|
321
|
-
.parent('tr')
|
|
308
|
+
return this.getRepositoryRightsLine(repoName)
|
|
322
309
|
.find('.read')
|
|
323
310
|
}
|
|
324
311
|
|
|
312
|
+
static toggleReadAccessAny() {
|
|
313
|
+
UserAndAccessSteps.toggleReadAccessForRepo('*');
|
|
314
|
+
}
|
|
315
|
+
|
|
325
316
|
static toggleReadAccessForRepo(repoName) {
|
|
326
317
|
return this.getReadAccessForRepo(repoName).realClick();
|
|
327
318
|
}
|
|
328
319
|
|
|
320
|
+
static validateReadAccessForRepo(repoName, expectedState) {
|
|
321
|
+
const readAccessCheckbox = this.getReadAccessForRepo(repoName);
|
|
322
|
+
this.validateRightsForRepo(repoName, readAccessCheckbox, expectedState);
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
// ============= Write Access Toggles and Validations =============
|
|
326
|
+
|
|
329
327
|
static getWriteAccessForRepo(repoName) {
|
|
330
|
-
|
|
331
|
-
return cy.get('#user-repos')
|
|
332
|
-
.contains(matchText)
|
|
333
|
-
.parent('tr')
|
|
328
|
+
return this.getRepositoryRightsLine(repoName)
|
|
334
329
|
.find('.write')
|
|
335
330
|
}
|
|
336
331
|
|
|
332
|
+
static toggleWriteAccessAny() {
|
|
333
|
+
UserAndAccessSteps.toggleWriteAccessForRepo('*');
|
|
334
|
+
}
|
|
335
|
+
|
|
337
336
|
static toggleWriteAccessForRepo(repoName) {
|
|
338
337
|
return this.getWriteAccessForRepo(repoName).realClick();
|
|
339
338
|
}
|
|
340
339
|
|
|
340
|
+
static validateWriteAccessForRepo(repoName, expectedState) {
|
|
341
|
+
const writeAccessCheckbox = this.getWriteAccessForRepo(repoName);
|
|
342
|
+
this.validateRightsForRepo(repoName, writeAccessCheckbox, expectedState);
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
// ============= Manange Repository Access Toggles and Validations =============
|
|
346
|
+
|
|
347
|
+
static getManageAccessRepoCheckbox(repoName) {
|
|
348
|
+
return this.getRepositoryRightsLine(repoName)
|
|
349
|
+
.find('.manage-repository');
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
static clickManageAccessRepo(repoName) {
|
|
353
|
+
UserAndAccessSteps.getManageAccessRepoCheckbox(repoName).realClick();
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
static toggleManageRepoForRepo(repoName) {
|
|
357
|
+
return this.clickManageAccessRepo(repoName);
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
static validateManageAccessForRepo(repoName, expectedState) {
|
|
361
|
+
const manageAccessCheckbox = this.getManageAccessRepoCheckbox(repoName);
|
|
362
|
+
this.validateRightsForRepo(repoName, manageAccessCheckbox, expectedState);
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
// ============= GraphQL Access Toggles and Validations =============
|
|
366
|
+
|
|
341
367
|
static getGraphqlAccessForRepo(repoName) {
|
|
342
|
-
|
|
343
|
-
return cy.get('#user-repos')
|
|
344
|
-
.contains(matchText)
|
|
345
|
-
.parent('tr')
|
|
368
|
+
return this.getRepositoryRightsLine(repoName)
|
|
346
369
|
.find('.graphql')
|
|
347
370
|
}
|
|
348
371
|
|
|
@@ -350,6 +373,11 @@ export class UserAndAccessSteps {
|
|
|
350
373
|
return this.getGraphqlAccessForRepo(repoName).realClick();
|
|
351
374
|
}
|
|
352
375
|
|
|
376
|
+
static validateGraphqlAccessForRepo(repoName, expectedState) {
|
|
377
|
+
const graphqlAccessCheckbox = this.getGraphqlAccessForRepo(repoName);
|
|
378
|
+
this.validateRightsForRepo(repoName, graphqlAccessCheckbox, expectedState);
|
|
379
|
+
}
|
|
380
|
+
|
|
353
381
|
static clickMenuItem(label) {
|
|
354
382
|
return cy.get('.main-menu').contains(label).click({force: true});
|
|
355
383
|
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import {BaseSteps} from "../base-steps";
|
|
2
|
+
import {DeprecationSteps} from '../deprecation-banner/deprecation-banner-steps.js';
|
|
2
3
|
|
|
3
4
|
export class TTYGViewSteps extends BaseSteps {
|
|
4
5
|
static visit() {
|
|
5
6
|
cy.visit('/ttyg');
|
|
7
|
+
DeprecationSteps.closeBanner();
|
|
6
8
|
}
|
|
7
9
|
|
|
8
10
|
static getTtygView() {
|
|
@@ -243,6 +245,7 @@ export class TTYGViewSteps extends BaseSteps {
|
|
|
243
245
|
}
|
|
244
246
|
|
|
245
247
|
static getOpenAgentActionsButton(index) {
|
|
248
|
+
this.getAgent(index).scrollIntoView();
|
|
246
249
|
return this.getAgent(index).realHover().find('.open-agent-actions-btn');
|
|
247
250
|
}
|
|
248
251
|
|
package/stubs/security-stubs.js
CHANGED
|
@@ -14,6 +14,10 @@ export class SecurityStubs {
|
|
|
14
14
|
cy.intercept('POST', 'rest/security/users/*').as('create-user');
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
+
static spyOnUserGet() {
|
|
18
|
+
cy.intercept('GET', 'rest/security/users/*').as('get-user');
|
|
19
|
+
}
|
|
20
|
+
|
|
17
21
|
static stubInferAndSameAsDefaults() {
|
|
18
22
|
cy.intercept('rest/security/all', (req) => {
|
|
19
23
|
req.reply(SecurityStubs.getResponseSecurityEnabled());
|