graphdb-workbench-tests 2.7.0-TR10 → 2.7.0-TR12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fixtures/locale-en.json +2 -0
- package/fixtures/url-import-template.json +1 -1
- package/integration/sparql-editor/internationalization.spec.js +62 -12
- package/integration-flaky/import/import-user-data-batch-operations.spec.js +3 -1
- package/integration-flaky/sparql-editor/actions/share-query.spec.js +1 -1
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/steps/language-selector-steps.js +12 -0
- package/steps/sparql-steps.js +1 -1
- package/steps/yasgui/yasgui-steps.js +6 -0
- package/support/sparql-commands.js +1 -1
package/fixtures/locale-en.json
CHANGED
|
@@ -803,6 +803,8 @@
|
|
|
803
803
|
"query.editor.automatically.execute.update.warning": "This is an update and it may change the data in the repository.<br>Are you sure you want to execute it automatically?",
|
|
804
804
|
"query.editor.error.show.full.message": "Show full exception message",
|
|
805
805
|
"query.editor.error.show.less.message": "Show less exception message",
|
|
806
|
+
"query.editor.language.change.warning.title": "Change language",
|
|
807
|
+
"query.editor.reload.page.warning": "Changing the language will reload the page. Are you sure you want to continue?",
|
|
806
808
|
"sparql.tab.directive.unnamed.tab.title": "Unnamed",
|
|
807
809
|
"search.resource.current.page.msg": "Use <b>View resource</b> on this page",
|
|
808
810
|
"search.resources.msg": "Search RDF resources",
|
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
"context": null,
|
|
6
6
|
"replaceGraphs": [],
|
|
7
7
|
"baseURI": null,
|
|
8
|
-
"contextLink": null,
|
|
9
8
|
"forceSerial": false,
|
|
10
9
|
"type": "url",
|
|
11
10
|
"format": "",
|
|
12
11
|
"data": "https://www.w3.org/TR/owl-guide/wine.rdf",
|
|
13
12
|
"timestamp": 1565777709509,
|
|
14
13
|
"parserSettings": {
|
|
14
|
+
"contextLink": null,
|
|
15
15
|
"preserveBNodeIds": false,
|
|
16
16
|
"failOnUnknownDataTypes": false,
|
|
17
17
|
"verifyDataTypeValues": false,
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import {QueryStubs} from "../../stubs/yasgui/query-stubs";
|
|
2
|
-
import {YasguiSteps} from "../../steps/yasgui/yasgui-steps";
|
|
2
|
+
import {PluginTabs, YasguiSteps} from "../../steps/yasgui/yasgui-steps";
|
|
3
3
|
import {LanguageSelectorSteps} from "../../steps/language-selector-steps";
|
|
4
4
|
import {YasqeSteps} from "../../steps/yasgui/yasqe-steps";
|
|
5
5
|
import {YasrSteps} from "../../steps/yasgui/yasr-steps";
|
|
6
6
|
import {SparqlEditorSteps} from "../../steps/sparql-editor-steps";
|
|
7
|
+
import {ImportUserDataSteps} from "../../steps/import/import-user-data-steps";
|
|
7
8
|
|
|
8
9
|
describe('Internationalization of ontotext-yasgui-web-component', () => {
|
|
9
|
-
|
|
10
|
+
let repositoryId;
|
|
10
11
|
beforeEach(() => {
|
|
11
|
-
|
|
12
|
+
repositoryId = 'sparql-editor-' + Date.now();
|
|
12
13
|
QueryStubs.stubQueryCountResponse();
|
|
13
14
|
cy.createRepository({id: repositoryId});
|
|
14
15
|
cy.presetRepository(repositoryId);
|
|
@@ -16,26 +17,75 @@ describe('Internationalization of ontotext-yasgui-web-component', () => {
|
|
|
16
17
|
SparqlEditorSteps.visitSparqlEditorPage();
|
|
17
18
|
});
|
|
18
19
|
|
|
20
|
+
afterEach(() => {
|
|
21
|
+
cy.deleteRepository(repositoryId);
|
|
22
|
+
});
|
|
23
|
+
|
|
19
24
|
it('Should translate labels when language is changed', () => {
|
|
20
|
-
// When I load page I expect all labels to be translated
|
|
25
|
+
// When I load page I expect all labels to be translated to the default English language.
|
|
26
|
+
YasguiSteps.getYasguiModeButton().contains('Editor and results');
|
|
27
|
+
|
|
28
|
+
// When I execute a query I expect labels in table plugin to be translated to the default English language.
|
|
29
|
+
YasqeSteps.executeQuery();
|
|
30
|
+
|
|
31
|
+
// Then I expect label in table plugin to be translated to the default English language.
|
|
32
|
+
YasrSteps.getResultFilter().invoke('attr', 'placeholder').should('contain', 'Filter query results');
|
|
33
|
+
|
|
34
|
+
// When I change language to French
|
|
35
|
+
LanguageSelectorSteps.switchToFr();
|
|
36
|
+
|
|
37
|
+
// Then confirm the language change
|
|
38
|
+
LanguageSelectorSteps.confirmLanguageChange();
|
|
39
|
+
|
|
40
|
+
// Then I expect labels to be translated in French language
|
|
41
|
+
PluginTabs.getGoogleChartsTab().should('contain.text', 'Graphique Google');
|
|
42
|
+
YasguiSteps.getYasguiModeButton().contains('Éditeur et résultats');
|
|
43
|
+
|
|
44
|
+
// And I expect label in table plugin to be translated in French language.
|
|
45
|
+
YasrSteps.getResultFilter().invoke('attr', 'placeholder').should('contain', 'Filtrer les résultats des requêtes');
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
it('Should not translate when language change is cancelled', () => {
|
|
49
|
+
// When I load page I expect all labels to be translated on the default English language
|
|
21
50
|
YasguiSteps.getYasguiModeButton().contains('Editor and results');
|
|
22
51
|
|
|
23
|
-
// When I execute a query I expect labels in table plugin to be translated
|
|
52
|
+
// When I execute a query I expect labels in table plugin to be translated in the default English language
|
|
24
53
|
YasqeSteps.executeQuery();
|
|
25
54
|
|
|
26
|
-
// Then I expect label in table plugin to be translated
|
|
55
|
+
// Then I expect label in table plugin to be translated in the default English language
|
|
27
56
|
YasrSteps.getResultFilter().invoke('attr', 'placeholder').should('contain', 'Filter query results');
|
|
28
57
|
|
|
29
|
-
// When I change language to French
|
|
58
|
+
// When I change language to French
|
|
30
59
|
LanguageSelectorSteps.switchToFr();
|
|
31
|
-
// Yasgui re-renders all DOM elements to shows the new labels. This includes the plugins of yasr which is time-consuming.
|
|
32
|
-
// We have to wait a bit because cypress is too fast and grabs the old element (with the old label) and the test fails.
|
|
33
|
-
cy.wait(500);
|
|
34
60
|
|
|
35
|
-
// Then
|
|
61
|
+
// Then cancel the language change
|
|
62
|
+
LanguageSelectorSteps.cancelLanguageChange();
|
|
63
|
+
|
|
64
|
+
// Then I expect labels to be in English
|
|
65
|
+
YasguiSteps.getYasguiModeButton().contains('Editor and results');
|
|
66
|
+
|
|
67
|
+
// And I expect label in table plugin to remain in English
|
|
68
|
+
YasrSteps.getResultFilter().invoke('attr', 'placeholder').should('contain', 'Filter query results');
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
it('Should translate labels when language is changed in another view', () => {
|
|
72
|
+
// Given I open the Import page
|
|
73
|
+
ImportUserDataSteps.visitImport('user', repositoryId);
|
|
74
|
+
|
|
75
|
+
// When I change language to French
|
|
76
|
+
LanguageSelectorSteps.switchToFr();
|
|
77
|
+
|
|
78
|
+
// And return to the SPARQL view
|
|
79
|
+
SparqlEditorSteps.visitSparqlEditorPage();
|
|
80
|
+
|
|
81
|
+
// When I execute a query
|
|
82
|
+
YasqeSteps.executeQuery();
|
|
83
|
+
|
|
84
|
+
// Then I expect labels to be translated to French
|
|
85
|
+
PluginTabs.getGoogleChartsTab().should('contain.text', 'Graphique Google');
|
|
36
86
|
YasguiSteps.getYasguiModeButton().contains('Éditeur et résultats');
|
|
37
87
|
|
|
38
|
-
// And I expect label in table plugin to be translated
|
|
88
|
+
// And I expect label in table plugin to be translated to French
|
|
39
89
|
YasrSteps.getResultFilter().invoke('attr', 'placeholder').should('contain', 'Filtrer les résultats des requêtes');
|
|
40
90
|
});
|
|
41
91
|
});
|
|
@@ -127,7 +127,9 @@ describe('Import user data: Batch operations', {retries: {runMode: 2}}, () => {
|
|
|
127
127
|
ImportUserDataSteps.selectFileByIndex(0);
|
|
128
128
|
// And I delete the file
|
|
129
129
|
ImportUserDataSteps.removeSelectedResources();
|
|
130
|
-
// Then I
|
|
130
|
+
// Then I force click the confirmation dialog, to hide the button popover, which covers it
|
|
131
|
+
ModalDialogSteps.getDialog().click({force: true});
|
|
132
|
+
// The dialog should be visible
|
|
131
133
|
ModalDialogSteps.getDialog().should('be.visible');
|
|
132
134
|
// When I confirm the deletion
|
|
133
135
|
ModalDialogSteps.clickOnConfirmButton();
|
|
@@ -32,7 +32,7 @@ describe('Share query', () => {
|
|
|
32
32
|
ShareSavedQueryDialog.getDialog().should('be.visible');
|
|
33
33
|
ShareSavedQueryDialog.getDialogTitle().should('contain', 'Copy URL to clipboard');
|
|
34
34
|
ShareSavedQueryDialog.getShareLink().then((shareLink) => {
|
|
35
|
-
expect(shareLink).to.have.string(`/sparql?name=Unnamed&query=select%20*%20where%20%7B%20%20%
|
|
35
|
+
expect(shareLink).to.have.string(`/sparql?name=Unnamed&query=select%20*%20where%20%7B%0A%20%20%20%20%3Fs%20%3Fp%20%3Fo%20.%0A%7D%20limit%20100&infer=true&sameAs=true`);
|
|
36
36
|
});
|
|
37
37
|
// When I cancel operation
|
|
38
38
|
ShareSavedQueryDialog.closeDialog();
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "graphdb-workbench-tests",
|
|
3
|
-
"version": "2.7.0-
|
|
3
|
+
"version": "2.7.0-TR12",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "graphdb-workbench-tests",
|
|
9
|
-
"version": "2.7.0-
|
|
9
|
+
"version": "2.7.0-TR12",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"devDependencies": {
|
|
12
12
|
"cypress": "^13.3.1",
|
package/package.json
CHANGED
|
@@ -19,4 +19,16 @@ export class LanguageSelectorSteps {
|
|
|
19
19
|
static switchToEn() {
|
|
20
20
|
LanguageSelectorSteps.changeLanguage('en');
|
|
21
21
|
}
|
|
22
|
+
|
|
23
|
+
static getLanguageChangeModal() {
|
|
24
|
+
return cy.get('.modal-dialog');
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
static confirmLanguageChange() {
|
|
28
|
+
this.getLanguageChangeModal().find('.confirm-btn').click();
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
static cancelLanguageChange() {
|
|
32
|
+
this.getLanguageChangeModal().find('.cancel-btn').click();
|
|
33
|
+
}
|
|
22
34
|
}
|
package/steps/sparql-steps.js
CHANGED
|
@@ -176,6 +176,12 @@ export class YasguiSteps {
|
|
|
176
176
|
}
|
|
177
177
|
}
|
|
178
178
|
|
|
179
|
+
export class PluginTabs {
|
|
180
|
+
static getGoogleChartsTab() {
|
|
181
|
+
return cy.get('.select_charts');
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
179
185
|
export class TabContextMenu {
|
|
180
186
|
static getContextMenu() {
|
|
181
187
|
return cy.get('.yasgui .context-menu');
|