(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
This commit is contained in:
Jarosław Sadziński 2022-10-21 23:34:26 +02:00
parent 3145af36c6
commit 64710b60f3
154 changed files with 13627 additions and 1090 deletions

View File

@ -12,11 +12,11 @@
"install:python3": "buildtools/prepare_python3.sh", "install:python3": "buildtools/prepare_python3.sh",
"build:prod": "buildtools/build.sh", "build:prod": "buildtools/build.sh",
"start:prod": "sandbox/run.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": "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 -g ${GREP_TESTS:-''} --slow 6000 _build/test/nbrowser/**/*.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 _build/test/client/**/*.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 _build/test/common/**/*.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 _build/test/server/**/*.js _build/test/gen-server/**/*.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:smoke": "NODE_PATH=_build:_build/stubs:_build/ext mocha _build/test/nbrowser/Smoke.js",
"test:docker": "./test/test_under_docker.sh", "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\"}", "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/express": "4.16.0",
"@types/form-data": "2.2.1", "@types/form-data": "2.2.1",
"@types/fs-extra": "5.0.4", "@types/fs-extra": "5.0.4",
"@types/http-proxy": "1.17.9",
"@types/i18next-fs-backend": "1.1.2", "@types/i18next-fs-backend": "1.1.2",
"@types/image-size": "0.0.29", "@types/image-size": "0.0.29",
"@types/js-yaml": "3.11.2", "@types/js-yaml": "3.11.2",
@ -74,6 +75,7 @@
"chai-as-promised": "7.1.1", "chai-as-promised": "7.1.1",
"chance": "1.0.16", "chance": "1.0.16",
"esbuild-loader": "2.19.0", "esbuild-loader": "2.19.0",
"http-proxy": "1.18.1",
"jsdom": "16.5.0", "jsdom": "16.5.0",
"mocha": "5.2.0", "mocha": "5.2.0",
"mocha-webdriver": "0.2.9", "mocha-webdriver": "0.2.9",

View File

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

BIN
test/fixtures/docs/ACL-Test.grist vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
test/fixtures/docs/AllColumns.grist vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
test/fixtures/docs/BlobMigrationV1.grist vendored Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
test/fixtures/docs/BlobMigrationV2.grist vendored Normal file

Binary file not shown.

BIN
test/fixtures/docs/BlobMigrationV3.grist vendored Normal file

Binary file not shown.

BIN
test/fixtures/docs/BlobMigrationV4.grist vendored Normal file

Binary file not shown.

BIN
test/fixtures/docs/BlobMigrationV5.grist vendored Normal file

Binary file not shown.

BIN
test/fixtures/docs/BlobMigrationV6.grist vendored Normal file

Binary file not shown.

BIN
test/fixtures/docs/BlobMigrationV7.grist vendored Normal file

Binary file not shown.

BIN
test/fixtures/docs/BlobMigrationV8.grist vendored Normal file

Binary file not shown.

BIN
test/fixtures/docs/CCTransactions.grist vendored Normal file

Binary file not shown.

BIN
test/fixtures/docs/CC_Statement.grist vendored Normal file

Binary file not shown.

BIN
test/fixtures/docs/CC_Summaries-v2.grist vendored Normal file

Binary file not shown.

BIN
test/fixtures/docs/CC_Summaries-v6.grist vendored Normal file

Binary file not shown.

BIN
test/fixtures/docs/CC_Summaries.grist vendored Normal file

Binary file not shown.

BIN
test/fixtures/docs/ChartData.grist vendored Normal file

Binary file not shown.

BIN
test/fixtures/docs/CopyOptions.grist vendored Normal file

Binary file not shown.

BIN
test/fixtures/docs/CopyPaste.grist vendored Normal file

Binary file not shown.

BIN
test/fixtures/docs/CopyPaste2.grist vendored Normal file

Binary file not shown.

BIN
test/fixtures/docs/Countries-Print.grist vendored Normal file

Binary file not shown.

BIN
test/fixtures/docs/Covid-19.grist vendored Normal file

Binary file not shown.

BIN
test/fixtures/docs/DefaultValuesV5.grist vendored Normal file

Binary file not shown.

BIN
test/fixtures/docs/DefaultValuesV6.grist vendored Normal file

Binary file not shown.

BIN
test/fixtures/docs/DefaultValuesV7.grist vendored Normal file

Binary file not shown.

BIN
test/fixtures/docs/DefaultValuesV8.grist vendored Normal file

Binary file not shown.

BIN
test/fixtures/docs/DownmigrateTest.grist vendored Normal file

Binary file not shown.

BIN
test/fixtures/docs/Excel.grist vendored Normal file

Binary file not shown.

BIN
test/fixtures/docs/Exports.grist vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
test/fixtures/docs/FieldSettings.grist vendored Normal file

Binary file not shown.

BIN
test/fixtures/docs/FilmsWithImages.grist vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
test/fixtures/docs/FilterTest.grist vendored Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
test/fixtures/docs/InvalidValues.grist vendored Normal file

Binary file not shown.

BIN
test/fixtures/docs/Landlord.grist vendored Normal file

Binary file not shown.

BIN
test/fixtures/docs/LastPosition.grist vendored Normal file

Binary file not shown.

BIN
test/fixtures/docs/LinkChain.grist vendored Normal file

Binary file not shown.

BIN
test/fixtures/docs/LongList.grist vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
test/fixtures/docs/Pages-v19.grist vendored Normal file

Binary file not shown.

BIN
test/fixtures/docs/PasteParsing.grist vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
test/fixtures/docs/SchoolsSample.grist vendored Normal file

Binary file not shown.

BIN
test/fixtures/docs/SelectByRefList.grist vendored Normal file

Binary file not shown.

BIN
test/fixtures/docs/SelectBySummary.grist vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
test/fixtures/docs/SortDates.grist vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
test/fixtures/docs/SummarizeByRef.grist vendored Normal file

Binary file not shown.

BIN
test/fixtures/docs/SummaryRulesBug.grist vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
test/fixtures/docs/TabBar.grist vendored Normal file

Binary file not shown.

BIN
test/fixtures/docs/TypeConversions.grist vendored Normal file

Binary file not shown.

BIN
test/fixtures/docs/Widgets.grist vendored Normal file

Binary file not shown.

BIN
test/fixtures/docs/World-v0.grist vendored Normal file

Binary file not shown.

BIN
test/fixtures/docs/World-v1.grist vendored Normal file

Binary file not shown.

BIN
test/fixtures/docs/World-v10.grist vendored Normal file

Binary file not shown.

BIN
test/fixtures/docs/World-v11.grist vendored Normal file

Binary file not shown.

BIN
test/fixtures/docs/World-v12.grist vendored Normal file

Binary file not shown.

BIN
test/fixtures/docs/World-v13.grist vendored Normal file

Binary file not shown.

BIN
test/fixtures/docs/World-v14.grist vendored Normal file

Binary file not shown.

BIN
test/fixtures/docs/World-v15.grist vendored Normal file

Binary file not shown.

BIN
test/fixtures/docs/World-v18.grist vendored Normal file

Binary file not shown.

BIN
test/fixtures/docs/World-v20.grist vendored Normal file

Binary file not shown.

BIN
test/fixtures/docs/World-v24.grist vendored Normal file

Binary file not shown.

BIN
test/fixtures/docs/World-v25.grist vendored Normal file

Binary file not shown.

BIN
test/fixtures/docs/World-v3.grist vendored Normal file

Binary file not shown.

BIN
test/fixtures/docs/World-v8.grist vendored Normal file

Binary file not shown.

BIN
test/fixtures/docs/WorldSQLDB.grist vendored Normal file

Binary file not shown.

BIN
test/fixtures/docs/WorldUndo.grist vendored Normal file

Binary file not shown.

BIN
test/fixtures/docs/doctour.grist vendored Normal file

Binary file not shown.

BIN
test/fixtures/docs/selectBy.grist vendored Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
test/fixtures/docs/video/Employees.grist vendored Normal file

Binary file not shown.

BIN
test/fixtures/docs/video/Leases.grist vendored Normal file

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

3
test/fixtures/export-csv/choice.csv vendored Normal file
View File

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

3
test/fixtures/export-csv/date.csv vendored Normal file
View File

@ -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

3
test/fixtures/export-csv/datetime.csv vendored Normal file
View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

3
test/fixtures/export-csv/integer.csv vendored Normal file
View File

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

4080
test/fixtures/export-csv/many-rows.csv vendored Normal file

File diff suppressed because it is too large Load Diff

4
test/fixtures/export-csv/numeric.csv vendored Normal file
View File

@ -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

View File

@ -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

View File

@ -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