-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature: Upload external resources (#1492)
* fix collapse clickthrough * move scheduling enum file to enums directory * Add ability to upload external dataset to plan * add ability to associate simulation dataset to external datasets * styling * add e2e tests for dataset uploading * update design * add toasts for external dataset upload * cleanup * ensure unique resource name * add styling * fix unique profile names * fix styling fix unique list of types * fix test
- Loading branch information
Showing
16 changed files
with
369 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
time_utc,TotalPower,BatteryStateOfCharge,Temperature | ||
2024-245T00:01:00.0,0.0,143.15,0.0 | ||
2024-245T00:02:00.0,384.999999940483,1.4,-12.0964867663028 | ||
2024-245T00:03:00.0,384.999999399855,137.45,-12.0974993557598 | ||
2024-245T00:04:00.0,385.000010807604,134.85,-12.0985125609155 | ||
2024-245T00:05:00.0,381.80000002749,132.4,-12.0995253838464 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
{ | ||
"datasetStart": "2024-245T14:00:00", | ||
"profileSet": { | ||
"/awake": { | ||
"schema": { | ||
"type": "string" | ||
}, | ||
"segments": [ | ||
{ | ||
"duration": 3000000000, | ||
"dynamics": "foo" | ||
}, | ||
{ | ||
"duration": 3000000000, | ||
"dynamics": "bar" | ||
} | ||
], | ||
"type": "discrete" | ||
}, | ||
"/batteryEnergy": { | ||
"schema": { | ||
"items": { | ||
"initial": { | ||
"type": "real" | ||
}, | ||
"rate": { | ||
"type": "real" | ||
} | ||
}, | ||
"type": "struct" | ||
}, | ||
"segments": [ | ||
{ | ||
"duration": 40000000, | ||
"dynamics": { | ||
"initial": 100, | ||
"rate": -0.5 | ||
} | ||
}, | ||
{ | ||
"duration": 30000000, | ||
"dynamics": { | ||
"initial": 35, | ||
"rate": -0.1 | ||
} | ||
} | ||
], | ||
"type": "real" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import test, { expect, type BrowserContext, type Page } from '@playwright/test'; | ||
import { Constraints } from '../fixtures/Constraints.js'; | ||
import { Models } from '../fixtures/Models.js'; | ||
import { Plan } from '../fixtures/Plan.js'; | ||
import { Plans } from '../fixtures/Plans.js'; | ||
import { SchedulingConditions } from '../fixtures/SchedulingConditions.js'; | ||
import { SchedulingGoals } from '../fixtures/SchedulingGoals.js'; | ||
|
||
let constraints: Constraints; | ||
let context: BrowserContext; | ||
let models: Models; | ||
let page: Page; | ||
let plan: Plan; | ||
let plans: Plans; | ||
let schedulingConditions: SchedulingConditions; | ||
let schedulingGoals: SchedulingGoals; | ||
|
||
test.beforeAll(async ({ baseURL, browser }) => { | ||
context = await browser.newContext(); | ||
page = await context.newPage(); | ||
|
||
models = new Models(page); | ||
plans = new Plans(page, models); | ||
constraints = new Constraints(page); | ||
schedulingConditions = new SchedulingConditions(page); | ||
schedulingGoals = new SchedulingGoals(page); | ||
plan = new Plan(page, plans, constraints, schedulingGoals, schedulingConditions); | ||
|
||
await models.goto(); | ||
await models.createModel(baseURL); | ||
await plans.goto(); | ||
await plans.createPlan(); | ||
await plan.goto(); | ||
}); | ||
|
||
test.afterAll(async () => { | ||
await plans.goto(); | ||
await plans.deletePlan(); | ||
await models.goto(); | ||
await models.deleteModel(); | ||
await page.close(); | ||
await context.close(); | ||
}); | ||
|
||
test.describe.serial('Plan Resources', () => { | ||
test('Uploading external plan dataset file - JSON', async () => { | ||
await plan.uploadExternalDatasets('e2e-tests/data/external-dataset.json'); | ||
await expect(plan.panelActivityTypes.getByText('/awake')).toBeVisible(); | ||
await expect(plan.panelActivityTypes.getByText('/batteryEnergy')).toBeVisible(); | ||
}); | ||
|
||
test('Uploading external plan dataset file - CSV', async () => { | ||
await plan.uploadExternalDatasets('e2e-tests/data/external-dataset.csv'); | ||
await expect(plan.panelActivityTypes.getByText('TotalPower')).toBeVisible(); | ||
await expect(plan.panelActivityTypes.getByText('BatteryStateOfCharge')).toBeVisible(); | ||
await expect(plan.panelActivityTypes.getByText('Temperature')).toBeVisible(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.