Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

FIX: Detail's detail did not show any rows after pressing the refresh button #2440

Merged
merged 2 commits into from Jan 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -763,7 +763,7 @@ export class FormScreenLifecycle02 implements IFormScreenLifecycle02 {
}
} finally {
for (let dataView of formScreen.nonRootDataViews) {
yield*dataView.lifecycle.startSelectedRowReaction();
yield*dataView.lifecycle.startSelectedRowReaction(true);
}
this.monitor.inFlow--;
}
Expand Down
2 changes: 1 addition & 1 deletion model-tests/model/AutomaticTests/.origamPackage
Expand Up @@ -7,7 +7,7 @@
x:id="c130ecd2-3b61-48fe-bac0-b721f86b0a0f"
x:isFolder="true"
p:name="AutomaticTests"
p:version="1.0.2">
p:version="1.0.3">
<pr:packageReference
x:id="db67be0a-ccca-4869-a2ea-426d7669c73e"
pr:referencedPackage="Widgets/.origamPackage#f17329d6-3143-420a-a2e6-30e431eea51d" />
Expand Down
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<x:file
xmlns:x="http://schemas.origam.com/model-persistence/1.0.0"
xmlns:asi="http://schemas.origam.com/Origam.Schema.AbstractSchemaItem/6.0.0"
xmlns:ausa="http://schemas.origam.com/Origam.Schema.DeploymentModel.AbstractUpdateScriptActivity/6.0.0"
xmlns:dv="http://schemas.origam.com/Origam.Schema.DeploymentModel.DeploymentVersion/6.0.0"
xmlns:scusa="http://schemas.origam.com/Origam.Schema.DeploymentModel.ServiceCommandUpdateScriptActivity/6.0.0">
<dv:DeploymentVersion
asi:abstract="false"
dv:deploymentDependenciesCsv="&#xD;&#xA;147fa70d-6519-4393-b5d0-87931f9fd609, 5.3.1&#xD;&#xA;951f2cda-2867-4b99-8824-071fa8749ead, 5.4.1&#xD;&#xA;b9ab12fe-7f7d-43f7-bedc-93747647d6e4, 1.2.3&#xD;&#xA;261b7cd5-4ba1-46a0-8963-27793379ac11, 1.0.1&#xD;&#xA;bb8c67fb-44c1-4b41-8fce-4d50cd5a759d, 1.0.0&#xD;&#xA;255eec22-89c5-479a-b48d-e7bc9baa564a, 1.0.0&#xD;&#xA;f17329d6-3143-420a-a2e6-30e431eea51d, 1.5.4"
x:id="c44d8dee-b348-47f0-a928-c360938c53dd"
asi:name="1.0.3"
dv:version="1.0.3">
<scusa:DeploymentUpdateScriptActivity
asi:abstract="false"
ausa:activityOrder="10"
scusa:commandText="-***-ExternalFile:1.0.3.origam___commandText___7400b485-8bbc-4585-8d8f-36561433cd22.txt"
x:id="7400b485-8bbc-4585-8d8f-36561433cd22"
asi:name="00010_restoreWidgetSectionTestMasterForRefreshTest.sql"
scusa:platform="MsSql"
scusa:service="Root/Service/DataService.origam#DataService/bbd7bd32-d40b-441a-bb5b-0b0fa89169d4" />
</dv:DeploymentVersion>
</x:file>
@@ -0,0 +1,12 @@
CREATE PROCEDURE restoreWidgetSectionTestMasterForRefreshTest
AS
DELETE FROM [dbo].[WidgetSectionTestDetailDetail];
DELETE FROM [dbo].[WidgetSectionTestDetail];
DELETE FROM [dbo].[WidgetSectionTestMaster];

