mirror of
https://github.com/nasa/openmct.git
synced 2025-01-18 18:57:01 +00:00
[e2e][couchdb] Add test coverage for mct5616 (#5913)
* [e2e][couchdb] Add test for mct5616 - Add test to verify that modifying object properties generates a single persistence operation with CouchDB * [e2e] Poll for 1 sec to allow time for request * [e2e] ignore expected console error * add comments * add `aria-label`s to form select fields * add `aria-label` for clock format select * [e2e] Improve selector * make property name less ambiguous * refactor(e2e): use default object name
This commit is contained in:
parent
d545124942
commit
4b14d2d6d2
@ -25,6 +25,7 @@ This test suite is dedicated to tests which verify form functionality in isolati
|
||||
*/
|
||||
|
||||
const { test, expect } = require('../../baseFixtures');
|
||||
const { createDomainObjectWithDefaults } = require('../../appActions');
|
||||
const path = require('path');
|
||||
|
||||
const TEST_FOLDER = 'test folder';
|
||||
@ -91,6 +92,44 @@ test.describe('Persistence operations @addInit', () => {
|
||||
});
|
||||
});
|
||||
|
||||
test.describe('Persistence operations @couchdb', () => {
|
||||
test.use({ failOnConsoleError: false });
|
||||
test('Editing object properties should generate a single persistence operation', async ({ page }) => {
|
||||
test.info().annotations.push({
|
||||
type: 'issue',
|
||||
description: 'https://github.com/nasa/openmct/issues/5616'
|
||||
});
|
||||
|
||||
await page.goto('./', { waitUntil: 'networkidle' });
|
||||
|
||||
// Create a new 'Clock' object with default settings
|
||||
const clock = await createDomainObjectWithDefaults(page, {
|
||||
type: 'Clock'
|
||||
});
|
||||
|
||||
// Count all persistence operations (PUT requests) for this specific object
|
||||
let putRequestCount = 0;
|
||||
page.on('request', req => {
|
||||
if (req.method() === 'PUT' && req.url().endsWith(clock.uuid)) {
|
||||
putRequestCount += 1;
|
||||
}
|
||||
});
|
||||
|
||||
// Open the edit form for the clock object
|
||||
await page.click('button[title="More options"]');
|
||||
await page.click('li[title="Edit properties of this object."]');
|
||||
|
||||
// Modify the display format from default 12hr -> 24hr and click 'Save'
|
||||
await page.locator('select[aria-label="12 or 24 hour clock"]').selectOption({ value: 'clock24' });
|
||||
await page.click('button[aria-label="Save"]');
|
||||
|
||||
await expect.poll(() => putRequestCount, {
|
||||
message: 'Verify a single PUT request was made to persist the object',
|
||||
timeout: 1000
|
||||
}).toEqual(1);
|
||||
});
|
||||
});
|
||||
|
||||
test.describe('Form Correctness by Object Type', () => {
|
||||
test.fixme('Verify correct behavior of number object (SWG)', async ({page}) => {});
|
||||
test.fixme('Verify correct behavior of number object Timer', async ({page}) => {});
|
||||
|
@ -26,6 +26,7 @@
|
||||
v-model="selected"
|
||||
required="model.required"
|
||||
name="mctControl"
|
||||
:aria-label="model.ariaLabel || model.name"
|
||||
@change="onChange($event)"
|
||||
>
|
||||
<option
|
||||
|
@ -68,6 +68,7 @@ export default function ClockPlugin(options) {
|
||||
]
|
||||
},
|
||||
{
|
||||
ariaLabel: "12 or 24 hour clock",
|
||||
control: 'select',
|
||||
options: [
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user