Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/182 mock stemweb #183

Merged
merged 35 commits into from
Nov 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
2177251
create, login and logout user pass
schiwaa Mar 16, 2023
262e791
sectionscount in test_traditions list
schiwaa Mar 17, 2023
4526a10
see if waiting after click on 'Sign in' will make github actions pass…
schiwaa Mar 28, 2023
74a67ed
see if higher defaultCommandTimeout will make github actions pass the…
schiwaa Mar 29, 2023
e7b23aa
remove cy.wait() where defaultCommandTimeout is set higher
schiwaa Mar 29, 2023
36a4377
Each tradition should have the right number of sections listed in the…
schiwaa Apr 6, 2023
e834c7f
add section names to test_traditions for testing them
schiwaa Apr 6, 2023
8696f1f
prepare section tests
schiwaa Apr 20, 2023
bca42d9
assert the inital number and order of sections displayed matches the …
schiwaa May 12, 2023
0a04557
add current date and time to the newuser id to make it unique along t…
schiwaa May 12, 2023
6a19b7b
and and delete a section
schiwaa May 15, 2023
0a28bc1
in the property panel assert that the relevant section name is displayed
schiwaa May 16, 2023
1ef14fe
assert section list is in its initial order
schiwaa May 17, 2023
3d22d4c
intercept login
schiwaa Jun 16, 2023
19730ce
test passed localy, lets try full path for github actions
schiwaa Jun 16, 2023
29a0b08
wait for the login input field
schiwaa Jun 16, 2023
a63154a
use url relative to CY_STEMMAWEB_FRONTEND_URL
schiwaa Jun 19, 2023
a3f565e
assert visibility of email input field
schiwaa Jun 19, 2023
5466d67
check whether interception works on github actions at all
schiwaa Jun 20, 2023
94174c5
Merge branch 'd3bootstrap' into d3bootstrap-test
schiwaa Jun 20, 2023
c6968c3
log the cypress frontend url
schiwaa Jun 20, 2023
611c171
temporarily skip all tests except 1 passing and one probably failing …
schiwaa Jun 27, 2023
09e46ca
Merge branch 'd3bootstrap' into d3bootstrap-test
tla Jun 28, 2023
306d20f
Merge remote-tracking branch 'origin/d3bootstrap' into d3bootstrap-test
tla Jun 28, 2023
1311332
Merge remote-tracking branch 'origin/d3bootstrap' into d3bootstrap-test
tla Jun 28, 2023
7ba1da4
unskipped tests which are passing locally
schiwaa Oct 18, 2023
d7b4a0c
under construction: set db to initial state before or after the tests
schiwaa Oct 18, 2023
35a79a0
link to testing requirements listed in github pull requests
schiwaa Oct 18, 2023
6b55066
add known issues (still without issue number)
schiwaa Oct 18, 2023
f1affa7
add issue number #170 to the relevant tests
schiwaa Oct 19, 2023
674eb63
add issue number #157 and #155 to the relevant tests
schiwaa Oct 19, 2023
2c4caaa
add issue number #180 and #181 to the relevant tests
schiwaa Oct 19, 2023
59c7d24
mark tests which fail on github but pass locally
schiwaa Oct 31, 2023
3713e63
outsource test_traditions object to a shared variables file
schiwaa Oct 31, 2023
868d971
first pass at mock Stemweb server. Implements #182
tla Nov 3, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 1 addition & 33 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,43 +24,11 @@ services:
entrypoint: >
/bin/bash -c "./wait-for-it.sh --host=${STEMMAREST_HOST} --port=${STEMMAREST_PORT} -- /init-data/init_test_data.sh"

stemweb_mysql:
container_name: stemweb_mysql
image: mariadb:10.4
restart: always
env_file:
- stemweb/.env.dev
ports:
- "4306:3306"

stemweb_redis:
container_name: stemweb_redis
image: redis:alpine
restart: always
sysctls:
# change this Linux Kernel Parameter (default is 128) within container because of this WARNING
# "The TCP backlog setting of 511 cannot be enforced
# because /proc/sys/net/core/somaxconn is set to the lower value of 128."
net.core.somaxconn: 512 # maximal number of connections
ports:
- "7379:6379"
volumes:
- ./stemweb/redis/redis.conf:/usr/local/etc/redis/redis.conf # version 6 from https://redis.io/topics/config
command:
redis-server /usr/local/etc/redis/redis.conf

stemweb:
container_name: stemweb
image: dhuniwien/stemweb_py37:latest
restart: always
env_file:
- stemweb/.env.dev
depends_on:
- stemweb_mysql
- stemweb_redis
build: stemweb_mock
ports:
- "8000:8000"
- "51000:51000"

stemmaweb:
container_name: stemmaweb
Expand Down
139 changes: 139 additions & 0 deletions frontend-e2e/cypress/e2e/_shared_variables.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
/* variables used in several .cy.js files
// TODO? move to a utilities directory
*/