INSERT [dbo].[WidgetSectionTestMaster] ([Text1], [Text2], [Memo1], [RecordCreatedBy], [RecordUpdatedBy], [Id], [RecordCreated], [RecordUpdated]) VALUES (N'text21', N'text22', NULL, N'69aacf26-300e-477b-b9a6-408324ca1cad', N'69aacf26-300e-477b-b9a6-408324ca1cad', N'c947a2f0-d287-4361-baeb-235150993b05', CAST(N'2024-01-30T16:21:25.590' AS DateTime), CAST(N'2024-01-30T16:22:59.033' AS DateTime))
INSERT [dbo].[WidgetSectionTestMaster] ([Text1], [Text2], [Memo1], [RecordCreatedBy], [RecordUpdatedBy], [Id], [RecordCreated], [RecordUpdated]) VALUES (N'text11', N'text12', NULL, N'69aacf26-300e-477b-b9a6-408324ca1cad', NULL, N'7f223028-0214-4b6a-90e8-498d6ad2ad9e', CAST(N'2024-01-30T16:22:10.327' AS DateTime), NULL)
INSERT [dbo].[WidgetSectionTestDetail] ([refWidgetSectionTestMasterId], [Text1], [Text2], [RecordCreatedBy], [RecordUpdatedBy], [Id], [RecordCreated], [RecordUpdated]) VALUES (N'7f223028-0214-4b6a-90e8-498d6ad2ad9e', N'detail1', NULL, N'69aacf26-300e-477b-b9a6-408324ca1cad', NULL, N'924f48a9-bc75-4334-80ed-b08b82507952', CAST(N'2024-01-30T16:22:36.987' AS DateTime), NULL)
INSERT [dbo].[WidgetSectionTestDetail] ([refWidgetSectionTestMasterId], [Text1], [Text2], [RecordCreatedBy], [RecordUpdatedBy], [Id], [RecordCreated], [RecordUpdated]) VALUES (N'c947a2f0-d287-4361-baeb-235150993b05', N'detail2', NULL, N'69aacf26-300e-477b-b9a6-408324ca1cad', N'69aacf26-300e-477b-b9a6-408324ca1cad', N'516cfe82-cf2b-43b5-9519-f9fc1a0e7044', CAST(N'2024-01-30T16:21:41.770' AS DateTime), CAST(N'2024-01-30T16:23:10.083' AS DateTime))
INSERT [dbo].[WidgetSectionTestDetailDetail] ([refWidgetSectionTestDetailId], [RecordCreatedBy], [RecordUpdatedBy], [Id], [RecordCreated], [RecordUpdated], [Text1]) VALUES (N'516cfe82-cf2b-43b5-9519-f9fc1a0e7044', N'69aacf26-300e-477b-b9a6-408324ca1cad', N'69aacf26-300e-477b-b9a6-408324ca1cad', N'37479aed-fab6-4b0e-98db-5b714d31b5ec', CAST(N'2024-01-30T16:21:55.960' AS DateTime), CAST(N'2024-01-30T16:23:18.283' AS DateTime), N'subDetail2')
INSERT [dbo].[WidgetSectionTestDetailDetail] ([refWidgetSectionTestDetailId], [RecordCreatedBy], [RecordUpdatedBy], [Id], [RecordCreated], [RecordUpdated], [Text1]) VALUES (N'924f48a9-bc75-4334-80ed-b08b82507952', N'69aacf26-300e-477b-b9a6-408324ca1cad', NULL, N'9335fa1d-5fc6-4737-8c49-e406c9e6cddd', CAST(N'2024-01-30T16:22:42.803' AS DateTime), NULL, N'subDetail1')
54 changes: 48 additions & 6 deletions test/tests_e2e/08_masterRecord.test.js
Expand Up @@ -6,7 +6,7 @@ const { sleep, openMenuItem, login, waitForRowCountData, switchToFormPerspective
const {widgetsMenuItemId,topMenuHeader, allDataTypesLazyDataViewId,
masterDataViewId, sectionsMenuItemId, masterDetailLazyLoadedMenuItemId, allDataTypesLazyMenuItemsId, detailDataViewId
} = require("./modelIds");
const { clearScreenConfiguration,
const { clearScreenConfiguration, restoreWidgetSectionTestMasterForRefreshTest,
restoreAllDataTypesTable} = require("./dbTools");
const expect = require("expect");
const {openFilters, setFilter} = require("./filterTestTools");
Expand All @@ -17,6 +17,7 @@ let page;

beforeAll(async() => {
await clearScreenConfiguration();
await restoreWidgetSectionTestMasterForRefreshTest();
});

beforeEach(async () => {
Expand All @@ -29,9 +30,11 @@ afterEach(async () => {
});


const dataViewId = "dataView_e67865b0-ce91-413c-bed7-1da486399633";
const text1PropertyId = "cb584956-8f34-4d95-852e-eff4680a2673";
const date1PropertyId ="c8e93248-81c0-4274-9ff1-1b7688944877";
const allDataTypes_dataViewId = "dataView_e67865b0-ce91-413c-bed7-1da486399633";
const master_dataViewId = "dataView_775fa5ea-fa75-40a7-8c39-7828f7cdf508";
const details_dataViewId = "dataView_b11ffa85-7507-475c-af50-ef08fd56072c";
const subDetails_dataViewId = "dataView_3430ae94-8642-4cf8-9e68-9df36dcf571c";


const text1InputId = "editor_cb584956-8f34-4d95-852e-eff4680a2673";

Expand All @@ -43,6 +46,16 @@ async function cancelRowChange() {
await cancelButton.click();
}

async function checkDataViewContainsSingleRow(page, dataViewId, tabName) {
const [button] = await page.$x(`//div[@title="${tabName}"]`);
if (!button) {
throw Error(`tab ${tabName} not found.`);
}
await button.click();
await sleep(300);
await waitForRowCountData(page, dataViewId, 1);
}

describe("Html client", () => {
it("Should ask user whether to save changes after changing row", async () => {
await restoreAllDataTypesTable();
Expand All @@ -58,7 +71,7 @@ describe("Html client", () => {
allDataTypesLazyMenuItemsId,
]);

await waitForRowCountData(page, dataViewId,2099);
await waitForRowCountData(page, allDataTypes_dataViewId,2099);
await sleep(500);
const formPerspectiveButton = await page.$(`#${allDataTypesLazyDataViewId} .formPerspectiveButton`);
await formPerspectiveButton.click();
Expand Down Expand Up @@ -122,4 +135,33 @@ describe("Html client", () => {
await lastRowButton.click();
await cancelRowChange();
});
});
it("Should reload all data after refresh is pressed", async () => {
await restoreAllDataTypesTable();
await switchLanguageTo({locale: "cs-CZ", page: page});
await login(page);
await installMouseHelper(page);
await openMenuItem(
page,
[
topMenuHeader,
widgetsMenuItemId,
sectionsMenuItemId,
masterDetailLazyLoadedMenuItemId,
]);

await waitForRowCountData(page, master_dataViewId, 2);
await sleep(500);

const [button] = await page.$x(`//div[@id="refreshButton"]`);
if (!button) {
throw Error(`#refreshButton not found.`);
}
await button.click();

await waitForRowCountData(page, master_dataViewId, 2);
await sleep(500);

await checkDataViewContainsSingleRow(page, details_dataViewId, "Details");
await checkDataViewContainsSingleRow(page, subDetails_dataViewId, "Details-Subdetail");
});
});
7 changes: 6 additions & 1 deletion test/tests_e2e/dbTools.js
Expand Up @@ -23,9 +23,14 @@ async function restoreWidgetSectionTestMaster(){
await executeProcedure("dbo.restoreWidgetSectionTestMaster");
}

// clears all data and insert new data used for the test
async function restoreWidgetSectionTestMasterForRefreshTest(){
await executeProcedure("dbo.restoreWidgetSectionTestMasterForRefreshTest");
}

async function putNumericTestDataToAllDataTypes(){
await executeProcedure("dbo.putNumericTestDataToAllDataTypes");
}

module.exports = { restoreAllDataTypesTable, restoreWidgetSectionTestMaster, clearScreenConfiguration,
putNumericTestDataToAllDataTypes }
putNumericTestDataToAllDataTypes, restoreWidgetSectionTestMasterForRefreshTest }