graphdb-workbench-tests 4.0.0-TR7 → 4.0.0-TR9

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.
@@ -18,7 +18,7 @@ describe('Graphs overview screen validation', () => {
18
18
  cy.window();
19
19
 
20
20
  cy.fixture('graph/rdf.txt').then((rdf) => {
21
- return new Cypress.Promise((resolve, reject) => {
21
+ return new Cypress.Promise((resolve) => {
22
22
  cy.importRDFTextSnippet(repositoryId, rdf, {format: "application/x-trig"});
23
23
  resolve();
24
24
  });
@@ -76,6 +76,7 @@ describe('Graphs overview screen validation', () => {
76
76
  it('Should switch pages', () => {
77
77
  // Makes this less flaky - is it possible the page elements don't have an event attached
78
78
  // yet when this fails? It looks like the click has never happened
79
+ // eslint-disable-next-line cypress/no-unnecessary-waiting
79
80
  cy.wait(100);
80
81
 
81
82
  // Switch through pages and verify that the respective pager button is active.
@@ -111,6 +112,31 @@ describe('Graphs overview screen validation', () => {
111
112
  verifyGraphExistence('urn:11', false);
112
113
  });
113
114
 
115
+ it('Should give the controls on the page accessible names', () => {
116
+ // Then the search field should have a visible label
117
+ GraphsOverviewSteps.getGraphsSearchLabel()
118
+ .should('be.visible')
119
+ .and('contain.text', 'Search Graphs');
120
+ GraphsOverviewSteps.getGraphsSearchInput().should('have.attr', 'id', 'search-graphs');
121
+ // And the table and the header controls should have accessible names
122
+ GraphsOverviewSteps.getResultsElement().should('have.attr', 'aria-label', 'Graphs')
123
+ .and('not.have.attr', 'aria-describedby');
124
+ GraphsOverviewSteps.getSelectAllGraphsCheckbox().should('have.attr', 'aria-label', 'Select all graphs');
125
+ GraphsOverviewSteps.getExportSelectedGraphsButton().should('have.attr', 'aria-label', 'Export selected graphs');
126
+ GraphsOverviewSteps.getDeleteSelectedGraphsButton().should('have.attr', 'aria-label', 'Removes all data from the selected graphs');
127
+ GraphsOverviewSteps.getActionsColumnHeader().should('contain.text', 'Actions');
128
+ // And no empty label should wrap the checkbox
129
+ GraphsOverviewSteps.getResultsHeader().find('label').should('not.exist');
130
+ // And the controls in each row should include the graph name
131
+ GraphsOverviewSteps.getSelectGraphCheckbox('urn:9').should('have.attr', 'aria-label', 'Select graph urn:9');
132
+ GraphsOverviewSteps.getExportGraphButton('urn:9').should('have.attr', 'aria-label', 'Export graph urn:9');
133
+ GraphsOverviewSteps.getDeleteGraphButton('urn:9').should('have.attr', 'aria-label', 'Remove all data from graph urn:9');
134
+ GraphsOverviewSteps.getGraphRow('urn:9').find('label').should('not.exist');
135
+ // And the default graph row should use the translated graph name
136
+ GraphsOverviewSteps.getDefaultGraphRow().find('.select-graph-checkbox')
137
+ .should('have.attr', 'aria-label', 'Select graph The default graph');
138
+ });
139
+
114
140
  it('Delete graph', () => {
115
141
  let graphToDelete = 'urn:9';
116
142
  cy.get(`${EXPORT_GRAPHS_TABLE_ID} tbody a[title="${graphToDelete}"]`)
@@ -125,7 +151,8 @@ describe('Graphs overview screen validation', () => {
125
151
  verifyVisibleGraphsCount(1);
126
152
  verifyGraphExistence('The default graph');
127
153
  // open default graph through the link and verify that the table view is rendered
128
- cy.getByTestId('graph-is-not-shaql').contains('The default graph').trigger('mouseover').click();
154
+ cy.getByTestId('graph-is-not-shaql').contains('The default graph').trigger('mouseover');
155
+ cy.getByTestId('graph-is-not-shaql').contains('The default graph').click();
129
156
  cy.url().should('contain', Cypress.config('baseUrl') + '/resource');
130
157
  YasrSteps.getResultTableHeader().should('be.visible');
131
158
  YasrSteps.getResultTableHeaderColumns().should('have.length', 5);
@@ -152,6 +152,32 @@ describe('Import user data: File upload', () => {
152
152
  ImportUserDataSteps.getResources().should('have.length', 1);
153
153
  });
154
154
 
155
+ it('Should give the controls on the page accessible names', () => {
156
+ // Given I have uploaded a file without importing it
157
+ const file = ImportUserDataSteps.createFile(testFiles[0], bnodes);
158
+ ImportUserDataSteps.selectFile(file);
159
+ ImportSettingsDialogSteps.uploadOnly();
160
+ ImportUserDataSteps.getResources().should('have.length', 1);
161
+ // Then the icon-only buttons and the row checkbox should have accessible names
162
+ ImportUserDataSteps.getHelpToggleButton().should('have.attr', 'aria-label', 'Get help on import');
163
+ ImportUserDataSteps.getStatusSelectMenuToggle().should('have.attr', 'aria-label', 'Select resources by status');
164
+ ImportUserDataSteps.getResourceSelectCheckbox('bnodes.ttl').should('have.attr', 'aria-label', 'Select bnodes.ttl');
165
+ ImportUserDataSteps.getResourceImportButton('bnodes.ttl').should('have.attr', 'aria-label', 'Import bnodes.ttl');
166
+ ImportUserDataSteps.getResourceRemoveButton('bnodes.ttl').should('have.attr', 'aria-label', 'Remove bnodes.ttl');
167
+ // And no empty context link should be rendered
168
+ ImportUserDataSteps.getResourceContextLink('bnodes.ttl').should('not.exist');
169
+ // And the filter field should have a visible label
170
+ ImportUserDataSteps.getFilterFieldLabel()
171
+ .should('be.visible')
172
+ .and('contain.text', 'Filter by name');
173
+ // When I import the file
174
+ ImportUserDataSteps.importFile(0);
175
+ ImportSettingsDialogSteps.import();
176
+ ImportUserDataSteps.checkImportedResourceByIndex(0, 'bnodes.ttl');
177
+ // Then the reset status button should have an accessible name
178
+ ImportUserDataSteps.getResourceResetButton('bnodes.ttl').should('have.attr', 'aria-label', 'Reset status of bnodes.ttl');
179
+ });
180
+
155
181
  it('Should be able to upload multiple unique files', () => {
156
182
  // Given there are no files uploaded yet
157
183
  ImportUserDataSteps.getResourcesTable().should('be.hidden');
@@ -0,0 +1,200 @@
1
+ import {ReactodiaSteps} from '../../steps/reactodia-steps.js';
2
+ import {PageRestrictionsSteps} from '../../steps/page-restrictions-steps.js';
3
+ import {RepositoryPickerListSteps} from '../../steps/repository-picker-list-steps.js';
4
+ import {LicenseStubs} from '../../stubs/license-stubs.js';
5
+ import {RepositorySteps} from '../../steps/repository-steps.js';
6
+
7
+ const NO_REPOSITORY_MESSAGE = 'you are not connected to any repository';
8
+ const INVALID_LICENSE_MESSAGE = 'your license is not valid';
9
+ const SELECT_OR_CREATE_REPOSITORY_MESSAGE = 'Select a repository below or create a new one.';
10
+ const SELECT_REPOSITORY_MESSAGE = 'Select a repository below.';
11
+
12
+ describe('Reactodia view restrictions', () => {
13
+ let repositoryId;
14
+
15
+ beforeEach(() => {
16
+ repositoryId = 'reactodia-view-restrictions-' + Date.now();
17
+ cy.createRepository({id: repositoryId});
18
+ });
19
+
20
+ afterEach(() => {
21
+ cy.deleteRepository(repositoryId);
22
+ });
23
+
24
+ it('should show the repository picker when no repository is selected', () => {
25
+ // GIVEN no repository is selected
26
+
27
+ // WHEN I open the Reactodia view
28
+ ReactodiaSteps.visit();
29
+ // THEN I expect the repository restriction is shown
30
+ PageRestrictionsSteps.getMessages().should('have.length', 1);
31
+ PageRestrictionsSteps.getMessage(NO_REPOSITORY_MESSAGE).should('be.visible');
32
+ // AND the existing repository is available in the picker
33
+ RepositoryPickerListSteps.getRepositoryRow(repositoryId).should('be.visible');
34
+ // AND the graph is not rendered
35
+ ReactodiaSteps.getComponent().should('not.exist');
36
+ });
37
+
38
+ it('should render the graph when a repository is selected from the picker', () => {
39
+ // GIVEN the Reactodia view is open with no repository selected
40
+ ReactodiaSteps.visit();
41
+
42
+ // WHEN I select a repository
43
+ RepositoryPickerListSteps.selectRepository(repositoryId);
44
+ // THEN I expect the restriction is removed and the graph is rendered
45
+ PageRestrictionsSteps.getRestrictions().should('not.exist');
46
+ ReactodiaSteps.getWorkspace().should('exist');
47
+ });
48
+
49
+ it('should not restrict the view when the license is valid and a repository is selected', () => {
50
+ // GIVEN a valid license and a selected repository
51
+ cy.presetRepository(repositoryId);
52
+
53
+ // WHEN I open the Reactodia view
54
+ ReactodiaSteps.visit();
55
+ // THEN I expect the view is not restricted
56
+ ReactodiaSteps.getWorkspace().should('exist');
57
+ PageRestrictionsSteps.getRestrictions().should('not.exist');
58
+ });
59
+
60
+ context('when the license is invalid', () => {
61
+ beforeEach(() => {
62
+ LicenseStubs.stubNoValidLicense();
63
+ });
64
+
65
+ it('should show the license restriction when a repository is selected', () => {
66
+ // GIVEN an invalid license and a selected repository
67
+ cy.presetRepository(repositoryId);
68
+
69
+ // WHEN I open the Reactodia view
70
+ ReactodiaSteps.visit();
71
+ // THEN I expect the license restriction is shown
72
+ PageRestrictionsSteps.getMessages().should('have.length', 1);
73
+ PageRestrictionsSteps.getMessage(INVALID_LICENSE_MESSAGE).should('be.visible');
74
+ // AND the "Set a new license" link is displayed
75
+ PageRestrictionsSteps.getInternalLink()
76
+ .should('contain.text', 'Set a new license')
77
+ .and('have.attr', 'href')
78
+ .and('include', '/license');
79
+ // AND the repository picker and graph are not rendered
80
+ RepositoryPickerListSteps.getRepositoryPickerList().should('not.exist');
81
+ ReactodiaSteps.getComponent().should('not.exist');
82
+ });
83
+
84
+ it('should show both restrictions when no repository is selected', () => {
85
+ // GIVEN an invalid license and no repository selected
86
+
87
+ // WHEN I open the Reactodia view
88
+ ReactodiaSteps.visit();
89
+ // THEN both restrictions are shown
90
+ PageRestrictionsSteps.getMessages().should('have.length', 2);
91
+ PageRestrictionsSteps.getMessage(INVALID_LICENSE_MESSAGE).should('be.visible');
92
+ PageRestrictionsSteps.getMessage(NO_REPOSITORY_MESSAGE)
93
+ .should('be.visible')
94
+ .and('not.contain.text', 'create a new one');
95
+ // AND the existing repository is available, but repository creation is not
96
+ RepositoryPickerListSteps.getRepositoryRow(repositoryId).should('be.visible');
97
+ RepositoryPickerListSteps.getCreateRepositoryButton().should('not.exist');
98
+ // AND the graph is not rendered
99
+ ReactodiaSteps.getComponent().should('not.exist');
100
+ });
101
+ });
102
+
103
+ context('with security enabled', () => {
104
+ const readOnlyUser = 'reactodia-reader-' + Date.now();
105
+ const repoManagerUser = 'reactodia-repo-manager-' + Date.now();
106
+ const repoMaintainerUser = 'reactodia-repo-maintainer-' + Date.now();
107
+ const password = 'root';
108
+
109
+ beforeEach(() => {
110
+ cy.createUser({
111
+ username: readOnlyUser,
112
+ password,
113
+ grantedAuthorities: ['ROLE_USER', `READ_REPO_${repositoryId}`]
114
+ });
115
+ cy.createUser({
116
+ username: repoManagerUser,
117
+ password,
118
+ grantedAuthorities: ['ROLE_USER', 'ROLE_REPO_MANAGER']
119
+ });
120
+ cy.createUser({
121
+ username: repoMaintainerUser,
122
+ password,
123
+ grantedAuthorities: [
124
+ 'ROLE_USER',
125
+ `READ_REPO_${repositoryId}`,
126
+ `WRITE_REPO_${repositoryId}`,
127
+ `MAINTAIN_REPO_${repositoryId}`
128
+ ]
129
+ });
130
+ cy.switchOnSecurity();
131
+ });
132
+
133
+ afterEach(() => {
134
+ cy.loginAsAdmin().then(() => {
135
+ cy.deleteUser(readOnlyUser, true);
136
+ cy.deleteUser(repoManagerUser, true);
137
+ cy.deleteUser(repoMaintainerUser, true);
138
+ cy.switchOffSecurity(true);
139
+ });
140
+ });
141
+
142
+ it('should not restrict the view for a user without write permission', () => {
143
+ // GIVEN a user with read-only access to the selected repository
144
+ cy.loginAs(readOnlyUser, password);
145
+ cy.presetRepository(repositoryId);
146
+
147
+ // WHEN I open the Reactodia view
148
+ ReactodiaSteps.visit();
149
+ // THEN I expect the view is not restricted
150
+ ReactodiaSteps.getWorkspace().should('exist');
151
+ PageRestrictionsSteps.getRestrictions().should('not.exist');
152
+ });
153
+
154
+ it('should offer repository creation to the administrator', () => {
155
+ // GIVEN the administrator is logged in with no repository selected
156
+ cy.loginAs('admin', password);
157
+
158
+ // WHEN I open the Reactodia view
159
+ ReactodiaSteps.visit();
160
+ // THEN I expect the option to select or create a repository is displayed
161
+ PageRestrictionsSteps.getMessage(SELECT_OR_CREATE_REPOSITORY_MESSAGE).should('be.visible');
162
+ RepositoryPickerListSteps.getRepositoryRow(repositoryId).should('be.visible');
163
+ RepositoryPickerListSteps.getCreateRepositoryButton().should('be.visible');
164
+ });
165
+
166
+ it('should offer repository creation to a repository manager', () => {
167
+ // GIVEN a repository manager is logged in with no repository selected
168
+ cy.loginAs(repoManagerUser, password);
169
+
170
+ // WHEN I open the Reactodia view
171
+ ReactodiaSteps.visit();
172
+ // THEN the option to select or create a repository is displayed
173
+ PageRestrictionsSteps.getMessage(SELECT_OR_CREATE_REPOSITORY_MESSAGE).should('be.visible');
174
+ RepositoryPickerListSteps.getRepositoryRow(repositoryId).should('be.visible');
175
+
176
+ // WHEN I click the create repository button
177
+ RepositoryPickerListSteps.clickCreateRepositoryButton();
178
+ // THEN the create repository view is opened
179
+ RepositorySteps.verifyRepositoryCreateViewUrl().and('include', 'previous=%2Freactodia');
180
+ });
181
+
182
+ [
183
+ {role: 'a read-only user', username: readOnlyUser},
184
+ {role: 'a repository maintainer', username: repoMaintainerUser},
185
+ ].forEach(({role, username}) => {
186
+ it(`should not offer repository creation to ${role}`, () => {
187
+ // GIVEN a user without repository management rights is logged in with no repository selected
188
+ cy.loginAs(username, password);
189
+
190
+ // WHEN I open the Reactodia view
191
+ ReactodiaSteps.visit();
192
+ // THEN only the option to select a repository is displayed
193
+ PageRestrictionsSteps.getMessage(SELECT_REPOSITORY_MESSAGE).should('be.visible');
194
+ PageRestrictionsSteps.getMessages().should('not.contain.text', 'create a new one');
195
+ RepositoryPickerListSteps.getRepositoryRow(repositoryId).should('be.visible');
196
+ RepositoryPickerListSteps.getCreateRepositoryButton().should('not.exist');
197
+ });
198
+ });
199
+ });
200
+ });
@@ -2,6 +2,8 @@ import {ReactodiaSteps} from '../../steps/reactodia-steps.js';
2
2
  import {LanguageSelectorSteps} from '../../steps/language-selector-steps.js';
3
3
  import {RepositorySelectorSteps} from '../../steps/repository-selector-steps.js';
4
4
  import {MainMenuSteps} from '../../steps/main-menu-steps.js';
5
+ import {YasqeSteps} from '../../steps/yasgui/yasqe-steps.js';
6
+ import {ToasterSteps} from '../../steps/toaster-steps.js';
5
7
 
6
8
  const FILE_TO_IMPORT = 'resource-test-data.ttl';
7
9
  const SEED_RESOURCE_ENCODED = 'http:%2F%2Fexample.com%2Fontology%23CustomerLoyalty';
@@ -86,6 +88,12 @@ describe('Reactodia graph explorer', () => {
86
88
  MainMenuSteps.clickOnSparqlMenu();
87
89
  ReactodiaSteps.getComponent().should('not.exist');
88
90
 
91
+ // Wait for the SPARQL Query & Update view to be loaded before continuing.
92
+ // Without this wait, Cypress may try to click the Reactodia menu item before the page is fully loaded,
93
+ // causing the test to fail intermittently with the error:
94
+ // "This element `<li.sub-menu-item>` is not visible because it has CSS property: `display: none`"
95
+ // when trying to click the Reactodia submenu.
96
+ YasqeSteps.getEditor().should('be.visible');
89
97
  // And I return to the reactodia view via the navigation bar.
90
98
  MainMenuSteps.clickOnReactodia();
91
99
 
@@ -94,6 +102,119 @@ describe('Reactodia graph explorer', () => {
94
102
  ReactodiaSteps.getElements().should('not.exist');
95
103
  });
96
104
 
105
+ // These run against the in-code REST stub. TODO: GDB-15242 switch to intercepts when the endpoints are available.
106
+ describe('Settings', () => {
107
+ it('should open the settings popover', () => {
108
+ // Given I open the reactodia view.
109
+ ReactodiaSteps.visit();
110
+
111
+ // When I click the Settings button.
112
+ ReactodiaSteps.openSettings();
113
+
114
+ // Then I expect the settings popover to be open.
115
+ ReactodiaSteps.getSettingsPopover().should('be.visible');
116
+ ReactodiaSteps.getBrowseButton().should('contain', 'Browse');
117
+ });
118
+
119
+ it('should not offer reset when the default settings are in use', () => {
120
+ // Given I open the settings of a repository without uploaded settings.
121
+ ReactodiaSteps.visit();
122
+ ReactodiaSteps.openSettings();
123
+
124
+ // Then I expect no reset action, because there is nothing to reset to.
125
+ ReactodiaSteps.getSettingsPopover().should('be.visible');
126
+ ReactodiaSteps.getResetButton().should('not.exist');
127
+ });
128
+
129
+ it('should cancel a selected file', () => {
130
+ // Given I have selected a settings file.
131
+ ReactodiaSteps.visit();
132
+ ReactodiaSteps.openSettings();
133
+ ReactodiaSteps.selectSettingsFile();
134
+ ReactodiaSteps.getSelectedSettingsFile().should('exist');
135
+
136
+ // When I cancel it.
137
+ ReactodiaSteps.clickCancelFile();
138
+
139
+ // Then I expect the file to be removed.
140
+ ReactodiaSteps.getSettingsPopover().should('not.contain', 'settings.ttl');
141
+ ReactodiaSteps.getUploadButton().should('be.disabled');
142
+ });
143
+
144
+ it('should ask for confirmation before uploading', () => {
145
+ // Given I have selected a settings file.
146
+ ReactodiaSteps.visit();
147
+ ReactodiaSteps.openSettings();
148
+ ReactodiaSteps.selectSettingsFile();
149
+
150
+ // When I upload it.
151
+ ReactodiaSteps.clickUpload();
152
+
153
+ // Then I expect a confirmation that warns the diagram may behave unexpectedly.
154
+ ReactodiaSteps.getConfirmDialog().should('be.visible')
155
+ .and('contain', 'The diagram might behave unexpectedly with the new settings.');
156
+
157
+ // When I cancel.
158
+ ReactodiaSteps.cancelDialog();
159
+
160
+ // Then I expect the popover to stay open with the file still selected.
161
+ ReactodiaSteps.getSettingsPopover().should('be.visible');
162
+ ReactodiaSteps.getSelectedSettingsFile().should('exist');
163
+
164
+ // When I upload and confirm.
165
+ ReactodiaSteps.clickUpload();
166
+ ReactodiaSteps.confirmDialog();
167
+
168
+ // Then I expect a success message and the diagram to be rendered.
169
+ ToasterSteps.verifySuccess('The settings were uploaded');
170
+ ReactodiaSteps.getWorkspace().should('exist');
171
+ });
172
+
173
+ it('should ask for confirmation before resetting', () => {
174
+ // Given the repository has uploaded settings.
175
+ ReactodiaSteps.visit();
176
+ ReactodiaSteps.openSettings();
177
+ ReactodiaSteps.selectSettingsFile();
178
+ ReactodiaSteps.clickUpload();
179
+ ReactodiaSteps.confirmDialog();
180
+ ToasterSteps.verifySuccess('The settings were uploaded');
181
+
182
+ // When I click outside the settings.
183
+ ReactodiaSteps.closeSettings();
184
+
185
+ // Then I expect the popover to close.
186
+ ReactodiaSteps.getSettingsPopover().should('not.exist');
187
+
188
+ // When I reset them.
189
+ ReactodiaSteps.openSettings();
190
+ ReactodiaSteps.getResetButton().should('be.visible');
191
+ ReactodiaSteps.clickReset();
192
+
193
+ // Then I expect a confirmation that warns the diagram may behave unexpectedly.
194
+ ReactodiaSteps.getConfirmDialog().should('be.visible')
195
+ .and('contain', 'The diagram might behave unexpectedly with the default settings.');
196
+
197
+ // When I confirm.
198
+ ReactodiaSteps.confirmDialog();
199
+
200
+ // Then I expect a success message and the diagram to be rendered.
201
+ ToasterSteps.verifySuccess('The settings were reset to the defaults');
202
+ ReactodiaSteps.getWorkspace().should('exist');
203
+ });
204
+
205
+ it('should export the current settings as a .ttl file', () => {
206
+ // Given I open the settings.
207
+ ReactodiaSteps.visit();
208
+ ReactodiaSteps.openSettings();
209
+
210
+ // When I export them.
211
+ ReactodiaSteps.clickExport();
212
+
213
+ // Then I expect a .ttl file named after the repository to be downloaded.
214
+ ReactodiaSteps.verifyFileDownloaded(`graph-navigator-settings-${repositoryId}.ttl`);
215
+ });
216
+ });
217
+
97
218
  describe('Repository switch', () => {
98
219
  let secondRepositoryId;
99
220
 
@@ -3,6 +3,7 @@ import {YasqeSteps} from '../../../steps/yasgui/yasqe-steps';
3
3
  import {SecurityStubs} from '../../../stubs/security-stubs';
4
4
  import {VisualGraphSteps} from '../../../steps/visual-graph-steps';
5
5
  import {ToasterSteps} from '../../../steps/toaster-steps';
6
+ import {SettingsSteps} from '../../../steps/setup/settings-steps';
6
7
 
7
8
  describe('My Settings', () => {
8
9
 
@@ -32,16 +33,12 @@ describe('My Settings', () => {
32
33
  //turn off inference, sameAs and count total results
33
34
  clickLabelBtn('#sameas-on')
34
35
  .then(() => {
35
- cy.get('#sameas-on')
36
- .find('.switch:checkbox')
37
- .should('not.be.visible');
36
+ SettingsSteps.getSameAsToggle().should('not.be.checked');
38
37
  });
39
38
 
40
39
  clickLabelBtn('#inference-on')
41
40
  .then(() => {
42
- cy.get('#inference-on')
43
- .find('.switch:checkbox')
44
- .should('not.be.visible');
41
+ SettingsSteps.getInferenceToggle().should('not.be.checked');
45
42
  });
46
43
 
47
44
  cy.get('#defaultCount:checkbox').uncheck();
@@ -95,9 +92,7 @@ describe('My Settings', () => {
95
92
  visitSettingsView();
96
93
 
97
94
  clickLabelBtn('#schema-on').then(() => {
98
- cy.get('#schema-on')
99
- .find('.switch:checkbox')
100
- .should('not.be.visible');
95
+ SettingsSteps.getSchemaToggle().should('not.be.checked');
101
96
  });
102
97
 
103
98
  getSaveButton()
@@ -152,14 +147,29 @@ describe('My Settings', () => {
152
147
  it('sameAs button should be disabled if inference is turned off', () => {
153
148
  clickLabelBtn('#inference-on')
154
149
  .then(() => {
155
- cy.get('#inference-on')
156
- .find('.switch:checkbox')
157
- .should('not.be.visible');
150
+ SettingsSteps.getInferenceToggle().should('not.be.checked');
158
151
  });
159
152
 
160
- cy.get('#sameas-on')
161
- .find('.switch:checkbox')
162
- .should('not.be.visible');
153
+ SettingsSteps.getSameAsToggle()
154
+ .should('be.disabled')
155
+ .and('not.be.checked');
156
+ });
157
+
158
+ it('should give the settings form controls accessible names', () => {
159
+ SettingsSteps.getUsernameLabel().should('contain', 'Username');
160
+
161
+ SettingsSteps.getSameAsToggleLabel().should('contain', 'Expand results over owl:SameAs');
162
+ SettingsSteps.getInferenceToggleLabel().should('contain', 'Enable inference');
163
+ SettingsSteps.getSchemaToggleLabel().should('contain', 'Show schema');
164
+
165
+ SettingsSteps.getAnyRepositoryReadCheckbox()
166
+ .should('have.attr', 'aria-label', 'Read access to Global (any data repository)');
167
+ SettingsSteps.getAnyRepositoryWriteCheckbox()
168
+ .should('have.attr', 'aria-label', 'Write access to Global (any data repository)');
169
+ SettingsSteps.getAnyRepositoryMaintainCheckbox()
170
+ .should('have.attr', 'aria-label', 'Maintain access to Global (any data repository)');
171
+ SettingsSteps.getAnyRepositoryGraphqlCheckbox()
172
+ .should('have.attr', 'aria-label', 'Restrict Global (any data repository) to GraphQL');
163
173
  });
164
174
 
165
175
  function getSaveButton() {