Skip to content

Commit e24f46a

Browse files
Merge branch 'd3bootstrap' into d3bootstrap_delsec branch, just updating to be able to further develop on delsec branch.
2 parents 5fc3562 + ae4b375 commit e24f46a

File tree

7 files changed

+214
-144
lines changed

7 files changed

+214
-144
lines changed

frontend-e2e/cypress/e2e/_shared_variables.js

Lines changed: 0 additions & 139 deletions
This file was deleted.

frontend-e2e/cypress/e2e/guests_privileges.cy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ [email protected] (pw AdminPass) has one tradition
4747
Verbum uncorrected, private
4848
*/
4949

50-
import { test_traditions } from "./_shared_variables";
50+
import test_traditions from '../fixtures/test_traditions.json';
5151

5252
beforeEach(() => {
5353
cy.visit(`${Cypress.env('CY_STEMMAWEB_FRONTEND_URL')}/`);

frontend-e2e/cypress/e2e/sections.cy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ reordering of sections. Functionalities to be tested:
2828
2929
*/
3030

31-
import { test_traditions } from './_shared_variables.js';
31+
import test_traditions from '../fixtures/test_traditions.json';
3232

3333
beforeEach(() => {
3434
cy.visit(`${Cypress.env('CY_STEMMAWEB_FRONTEND_URL')}/`);

frontend-e2e/cypress/e2e/stemwebdialog.cy.js

Lines changed: 63 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,74 @@ Tests to add:
1818
1919
*/
2020

21+
import stemweb_algorithms from '../fixtures/stemweb_algorithms.json'
22+
const len_stemweb_algorithms = stemweb_algorithms.length;
2123

2224
beforeEach(() => {
2325
cy.visit(`${Cypress.env('CY_STEMMAWEB_FRONTEND_URL')}/`);
2426
});
2527

2628
describe('Stemweb dialog should work properly', () => {
27-
it.skip('under construction', () => {
28-
// ...
29+
it('under construction', () => {
30+
// click on button "Run Stemweb" should open Stemweb dialog
31+
cy.contains('Run Stemweb').click();
32+
cy.get('stemmaweb-dialog .modal-content').as('stemwebmodal');
33+
cy.get('@stemwebmodal').contains('Generate a Stemweb tree').should('be.visible');
34+
35+
// Dropdown should show names of Stemweb algorithms
36+
// (currently: RHM, Neighbour Joining, and Neighbour Net, and Pars)
37+
cy.get('@stemwebmodal').find('select>option')
38+
.should('have.length', len_stemweb_algorithms) // number of options is ok
39+
.each(($el, index, $list) => {
40+
const optionText = $el.text().trim();
41+
cy.get('@stemwebmodal').find('select').select(optionText); // click on optionText
42+
cy.get('@stemwebmodal').find('select option:selected') // get the selected option
43+
.invoke("text").then((txt) => {
44+
const selected = txt.trim();
45+
expect(selected).equal(optionText); // ok, desired option is selected
46+
expect(optionText).equal(stemweb_algorithms[index].text); // and it matches the test data
47+
48+
// Click info badge ('i') should show description of algorithm
49+
cy.get('@stemwebmodal').find('form').find('svg') // .its('length').then((len) => {cy.log(len)});
50+
.should('have.length', 1)
51+
.click();
52+
cy.get('@stemwebmodal').find('#algorithm-info')
53+
.invoke('html').then((innerHTML) => {
54+
expect(innerHTML).equal(stemweb_algorithms[index].description);
55+
});
56+
57+
// Click on RHM should reveal argument field 'Iterations'
58+
if (optionText === 'RHM') {
59+
cy.get('@stemwebmodal').find('#algorithm-args').find('#iterations_input').should('be.visible');
60+
// Click on other algorithms should not show any argument fields
61+
} else {
62+
cy.get('@stemwebmodal').find('#algorithm-args').children().should('not.exist');
63+
}
64+
});
65+
});
66+
67+
// Click on Cancel closes dialog
68+
cy.get('@stemwebmodal').should('be.visible');
69+
cy.get('@stemwebmodal').find('button').contains('Cancel').trigger('mouseover').click();
70+
cy.get('@stemwebmodal').should('not.be.visible');
71+
72+
// Click on "Run" (not implemented yet, just closes dialog for now)
73+
cy.contains('Run Stemweb').click();
74+
cy.get('stemmaweb-dialog .modal-content').as('stemwebmodal');
75+
cy.get('@stemwebmodal').contains('Generate a Stemweb tree').should('be.visible');
76+
cy.get('@stemwebmodal').find('button').contains('Run').its('length').then((len) => {cy.log('length:' + len)});
77+
cy.get('@stemwebmodal').find('button').contains('Run').trigger('mouseover').click();
78+
cy.get('@stemwebmodal').should('not.be.visible'); // fuzzy
79+
80+
// Click on anywhere outside dialog closes dialog
81+
cy.contains('Run Stemweb').click();
82+
cy.get('stemmaweb-dialog .modal-content').as('stemwebmodal');
83+
cy.get('@stemwebmodal').contains('Generate a Stemweb tree').should('be.visible');
84+
cy.get('@stemwebmodal').closest("#modalDialog").then((elem) => {
85+
cy.log("#modalDialog:", elem);
86+
});
87+
cy.get('@stemwebmodal').closest("#modalDialog").its('length').then((len) => {cy.log('length:' + len)}); // seems to help against fuzziness
88+
cy.get('@stemwebmodal').closest("#modalDialog").trigger('mouseover', { 'timeout': 10000 }).click('left');
89+
cy.get('@stemwebmodal').should('not.be.visible');
2990
});
3091
});

frontend-e2e/cypress/e2e/traditions.cy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Cypress tests to be added:
2424
2525
*/
2626

27-
import { test_traditions } from './_shared_variables.js';
27+
import test_traditions from '../fixtures/test_traditions.json';
2828

2929
beforeEach(() => {
3030
cy.visit(`${Cypress.env('CY_STEMMAWEB_FRONTEND_URL')}/`);
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[
2+
{
3+
"value" : "2",
4+
"text" : "RHM",
5+
"description" : "The Roos-Heikkila-Myllymaki (RHM) method is similar to the maximum parsimony method. Both of them optimize a bifurcating tree structure to minimize a cost function. In RHM, the cost function is based on data compression which measures not only whether two variants are the same or not but also how different they are. The comparison is done in blocks of about ten words, which implies that change of word order is also handled in a sensible way: a change in word order will typically result in a smaller cost than changing the words into completely new ones. Because the comparison is based on the actual words, RHM requires that the actual text versions are given as the input in CSV (comma-separated values) format. RHM utilizes a stochastic search technique to minimize the cost of the stemma. The search procedure may easily get stuck in a suboptimal stemma unless the number of iterations is large enough. The best way to find out whether the number of iterations is large enough is to run RHM several times and to see if the resulting stemmata are similar or not. If not, it usually helps to increase the number of iterations. Note that it is often not possible to obtain identical stemmata in every run even if the number of iterations is very large."
6+
},
7+
{
8+
"value" : "3",
9+
"text" : "Neighbour Joining",
10+
"description" : "Neighbor-Joining (NJ) is a classical phylogenetic algorithm which operates in a bottom-up fashion, combining at each step two taxa or groups of taxa. Choosing which groups of taxa to combine is based on distances between the taxa. NJ is very fast and it is guaranteed to converge to the true underlying phylogenetic tree (or stemma) if one exists as the length of the sequences (or texts) increases. However, in practice it is often slightly less accurate than, for instance, maximum parsimony or RHM. Note that the version implemented in this server takes as input a set of sequences in Nexus format and computes their pairwise distances using Hamming distance (the number of differences divided by the length of the sequences). This may or may not be desirable. If another distance is preferred, or if for instance, a so called Jukes-Cantor correction is called for, it is necessary to use some other tools. NJ is available in most phylogenetic software tools."
11+
},
12+
{
13+
"value" : "4",
14+
"text" : "Neighbour Net",
15+
"description" : "Neighbour Net algorithm"
16+
},
17+
{
18+
"value" : "100",
19+
"text" : "Pars",
20+
"description" : "The program \"pars\", from the Phylip bio-statistical software package, produces a maximum-parsimony distance tree of the witnesses. More information on maximum parsimony can be found <a href=\"https://wiki.hiit.fi/display/stemmatology/Maximum+parsimony\">here</a>. Please note that Phylip \"pars\" only supports a maximum of eight variants readings in any one variant location in the text. If your text displays more divergence than this at any point, please consider disregarding orthographic and spelling variation below, or use one of the other algorithms."
21+
}
22+
]
Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
[
2+
{ "title" : "Notre besoin",
3+
"filetype" : "stemmaweb",
4+
"owner" : "[email protected]",
5+
"language" : "French",
6+
"access" : "Public",
7+
"sectionscount" : 1,
8+
"sections" : [
9+
{ "name" : "DEFAULT",
10+
"language" : "French"
11+
}
12+
],
13+
"direction" : "Left to Right",
14+
"witnesses" : ["A", "B", "C", "D", "F", "J", "L", "M", "S", "T1", "T2", "U", "V"],
15+
"stemmata" : [
16+
"Stemweb stemma",
17+
"Stemweb stemma duplicate"
18+
]
19+
},
20+
{ "title" : "Florilegium \"Coislinianum B\"",
21+
"filetype" : "csv",
22+
"owner" : "[email protected]",
23+
"language" : "Greek",
24+
"access" : "Private",
25+
"sectionscount" : 3,
26+
"sections" : [
27+
{ "name" : "section 'w'",
28+
"language" : "Greek"
29+
},
30+
{ "name" : "section 'x'",
31+
"language" : "Greek"
32+
},
33+
{ "name" : "section 'y'",
34+
"language" : "Greek"
35+
}
36+
],
37+
"direction" : "Left to Right",
38+
"witnesses" : ["A", "B", "C", "D", "E", "F", "G", "H", "K", "P", "Q", "S", "T"],
39+
"stemmata" : [
40+
"stemma of Tomas"
41+
]
42+
},
43+
{ "title" : "Legend's fragment",
44+
"filetype" : "stemmaweb",
45+
"owner" : "[email protected]",
46+
"language" : "Latin",
47+
"access" : "Private",
48+
"sectionscount" : 2,
49+
"sections" : [
50+
{ "name" : "DEFAULT",
51+
"language" : "Latin"
52+
},
53+
{ "name" : "section 2",
54+
"language" : "Latin"
55+
}
56+
],
57+
"direction" : "Left to Right",
58+
"witnesses" : ["A", "Ab", "B", "BA", "BL", "BLu", "BS", "BSt", "BU", "Bc", "C", "Dr", "Ef", "F", "G", "Gh", "H", "Ho", "JG", "K", "L", "Li", "M", "MN", "N", "O", "P", "Q", "S", "Sk", "St", "T", "U", "V", "Vg", "X", "Y"],
59+
"stemmata" : []
60+
},
61+
62+
{ "title" : "Ժամանակագրութիւն checked",
63+
"filetype" : "graphml",
64+
"owner" : "[email protected]",
65+
"language" : "Armenian",
66+
"access" : "Private",
67+
"sectionscount" : 1,
68+
"sections" : [
69+
{ "name" : "milestone-401",
70+
"language" : "Armenian"
71+
}
72+
],
73+
"direction" : "Left to Right",
74+
"witnesses" : ["A", "B", "Bz430", "Bz644", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M1775", "M2855", "M2899", "M3380", "M6605", "M6686", "M8232", "O", "V", "W", "W243", "W246", "X", "Y", "Z"],
75+
"stemmata" : [
76+
"First attempt",
77+
"RHM 1641561271_0"
78+
]
79+
},
80+
{ "title" : "John verse",
81+
"filetype" : "stemmaweb",
82+
"owner" : "[email protected]",
83+
"language" : "Greek",
84+
"access" : "Public",
85+
"sectionscount" : 1,
86+
"sections" : [
87+
{ "name" : "DEFAULT",
88+
"language" : "Greek"
89+
}
90+
],
91+
"direction" : "Left to Right",
92+
"witnesses" : ["P60", "P66", "base", "w1", "w11", "w13", "w17", "w19", "w2", "w21", "w211", "w22", "w28", "w290", "w3", "w30", "w32", "w33", "w34", "w36", "w37", "w38", "w39", "w41", "w44", "w45", "w54", "w7"],
93+
"stemmata" : []
94+
},
95+
{ "title" : "Arabic snippet",
96+
"filetype" : "csv",
97+
"owner" : "[email protected]",
98+
"language" : "Arabic",
99+
"access" : "Private",
100+
"sectionscount" : 1,
101+
"sections" : [
102+
{ "name" : "DEFAULT",
103+
"language" : "Arabic"
104+
}
105+
],
106+
"direction" : "Right to Left",
107+
"witnesses" : ["A", "B"],
108+
"stemmata" : []
109+
},
110+
111+
{ "title" : "Verbum uncorrected",
112+
"filetype" : "stemmaweb",
113+
"owner" : "[email protected]",
114+
"language" : "Latin",
115+
"access" : "Private",
116+
"sectionscount" : 1,
117+
"sections" : [
118+
{ "name" : "DEFAULT",
119+
"language" : "Latin"
120+
}
121+
],
122+
"direction" : "Left to Right",
123+
"witnesses" : ["Ba96", "Er16", "Go325", "Gr314", "Kf133", "Kr185", "Kr299", "Mü11475", "Mü22405", "Mü28315", "MüU151", "Sg524", "Wi3818"],
124+
"stemmata" : []
125+
}
126+
]

0 commit comments

Comments
 (0)