// TODO: check with init_test_data.sh
const test_traditions = [
{ title : "Notre besoin",
filetype : "stemmaweb",
owner : "[email protected]",
language : "French",
access : "Public",
sectionscount : 1,
sections : [
{ name: 'DEFAULT',
language : 'French'
},
],
// tradition_id : "", // random
direction : "Left to Right", // implied (language : French)
witnesses : ["A", "B", "C", "D", "F", "J", "L", "M", "S", "T1", "T2", "U", "V"], // besoin_stemma.json, besoin_stemma_2.json
stemmata : [
"Stemweb stemma", // identifier in besoin_stemma.json"
"Stemweb stemma duplicate" // identifier in besoin_stemma_2.json
]
},
{ title : "Florilegium \"Coislinianum B\"",
filetype : "csv",
owner : "[email protected]",
language : "Greek",
access : "Private",
sectionscount : 3, // init_test_data.sh sections w x y.
sections : [
{ name: 'section \'w\'',
language : 'Greek'
},
{ name: 'section \'x\'',
language : 'Greek'
},
{ name: 'section \'y\'',
language : 'Greek'
},
],
// tradition_id : "",
direction : "Left to Right",
witnesses : ["A", "B", "C", "D", "E", "F", "G", "H", "K", "P", "Q", "S", "T"], // from the dashboard, looks ok from the florilegium csv files
stemmata : [
"stemma of Tomas" // identifier in florilegium_stemma.json
]
},
{ title : "Legend's fragment", // name given in init_test_data.sh, full title in legendfrag.xml: "Legend of Bishop Henry",
filetype : "stemmaweb",
owner : "[email protected]",
language : "Latin", // in legendfrag.xml (not Armenian, ok)
access : "Private",
sectionscount : 2,
sections : [
{ name: 'DEFAULT',
language : 'Latin'
},
{ name: 'section 2',
language : 'Latin'
},
],
// tradition_id : "",
direction : "Left to Right",
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"],
stemmata : []
},

{ title : "Ժամանակագրութիւն checked", // just milestone "Matthew 401"; title taken from the graphml/zip file
filetype : "graphml",
owner : "[email protected]",
language : "Armenian",
access : "Private",
sectionscount : 1,
sections : [
{ name: 'milestone-401',
language : 'Armenian'
},
],
// tradition_id : "",
direction : "Left to Right",
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"],
stemmata : [
"First attempt", // Stemma is included in zip data
"RHM 1641561271_0" // Stemma is included in zip data
]
},
{ title : "John verse",
filetype : "stemmaweb",
owner : "[email protected]",
language : "Greek",
access : "Public",
sectionscount : 1,
sections : [
{ name: 'DEFAULT',
language : 'Greek'
},
],
// tradition_id : "",
direction : "Left to Right",
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"],
stemmata : []
},
{ title : "Arabic snippet",
filetype : "csv",
owner : "[email protected]",
language : "Arabic",
access : "Private",
sectionscount : 1,
sections : [
{ name: 'DEFAULT',
language : 'Arabic'
},
],
// tradition_id : "",
direction : "Right to Left", // implied (language : Arabic)
witnesses : ["A", "B"], // arabic_snippet.csv
stemmata : []
},

{ title : "Verbum uncorrected",
filetype : "stemmaweb",
owner : "[email protected]",
language : "Latin",
access : "Private",
sectionscount : 1,
sections : [
{ name: 'DEFAULT',
language : 'Latin'
},
],
// tradition_id : "",
direction : "Left to Right",
witnesses : ["Ba96", "Er16", "Go325", "Gr314", "Kf133", "Kr185", "Kr299", "Mü11475", "Mü22405", "Mü28315", "MüU151", "Sg524", "Wi3818"], // looks good
stemmata : []
},
];
export {test_traditions};
14 changes: 14 additions & 0 deletions frontend-e2e/cypress/e2e/admin_privileges.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/* An admin should be allowed to
see all other users' traditions,
edit other users' traditions,
delete other users' traditions.

Users except admins should only be allowed to see and manipulate their own traditions.
They should not be able to see other users' traditions, nor edit or delete them.
*/

describe('Users except admins should not be allowed to see and manipulate other users\'s traditions', () => {
it.skip('issue #170, #157', () => { // currently, logged in as XYZ, one can even delete another user's tradition
// set db to initial state
});
});
21 changes: 0 additions & 21 deletions frontend-e2e/cypress/e2e/dont_create_existing_user.cy.js

This file was deleted.

13 changes: 13 additions & 0 deletions frontend-e2e/cypress/e2e/experimental.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// attempts to solve problems with cypress that occur on github actions but not locally

// does intercept work at all on github actions?
describe('intercept traditions', () => {
it.skip('fails on github, passes locally', () => {
cy.intercept(`${Cypress.env('CY_STEMMAWEB_FRONTEND_URL')}/requests/api/traditions`).as('apiCheck');
cy.visit(`${Cypress.env('CY_STEMMAWEB_FRONTEND_URL')}/`);
cy.log('CY_STEMMAWEB_FRONTEND_URL: ' + `${Cypress.env('CY_STEMMAWEB_FRONTEND_URL')}/`);
cy.wait('@apiCheck').then((interception) => {
assert.isNotNull(interception.response.body, '1st API call has data')
});
});
});
Loading