100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps
Java asset-managementbuildingdashboarddataplatformdevice-managementedge-computingenergyenergy-managementenergy-monitorfleet-managementfleet-telematicsiotiot-applicationiot-platformmodbusmqttmqtt-brokerota-updaterules-enginesmartcity
Fix the unstable asset tree UI test (#3458)
Martin Peeters9bab8b950be7
diff --git a/ui/app/manager/test/assettree.test.ts b/ui/app/manager/test/assettree.test.tsindex 4b96a0aef..df98fd520 100644--- a/ui/app/manager/test/assettree.test.ts+++ b/ui/app/manager/test/assettree.test.ts@@ -183,7 +183,6 @@ test(`Open browser tab directly to the battery asset`, async ({await applyParentAssets(parentAssets, manager);const id = manager.assets.find((asset) => asset.name === batteryAssets[0].name)?.id;expect(id).toBeDefined();- await manager.goToRealmStartPage("smartcity");await assetsPage.gotoAssetId("smartcity", id!);await expect(assetTree.getFilterInput()).toHaveValue(id!);await expect(assetTree.getAssetNodes()).toHaveCount(2); // The parent city asset + selected battery assetdiff --git a/ui/app/manager/test/fixtures/manager.ts b/ui/app/manager/test/fixtures/manager.tsindex f1ef457ba..2c5a19e8f 100644--- a/ui/app/manager/test/fixtures/manager.ts+++ b/ui/app/manager/test/fixtures/manager.ts@@ -521,7 +521,6 @@ export class Manager {// Provision assetsif (assets) {- this.assets = [];for (const asset of assets) {await this.createAsset(asset, config);}diff --git a/ui/app/manager/test/fixtures/pages/assets.ts b/ui/app/manager/test/fixtures/pages/assets.tsindex bad4004e3..0d1af3637 100644--- a/ui/app/manager/test/fixtures/pages/assets.ts+++ b/ui/app/manager/test/fixtures/pages/assets.ts@@ -31,8 +31,11 @@ export class AssetsPage implements BasePage {this.manager.navigateToTab("Assets");}+ /**+ * Navigate to an asset's page, as when opening its URL in a new tab.+ */async gotoAssetId(realm: string, id: string, editor = false) {- this.page.goto(this.manager.getAppUrl(realm) + `#/assets/${editor}/${id}`);+ await this.page.goto(this.manager.getAppUrl(realm) + `#/assets/${editor}/${id}`);}/**