(core) Moving nbrowser tests to grist-core

Summary:
Moving bulk of nbrowser tests to core. Some tests were split and only part of them were moved.
Tests that are left are either: not suitable for grist-core (like billing) or are failing during browser tests (are not reliable).
Four fixtures directory (uploads, docs, exports-csv/excel) where completely moved to grist-core and are linked as folders.
Those changes allows to add an nbrowser test in grist-core or in the main test folder without any need to link it or link a fixture document.

Other changes:
- testrun.sh has been modified, now it runs tests from both folders (test and core/test),
- TestServer used in grist-core is now adding sample orgs and users (kiwi and others),

Test modified
- SelectionSummary: now it is run on a bigScreen, it was failing randomly
- Billing.ts: relative paths were used
- DateEditor: added waitForServer - it was failing in browser mode
- FrozenColumns, ImportFromGDrive, Printing: updated import paths
- UserManager.ts: was split into two parts (it assumed limited products)
- ViewLayoutResize.ts: this test is still in main repo, it is still failing in browser mode tests

Test Plan: Existing

Reviewers: paulfitz

Reviewed By: paulfitz

Subscribers: dsagal, paulfitz

Differential Revision: https://phab.getgrist.com/D3664
pull/282/head
Jarosław Sadziński 2 years ago
parent 3145af36c6
commit 64710b60f3

@ -12,11 +12,11 @@
"install:python3": "buildtools/prepare_python3.sh",
"build:prod": "buildtools/build.sh",
"start:prod": "sandbox/run.sh",
"test": "GRIST_SESSION_COOKIE=grist_test_cookie GRIST_TEST_LOGIN=1 TEST_SUPPORT_API_KEY=api_key_for_support TEST_CLEAN_DATABASE=true NODE_PATH=_build:_build/stubs:_build/ext mocha -g ${GREP_TESTS:-''} _build/test/common/*.js _build/test/client/*.js _build/test/nbrowser/*.js _build/test/server/**/*.js _build/test/gen-server/**/*.js",
"test:nbrowser": "GRIST_SESSION_COOKIE=grist_test_cookie GRIST_TEST_LOGIN=1 TEST_SUPPORT_API_KEY=api_key_for_support TEST_CLEAN_DATABASE=true NODE_PATH=_build:_build/stubs:_build/ext mocha -g ${GREP_TESTS:-''} --slow 6000 _build/test/nbrowser/**/*.js",
"test:client": "GRIST_SESSION_COOKIE=grist_test_cookie NODE_PATH=_build:_build/stubs:_build/ext mocha _build/test/client/**/*.js",
"test:common": "GRIST_SESSION_COOKIE=grist_test_cookie NODE_PATH=_build:_build/stubs:_build/ext mocha _build/test/common/**/*.js",
"test:server": "GRIST_SESSION_COOKIE=grist_test_cookie NODE_PATH=_build:_build/stubs:_build/ext mocha _build/test/server/**/*.js _build/test/gen-server/**/*.js",
"test": "GRIST_SESSION_COOKIE=grist_test_cookie GRIST_TEST_LOGIN=1 TEST_SUPPORT_API_KEY=api_key_for_support TEST_CLEAN_DATABASE=true NODE_PATH=_build:_build/stubs:_build/ext mocha ${DEBUG:+-b --no-exit} ${DEBUG:---forbid-only} -g ${GREP_TESTS:-''} _build/test/common/*.js _build/test/client/*.js _build/test/nbrowser/*.js _build/test/server/**/*.js _build/test/gen-server/**/*.js",
"test:nbrowser": "GRIST_SESSION_COOKIE=grist_test_cookie GRIST_TEST_LOGIN=1 TEST_SUPPORT_API_KEY=api_key_for_support TEST_CLEAN_DATABASE=true NODE_PATH=_build:_build/stubs:_build/ext mocha ${DEBUG:+-b --no-exit} ${DEBUG:---forbid-only} -g ${GREP_TESTS:-''} --slow 8000 _build/test/nbrowser/**/*.js",
"test:client": "GRIST_SESSION_COOKIE=grist_test_cookie NODE_PATH=_build:_build/stubs:_build/ext mocha ${DEBUG:+'-b'} _build/test/client/**/*.js",
"test:common": "GRIST_SESSION_COOKIE=grist_test_cookie NODE_PATH=_build:_build/stubs:_build/ext mocha ${DEBUG:+'-b'} _build/test/common/**/*.js",
"test:server": "GRIST_SESSION_COOKIE=grist_test_cookie NODE_PATH=_build:_build/stubs:_build/ext mocha ${DEBUG:+'-b'} _build/test/server/**/*.js _build/test/gen-server/**/*.js",
"test:smoke": "NODE_PATH=_build:_build/stubs:_build/ext mocha _build/test/nbrowser/Smoke.js",
"test:docker": "./test/test_under_docker.sh",
"test:python": "sandbox_venv3/bin/python sandbox/grist/runtests.py ${GREP_TESTS:+discover -p \"test*${GREP_TESTS}*.py\"}",
@ -43,6 +43,7 @@
"@types/express": "4.16.0",
"@types/form-data": "2.2.1",
"@types/fs-extra": "5.0.4",
"@types/http-proxy": "1.17.9",
"@types/i18next-fs-backend": "1.1.2",
"@types/image-size": "0.0.29",
"@types/js-yaml": "3.11.2",
@ -74,6 +75,7 @@
"chai-as-promised": "7.1.1",
"chance": "1.0.16",
"esbuild-loader": "2.19.0",
"http-proxy": "1.18.1",
"jsdom": "16.5.0",
"mocha": "5.2.0",
"mocha-webdriver": "0.2.9",

