(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

BIN
test/fixtures/uploads/BooleanData.xlsx vendored Normal file

Binary file not shown.

1244
test/fixtures/uploads/CCTransactions.csv vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,11 @@
Group,X,Y1,Y2
Foo,2.00,1.00,6.00
Foo,4.00,2.50,5.00
Foo,3.00,3.50,4.90
Foo,5.00,4.00,7.00
Foo,1.00,1.50,6.90
Bar,2.50,1.00,6.00
Bar,4.50,2.50,5.00
Bar,3.50,3.50,4.90
Bar,5.50,4.00,7.00
Bar,1.50,1.50,6.90
1 Group X Y1 Y2
2 Foo 2.00 1.00 6.00
3 Foo 4.00 2.50 5.00
4 Foo 3.00 3.50 4.90
5 Foo 5.00 4.00 7.00
6 Foo 1.00 1.50 6.90
7 Bar 2.50 1.00 6.00
8 Bar 4.50 2.50 5.00
9 Bar 3.50 3.50 4.90
10 Bar 5.50 4.00 7.00
11 Bar 1.50 1.50 6.90

7
test/fixtures/uploads/ChartData.csv vendored Normal file
View File

@@ -0,0 +1,7 @@
label,value,largeValue,dataSet
6,1,22,0
5,2,33,0
4,3,11,0
3,4,44,1
2,5,22,1
1,6,55,1
1 label value largeValue dataSet
2 6 1 22 0
3 5 2 33 0
4 4 3 11 0
5 3 4 44 1
6 2 5 22 1
7 1 6 55 1

4080
test/fixtures/uploads/Cities.csv vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,3 @@
Alice,1
Bob,2
Carol,3
1 Alice 1
2 Bob 2
3 Carol 3

View File

@@ -0,0 +1,6 @@
Alice,Jones
Bob,Mathews
Alice,Jones
Carol,Jones
Bob,Jones
Alice,Barber
1 Alice Jones
2 Bob Mathews
3 Alice Jones
4 Carol Jones
5 Bob Jones
6 Alice Barber

View File

@@ -0,0 +1,35 @@
Fruit,Name,Letter
Apple,Alice,a
Banana,Bob,a
Orange,Carol,a
Grapefruit,Alice,b
Apple,Bob,b
Banana,Carol,c
Orange,Alice,c
Grapefruit,Bob,d
Apple,Carol,d
Banana,Alice,e
Orange,Bob,e
Grapefruit,Carol,f
Apple,Alice,f
Banana,Bob,g
Orange,Carol,g
Grapefruit,Alice,h
Apple,Bob,h
Banana,Carol,i
Orange,Alice,i
Grapefruit,Bob,j
Apple,Carol,j
Banana,Alice,k
Orange,Bob,k
Grapefruit,Carol,l
Apple,Alice,l
Banana,Bob,m
Orange,Carol,m
Grapefruit,Alice,n
Apple,Bob,n
Banana,Carol,o
Orange,Alice,p
Apple,Bob,q
Banana,Carol,r
Apple,Alice,s
1 Fruit Name Letter
2 Apple Alice a
3 Banana Bob a
4 Orange Carol a
5 Grapefruit Alice b
6 Apple Bob b
7 Banana Carol c
8 Orange Alice c
9 Grapefruit Bob d
10 Apple Carol d
11 Banana Alice e
12 Orange Bob e
13 Grapefruit Carol f
14 Apple Alice f
15 Banana Bob g
16 Orange Carol g
17 Grapefruit Alice h
18 Apple Bob h
19 Banana Carol i
20 Orange Alice i
21 Grapefruit Bob j
22 Apple Carol j
23 Banana Alice k
24 Orange Bob k
25 Grapefruit Carol l
26 Apple Alice l
27 Banana Bob m
28 Orange Carol m
29 Grapefruit Alice n
30 Apple Bob n
31 Banana Carol o
32 Orange Alice p
33 Apple Bob q
34 Banana Carol r
35 Apple Alice s

4
test/fixtures/uploads/EmptyDate.csv vendored Normal file
View File

@@ -0,0 +1,4 @@
Name,Birthday
Bob,2018-01-01
Alice,
Carol,2017-01-01
1 Name Birthday
2 Bob 2018-01-01
3 Alice
4 Carol 2017-01-01

4
test/fixtures/uploads/SchoolData.csv vendored Normal file
View File

@@ -0,0 +1,4 @@
School,Location
Cornell,Ithaca
NYU,NYC
U of R,Rochester
1 School Location
2 Cornell Ithaca
3 NYU NYC
4 U of R Rochester

6
test/fixtures/uploads/StudentData.csv vendored Normal file
View File

@@ -0,0 +1,6 @@
Student,School,DOB
Mike,1,2/13/92
Joe,2,12/30/85
Tom,1,1/4/96
Sue,3,5/18/91
Bill,3,6/12/94
1 Student School DOB
2 Mike 1 2/13/92
3 Joe 2 12/30/85
4 Tom 1 1/4/96
5 Sue 3 5/18/91
6 Bill 3 6/12/94

View File

@@ -0,0 +1,4 @@
Name,Phone,Title
Lily,Jones,director
Kathy,Mills,student
Karen,Gold,professor
1 Name Phone Title
2 Lily Jones director
3 Kathy Mills student
4 Karen Gold professor

View File

@@ -0,0 +1,6 @@
Name,Phone,Title
Lily,Jones,student
Kathy,Mills,professor
Karen,Gold,director
Michael,Smith,student
Lily,James,student
1 Name Phone Title
2 Lily Jones student
3 Kathy Mills professor
4 Karen Gold director
5 Michael Smith student
6 Lily James student

View File

@@ -0,0 +1,7 @@
CourseId,CourseName,Instructor,StartDate,PassFail
BUS100,Intro to Business,,01/13/2021,false
BUS102,Business Law,Nathalie Patricia,01/13/2021,false
BUS300,Business Operations,Michael Rian,01/14/2021,false
BUS301,History of Business,Mariyam Melania,01/14/2021,false
BUS500,Ethics and Law,Filip Andries,01/13/2021,false
BUS540,Capstone,,01/13/2021,true
1 CourseId CourseName Instructor StartDate PassFail
2 BUS100 Intro to Business 01/13/2021 false
3 BUS102 Business Law Nathalie Patricia 01/13/2021 false
4 BUS300 Business Operations Michael Rian 01/14/2021 false
5 BUS301 History of Business Mariyam Melania 01/14/2021 false
6 BUS500 Ethics and Law Filip Andries 01/13/2021 false
7 BUS540 Capstone 01/13/2021 true

View File

@@ -0,0 +1,9 @@
CourseId,CourseName,Instructor,StartDate,PassFail
BUS100,Intro to Business,Mariyam Melania,01/13/2021,false
BUS102,Business Law,Nathalie Patricia,01/13/2021,false
BUS300,Business Operations,Michael Rian,01/14/2021,false
BUS301,History of Business,Mariyam Melania,01/14/2021,false
BUS500,,Filip Andries,01/13/2021,false
BUS501,Marketing,Michael Rian,01/13/2021,false
BUS539,Independent Study,,01/13/2021,true
BUS540,Capstone,,01/13/2021,false
1 CourseId CourseName Instructor StartDate PassFail
2 BUS100 Intro to Business Mariyam Melania 01/13/2021 false
3 BUS102 Business Law Nathalie Patricia 01/13/2021 false
4 BUS300 Business Operations Michael Rian 01/14/2021 false
5 BUS301 History of Business Mariyam Melania 01/14/2021 false
6 BUS500 Filip Andries 01/13/2021 false
7 BUS501 Marketing Michael Rian 01/13/2021 false
8 BUS539 Independent Study 01/13/2021 true
9 BUS540 Capstone 01/13/2021 false

View File

@@ -0,0 +1,5 @@
,,,
,,,
milk,1,sold
egg,2,in stock
butter,4,sold
1 ,,,
2 ,,,
3 milk,1,sold
4 egg,2,in stock
5 butter,4,sold

View File

@@ -0,0 +1 @@

BIN
test/fixtures/uploads/World-v0.xlsx vendored Normal file

Binary file not shown.

BIN
test/fixtures/uploads/World-v1.xlsx vendored Normal file

Binary file not shown.

28
test/fixtures/uploads/cities.jgrist vendored Normal file
View File

@@ -0,0 +1,28 @@
{
"parseOptions": {},
"tables": [
{
"table_name": "city",
"column_metadata": [
{
"id": "id",
"type": "Int"
},
{
"id": "city",
"type": "Text"
}
],
"table_data": [
[
1,
2
],
[
"Berlin",
"Tokyo"
]
]
}
]
}

View File

@@ -0,0 +1,28 @@
{
"parseOptions": {},
"tables": [
{
"table_name": "city",
"column_metadata": [
{
"id": "id",
"type": "Int"
},
{
"id": "city",
"type": ["Space", "Monkey"]
}
],
"table_data": [
[
1,
2
],
[
"Berlin",
"Tokyo"
]
]
}
]
}

1
test/fixtures/uploads/dirtyNames.json vendored Normal file
View File

@@ -0,0 +1 @@
{"**dirty_name**": {"a": {"b": 1}}}

11
test/fixtures/uploads/empty_data.jgrist vendored Normal file
View File

@@ -0,0 +1,11 @@
{
"parseOptions": {
},
"tables": [
{
"column_metadata": [],
"table_data": [],
"table_name": "no-data"
}
]
}

BIN
test/fixtures/uploads/empty_excel.xlsx vendored Normal file

Binary file not shown.

0
test/fixtures/uploads/file1.mov vendored Normal file
View File

0
test/fixtures/uploads/file2.mp3 vendored Normal file
View File

0
test/fixtures/uploads/file3.zip vendored Normal file
View File

View File

@@ -0,0 +1,2 @@
fn_currency,fn_scientific,fn_decimal,fn_percent,fn_parens
$1.00,1.20E3,"2,000,000",43%,(56)
1 fn_currency fn_scientific fn_decimal fn_percent fn_parens
2 $1.00 1.20E3 2,000,000 43% (56)

BIN
test/fixtures/uploads/gplaypattern.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
test/fixtures/uploads/grist.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

7
test/fixtures/uploads/htmlfile.html vendored Normal file
View File

@@ -0,0 +1,7 @@
<html>
<body>
<script>
window.alert("ASDF");
</script>
</body>
</html>

11
test/fixtures/uploads/mixed_dates.csv vendored Normal file
View File

@@ -0,0 +1,11 @@
date
2020-03-04
2020-03-05
2020-03-06
2020-03-04
2020-03-05
2020-03-06
2020-03-04
2020-03-05
2020-03-06
01/02/03
1 date
2 2020-03-04
3 2020-03-05
4 2020-03-06
5 2020-03-04
6 2020-03-05
7 2020-03-06
8 2020-03-04
9 2020-03-05
10 2020-03-06
11 01/02/03

View File

@@ -0,0 +1,3 @@
Name,Reference
Charlie,Alice
Dennis,Bob
1 Name Reference
2 Charlie Alice
3 Dennis Bob

12
test/fixtures/uploads/names.json vendored Normal file
View File

@@ -0,0 +1,12 @@
[
{
"name": {
"first": "Bob"
}
},
{
"name": {
"first": "Alice"
}
}
]

198
test/fixtures/uploads/sample.pdf vendored Normal file
View File

@@ -0,0 +1,198 @@
%PDF-1.3
%âãÏÓ
1 0 obj
<<
/Type /Catalog
/Outlines 2 0 R
/Pages 3 0 R
>>
endobj
2 0 obj
<<
/Type /Outlines
/Count 0
>>
endobj
3 0 obj
<<
/Type /Pages
/Count 2
/Kids [ 4 0 R 6 0 R ]
>>
endobj
4 0 obj
<<
/Type /Page
/Parent 3 0 R
/Resources <<
/Font <<
/F1 9 0 R
>>
/ProcSet 8 0 R
>>
/MediaBox [0 0 612.0000 792.0000]
/Contents 5 0 R
>>
endobj
5 0 obj
<< /Length 1074 >>
stream
2 J
BT
0 0 0 rg
/F1 0027 Tf
57.3750 722.2800 Td
( A Simple PDF File ) Tj
ET
BT
/F1 0010 Tf
69.2500 688.6080 Td
( This is a small demonstration .pdf file - ) Tj
ET
BT
/F1 0010 Tf
69.2500 664.7040 Td
( just for use in the Virtual Mechanics tutorials. More text. And more ) Tj
ET
BT
/F1 0010 Tf
69.2500 652.7520 Td
( text. And more text. And more text. And more text. ) Tj
ET
BT
/F1 0010 Tf
69.2500 628.8480 Td
( And more text. And more text. And more text. And more text. And more ) Tj
ET
BT
/F1 0010 Tf
69.2500 616.8960 Td
( text. And more text. Boring, zzzzz. And more text. And more text. And ) Tj
ET
BT
/F1 0010 Tf
69.2500 604.9440 Td
( more text. And more text. And more text. And more text. And more text. ) Tj
ET
BT
/F1 0010 Tf
69.2500 592.9920 Td
( And more text. And more text. ) Tj
ET
BT
/F1 0010 Tf
69.2500 569.0880 Td
( And more text. And more text. And more text. And more text. And more ) Tj
ET
BT
/F1 0010 Tf
69.2500 557.1360 Td
( text. And more text. And more text. Even more. Continued on page 2 ...) Tj
ET
endstream
endobj
6 0 obj
<<
/Type /Page
/Parent 3 0 R
/Resources <<
/Font <<
/F1 9 0 R
>>
/ProcSet 8 0 R
>>
/MediaBox [0 0 612.0000 792.0000]
/Contents 7 0 R
>>
endobj
7 0 obj
<< /Length 676 >>
stream
2 J
BT
0 0 0 rg
/F1 0027 Tf
57.3750 722.2800 Td
( Simple PDF File 2 ) Tj
ET
BT
/F1 0010 Tf
69.2500 688.6080 Td
( ...continued from page 1. Yet more text. And more text. And more text. ) Tj
ET
BT
/F1 0010 Tf
69.2500 676.6560 Td
( And more text. And more text. And more text. And more text. And more ) Tj
ET
BT
/F1 0010 Tf
69.2500 664.7040 Td
( text. Oh, how boring typing this stuff. But not as boring as watching ) Tj
ET
BT
/F1 0010 Tf
69.2500 652.7520 Td
( paint dry. And more text. And more text. And more text. And more text. ) Tj
ET
BT
/F1 0010 Tf
69.2500 640.8000 Td
( Boring. More, a little more text. The end, and just as well. ) Tj
ET
endstream
endobj
8 0 obj
[/PDF /Text]
endobj
9 0 obj
<<
/Type /Font
/Subtype /Type1
/Name /F1
/BaseFont /Helvetica
/Encoding /WinAnsiEncoding
>>
endobj
10 0 obj
<<
/Creator (Rave \(http://www.nevrona.com/rave\))
/Producer (Nevrona Designs)
/CreationDate (D:20060301072826)
>>
endobj
xref
0 11
0000000000 65535 f
0000000019 00000 n
0000000093 00000 n
0000000147 00000 n
0000000222 00000 n
0000000390 00000 n
0000001522 00000 n
0000001690 00000 n
0000002423 00000 n
0000002456 00000 n
0000002574 00000 n
trailer
<<
/Size 11
/Root 1 0 R
/Info 10 0 R
>>
startxref
2714
%%EOF

View File

@@ -0,0 +1 @@
[{"a": 1, "b": "baba"}, {"a": 4, "b": "abab"}]

View File

@@ -0,0 +1,110 @@
{
"albums" : [ {
"album_type" : "album",
"artists" : [ {
"external_urls" : {
"spotify" : "https://open.spotify.com/artist/53A0W3U0s8diEn9RhXQhVz"
},
"href" : "https://api.spotify.com/v1/artists/53A0W3U0s8diEn9RhXQhVz",
"id" : "53A0W3U0s8diEn9RhXQhVz",
"name" : "Keane",
"type" : "artist",
"uri" : "spotify:artist:53A0W3U0s8diEn9RhXQhVz"
} ],
"available_markets" : [ "AD", "AR", "AT", "AU", "BE", "BG", "BO", "BR", "CH", "CL", "CO", "CR", "CY", "CZ", "DE", "DK", "DO", "EC", "EE", "ES", "FI", "FR", "GB", "GR", "GT", "HK", "HN", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MC", "MT", "MY", "NI", "NL", "NO", "NZ", "PA", "PE", "PH", "PL", "PT", "PY", "RO", "SE", "SG", "SI", "SK", "SV", "TR", "TW", "UY" ],
"copyrights" : [ {
"text" : "(C) 2013 Universal Island Records, a division of Universal Music Operations Limited",
"type" : "C"
}, {
"text" : "(P) 2013 Universal Island Records, a division of Universal Music Operations Limited",
"type" : "P"
} ],
"external_ids" : {
"upc" : "00602537518357"
},
"external_urls" : {
"spotify" : "https://open.spotify.com/album/41MnTivkwTO3UUJ8DrqEJJ"
},
"genres" : [ ],
"href" : "https://api.spotify.com/v1/albums/41MnTivkwTO3UUJ8DrqEJJ",
"id" : "41MnTivkwTO3UUJ8DrqEJJ",
"images" : [ {
"height" : 640,
"url" : "https://i.scdn.co/image/89b92c6b59131776c0cd8e5df46301ffcf36ed69",
"width" : 640
}, {
"height" : 300,
"url" : "https://i.scdn.co/image/eb6f0b2594d81f8d9dced193f3e9a3bc4318aedc",
"width" : 300
}, {
"height" : 64,
"url" : "https://i.scdn.co/image/21e1ebcd7ebd3b679d9d5084bba1e163638b103a",
"width" : 64
} ],
"name" : "The Best Of Keane (Deluxe Edition)",
"popularity" : 65,
"release_date" : "2013-11-08",
"release_date_precision" : "day",
"tracks" : {
"href" : "https://api.spotify.com/v1/albums/41MnTivkwTO3UUJ8DrqEJJ/tracks?offset=0&limit=50",
"items" : [ {
"artists" : [ {
"external_urls" : {
"spotify" : "https://open.spotify.com/artist/53A0W3U0s8diEn9RhXQhVz"
},
"href" : "https://api.spotify.com/v1/artists/53A0W3U0s8diEn9RhXQhVz",
"id" : "53A0W3U0s8diEn9RhXQhVz",
"name" : "Keane",
"type" : "artist",
"uri" : "spotify:artist:53A0W3U0s8diEn9RhXQhVz"
} ],
"available_markets" : [ "AD", "AR", "AT", "AU", "BE", "BG", "BO", "BR", "CH", "CL", "CO", "CR", "CY", "CZ", "DE", "DK", "DO", "EC", "EE", "ES", "FI", "FR", "GB", "GR", "GT", "HK", "HN", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MC", "MT", "MY", "NI", "NL", "NO", "NZ", "PA", "PE", "PH", "PL", "PT", "PY", "RO", "SE", "SG", "SI", "SK", "SV", "TR", "TW", "UY" ],
"disc_number" : 1,
"duration_ms" : 215986,
"explicit" : false,
"external_urls" : {
"spotify" : "https://open.spotify.com/track/4r9PmSmbAOOWqaGWLf6M9Q"
},
"href" : "https://api.spotify.com/v1/tracks/4r9PmSmbAOOWqaGWLf6M9Q",
"id" : "4r9PmSmbAOOWqaGWLf6M9Q",
"name" : "Everybody's Changing",
"preview_url" : "https://p.scdn.co/mp3-preview/641fd877ee0f42f3713d1649e20a9734cc64b8f9",
"track_number" : 1,
"type" : "track",
"uri" : "spotify:track:4r9PmSmbAOOWqaGWLf6M9Q"
}, {
"artists" : [ {
"external_urls" : {
"spotify" : "https://open.spotify.com/artist/53A0W3U0s8diEn9RhXQhVz"
},
"href" : "https://api.spotify.com/v1/artists/53A0W3U0s8diEn9RhXQhVz",
"id" : "53A0W3U0s8diEn9RhXQhVz",
"name" : "Keane",
"type" : "artist",
"uri" : "spotify:artist:53A0W3U0s8diEn9RhXQhVz"
} ],
"available_markets" : [ "AD", "AR", "AT", "AU", "BE", "BG", "BO", "BR", "CH", "CL", "CO", "CR", "CY", "CZ", "DE", "DK", "DO", "EC", "EE", "ES", "FI", "FR", "GB", "GR", "GT", "HK", "HN", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MC", "MT", "MY", "NI", "NL", "NO", "NZ", "PA", "PE", "PH", "PL", "PT", "PY", "RO", "SE", "SG", "SI", "SK", "SV", "TR", "TW", "UY" ],
"disc_number" : 1,
"duration_ms" : 235880,
"explicit" : false,
"external_urls" : {
"spotify" : "https://open.spotify.com/track/0HJQD8uqX2Bq5HVdLnd3ep"
},
"href" : "https://api.spotify.com/v1/tracks/0HJQD8uqX2Bq5HVdLnd3ep",
"id" : "0HJQD8uqX2Bq5HVdLnd3ep",
"name" : "Somewhere Only We Know",
"preview_url" : "https://p.scdn.co/mp3-preview/e001676375ea2b4807cee2f98b51f2f3fe0d109b",
"track_number" : 2,
"type" : "track",
"uri" : "spotify:track:0HJQD8uqX2Bq5HVdLnd3ep"
}],
"limit" : 50,
"next" : null,
"offset" : 0,
"previous" : null,
"total" : 9
},
"type" : "album",
"uri" : "spotify:album:6UXCm6bOO4gFlDQZV5yL37"
} ]
}

View File

@@ -0,0 +1 @@
Բարեւ աշխարհ,Γειά σου Κόσμε,123 test,สวัสดีชาวโลก,こんにちは世界,नमस्ते दुनिया,გამარჯობა მსოფლიო,你好世界,% test
1 Բարեւ աշխարհ Γειά σου Κόσμε 123 test สวัสดีชาวโลก こんにちは世界 नमस्ते दुनिया გამარჯობა მსოფლიო 你好世界 % test

Binary file not shown.

Binary file not shown.