-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test to check that bar graph makes requests with size 1 (limit=1). (#470
) * Include Graphs in default plugins installed. Test to check that bar graph makes requests with size 1 (limit=1). * Remove unnecessary page.goto. Move waitForResponse to just before telemetry is added to the graph * Use request url for checking query parameters * Small locator changes * Fix locators * Standardize request parameter checks * Update logic to properly detect branch * update test to match new appActions layout * add a yamcs appAction file * remove temp * update documentation * Clean up clean * address review comments --------- Co-authored-by: John Hill <[email protected]>
- Loading branch information
1 parent
c300270
commit f1b3922
Showing
5 changed files
with
133 additions
and
8 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/***************************************************************************** | ||
* Open MCT, Copyright (c) 2014-2024, United States Government | ||
* as represented by the Administrator of the National Aeronautics and Space | ||
* Administration. All rights reserved. | ||
* | ||
* Open MCT is licensed under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* http://www.apache.org/licenses/LICENSE-2.0. | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
* License for the specific language governing permissions and limitations | ||
* under the License. | ||
* | ||
* Open MCT includes source code licensed under additional open source | ||
* licenses. See the Open Source Licenses file (LICENSES.md) included with | ||
* this source code distribution or the Licensing information page available | ||
* at runtime from the About dialog for additional information. | ||
*****************************************************************************/ | ||
|
||
/* | ||
* This test suite is dedicated to testing the Bar Graph component. | ||
*/ | ||
|
||
import { pluginFixtures, appActions } from 'openmct-e2e'; | ||
import { searchAndLinkTelemetryToObject } from '../yamcsAppActions.mjs'; | ||
const { test, expect } = pluginFixtures; | ||
const { createDomainObjectWithDefaults } = appActions; | ||
|
||
test.describe('Bar Graph @yamcs', () => { | ||
let barGraph; | ||
let historicalGet; | ||
|
||
test.beforeEach(async ({ page }) => { | ||
// Open a browser, navigate to the main page, and wait until all networkevents to resolve | ||
await page.goto('./', { waitUntil: 'networkidle' }); | ||
|
||
// Create the Bar Graph | ||
barGraph = await createDomainObjectWithDefaults(page, { type: 'Graph', name: 'Bar Graph' }); | ||
// Enter edit mode for the overlay plot | ||
await searchAndLinkTelemetryToObject(page, 'Magnetometer', barGraph.name); | ||
}); | ||
|
||
test('Requests a single historical datum', async ({ page }) => { | ||
|
||
//http://localhost:9000/yamcs-proxy/api/archive/myproject/parameters/myproject/Magnetometer?start=2024-09-25T14%3A08%3A46.244Z&stop=2024-09-25T14%3A38%3A46.245Z&limit=1&order=desc | ||
historicalGet = page.waitForRequest(/.*\/api\/.*\/parameters.*limit=1&order=desc$/); | ||
|
||
await page.goto(barGraph.url, { waitUntil: 'networkidle' }); | ||
|
||
await historicalGet; | ||
|
||
await expect(page.getByRole('main').getByText(barGraph.name)).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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/***************************************************************************** | ||
* Open MCT, Copyright (c) 2014-2024, United States Government | ||
* as represented by the Administrator of the National Aeronautics and Space | ||
* Administration. All rights reserved. | ||
* | ||
* Open MCT is licensed under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* http://www.apache.org/licenses/LICENSE-2.0. | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
* License for the specific language governing permissions and limitations | ||
* under the License. | ||
* | ||
* Open MCT includes source code licensed under additional open source | ||
* licenses. See the Open Source Licenses file (LICENSES.md) included with | ||
* this source code distribution or the Licensing information page available | ||
* at runtime from the About dialog for additional information. | ||
*****************************************************************************/ | ||
|
||
/** | ||
* The fixtures in this file are to be used to consolidate common actions performed by the | ||
* various test suites. The goal is only to avoid duplication of code across test suites and not to abstract | ||
* away the underlying functionality of the application. For more about the App Action pattern, see /e2e/README.md) | ||
* | ||
* For example, if two functions are nearly identical in | ||
* timer.e2e.spec.js and notebook.e2e.spec.js, that function should be generalized and moved into this file. | ||
*/ | ||
|
||
/** | ||
* Search for telemetry and link it to an object. objectName should come from the domainObject.name function. | ||
* @param {import('@playwright/test').Page} page | ||
* @param {string} parameterName | ||
* @param {string} objectName | ||
*/ | ||
async function searchAndLinkTelemetryToObject(page, parameterName, objectName) { | ||
await page.getByRole('searchbox', { name: 'Search Input' }).click(); | ||
await page.getByRole('searchbox', { name: 'Search Input' }).fill(parameterName); | ||
await page.getByLabel(`${parameterName} yamcs.aggregate result`).getByText(parameterName).click(); | ||
await page.getByLabel('More actions').click(); | ||
await page.getByLabel('Create Link').click(); | ||
await page.getByLabel('Modal Overlay').getByLabel('Search Input').click(); | ||
await page.getByLabel('Modal Overlay').getByLabel('Search Input').fill(objectName); | ||
await page.getByLabel('Navigate to Bar Graph').click(); | ||
await page.getByText('Ok').click(); | ||
} | ||
|
||
export { | ||
searchAndLinkTelemetryToObject | ||
}; |