@ -59,7 +59,12 @@ export async function main() {
setDefaultEnv('GRIST_DATA_DIR', 'docs');
await fse.mkdirp(process.env.GRIST_DATA_DIR!);
// Make a blank db if needed.
await updateDb();
if (process.env.TEST_CLEAN_DATABASE) {
const {createInitialDb} = require('test/gen-server/seed');
await createInitialDb();
} else {
await updateDb();
}
const db = new HomeDBManager();
await db.connect();
await db.initializeSpecialIds({skipWorkspaces: true});

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -0,0 +1,3 @@
TextBox,Spinner
foo,foo
bar,Baz
1 TextBox Spinner
2 foo foo
3 bar Baz

@ -0,0 +1,3 @@
YYYY-MM-DD,MM-DD-YYYY,MM/DD/YYYY,MM-DD-YY,MM/DD/YY,"MMMM Do, YYYY",DD-MM-YYYY,Custom YYYY-MM
2016-12-01,12-03-2016,12/08/2016,12-13-16,12/23/16,"December 1st, 2016",08-12-2016,2016-12
2016-12-22,12-28-2016,12/28/2016,12-11-16,12/11/16,"December 26th, 2016",25-12-2016,2016-11
1 YYYY-MM-DD MM-DD-YYYY MM/DD/YYYY MM-DD-YY MM/DD/YY MMMM Do, YYYY DD-MM-YYYY Custom YYYY-MM
2 2016-12-01 12-03-2016 12/08/2016 12-13-16 12/23/16 December 1st, 2016 08-12-2016 2016-12
3 2016-12-22 12-28-2016 12/28/2016 12-11-16 12/11/16 December 26th, 2016 25-12-2016 2016-11

@ -0,0 +1,3 @@
h:mma,h:mma z,HH:mm,HH:mm z,HH:mm:ss,HH:mm:ss z
2016-12-08 7:00pm,2016-12-01 11:08pm WAT,2016-12-09 00:00,2016-12-28 03:00 -02,2016-12-08 13:33:00,2016-12-08 12:45:12 EST
2016-12-29 5:07am,2016-12-29 4:00am WAT,2016-12-31 08:00,2016-12-06 21:00 -02,2016-12-07 13:33:55,2016-12-28 10:52:34 EST
1 h:mma h:mma z HH:mm HH:mm z HH:mm:ss HH:mm:ss z
2 2016-12-08 7:00pm 2016-12-01 11:08pm WAT 2016-12-09 00:00 2016-12-28 03:00 -02 2016-12-08 13:33:00 2016-12-08 12:45:12 EST
3 2016-12-29 5:07am 2016-12-29 4:00am WAT 2016-12-31 08:00 2016-12-06 21:00 -02 2016-12-07 13:33:55 2016-12-28 10:52:34 EST

@ -0,0 +1,4 @@
Text Formula,MM-DD-YY
a,04-14-17
"b ,d",04-03-17
a,05-15-17
1 Text Formula MM-DD-YY
2 a 04-14-17
3 b ,d 04-03-17
4 a 05-15-17

@ -0,0 +1,4 @@
A,B
"John, Bob",John
"Bob, Alice",Alice
Bob,
1 A B
2 John, Bob John
3 Bob, Alice Alice
4 Bob

@ -0,0 +1,3 @@
Color,Place,Height
yellow,springfield,100
red,cambridge,200
1 Color Place Height
2 yellow springfield 100
3 red cambridge 200

@ -0,0 +1,4 @@
Color,Place,Height
green,kansas,50
green,earth,75
yellow,springfield,100
1 Color Place Height
2 green kansas 50
3 green earth 75
4 yellow springfield 100

@ -0,0 +1,4 @@
Id is Baz Label is this,Formula,Foo,Link
hello,a --- grist https://www.getgrist.com/,1,grist https://www.getgrist.com/
world,"b ,d --- https://www.getgrist.com/",2,https://www.getgrist.com/
,"the ""quote marks"" ? --- ",3,
1 Id is Baz Label is this Formula Foo Link
2 hello a --- grist https://www.getgrist.com/ 1 grist https://www.getgrist.com/
3 world b ,d --- https://www.getgrist.com/ 2 https://www.getgrist.com/
4 the "quote marks" ? --- 3

@ -0,0 +1,3 @@
TextBox,Spinner
500,foo
200,4
1 TextBox Spinner
2 500 foo
3 200 4

File diff suppressed because it is too large Load Diff

@ -0,0 +1,4 @@
TextBox,Spinner,OneDecimal
1.33,5000,700.6
2.01,0,0.55
400.00,2000.55,0.0
1 TextBox Spinner OneDecimal
2 1.33 5000 700.6
3 2.01 0 0.55
4 400.00 2000.55 0.0

@ -0,0 +1,6 @@
Color,Place,Height
yellow,zoo,88
yellow,springfield,100
red,cambridge,200
green,kansas,50
green,earth,75
1 Color Place Height
2 yellow zoo 88
3 yellow springfield 100
4 red cambridge 200
5 green kansas 50
6 green earth 75

@ -0,0 +1,6 @@
Color,Place,Height
green,kansas,50
green,earth,75
red,cambridge,200
yellow,zoo,88
yellow,springfield,100
1 Color Place Height
2 green kansas 50
3 green earth 75
4 red cambridge 200
5 yellow zoo 88
6 yellow springfield 100

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save