@datagrok/curves 1.13.3 → 1.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/.grokignore +2 -0
  2. package/.turbo/turbo-build.log +5 -4
  3. package/CHANGELOG.md +18 -0
  4. package/README.md +2 -2
  5. package/bdd/bdd.config.json +1 -0
  6. package/bdd/bindings/curves.ts +28 -0
  7. package/bdd/features/MISSING.md +20 -0
  8. package/bdd/features/data/curve-json-columns.feature +66 -0
  9. package/bdd/features/data/data-to-curves.feature +50 -0
  10. package/bdd/features/data/pzfx-files.feature +25 -0
  11. package/bdd/features/grid/curve-cells.feature +55 -0
  12. package/bdd/features/grid/curve-options.feature +52 -0
  13. package/bdd/features/grid/statistic-columns.feature +47 -0
  14. package/bdd/features/guides/INDEX.md +8 -0
  15. package/bdd/features/guides/curves-legend-cells.feature +37 -0
  16. package/bdd/features/guides/curves-legend.feature +42 -0
  17. package/bdd/features/viewers/curves-in-trellis.feature +90 -0
  18. package/bdd/features/viewers/multi-curve-viewer.feature +92 -0
  19. package/bdd/generated/data/curve-json-columns.test.ts +75 -0
  20. package/bdd/generated/data/data-to-curves.test.ts +45 -0
  21. package/bdd/generated/data/pzfx-files.test.ts +50 -0
  22. package/bdd/generated/grid/curve-cells.test.ts +67 -0
  23. package/bdd/generated/grid/curve-options.test.ts +66 -0
  24. package/bdd/generated/grid/statistic-columns.test.ts +64 -0
  25. package/bdd/generated/guides/curves-legend-cells.test.ts +48 -0
  26. package/bdd/generated/guides/curves-legend.test.ts +48 -0
  27. package/bdd/generated/viewers/curves-in-trellis.test.ts +98 -0
  28. package/bdd/generated/viewers/multi-curve-viewer.test.ts +103 -0
  29. package/bdd/package.json +1 -0
  30. package/bdd/tsconfig.json +13 -0
  31. package/detectors.js +4 -4
  32. package/dist/package-test.js +28 -16
  33. package/dist/package-test.js.map +1 -1
  34. package/dist/package.js +1 -1
  35. package/dist/package.js.map +1 -1
  36. package/package.json +12 -5
  37. package/src/fit/fit-grid-cell-handler.ts +29 -4
  38. package/src/fit/fit-interaction.ts +15 -9
  39. package/src/fit/fit-legend.ts +35 -9
  40. package/src/fit/fit-renderer.ts +24 -9
  41. package/src/fit/multi-curve-viewer.ts +82 -19
  42. package/src/package-test.ts +1 -0
  43. package/src/package.g.ts +1 -0
  44. package/src/package.ts +1 -1
  45. package/src/tests/calculated-columns-tests.ts +3 -3
  46. package/src/tests/curve-data.ts +5 -1
  47. package/src/tests/curves-cell-renderer-tests.ts +10 -10
  48. package/src/tests/data-to-curves-tests.ts +34 -0
  49. package/src/tests/detector-tests.ts +26 -0
  50. package/src/tests/fit-tests.ts +12 -0
  51. package/src/tests/legend-tests.ts +24 -1
  52. package/src/tests/multi-curve-viewer-tests.ts +90 -17
  53. package/src/tests/panel-renderer-tests.ts +75 -30
  54. package/src/tests/project-tests.ts +30 -12
  55. package/test-console-output-1.log +366 -332
  56. package/test-record-1.mp4 +0 -0
