-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Feature plot better utc ticks #8139
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
Open
shefalijoshi
wants to merge
12
commits into
master
Choose a base branch
from
feature-plot-better-utc-ticks
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
bde9ac7
Initial prototype of UTC timestamp ticks
shefalijoshi a0aa65e
draft tick changes
shefalijoshi 50ff8a3
Refactor time-series ticks
shefalijoshi 4500817
Add e2e test for time ticks
shefalijoshi e34e0a0
Merge branch 'master' of https://github.com/nasa/openmct into feature…
shefalijoshi 96d25b1
Merge branch 'master' of https://github.com/nasa/openmct into feature…
shefalijoshi 673e929
Better comments and variable names and some formatting
shefalijoshi 2b9fd48
Fix tests broken due to new implementation of ticks
shefalijoshi 1646bad
Merge branch 'master' into feature-plot-better-utc-ticks
shefalijoshi afb1800
Merge branch 'master' into feature-plot-better-utc-ticks
shefalijoshi 515c99f
Only use extra ticks for xaxis when it's a timeseries
shefalijoshi 850dfd1
Revert accidental change to y-axis tick count
shefalijoshi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
153 changes: 153 additions & 0 deletions
153
e2e/tests/functional/plugins/plot/timeTicks.e2e.spec.js
This file contains hidden or 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,153 @@ | ||
| import { expect, test } from '@playwright/test'; | ||
|
|
||
| import { createDomainObjectWithDefaults, setTimeConductorBounds } from '../../../../appActions.js'; | ||
|
|
||
| test.describe('Time Tick Generation', () => { | ||
| // Test cases will go here | ||
| let sineWaveGeneratorObject; | ||
|
|
||
| test.beforeEach(async ({ page }) => { | ||
| // Open a browser, navigate to the main page, and wait until all networkevents to resolve | ||
| await page.goto('./', { waitUntil: 'domcontentloaded' }); | ||
|
|
||
| sineWaveGeneratorObject = await createDomainObjectWithDefaults(page, { | ||
| type: 'Sine Wave Generator' | ||
| }); | ||
|
|
||
| // Navigate to Sine Wave Generator | ||
| await page.goto(sineWaveGeneratorObject.url); | ||
| }); | ||
|
|
||
| test('Plot time-series ticks are functionally correct over a period of 6 months, between two years', async ({ | ||
| page | ||
| }) => { | ||
| const startDate = '2022-09-01'; | ||
| const startTime = '22:00:00'; | ||
| const endDate = '2023-03-01'; | ||
| const endTime = '22:00:30'; | ||
| await setTimeConductorBounds(page, { startDate, startTime, endDate, endTime }); | ||
|
|
||
| await testYearTimeSeriesTicks(page); | ||
| }); | ||
|
|
||
| test('Plot time-series ticks are functionally correct over a period of days', async ({ | ||
| page | ||
| }) => { | ||
| const startDate = '2023-03-22'; | ||
| const startTime = '00:00:00'; | ||
| const endDate = '2023-04-20'; | ||
| const endTime = '12:00:00'; | ||
| await setTimeConductorBounds(page, { startDate, startTime, endDate, endTime }); | ||
|
|
||
| await testDaysTimeSeriesTicks(page); | ||
| }); | ||
|
|
||
| test('Plot time-series ticks are functionally correct over a period of hours', async ({ | ||
| page | ||
| }) => { | ||
| const startDate = '2023-03-22'; | ||
| const startTime = '01:15:00'; | ||
| const endDate = '2023-03-22'; | ||
| const endTime = '09:15:00'; | ||
| await setTimeConductorBounds(page, { startDate, startTime, endDate, endTime }); | ||
|
|
||
| await testHoursTimeSeriesTicks(page); | ||
| }); | ||
|
|
||
| test('Plot time-series ticks are functionally correct over a period of minutes', async ({ | ||
| page | ||
| }) => { | ||
| const startDate = '2023-03-22'; | ||
| const startTime = '01:15:00'; | ||
| const endDate = '2023-03-22'; | ||
| const endTime = '01:35:00'; | ||
| await setTimeConductorBounds(page, { startDate, startTime, endDate, endTime }); | ||
|
|
||
| await testMinutesTimeSeriesTicks(page); | ||
| }); | ||
|
|
||
| test('Plot time-series ticks are functionally correct over a period of seconds', async ({ | ||
| page | ||
| }) => { | ||
| const startDate = '2023-03-22'; | ||
| const startTime = '01:22:00'; | ||
| const endDate = '2023-03-22'; | ||
| const endTime = '01:23:00'; | ||
| await setTimeConductorBounds(page, { startDate, startTime, endDate, endTime }); | ||
|
|
||
| await testSecondsTimeSeriesTicks(page); | ||
| }); | ||
| }); | ||
|
|
||
| /** | ||
| * @param {import('@playwright/test').Page} page | ||
| */ | ||
| async function testYearTimeSeriesTicks(page) { | ||
| const xTicks = page.locator('.gl-plot-x-tick-label'); | ||
| await expect(xTicks).toHaveCount(6); | ||
| await expect(xTicks.nth(0)).toHaveText('2022-09-01 22:00:00'); | ||
| await expect(xTicks.nth(1)).toHaveText('2022-10-01 22:00:00'); | ||
| await expect(xTicks.nth(2)).toHaveText('2022-11-01 22:00:00'); | ||
| await expect(xTicks.nth(3)).toHaveText('2022-12-01 23:00:00'); | ||
| await expect(xTicks.nth(4)).toHaveText('2023-01-01 23:00:00'); | ||
| await expect(xTicks.nth(5)).toHaveText('2023-02-01 23:00:00'); | ||
| } | ||
|
|
||
| async function testDaysTimeSeriesTicks(page) { | ||
| const xTicks = page.locator('.gl-plot-x-tick-label'); | ||
| await expect(xTicks).toHaveCount(10); | ||
| await expect(xTicks.nth(0)).toHaveText('2023-03-24'); | ||
| await expect(xTicks.nth(1)).toHaveText('2023-03-27'); | ||
| await expect(xTicks.nth(2)).toHaveText('2023-03-30'); | ||
| await expect(xTicks.nth(3)).toHaveText('2023-04-02'); | ||
| await expect(xTicks.nth(4)).toHaveText('2023-04-05'); | ||
| await expect(xTicks.nth(5)).toHaveText('2023-04-08'); | ||
| await expect(xTicks.nth(6)).toHaveText('2023-04-11'); | ||
| await expect(xTicks.nth(7)).toHaveText('2023-04-14'); | ||
| await expect(xTicks.nth(8)).toHaveText('2023-04-17'); | ||
| await expect(xTicks.nth(9)).toHaveText('2023-04-20'); | ||
| } | ||
|
|
||
| async function testHoursTimeSeriesTicks(page) { | ||
| const xTicks = page.locator('.gl-plot-x-tick-label'); | ||
| await expect(xTicks).toHaveCount(8); | ||
| await expect(xTicks.nth(0)).toHaveText('02:00:00'); | ||
| await expect(xTicks.nth(1)).toHaveText('03:00:00'); | ||
| await expect(xTicks.nth(2)).toHaveText('04:00:00'); | ||
| await expect(xTicks.nth(3)).toHaveText('05:00:00'); | ||
| await expect(xTicks.nth(4)).toHaveText('06:00:00'); | ||
| await expect(xTicks.nth(5)).toHaveText('07:00:00'); | ||
| await expect(xTicks.nth(6)).toHaveText('08:00:00'); | ||
| await expect(xTicks.nth(7)).toHaveText('09:00:00'); | ||
| } | ||
|
|
||
| async function testMinutesTimeSeriesTicks(page) { | ||
| const xTicks = page.locator('.gl-plot-x-tick-label'); | ||
| await expect(xTicks).toHaveCount(10); | ||
| await expect(xTicks.nth(0)).toHaveText('01:16:00'); | ||
| await expect(xTicks.nth(1)).toHaveText('01:18:00'); | ||
| await expect(xTicks.nth(2)).toHaveText('01:20:00'); | ||
| await expect(xTicks.nth(3)).toHaveText('01:22:00'); | ||
| await expect(xTicks.nth(4)).toHaveText('01:24:00'); | ||
| await expect(xTicks.nth(5)).toHaveText('01:26:00'); | ||
| await expect(xTicks.nth(6)).toHaveText('01:28:00'); | ||
| await expect(xTicks.nth(7)).toHaveText('01:30:00'); | ||
| await expect(xTicks.nth(8)).toHaveText('01:32:00'); | ||
| await expect(xTicks.nth(9)).toHaveText('01:34:00'); | ||
| } | ||
|
|
||
| async function testSecondsTimeSeriesTicks(page) { | ||
| const xTicks = page.locator('.gl-plot-x-tick-label'); | ||
| await expect(xTicks).toHaveCount(11); | ||
| await expect(xTicks.nth(0)).toHaveText('01:22:00'); | ||
| await expect(xTicks.nth(1)).toHaveText('01:22:06'); | ||
| await expect(xTicks.nth(2)).toHaveText('01:22:12'); | ||
| await expect(xTicks.nth(3)).toHaveText('01:22:18'); | ||
| await expect(xTicks.nth(4)).toHaveText('01:22:24'); | ||
| await expect(xTicks.nth(5)).toHaveText('01:22:30'); | ||
| await expect(xTicks.nth(6)).toHaveText('01:22:36'); | ||
| await expect(xTicks.nth(7)).toHaveText('01:22:42'); | ||
| await expect(xTicks.nth(8)).toHaveText('01:22:48'); | ||
| await expect(xTicks.nth(9)).toHaveText('01:22:54'); | ||
| await expect(xTicks.nth(10)).toHaveText('01:23:00'); | ||
| } |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.