@@ -0,0 +1,92 @@
1
+ @journey
2
+ Feature: The Multi curve viewer from the Add Viewer dialog, its curve columns, Use in Trellis
3
+ Translated from TestTrack Curves/multi-curve-viewer.md, scenarios 1, 2, 3, 4 (the viewer's part), 5
4
+ and 7. The MultiCurveViewer card of the Add Viewer dialog is enabled on a table with curve columns and
5
+ disabled on one without (GROK-19014, GROK-14069); added, the viewer takes one of the five curve
6
+ columns and draws the curves of the current row, the Curves editor's All takes all five, the selected
7
+ rows add theirs and with Show Selected Rows Curves unchecked only the current row's stay (scenario 3,
8
+ step 5); Merge Cell Series draws one curve per cell (GROK-19028); General > Use in Trellis
9
+ puts it into a trellis as the inner viewer (GROK-19025); a closed viewer leaves no error behind
10
+ (Curves 1.13.1). The curves table is ready once the Context Panel shows the value of its current
11
+ cell: until then the platform may still replace the viewer's properties opened from its menu.
12
+
13
+ What the viewer draws is its "curves" reading. Row 1 of the curves table holds 2 + 2 + 1 + 1 + 1
14
+ curves in its five columns. That merging leaves the grid's own cell alone is the package's
15
+ multi-curve-viewer test; the legend is the guide guides/curves-legend.feature. With all five columns, every
16
+ point lies within the axes the viewer draws (GROK-20661: a range one cell declares for its own chart no
17
+ longer narrows the overlay).
18
+
19
+ Background:
20
+ Given user is logged in
21
+ And simple mode is off
22
+ And the package autostarts have completed
23
+ And the "Curves" package is installed
24
+
25
+ Scenario: On a table without curves the MultiCurveViewer card is disabled
26
+ Given user opens demog-1000 dataset
27
+ Then "Add viewer" icon in toolbar should be visible
28
+ When user clicks on "Add viewer" icon in toolbar
29
+ Then "Add Viewer" dialog should be visible
30
+ When user types "curve" into viewer gallery search in "Add Viewer" dialog
31
+ Then first "MultiCurveViewer" card in "Add Viewer" dialog should be disabled
32
+ When user presses Escape
33
+ Then "Add Viewer" dialog should be absent
34
+ And no errors should have been logged
35
+
36
+ Scenario: On the curves table the card adds the viewer with one curve column, and All takes five
37
+ Given user closes all views
38
+ And user opens curves dataset
39
+ Then the context panel should show the current cell
40
+ And "Add viewer" icon in toolbar should be visible
41
+ When user clicks on "Add viewer" icon in toolbar
42
+ Then "Add Viewer" dialog should be visible
43
+ When user types "curve" into viewer gallery search in "Add Viewer" dialog
44
+ Then first "MultiCurveViewer" card in "Add Viewer" dialog should be enabled
45
+ When user clicks on first "MultiCurveViewer" card in "Add Viewer" dialog
46
+ Then "Add Viewer" dialog should be absent
47
+ And the open tableview should have 1 MultiCurveViewer viewer
48
+ And the "curves" reading of MultiCurveViewer viewer should be 2
49
+ When user picks "Properties..." from the viewer menu of MultiCurveViewer viewer
50
+ Then "Curves" property in context panel should contain text "1 / 5"
51
+ When user clicks on "..." button in "Curves" property in context panel
52
+ Then "Select columns..." dialog should be visible
53
+ When user clicks on "All" link in "Select columns..." dialog
54
+ Then "5 checked" text in "Select columns..." dialog should be visible
55
+ When user clicks on OK button in "Select columns..." dialog
56
+ And user picks "Properties..." from the viewer menu of MultiCurveViewer viewer
57
+ Then "Curves" property in context panel should contain text "5 / 5"
58
+ And the "curves" reading of MultiCurveViewer viewer should be 7
59
+ And the "points outside the axes" reading of MultiCurveViewer viewer should be 0
60
+ And no errors should have been logged
61
+
62
+ Scenario: The selected rows add their curves, Merge Cell Series draws one curve per cell
63
+ When user selects the first 3 rows
64
+ Then the "curves" reading of MultiCurveViewer viewer should be 21
65
+ When user expands "Misc" category in context panel
66
+ And user checks "Merge Cell Series" property in context panel
67
+ Then the "curves" reading of MultiCurveViewer viewer should be 15
68
+ When user unchecks "Merge Cell Series" property in context panel
69
+ Then the "curves" reading of MultiCurveViewer viewer should be 21
70
+ When user unchecks "Show Selected Rows Curves" property in context panel
71
+ Then the "curves" reading of MultiCurveViewer viewer should be 7
72
+ When user checks "Show Selected Rows Curves" property in context panel
73
+ Then the "curves" reading of MultiCurveViewer viewer should be 21
74
+ When user clears the row selection
75
+ Then the "curves" reading of MultiCurveViewer viewer should be 7
76
+ And no errors should have been logged
77
+
78
+ Scenario: A closed viewer leaves no error when rows are clicked afterwards
79
+ When user hovers over MultiCurveViewer viewer
80
+ And user clicks on close icon of MultiCurveViewer viewer
81
+ Then the open tableview should have 0 MultiCurveViewer viewers
82
+ When user selects the first 3 rows
83
+ And user makes row 4 current
84
+ Then no errors should have been logged
85
+
86
+ Scenario: Use in Trellis puts the viewer into a trellis plot as its inner viewer
87
+ Given user adds MultiCurveViewer viewer
88
+ When user picks "General | Use in Trellis" from the viewer menu of MultiCurveViewer viewer
89
+ Then the open tableview should have 1 trellis plot viewer
90
+ And the "inner viewer type" reading of trellis plot viewer should be "MultiCurveViewer"
91
+ And trellis plot viewer should report no error
92
+ And no errors should have been logged
@@ -0,0 +1,75 @@
1
+ /* eslint-disable max-len */
2
+ /* eslint-disable comma-spacing */
3
+ /* eslint-disable quotes */
4
+ /* ---
5
+ generated: features/data/curve-json-columns.feature
6
+ generator: @datagrok-libraries/bdd — do not edit; run `grok-bdd compile` to regenerate
7
+ --- */
8
+ import {test} from '@playwright/test';
9
+ import '../../bindings/curves.js';
10
+ import '@datagrok-libraries/bdd/bindings/common/kinds';
11
+ import '@datagrok-libraries/bdd/bindings/common/parameter-types';
12
+ import '@datagrok-libraries/bdd/bindings/platform/datasets';
13
+ import '@datagrok-libraries/bdd/bindings/platform/elements';
14
+ import {loggedIn} from '@datagrok-libraries/bdd/bindings/common/session';
15
+ import {clickOn, isExpanded, pasteInto, shouldBe, typeInto} from '@datagrok-libraries/bdd/bindings/common/steps';
16
+ import {columnSemType, columnsExactly, hasColumn} from '@datagrok-libraries/bdd/bindings/platform/columns';
17
+ import {pickFromTopMenu} from '@datagrok-libraries/bdd/bindings/platform/commands';
18
+ import {currentColumnIs} from '@datagrok-libraries/bdd/bindings/platform/data';
19
+ import {autostartsCompleted, closeAllViews, contextPanelOpen, dialogCloses, openDataset, openTableOf, packageInstalled, simpleModeOff} from '@datagrok-libraries/bdd/bindings/platform/steps';
20
+ import {clickArea, noBalloons, noErrors} from '@datagrok-libraries/bdd/bindings/tiers/viewers/steps';
21
+ import {ds, el, feature, journey} from '@datagrok-libraries/bdd/runtime';
22
+
23
+ test.describe("Curve JSON typed into a formula, a series without a name, and a broken curve cell", () => {
24
+ const session = feature(test, "features/data/curve-json-columns.feature", import.meta.url);
25
+ test("Curve JSON typed into a formula, a series without a name, and a broken curve cell", {tag: ["@journey"]}, async ({browser}) => {
26
+ const page = await session.page(browser);
27
+ const run = journey(test, 3, page);
28
+ await session.step(15, "Given user is logged in", () => loggedIn(page));
29
+ await session.step(16, "And simple mode is off", () => simpleModeOff(page));
30
+ await session.step(17, "And the package autostarts have completed", () => autostartsCompleted(page));
31
+ await session.step(18, "And the \"Curves\" package is installed", () => packageInstalled(page, "Curves"));
32
+ await run.scenario("A JSON formula adds its column and Add New Column opens again", async () => {
33
+ await session.step(21, "Given user opens demog-1000 dataset", () => openDataset(page, ds("demog-1000")));
34
+ await session.step(22, "When user picks \"Edit > Add New Column...\" from the top menu", () => pickFromTopMenu(page, "Edit > Add New Column..."));
35
+ await session.step(23, "Then \"Add New Column\" dialog should be visible", () => shouldBe(page, el("\"Add New Column\" dialog"), "visible"));
36
+ await session.step(24, "When user pastes \"{}\" into code editor in \"Add New Column\" dialog", () => pasteInto(page, "{}", el("code editor in \"Add New Column\" dialog")));
37
+ await session.step(25, "And user types \"jsoncol\" into column name input", () => typeInto(page, "jsoncol", el("column name input")));
38
+ await session.step(26, "And user clicks on OK button in \"Add New Column\" dialog", () => clickOn(page, el("OK button in \"Add New Column\" dialog")));
39
+ await session.step(27, "Then the \"Add New Column\" dialog should close", () => dialogCloses(page, "Add New Column"));
40
+ await session.step(28, "And the table should have a column \"jsoncol\"", () => hasColumn(page, "jsoncol"));
41
+ await session.step(29, "And no errors should have been logged", () => noErrors(page));
42
+ await session.step(30, "When user picks \"Edit > Add New Column...\" from the top menu", () => pickFromTopMenu(page, "Edit > Add New Column..."));
43
+ await session.step(31, "Then \"Add New Column\" dialog should be visible", () => shouldBe(page, el("\"Add New Column\" dialog"), "visible"));
44
+ await session.step(32, "When user pastes \"'{\\\"series\\\":[{\\\"points\\\":[{\\\"x\\\":0.1,\\\"y\\\":1},{\\\"x\\\":1,\\\"y\\\":5},{\\\"x\\\":10,\\\"y\\\":9}]}]}'\" into code editor in \"Add New Column\" dialog", () => pasteInto(page, "'{\"series\":[{\"points\":[{\"x\":0.1,\"y\":1},{\"x\":1,\"y\":5},{\"x\":10,\"y\":9}]}]}'", el("code editor in \"Add New Column\" dialog")));
45
+ await session.step(33, "And user types \"curvecol\" into column name input", () => typeInto(page, "curvecol", el("column name input")));
46
+ await session.step(34, "And user clicks on OK button in \"Add New Column\" dialog", () => clickOn(page, el("OK button in \"Add New Column\" dialog")));
47
+ await session.step(35, "Then the \"Add New Column\" dialog should close", () => dialogCloses(page, "Add New Column"));
48
+ await session.step(36, "And the table should have a column \"curvecol\"", () => hasColumn(page, "curvecol"));
49
+ await session.step(37, "And \"curvecol\" column should have semantic type \"fit\"", () => columnSemType(page, "curvecol", "fit"));
50
+ await session.step(38, "And no errors should have been logged", () => noErrors(page));
51
+ });
52
+ await run.scenario("The statistic of a series without a name becomes a column", async () => {
53
+ await session.step(41, "Given user closes all views", () => closeAllViews(page));
54
+ await session.step(42, "And user opens a table \"unnamed-series\" with:", () => openTableOf(page, "unnamed-series", [["id","curve"],["1","{\"series\":[{\"points\":[{\"x\":0.1,\"y\":1},{\"x\":1,\"y\":5},{\"x\":10,\"y\":9}]}]}"],["2","{\"series\":[{\"points\":[{\"x\":0.1,\"y\":2},{\"x\":1,\"y\":6},{\"x\":10,\"y\":8}]}]}"]]), [["id","curve"],["1","{\"series\":[{\"points\":[{\"x\":0.1,\"y\":1},{\"x\":1,\"y\":5},{\"x\":10,\"y\":9}]}]}"],["2","{\"series\":[{\"points\":[{\"x\":0.1,\"y\":2},{\"x\":1,\"y\":6},{\"x\":10,\"y\":8}]}]}"]]);
55
+ await session.step(46, "And the context panel is open", () => contextPanelOpen(page));
56
+ await session.step(47, "When user clicks on the \"cell 1 of curve\" area of grid", () => clickArea(page, "cell 1 of curve", el("grid")));
57
+ await session.step(48, "Then the current column should be \"curve\"", () => currentColumnIs(page, "curve"));
58
+ await session.step(49, "Given \"Fit\" pane in context panel is expanded", () => isExpanded(page, el("\"Fit\" pane in context panel")));
59
+ await session.step(50, "When user clicks on first \"Calculate rSquared for the whole column\" icon in context panel", () => clickOn(page, el("first \"Calculate rSquared for the whole column\" icon in context panel")));
60
+ await session.step(51, "Then the table should have the columns \"id, curve, curve 1 rSquared\"", () => columnsExactly(page, "id, curve, curve 1 rSquared"));
61
+ await session.step(52, "And no errors should have been logged", () => noErrors(page));
62
+ await session.step(53, "And no error or warning balloon should have been shown", () => noBalloons(page));
63
+ });
64
+ await run.scenario("A click on a truncated curve cell logs no error", async () => {
65
+ await session.step(56, "Given user closes all views", () => closeAllViews(page));
66
+ await session.step(57, "And user opens a table \"broken-curves\" with:", () => openTableOf(page, "broken-curves", [["id","curve"],["1","{\"series\":[{\"points\":[{\"x\":0.1,\"y\":1},{\"x\":1,\"y\":5},{\"x\":10,\"y\":9}]}]}"],["2","{\"series\":[{\"points\":[{\"x\":0.1"],["3","{\"series\":[{\"points\":[{\"x\":0.1,\"y\":2},{\"x\":1,\"y\":6},{\"x\":10,\"y\":8}]}]}"]]), [["id","curve"],["1","{\"series\":[{\"points\":[{\"x\":0.1,\"y\":1},{\"x\":1,\"y\":5},{\"x\":10,\"y\":9}]}]}"],["2","{\"series\":[{\"points\":[{\"x\":0.1"],["3","{\"series\":[{\"points\":[{\"x\":0.1,\"y\":2},{\"x\":1,\"y\":6},{\"x\":10,\"y\":8}]}]}"]]);
67
+ await session.step(62, "Then \"curve\" column should have semantic type \"fit\"", () => columnSemType(page, "curve", "fit"));
68
+ await session.step(63, "When user clicks on the \"cell 2 of curve\" area of grid", () => clickArea(page, "cell 2 of curve", el("grid")));
69
+ await session.step(64, "Then the current column should be \"curve\"", () => currentColumnIs(page, "curve"));
70
+ await session.step(65, "And no errors should have been logged", () => noErrors(page));
71
+ await session.step(66, "And no error or warning balloon should have been shown", () => noBalloons(page));
72
+ });
73
+ run.finish();
74
+ });
75
+ });
@@ -0,0 +1,45 @@
1
+ /* eslint-disable max-len */
2
+ /* eslint-disable comma-spacing */
3
+ /* eslint-disable quotes */
4
+ /* ---
5
+ generated: features/data/data-to-curves.feature
6
+ generator: @datagrok-libraries/bdd — do not edit; run `grok-bdd compile` to regenerate
7
+ sub_features_covered: [core#1246]
8
+ --- */
9
+ import {test} from '@playwright/test';
10
+ import '../../bindings/curves.js';
11
+ import '@datagrok-libraries/bdd/bindings/common/kinds';
12
+ import '@datagrok-libraries/bdd/bindings/common/parameter-types';
13
+ import '@datagrok-libraries/bdd/bindings/platform/datasets';
14
+ import '@datagrok-libraries/bdd/bindings/platform/elements';
15
+ import {loggedIn} from '@datagrok-libraries/bdd/bindings/common/session';
16
+ import {clickOn, shouldBe, shouldContainText} from '@datagrok-libraries/bdd/bindings/common/steps';
17
+ import {columnSemType} from '@datagrok-libraries/bdd/bindings/platform/columns';
18
+ import {pickFromTopMenu} from '@datagrok-libraries/bdd/bindings/platform/commands';
19
+ import {rowCount} from '@datagrok-libraries/bdd/bindings/platform/data';
20
+ import {autostartsCompleted, openTableOf, switchTableView} from '@datagrok-libraries/bdd/bindings/platform/steps';
21
+ import {openTableViewsExactly} from '@datagrok-libraries/bdd/bindings/platform/workspace';
22
+ import {noErrors, viewerCount} from '@datagrok-libraries/bdd/bindings/tiers/viewers/steps';
23
+ import {el, feature} from '@datagrok-libraries/bdd/runtime';
24
+
25
+ test.describe("Data to Curves turns a table of wells into a table of fitted curves, one per compound, assay, target and run", () => {
26
+ const session = feature(test, "features/data/data-to-curves.feature", import.meta.url);
27
+ test("The Data menu opens the dialog with the roles prefilled from the column names, and OK opens the Fitted Curves view", {tag: ["@realizes:core#1246"]}, async ({browser}) => {
28
+ const page = await session.page(browser);
29
+ await session.step(21, "Given user is logged in", () => loggedIn(page));
30
+ await session.step(22, "And the package autostarts have completed", () => autostartsCompleted(page));
31
+ await session.step(23, "And user opens a table \"wells\" with:", () => openTableOf(page, "wells", [["compound_id","assay_name","target_entity","batch_id","run_id","concentration_uM","inhibition"],["C1","A","T","B1","R1","0.1","5"],["C1","A","T","B1","R1","1","20"],["C1","A","T","B1","R1","10","60"],["C1","A","T","B1","R1","100","95"],["C1","A","T","B1","R2","0.1","4"],["C1","A","T","B1","R2","1","25"],["C1","A","T","B1","R2","10","55"],["C1","A","T","B1","R2","100","90"],["C2","A","T","B2","R1","0.1","2"],["C2","A","T","B2","R1","1","10"],["C2","A","T","B2","R1","10","30"],["C2","A","T","B2","R1","100","50"]]), [["compound_id","assay_name","target_entity","batch_id","run_id","concentration_uM","inhibition"],["C1","A","T","B1","R1","0.1","5"],["C1","A","T","B1","R1","1","20"],["C1","A","T","B1","R1","10","60"],["C1","A","T","B1","R1","100","95"],["C1","A","T","B1","R2","0.1","4"],["C1","A","T","B1","R2","1","25"],["C1","A","T","B1","R2","10","55"],["C1","A","T","B1","R2","100","90"],["C2","A","T","B2","R1","0.1","2"],["C2","A","T","B2","R1","1","10"],["C2","A","T","B2","R1","10","30"],["C2","A","T","B2","R1","100","50"]]);
32
+ await session.step(39, "When user picks \"Data > Curves > Data to Curves\" from the top menu", () => pickFromTopMenu(page, "Data > Curves > Data to Curves"));
33
+ await session.step(40, "Then \"Data to Curves\" dialog should be visible", () => shouldBe(page, el("\"Data to Curves\" dialog"), "visible"));
34
+ await session.step(41, "And Concentration input in \"Data to Curves\" dialog should contain text \"concentration_uM\"", () => shouldContainText(page, el("Concentration input in \"Data to Curves\" dialog"), "concentration_uM"));
35
+ await session.step(42, "And Readout input in \"Data to Curves\" dialog should contain text \"inhibition\"", () => shouldContainText(page, el("Readout input in \"Data to Curves\" dialog"), "inhibition"));
36
+ await session.step(43, "When user clicks on OK button in \"Data to Curves\" dialog", () => clickOn(page, el("OK button in \"Data to Curves\" dialog")));
37
+ await session.step(44, "Then the open table views should be exactly \"wells, Fitted Curves\"", () => openTableViewsExactly(page, "wells, Fitted Curves"));
38
+ await session.step(45, "Given user switches to the \"Fitted Curves\" table view", () => switchTableView(page, "Fitted Curves"));
39
+ await session.step(46, "Then the table should have 3 rows", () => rowCount(page, 3));
40
+ await session.step(47, "And \"Fitted Curve\" column should have semantic type \"fit\"", () => columnSemType(page, "Fitted Curve", "fit"));
41
+ await session.step(48, "And trellis plot viewer should be visible", () => shouldBe(page, el("trellis plot viewer"), "visible"));
42
+ await session.step(49, "And the open tableview should have 1 MultiCurveViewer viewer", () => viewerCount(page, 1, "MultiCurveViewer"));
43
+ await session.step(50, "And no errors should have been logged", () => noErrors(page));
44
+ });
45
+ });
@@ -0,0 +1,50 @@
1
+ /* eslint-disable max-len */
2
+ /* eslint-disable comma-spacing */
3
+ /* eslint-disable quotes */
4
+ /* ---
5
+ generated: features/data/pzfx-files.feature
6
+ generator: @datagrok-libraries/bdd — do not edit; run `grok-bdd compile` to regenerate
7
+ --- */
8
+ import {test} from '@playwright/test';
9
+ import '../../bindings/curves.js';
10
+ import '@datagrok-libraries/bdd/bindings/common/kinds';
11
+ import '@datagrok-libraries/bdd/bindings/common/parameter-types';
12
+ import '@datagrok-libraries/bdd/bindings/platform/datasets';
13
+ import '@datagrok-libraries/bdd/bindings/platform/elements';
14
+ import {loggedIn} from '@datagrok-libraries/bdd/bindings/common/session';
15
+ import {doubleClickOn, isExpanded} from '@datagrok-libraries/bdd/bindings/common/steps';
16
+ import {autostartsCompleted, browsePanelOpen, packageInstalled, simpleModeOff, viewIsCurrent} from '@datagrok-libraries/bdd/bindings/platform/steps';
17
+ import {noErrors, pickFromContextMenu} from '@datagrok-libraries/bdd/bindings/tiers/viewers/steps';
18
+ import {el, feature} from '@datagrok-libraries/bdd/runtime';
19
+
20
+ test.describe("A GraphPad Prism file opens from Browse", () => {
21
+ const session = feature(test, "features/data/pzfx-files.feature", import.meta.url);
22
+ test("A double-click previews the file in a view of its name", async ({browser}) => {
23
+ const page = await session.page(browser);
24
+ await session.step(8, "Given user is logged in", () => loggedIn(page));
25
+ await session.step(9, "And simple mode is off", () => simpleModeOff(page));
26
+ await session.step(10, "And the package autostarts have completed", () => autostartsCompleted(page));
27
+ await session.step(11, "And the \"Curves\" package is installed", () => packageInstalled(page, "Curves"));
28
+ await session.step(12, "And the browse panel is open", () => browsePanelOpen(page));
29
+ await session.step(13, "And Files tree node inside browse tree is expanded", () => isExpanded(page, el("Files tree node inside browse tree")));
30
+ await session.step(14, "And Files---App-Data tree node inside browse tree is expanded", () => isExpanded(page, el("Files---App-Data tree node inside browse tree")));
31
+ await session.step(15, "And Files---App-Data---Curves tree node inside browse tree is expanded", () => isExpanded(page, el("Files---App-Data---Curves tree node inside browse tree")));
32
+ await session.step(18, "When user double-clicks on Files---App-Data---Curves---dose-response-4pl.pzfx tree node inside browse tree", () => doubleClickOn(page, el("Files---App-Data---Curves---dose-response-4pl.pzfx tree node inside browse tree")));
33
+ await session.step(19, "Then the \"dose-response-4pl.pzfx\" view should be current", () => viewIsCurrent(page, "dose-response-4pl.pzfx"));
34
+ await session.step(20, "And no errors should have been logged", () => noErrors(page));
35
+ });
36
+ test("Open from the context menu opens the file", async ({browser}) => {
37
+ const page = await session.page(browser);
38
+ await session.step(8, "Given user is logged in", () => loggedIn(page));
39
+ await session.step(9, "And simple mode is off", () => simpleModeOff(page));
40
+ await session.step(10, "And the package autostarts have completed", () => autostartsCompleted(page));
41
+ await session.step(11, "And the \"Curves\" package is installed", () => packageInstalled(page, "Curves"));
42
+ await session.step(12, "And the browse panel is open", () => browsePanelOpen(page));
43
+ await session.step(13, "And Files tree node inside browse tree is expanded", () => isExpanded(page, el("Files tree node inside browse tree")));
44
+ await session.step(14, "And Files---App-Data tree node inside browse tree is expanded", () => isExpanded(page, el("Files---App-Data tree node inside browse tree")));
45
+ await session.step(15, "And Files---App-Data---Curves tree node inside browse tree is expanded", () => isExpanded(page, el("Files---App-Data---Curves tree node inside browse tree")));
46
+ await session.step(23, "When user picks \"Open\" from the context menu of Files---App-Data---Curves---dose-response-4pl.pzfx tree node inside browse tree", () => pickFromContextMenu(page, "Open", el("Files---App-Data---Curves---dose-response-4pl.pzfx tree node inside browse tree")));
47
+ await session.step(24, "Then the \"dose-response-4pl.pzfx\" view should be current", () => viewIsCurrent(page, "dose-response-4pl.pzfx"));
48
+ await session.step(25, "And no errors should have been logged", () => noErrors(page));
49
+ });
50
+ });
@@ -0,0 +1,67 @@
1
+ /* eslint-disable max-len */
2
+ /* eslint-disable comma-spacing */
3
+ /* eslint-disable quotes */
4
+ /* ---
5
+ generated: features/grid/curve-cells.feature
6
+ generator: @datagrok-libraries/bdd — do not edit; run `grok-bdd compile` to regenerate
7
+ --- */
8
+ import {test} from '@playwright/test';
9
+ import '../../bindings/curves.js';
10
+ import '@datagrok-libraries/bdd/bindings/common/kinds';
11
+ import '@datagrok-libraries/bdd/bindings/common/parameter-types';
12
+ import '@datagrok-libraries/bdd/bindings/platform/datasets';
13
+ import '@datagrok-libraries/bdd/bindings/platform/elements';
14
+ import {loggedIn} from '@datagrok-libraries/bdd/bindings/common/session';
15
+ import {clickOn, isExpanded, shouldBe, shouldHaveValue, shouldOfferChoice} from '@datagrok-libraries/bdd/bindings/common/steps';
16
+ import {currentColumnIs, rowCount} from '@datagrok-libraries/bdd/bindings/platform/data';
17
+ import {autostartsCompleted, contextPanelOpen, openDataset, packageInstalled, simpleModeOff} from '@datagrok-libraries/bdd/bindings/platform/steps';
18
+ import {clickArea, doubleClickArea, noErrors, pickFromAreaContextMenu} from '@datagrok-libraries/bdd/bindings/tiers/viewers/steps';
19
+ import {gridPins, scrollGridTo} from '@datagrok-libraries/bdd/bindings/tiers/viewers/widgets';
20
+ import {ds, el, feature, journey} from '@datagrok-libraries/bdd/runtime';
21
+
22
+ test.describe("Curve cells in the grid and their Context Panel", () => {
23
+ const session = feature(test, "features/grid/curve-cells.feature", import.meta.url);
24
+ test("Curve cells in the grid and their Context Panel", {tag: ["@journey"]}, async ({browser}) => {
25
+ const page = await session.page(browser);
26
+ const run = journey(test, 3, page);
27
+ await session.step(18, "Given user is logged in", () => loggedIn(page));
28
+ await session.step(19, "And simple mode is off", () => simpleModeOff(page));
29
+ await session.step(20, "And the package autostarts have completed", () => autostartsCompleted(page));
30
+ await session.step(21, "And the \"Curves\" package is installed", () => packageInstalled(page, "Curves"));
31
+ await session.step(22, "And user opens curves dataset", () => openDataset(page, ds("curves")));
32
+ await session.step(23, "And the context panel is open", () => contextPanelOpen(page));
33
+ await run.scenario("A cell with two curves shows its panes and the level its options are set at", async () => {
34
+ await session.step(26, "When user scrolls the grid to the \"multiple styled series\" column", () => scrollGridTo(page, "multiple styled series"));
35
+ await session.step(27, "And user clicks on the \"cell 2 of multiple styled series\" area of grid", () => clickArea(page, "cell 2 of multiple styled series", el("grid")));
36
+ await session.step(28, "Then the current column should be \"multiple styled series\"", () => currentColumnIs(page, "multiple styled series"));
37
+ await session.step(29, "And \"Options\" pane in context panel should be visible", () => shouldBe(page, el("\"Options\" pane in context panel"), "visible"));
38
+ await session.step(30, "And \"Chart\" pane in context panel should be visible", () => shouldBe(page, el("\"Chart\" pane in context panel"), "visible"));
39
+ await session.step(31, "And \"Fit\" pane in context panel should be visible", () => shouldBe(page, el("\"Fit\" pane in context panel"), "visible"));
40
+ await session.step(32, "Given \"Options\" pane in context panel is expanded", () => isExpanded(page, el("\"Options\" pane in context panel")));
41
+ await session.step(33, "Then \"Level\" input in context panel should have value \"Column\"", () => shouldHaveValue(page, el("\"Level\" input in context panel"), "Column"));
42
+ await session.step(34, "And \"Level\" input in context panel should offer the choice \"Dataframe\"", () => shouldOfferChoice(page, el("\"Level\" input in context panel"), "Dataframe"));
43
+ await session.step(35, "And \"Level\" input in context panel should offer the choice \"Cell\"", () => shouldOfferChoice(page, el("\"Level\" input in context panel"), "Cell"));
44
+ await session.step(36, "And \"Statistics mode\" input in context panel should be visible", () => shouldBe(page, el("\"Statistics mode\" input in context panel"), "visible"));
45
+ await session.step(37, "And no errors should have been logged", () => noErrors(page));
46
+ });
47
+ await run.scenario("A double-click opens the chart in the Edit chart dialog, and Close closes it", async () => {
48
+ await session.step(40, "When user scrolls the grid to the \"multiple prefit\" column", () => scrollGridTo(page, "multiple prefit"));
49
+ await session.step(41, "And user double-clicks on the \"cell 3 of multiple prefit\" area of grid", () => doubleClickArea(page, "cell 3 of multiple prefit", el("grid")));
50
+ await session.step(42, "Then \"Edit chart\" dialog should be visible", () => shouldBe(page, el("\"Edit chart\" dialog"), "visible"));
51
+ await session.step(43, "When user clicks on \"Close\" button in \"Edit chart\" dialog", () => clickOn(page, el("\"Close\" button in \"Edit chart\" dialog")));
52
+ await session.step(44, "Then \"Edit chart\" dialog should be absent", () => shouldBe(page, el("\"Edit chart\" dialog"), "absent"));
53
+ await session.step(45, "And the table should have 30 rows", () => rowCount(page, 30));
54
+ await session.step(46, "And no errors should have been logged", () => noErrors(page));
55
+ });
56
+ await run.scenario("The filter panel and a pinned curve column take the curves without errors", async () => {
57
+ await session.step(49, "When user clicks on filter icon in toolbar", () => clickOn(page, el("filter icon in toolbar")));
58
+ await session.step(50, "Then filter panel should be visible", () => shouldBe(page, el("filter panel"), "visible"));
59
+ await session.step(51, "And no errors should have been logged", () => noErrors(page));
60
+ await session.step(52, "When user scrolls the grid to the \"multiple prefit\" column", () => scrollGridTo(page, "multiple prefit"));
61
+ await session.step(53, "And user picks \"Pin > Pin Column\" from the context menu of the \"header multiple prefit\" area of grid", () => pickFromAreaContextMenu(page, "Pin > Pin Column", "header multiple prefit", el("grid")));
62
+ await session.step(54, "Then the grid should pin the columns \"multiple prefit\"", () => gridPins(page, "multiple prefit"));
63
+ await session.step(55, "And no errors should have been logged", () => noErrors(page));
64
+ });
65
+ run.finish();
66
+ });
67
+ });
@@ -0,0 +1,66 @@
1
+ /* eslint-disable max-len */
2
+ /* eslint-disable comma-spacing */
3
+ /* eslint-disable quotes */
4
+ /* ---
5
+ generated: features/grid/curve-options.feature
6
+ generator: @datagrok-libraries/bdd — do not edit; run `grok-bdd compile` to regenerate
7
+ --- */
8
+ import {test} from '@playwright/test';
9
+ import '../../bindings/curves.js';
10
+ import '@datagrok-libraries/bdd/bindings/common/kinds';
11
+ import '@datagrok-libraries/bdd/bindings/common/parameter-types';
12
+ import '@datagrok-libraries/bdd/bindings/platform/datasets';
13
+ import '@datagrok-libraries/bdd/bindings/platform/elements';
14
+ import {loggedIn} from '@datagrok-libraries/bdd/bindings/common/session';
15
+ import {enterInto, isExpanded, selectIn, shouldHaveValue} from '@datagrok-libraries/bdd/bindings/common/steps';
16
+ import {currentColumnIs} from '@datagrok-libraries/bdd/bindings/platform/data';
17
+ import {autostartsCompleted, contextPanelOpen, openDataset, packageInstalled, simpleModeOff} from '@datagrok-libraries/bdd/bindings/platform/steps';
18
+ import {clickArea, noErrors} from '@datagrok-libraries/bdd/bindings/tiers/viewers/steps';
19
+ import {scrollGridTo} from '@datagrok-libraries/bdd/bindings/tiers/viewers/widgets';
20
+ import {ds, el, feature, journey} from '@datagrok-libraries/bdd/runtime';
21
+
22
+ test.describe("Curve options and the level they are set at", () => {
23
+ const session = feature(test, "features/grid/curve-options.feature", import.meta.url);
24
+ test("Curve options and the level they are set at", {tag: ["@journey"]}, async ({browser}) => {
25
+ const page = await session.page(browser);
26
+ const run = journey(test, 2, page);
27
+ await session.step(16, "Given user is logged in", () => loggedIn(page));
28
+ await session.step(17, "And simple mode is off", () => simpleModeOff(page));
29
+ await session.step(18, "And the package autostarts have completed", () => autostartsCompleted(page));
30
+ await session.step(19, "And the \"Curves\" package is installed", () => packageInstalled(page, "Curves"));
31
+ await session.step(20, "And user opens curves dataset", () => openDataset(page, ds("curves")));
32
+ await session.step(21, "And the context panel is open", () => contextPanelOpen(page));
33
+ await run.scenario("A Column level fit function reaches the other cells of its column, not another column", async () => {
34
+ await session.step(24, "When user scrolls the grid to the \"styled proprtional with IC50\" column", () => scrollGridTo(page, "styled proprtional with IC50"));
35
+ await session.step(25, "And user clicks on the \"cell 1 of styled proprtional with IC50\" area of grid", () => clickArea(page, "cell 1 of styled proprtional with IC50", el("grid")));
36
+ await session.step(26, "Then the current column should be \"styled proprtional with IC50\"", () => currentColumnIs(page, "styled proprtional with IC50"));
37
+ await session.step(27, "Given \"Options\" pane in context panel is expanded", () => isExpanded(page, el("\"Options\" pane in context panel")));
38
+ await session.step(28, "Then \"Level\" input in context panel should have value \"Column\"", () => shouldHaveValue(page, el("\"Level\" input in context panel"), "Column"));
39
+ await session.step(29, "And \"Fit Function\" input in context panel should have value \"sigmoid\"", () => shouldHaveValue(page, el("\"Fit Function\" input in context panel"), "sigmoid"));
40
+ await session.step(30, "When user selects \"linear\" in \"Fit Function\" input in context panel", () => selectIn(page, "linear", el("\"Fit Function\" input in context panel")));
41
+ await session.step(31, "And user clicks on the \"cell 5 of styled proprtional with IC50\" area of grid", () => clickArea(page, "cell 5 of styled proprtional with IC50", el("grid")));
42
+ await session.step(32, "Then the current column should be \"styled proprtional with IC50\"", () => currentColumnIs(page, "styled proprtional with IC50"));
43
+ await session.step(33, "And \"Fit Function\" input in context panel should have value \"linear\"", () => shouldHaveValue(page, el("\"Fit Function\" input in context panel"), "linear"));
44
+ await session.step(34, "When user scrolls the grid to the \"custom fit function\" column", () => scrollGridTo(page, "custom fit function"));
45
+ await session.step(35, "And user clicks on the \"cell 1 of custom fit function\" area of grid", () => clickArea(page, "cell 1 of custom fit function", el("grid")));
46
+ await session.step(36, "Then the current column should be \"custom fit function\"", () => currentColumnIs(page, "custom fit function"));
47
+ await session.step(37, "And \"Fit Function\" input in context panel should have value \"Polynomial\"", () => shouldHaveValue(page, el("\"Fit Function\" input in context panel"), "Polynomial"));
48
+ await session.step(38, "And no errors should have been logged", () => noErrors(page));
49
+ });
50
+ await run.scenario("A Cell level title stays in its cell", async () => {
51
+ await session.step(41, "When user scrolls the grid to the \"styled proprtional with IC50\" column", () => scrollGridTo(page, "styled proprtional with IC50"));
52
+ await session.step(42, "And user clicks on the \"cell 1 of styled proprtional with IC50\" area of grid", () => clickArea(page, "cell 1 of styled proprtional with IC50", el("grid")));
53
+ await session.step(43, "Then the current column should be \"styled proprtional with IC50\"", () => currentColumnIs(page, "styled proprtional with IC50"));
54
+ await session.step(44, "And \"Title\" input in context panel should have value \"Dose-Response curves\"", () => shouldHaveValue(page, el("\"Title\" input in context panel"), "Dose-Response curves"));
55
+ await session.step(45, "When user selects \"Cell\" in \"Level\" input in context panel", () => selectIn(page, "Cell", el("\"Level\" input in context panel")));
56
+ await session.step(46, "And user enters \"Only this one\" into \"Title\" input in context panel", () => enterInto(page, "Only this one", el("\"Title\" input in context panel")));
57
+ await session.step(47, "And user clicks on the \"cell 3 of styled proprtional with IC50\" area of grid", () => clickArea(page, "cell 3 of styled proprtional with IC50", el("grid")));
58
+ await session.step(48, "Then the current column should be \"styled proprtional with IC50\"", () => currentColumnIs(page, "styled proprtional with IC50"));
59
+ await session.step(49, "And \"Title\" input in context panel should have value \"Dose-Response curves\"", () => shouldHaveValue(page, el("\"Title\" input in context panel"), "Dose-Response curves"));
60
+ await session.step(50, "When user clicks on the \"cell 1 of styled proprtional with IC50\" area of grid", () => clickArea(page, "cell 1 of styled proprtional with IC50", el("grid")));
61
+ await session.step(51, "Then \"Title\" input in context panel should have value \"Only this one\"", () => shouldHaveValue(page, el("\"Title\" input in context panel"), "Only this one"));
62
+ await session.step(52, "And no errors should have been logged", () => noErrors(page));
63
+ });
64
+ run.finish();
65
+ });
66
+ });
@@ -0,0 +1,64 @@
1
+ /* eslint-disable max-len */
2
+ /* eslint-disable comma-spacing */
3
+ /* eslint-disable quotes */
4
+ /* ---
5
+ generated: features/grid/statistic-columns.feature
6
+ generator: @datagrok-libraries/bdd — do not edit; run `grok-bdd compile` to regenerate
7
+ --- */
8
+ import {test} from '@playwright/test';
9
+ import '../../bindings/curves.js';
10
+ import '@datagrok-libraries/bdd/bindings/common/kinds';
11
+ import '@datagrok-libraries/bdd/bindings/common/parameter-types';
12
+ import '@datagrok-libraries/bdd/bindings/platform/datasets';
13
+ import '@datagrok-libraries/bdd/bindings/platform/elements';
14
+ import {loggedIn} from '@datagrok-libraries/bdd/bindings/common/session';
15
+ import {clickOn, isExpanded, selectIn, shouldBe, shouldOfferChoice} from '@datagrok-libraries/bdd/bindings/common/steps';
16
+ import {columnType, columnsExactly, distinctValues} from '@datagrok-libraries/bdd/bindings/platform/columns';
17
+ import {currentColumnIs} from '@datagrok-libraries/bdd/bindings/platform/data';
18
+ import {autostartsCompleted, contextPanelOpen, openDataset, packageInstalled, simpleModeOff} from '@datagrok-libraries/bdd/bindings/platform/steps';
19
+ import {clickArea, noErrors} from '@datagrok-libraries/bdd/bindings/tiers/viewers/steps';
20
+ import {scrollGridTo} from '@datagrok-libraries/bdd/bindings/tiers/viewers/widgets';
21
+ import {ds, el, feature, journey} from '@datagrok-libraries/bdd/runtime';
22
+
23
+ test.describe("Fit statistics of a curve cell become columns", () => {
24
+ const session = feature(test, "features/grid/statistic-columns.feature", import.meta.url);
25
+ test("Fit statistics of a curve cell become columns", {tag: ["@journey"]}, async ({browser}) => {
26
+ const page = await session.page(browser);
27
+ const run = journey(test, 2, page);
28
+ await session.step(14, "Given user is logged in", () => loggedIn(page));
29
+ await session.step(15, "And simple mode is off", () => simpleModeOff(page));
30
+ await session.step(16, "And the package autostarts have completed", () => autostartsCompleted(page));
31
+ await session.step(17, "And the \"Curves\" package is installed", () => packageInstalled(page, "Curves"));
32
+ await session.step(18, "And user opens curves dataset", () => openDataset(page, ds("curves")));
33
+ await session.step(19, "And the context panel is open", () => contextPanelOpen(page));
34
+ await run.scenario("The IC50 of a one-curve column is added right after it, filled with numbers", async () => {
35
+ await session.step(22, "When user scrolls the grid to the \"styled proprtional with IC50\" column", () => scrollGridTo(page, "styled proprtional with IC50"));
36
+ await session.step(23, "And user clicks on the \"cell 1 of styled proprtional with IC50\" area of grid", () => clickArea(page, "cell 1 of styled proprtional with IC50", el("grid")));
37
+ await session.step(24, "Then the current column should be \"styled proprtional with IC50\"", () => currentColumnIs(page, "styled proprtional with IC50"));
38
+ await session.step(25, "Given \"Fit\" pane in context panel is expanded", () => isExpanded(page, el("\"Fit\" pane in context panel")));
39
+ await session.step(26, "Then \"IC50\" input in context panel should be visible", () => shouldBe(page, el("\"IC50\" input in context panel"), "visible"));
40
+ await session.step(27, "And \"R²\" input in context panel should be visible", () => shouldBe(page, el("\"R²\" input in context panel"), "visible"));
41
+ await session.step(28, "When user clicks on first \"Calculate ic50 for the whole column\" icon in context panel", () => clickOn(page, el("first \"Calculate ic50 for the whole column\" icon in context panel")));
42
+ await session.step(29, "Then the table should have the columns \"smiles, multiple prefit, multiple styled series, styled proprtional with IC50, styled proprtional with IC50 1 ic50, log min/max candlesticks, custom fit function\"", () => columnsExactly(page, "smiles, multiple prefit, multiple styled series, styled proprtional with IC50, styled proprtional with IC50 1 ic50, log min/max candlesticks, custom fit function"));
43
+ await session.step(30, "And \"styled proprtional with IC50 1 ic50\" column should have type \"double\"", () => columnType(page, "styled proprtional with IC50 1 ic50", "double"));
44
+ await session.step(31, "And \"styled proprtional with IC50 1 ic50\" column should have at least 10 distinct values", () => distinctValues(page, "styled proprtional with IC50 1 ic50", 10));
45
+ await session.step(32, "And no errors should have been logged", () => noErrors(page));
46
+ });
47
+ await run.scenario("The average IC50 of a two-curve column is added right after it", async () => {
48
+ await session.step(35, "When user scrolls the grid to the \"multiple styled series\" column", () => scrollGridTo(page, "multiple styled series"));
49
+ await session.step(36, "And user clicks on the \"cell 2 of multiple styled series\" area of grid", () => clickArea(page, "cell 2 of multiple styled series", el("grid")));
50
+ await session.step(37, "Then the current column should be \"multiple styled series\"", () => currentColumnIs(page, "multiple styled series"));
51
+ await session.step(38, "Given \"Fit\" pane in context panel is expanded", () => isExpanded(page, el("\"Fit\" pane in context panel")));
52
+ await session.step(39, "Then \"Series\" input in context panel should offer the choice \"all\"", () => shouldOfferChoice(page, el("\"Series\" input in context panel"), "all"));
53
+ await session.step(40, "And \"Series\" input in context panel should offer the choice \"aggregated\"", () => shouldOfferChoice(page, el("\"Series\" input in context panel"), "aggregated"));
54
+ await session.step(41, "When user selects \"aggregated\" in \"Series\" input in context panel", () => selectIn(page, "aggregated", el("\"Series\" input in context panel")));
55
+ await session.step(42, "And user selects \"avg\" in \"Aggregation type\" input in context panel", () => selectIn(page, "avg", el("\"Aggregation type\" input in context panel")));
56
+ await session.step(43, "And user clicks on first \"Calculate ic50 avg for the whole column\" icon in context panel", () => clickOn(page, el("first \"Calculate ic50 avg for the whole column\" icon in context panel")));
57
+ await session.step(44, "Then the table should have the columns \"smiles, multiple prefit, multiple styled series, multiple styled series avg ic50, styled proprtional with IC50, styled proprtional with IC50 1 ic50, log min/max candlesticks, custom fit function\"", () => columnsExactly(page, "smiles, multiple prefit, multiple styled series, multiple styled series avg ic50, styled proprtional with IC50, styled proprtional with IC50 1 ic50, log min/max candlesticks, custom fit function"));
58
+ await session.step(45, "And \"multiple styled series avg ic50\" column should have type \"double\"", () => columnType(page, "multiple styled series avg ic50", "double"));
59
+ await session.step(46, "And \"multiple styled series avg ic50\" column should have at least 10 distinct values", () => distinctValues(page, "multiple styled series avg ic50", 10));
60
+ await session.step(47, "And no errors should have been logged", () => noErrors(page));
61
+ });
62
+ run.finish();
63
+ });
64
+ });
@@ -0,0 +1,48 @@
1
+ /* eslint-disable max-len */
2
+ /* eslint-disable comma-spacing */
3
+ /* eslint-disable quotes */
4
+ /* ---
5
+ generated: features/guides/curves-legend-cells.feature
6
+ generator: @datagrok-libraries/bdd — do not edit; run `grok-bdd compile` to regenerate
7
+ --- */
8
+ import {test} from '@playwright/test';
9
+ import '../../bindings/curves.js';
10
+ import '@datagrok-libraries/bdd/bindings/common/kinds';
11
+ import '@datagrok-libraries/bdd/bindings/common/parameter-types';
12
+ import '@datagrok-libraries/bdd/bindings/platform/datasets';
13
+ import '@datagrok-libraries/bdd/bindings/platform/elements';
14
+ import {loggedIn} from '@datagrok-libraries/bdd/bindings/common/session';
15
+ import {check, expand, scrollIntoView, selectIn, shouldBe, shouldHaveValue, uncheck} from '@datagrok-libraries/bdd/bindings/common/steps';
16
+ import {removeColumn} from '@datagrok-libraries/bdd/bindings/platform/data';
17
+ import {contextPanelOpen, openDataset, simpleModeOff} from '@datagrok-libraries/bdd/bindings/platform/steps';
18
+ import {clickArea, noErrors, setProperties} from '@datagrok-libraries/bdd/bindings/tiers/viewers/steps';
19
+ import {gridColumnWidth} from '@datagrok-libraries/bdd/bindings/tiers/viewers/widgets';
20
+ import {ds, el, feature} from '@datagrok-libraries/bdd/runtime';
21
+
22
+ test.describe("Show Legend of curves in grid cells is set for the table, a column or one cell", () => {
23
+ const session = feature(test, "features/guides/curves-legend-cells.feature", import.meta.url);
24
+ test("Hide the legend for the column, then show it in one cell", {tag: ["@guide"]}, async ({browser}) => {
25
+ const page = await session.page(browser);
26
+ await session.step(15, "Given user is logged in", () => loggedIn(page));
27
+ await session.step(16, "And simple mode is off", () => simpleModeOff(page));
28
+ await session.step(17, "And user opens assay-curves dataset", () => openDataset(page, ds("assay-curves")));
29
+ await session.step(18, "And user removes \"Molecule\" column", () => removeColumn(page, "Molecule"));
30
+ await session.step(19, "And user sets properties of grid:", () => setProperties(page, el("grid"), [["Row Height","290"],["Col Header Height","30"]]), [["Row Height","290"],["Col Header Height","30"]]);
31
+ await session.step(22, "And the \"Fitted Curve\" column of the grid is 340 px wide", () => gridColumnWidth(page, "Fitted Curve", 340));
32
+ await session.step(23, "And the context panel is open", () => contextPanelOpen(page));
33
+ await session.step(24, "When user clicks on the \"cell 1 of Fitted Curve\" area of grid", () => clickArea(page, "cell 1 of Fitted Curve", el("grid")));
34
+ await session.step(25, "And user expands \"Options\" pane in context panel", () => expand(page, el("\"Options\" pane in context panel")));
35
+ await session.step(26, "Then \"Level\" input in context panel should have value \"Column\"", () => shouldHaveValue(page, el("\"Level\" input in context panel"), "Column"));
36
+ await session.step(27, "When user scrolls \"Show Legend\" input in context panel into view", () => scrollIntoView(page, el("\"Show Legend\" input in context panel")));
37
+ await session.step(28, "And user unchecks \"Show Legend\" input in context panel", () => uncheck(page, el("\"Show Legend\" input in context panel")));
38
+ await session.step(29, "And user scrolls \"Level\" input in context panel into view", () => scrollIntoView(page, el("\"Level\" input in context panel")));
39
+ await session.step(30, "And user selects \"Cell\" in \"Level\" input in context panel", () => selectIn(page, "Cell", el("\"Level\" input in context panel")));
40
+ await session.step(31, "And user scrolls \"Show Legend\" input in context panel into view", () => scrollIntoView(page, el("\"Show Legend\" input in context panel")));
41
+ await session.step(32, "And user checks \"Show Legend\" input in context panel", () => check(page, el("\"Show Legend\" input in context panel")));
42
+ await session.step(33, "And user clicks on the \"cell 2 of Fitted Curve\" area of grid", () => clickArea(page, "cell 2 of Fitted Curve", el("grid")));
43
+ await session.step(34, "Then \"Show Legend\" input in context panel should be unchecked", () => shouldBe(page, el("\"Show Legend\" input in context panel"), "unchecked"));
44
+ await session.step(35, "When user clicks on the \"cell 1 of Fitted Curve\" area of grid", () => clickArea(page, "cell 1 of Fitted Curve", el("grid")));
45
+ await session.step(36, "Then \"Show Legend\" input in context panel should be checked", () => shouldBe(page, el("\"Show Legend\" input in context panel"), "checked"));
46
+ await session.step(37, "And no errors should have been logged", () => noErrors(page));
47
+ });
48
+ });
@@ -0,0 +1,48 @@
1
+ /* eslint-disable max-len */
2
+ /* eslint-disable comma-spacing */
3
+ /* eslint-disable quotes */
4
+ /* ---
5
+ generated: features/guides/curves-legend.feature
6
+ generator: @datagrok-libraries/bdd — do not edit; run `grok-bdd compile` to regenerate
7
+ --- */
8
+ import {test} from '@playwright/test';
9
+ import '@datagrok-libraries/bdd/bindings/common/kinds';
10
+ import '@datagrok-libraries/bdd/bindings/common/parameter-types';
11
+ import '@datagrok-libraries/bdd/bindings/platform/datasets';
12
+ import '@datagrok-libraries/bdd/bindings/platform/elements';
13
+ import {addWideViewer} from '../../bindings/curves.js';
14
+ import {loggedIn} from '@datagrok-libraries/bdd/bindings/common/session';
15
+ import {check, expand, selectIn, shouldBe, shouldContainText, uncheck} from '@datagrok-libraries/bdd/bindings/common/steps';
16
+ import {removeColumn, selectWhereIs} from '@datagrok-libraries/bdd/bindings/platform/data';
17
+ import {openDataset, simpleModeOff} from '@datagrok-libraries/bdd/bindings/platform/steps';
18
+ import {hoverArea, hoverFirstArea, pointerAway, readingReads} from '@datagrok-libraries/bdd/bindings/tiers/viewers/steps';
19
+ import {clickOtherCell, pickFromViewerMenu} from '@datagrok-libraries/bdd/bindings/tiers/viewers/widgets';
20
+ import {ds, el, feature} from '@datagrok-libraries/bdd/runtime';
21
+
22
+ test.describe("The legend of a dose-response chart names the curves without hiding them", () => {
23
+ const session = feature(test, "features/guides/curves-legend.feature", import.meta.url);
24
+ test("Name the curves, read a shortened name and the folded rows, then hide and show the legend", {tag: ["@guide"]}, async ({browser}) => {
25
+ const page = await session.page(browser);
26
+ await session.step(22, "Given user is logged in", () => loggedIn(page));
27
+ await session.step(23, "And simple mode is off", () => simpleModeOff(page));
28
+ await session.step(24, "And user opens assay-curves dataset", () => openDataset(page, ds("assay-curves")));
29
+ await session.step(25, "And user removes \"Molecule\" column", () => removeColumn(page, "Molecule"));
30
+ await session.step(26, "And user selects rows where \"Assay Name\" is \"Collapse Assay\"", () => selectWhereIs(page, "Assay Name", "Collapse Assay"));
31
+ await session.step(27, "And user adds a MultiCurveViewer viewer of the selected rows taking 45 percent of the view width", () => addWideViewer(page, 45));
32
+ await session.step(28, "When user clicks on a \"AUC\" cell of grid other than the current one", () => clickOtherCell(page, "AUC", el("grid")));
33
+ await session.step(29, "And user picks \"Properties...\" from the viewer menu of MultiCurveViewer viewer", () => pickFromViewerMenu(page, "Properties...", el("MultiCurveViewer viewer")));
34
+ await session.step(30, "And user selects \"Compound|Assay|Target\" in \"Legend\" property in context panel", () => selectIn(page, "Compound|Assay|Target", el("\"Legend\" property in context panel")));
35
+ await session.step(31, "Then the \"legend corner\" reading of MultiCurveViewer viewer should be \"bottom left\"", () => readingReads(page, "legend corner", el("MultiCurveViewer viewer"), "bottom left"));
36
+ await session.step(32, "When user hovers over the first \"shortened legend row\" area of MultiCurveViewer viewer", () => hoverFirstArea(page, "shortened legend row", el("MultiCurveViewer viewer")));
37
+ await session.step(33, "Then tooltip should contain text \"| Collapse Assay | target_10\"", () => shouldContainText(page, el("tooltip"), "| Collapse Assay | target_10"));
38
+ await session.step(34, "When user hovers over the \"legend more\" area of MultiCurveViewer viewer", () => hoverArea(page, "legend more", el("MultiCurveViewer viewer")));
39
+ await session.step(35, "Then tooltip should contain text \"compound_id 20 | Collapse Assay | target_10\"", () => shouldContainText(page, el("tooltip"), "compound_id 20 | Collapse Assay | target_10"));
40
+ await session.step(36, "When user moves the pointer away from MultiCurveViewer viewer", () => pointerAway(page, el("MultiCurveViewer viewer")));
41
+ await session.step(37, "And user expands \"Misc\" category in context panel", () => expand(page, el("\"Misc\" category in context panel")));
42
+ await session.step(38, "Then \"Show Legend\" property in context panel should be checked", () => shouldBe(page, el("\"Show Legend\" property in context panel"), "checked"));
43
+ await session.step(39, "When user unchecks \"Show Legend\" property in context panel", () => uncheck(page, el("\"Show Legend\" property in context panel")));
44
+ await session.step(40, "Then the \"legend shown\" reading of MultiCurveViewer viewer should be \"false\"", () => readingReads(page, "legend shown", el("MultiCurveViewer viewer"), "false"));
45
+ await session.step(41, "When user checks \"Show Legend\" property in context panel", () => check(page, el("\"Show Legend\" property in context panel")));
46
+ await session.step(42, "Then the \"legend shown\" reading of MultiCurveViewer viewer should be \"true\"", () => readingReads(page, "legend shown", el("MultiCurveViewer viewer"), "true"));
47
+ });
48
+ });