Skip to content

Commit e16cbdf

Browse files
authored
Merge branch 'master' into fix/empty-author
2 parents 86305e1 + f21685e commit e16cbdf

File tree

19 files changed

+267
-166
lines changed

19 files changed

+267
-166
lines changed

.eslintrc.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ module.exports = {
1313
extends: [
1414
'eslint:recommended',
1515
'plugin:compat/recommended',
16-
'plugin:vue/recommended',
16+
'plugin:vue/vue3-recommended',
1717
'plugin:you-dont-need-lodash-underscore/compatible',
1818
'plugin:prettier/recommended'
1919
],
@@ -28,6 +28,8 @@ module.exports = {
2828
}
2929
},
3030
rules: {
31+
'vue/no-deprecated-dollar-listeners-api': 'warn',
32+
'vue/no-deprecated-events-api': 'warn',
3133
'vue/no-v-for-template-key': 'off',
3234
'vue/no-v-for-template-key-on-child': 'error',
3335
'prettier/prettier': 'error',

docs/src/process/version.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ requirements.
5353

5454
Additionally, the following project-specific standards will be used:
5555

56-
* During development, a "-SNAPSHOT" suffix shall be appended to the
56+
* During development, a "-next" suffix shall be appended to the
5757
version number. The version number before the suffix shall reflect
5858
the next expected version number for release.
5959
* Prior to a 1.0.0 release, the _minor_ version will be incremented
@@ -93,7 +93,7 @@ numbers by the following process:
9393

9494
1. Update version number in `package.json`
9595
1. Checkout branch created for the last sprint that has been successfully tested.
96-
2. Remove a `-SNAPSHOT` suffix from the version in `package.json`.
96+
2. Remove a `-next` suffix from the version in `package.json`.
9797
3. Verify that resulting version number meets semantic versioning
9898
requirements relative to previous stable version. Increment the
9999
version number if necessary.
@@ -138,7 +138,7 @@ numbers by the following process:
138138
1. Create a new branch off the `master` branch.
139139
2. Remove any suffix from the version number,
140140
or increment the _patch_ version if there is no suffix.
141-
3. Append a `-SNAPSHOT` suffix.
141+
3. Append a `-next` suffix.
142142
4. Commit changes to `package.json` on the `master` branch.
143143
The commit message should reference the sprint being opened,
144144
preferably by a URL reference to the associated Milestone in
@@ -150,6 +150,6 @@ numbers by the following process:
150150
Projects dependent on Open MCT being co-developed by the Open MCT
151151
team should follow a similar process, except that they should
152152
additionally update their dependency on Open MCT to point to the
153-
latest archive when removing their `-SNAPSHOT` status, and
153+
latest archive when removing their `-next` status, and
154154
that they should be pointed back to the `master` branch after
155155
this has completed.

e2e/appActions.js

+23-2
Original file line numberDiff line numberDiff line change
@@ -480,29 +480,50 @@ async function setEndOffset(page, offset) {
480480
await setTimeConductorOffset(page, offset);
481481
}
482482

483+
/**
484+
* Set the time conductor bounds in fixed time mode
485+
*
486+
* NOTE: Unless explicitly testing the Time Conductor itself, it is advised to instead
487+
* navigate directly to the object with the desired time bounds using `navigateToObjectWithFixedTimeBounds()`.
488+
* @param {import('@playwright/test').Page} page
489+
* @param {string} startDate
490+
* @param {string} endDate
491+
*/
483492
async function setTimeConductorBounds(page, startDate, endDate) {
484493
// Bring up the time conductor popup
494+
expect(await page.locator('.l-shell__time-conductor.c-compact-tc').count()).toBe(1);
485495
await page.click('.l-shell__time-conductor.c-compact-tc');
486496

487497
await setTimeBounds(page, startDate, endDate);
488498

489499
await page.keyboard.press('Enter');
490500
}
491501

502+
/**
503+
* Set the independent time conductor bounds in fixed time mode
504+
* @param {import('@playwright/test').Page} page
505+
* @param {string} startDate
506+
* @param {string} endDate
507+
*/
492508
async function setIndependentTimeConductorBounds(page, startDate, endDate) {
493509
// Activate Independent Time Conductor in Fixed Time Mode
494510
await page.getByRole('switch').click();
495511

496512
// Bring up the time conductor popup
497513
await page.click('.c-conductor-holder--compact .c-compact-tc');
498-
499-
await expect(page.locator('.itc-popout')).toBeVisible();
514+
await expect(page.locator('.itc-popout')).toBeInViewport();
500515

501516
await setTimeBounds(page, startDate, endDate);
502517

503518
await page.keyboard.press('Enter');
504519
}
505520

521+
/**
522+
* Set the bounds of the visible conductor in fixed time mode
523+
* @param {import('@playwright/test').Page} page
524+
* @param {string} startDate
525+
* @param {string} endDate
526+
*/
506527
async function setTimeBounds(page, startDate, endDate) {
507528
if (startDate) {
508529
// Fill start time

e2e/tests/functional/plugins/conditionSet/conditionSet.e2e.spec.js

+74-72
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@ demonstrate some playwright for test developers. This pattern should not be re-u
2727
*/
2828

2929
const { test, expect } = require('../../../../pluginFixtures.js');
30-
const { createDomainObjectWithDefaults } = require('../../../../appActions');
30+
const {
31+
createDomainObjectWithDefaults,
32+
createExampleTelemetryObject
33+
} = require('../../../../appActions');
3134

3235
let conditionSetUrl;
3336
let getConditionSetIdentifierFromUrl;
@@ -205,23 +208,31 @@ test.describe.serial('Condition Set CRUD Operations on @localStorage', () => {
205208
});
206209

207210
test.describe('Basic Condition Set Use', () => {
211+
let conditionSet;
212+
208213
test.beforeEach(async ({ page }) => {
209214
// Open a browser, navigate to the main page, and wait until all network events to resolve
210215
await page.goto('./', { waitUntil: 'domcontentloaded' });
211-
});
212-
test('Can add a condition', async ({ page }) => {
213216
// Create a new condition set
214-
await createDomainObjectWithDefaults(page, {
217+
conditionSet = await createDomainObjectWithDefaults(page, {
215218
type: 'Condition Set',
216219
name: 'Test Condition Set'
217220
});
221+
});
222+
test('Creating a condition defaults the condition name to "Unnamed Condition"', async ({
223+
page
224+
}) => {
225+
await page.goto(conditionSet.url);
226+
218227
// Change the object to edit mode
219228
await page.locator('[title="Edit"]').click();
220229

221230
// Click Add Condition button
222231
await page.locator('#addCondition').click();
223232
// Check that the new Unnamed Condition section appears
224-
const numOfUnnamedConditions = await page.locator('text=Unnamed Condition').count();
233+
const numOfUnnamedConditions = await page
234+
.locator('.c-condition__name', { hasText: 'Unnamed Condition' })
235+
.count();
225236
expect(numOfUnnamedConditions).toEqual(1);
226237
});
227238
test('ConditionSet should display appropriate view options', async ({ page }) => {
@@ -238,16 +249,13 @@ test.describe('Basic Condition Set Use', () => {
238249
type: 'Sine Wave Generator',
239250
name: 'Beta Sine Wave Generator'
240251
});
241-
const conditionSet1 = await createDomainObjectWithDefaults(page, {
242-
type: 'Condition Set',
243-
name: 'Test Condition Set'
244-
});
252+
253+
await page.goto(conditionSet.url);
245254

246255
// Change the object to edit mode
247256
await page.locator('[title="Edit"]').click();
248257

249258
// Expand the 'My Items' folder in the left tree
250-
await page.goto(conditionSet1.url);
251259
page.click('button[title="Show selected item in tree"]');
252260
// Add the Alpha & Beta Sine Wave Generator to the Condition Set and save changes
253261
const treePane = page.getByRole('tree', {
@@ -264,105 +272,99 @@ test.describe('Basic Condition Set Use', () => {
264272
await alphaGeneratorTreeItem.dragTo(conditionCollection);
265273
await betaGeneratorTreeItem.dragTo(conditionCollection);
266274

267-
const saveButtonLocator = page.locator('button[title="Save"]');
268-
await saveButtonLocator.click();
275+
await page.locator('button[title="Save"]').click();
269276
await page.getByRole('listitem', { name: 'Save and Finish Editing' }).click();
277+
270278
await page.click('button[title="Change the current view"]');
271279

272280
await expect(page.getByRole('menuitem', { name: /Lad Table/ })).toBeHidden();
273281
await expect(page.getByRole('menuitem', { name: /Conditions View/ })).toBeVisible();
274282
await expect(page.getByRole('menuitem', { name: /Plot/ })).toBeVisible();
275283
await expect(page.getByRole('menuitem', { name: /Telemetry Table/ })).toBeVisible();
276284
});
277-
test('ConditionSet should output blank instead of the default value', async ({ page }) => {
278-
//Navigate to baseURL
279-
await page.goto('./', { waitUntil: 'domcontentloaded' });
280-
281-
//Click the Create button
282-
await page.click('button:has-text("Create")');
283-
284-
// Click the object specified by 'type'
285-
await page.click(`li[role='menuitem']:text("Sine Wave Generator")`);
286-
await page.getByRole('spinbutton', { name: 'Loading Delay (ms)' }).fill('8000');
287-
const nameInput = page.locator('form[name="mctForm"] .first input[type="text"]');
288-
await nameInput.fill('Delayed Sine Wave Generator');
289-
290-
// Click OK button and wait for Navigate event
291-
await Promise.all([
292-
page.waitForLoadState(),
293-
page.click('[aria-label="Save"]'),
294-
// Wait for Save Banner to appear
295-
page.waitForSelector('.c-message-banner__message')
296-
]);
285+
test('ConditionSet has correct outputs when telemetry is and is not available', async ({
286+
page
287+
}) => {
288+
const exampleTelemetry = await createExampleTelemetryObject(page);
297289

298-
// Create a new condition set
299-
await createDomainObjectWithDefaults(page, {
300-
type: 'Condition Set',
301-
name: 'Test Blank Output of Condition Set'
302-
});
290+
await page.getByTitle('Show selected item in tree').click();
291+
await page.goto(conditionSet.url);
303292
// Change the object to edit mode
304293
await page.locator('[title="Edit"]').click();
305294

306-
// Click Add Condition button twice
295+
// Create two conditions
307296
await page.locator('#addCondition').click();
308297
await page.locator('#addCondition').click();
309298
await page.locator('#conditionCollection').getByRole('textbox').nth(0).fill('First Condition');
310299
await page.locator('#conditionCollection').getByRole('textbox').nth(1).fill('Second Condition');
311300

312-
// Expand the 'My Items' folder in the left tree
313-
await page.locator('.c-tree__item__view-control.c-disclosure-triangle').first().click();
314-
// Add the Sine Wave Generator to the Condition Set and save changes
315-
const treePane = page.getByRole('tree', {
316-
name: 'Main Tree'
317-
});
318-
const sineWaveGeneratorTreeItem = treePane.getByRole('treeitem', {
319-
name: 'Delayed Sine Wave Generator'
320-
});
321-
const conditionCollection = await page.locator('#conditionCollection');
322-
301+
// Add Telemetry to ConditionSet
302+
const sineWaveGeneratorTreeItem = page
303+
.getByRole('tree', {
304+
name: 'Main Tree'
305+
})
306+
.getByRole('treeitem', {
307+
name: exampleTelemetry.name
308+
});
309+
const conditionCollection = page.locator('#conditionCollection');
323310
await sineWaveGeneratorTreeItem.dragTo(conditionCollection);
324311

325-
const firstCriterionTelemetry = await page.locator(
312+
// Modify First Criterion
313+
const firstCriterionTelemetry = page.locator(
326314
'[aria-label="Criterion Telemetry Selection"] >> nth=0'
327315
);
328-
firstCriterionTelemetry.selectOption({ label: 'Delayed Sine Wave Generator' });
329-
330-
const secondCriterionTelemetry = await page.locator(
331-
'[aria-label="Criterion Telemetry Selection"] >> nth=1'
332-
);
333-
secondCriterionTelemetry.selectOption({ label: 'Delayed Sine Wave Generator' });
334-
335-
const firstCriterionMetadata = await page.locator(
316+
firstCriterionTelemetry.selectOption({ label: exampleTelemetry.name });
317+
const firstCriterionMetadata = page.locator(
336318
'[aria-label="Criterion Metadata Selection"] >> nth=0'
337319
);
338320
firstCriterionMetadata.selectOption({ label: 'Sine' });
321+
const firstCriterionComparison = page.locator(
322+
'[aria-label="Criterion Comparison Selection"] >> nth=0'
323+
);
324+
firstCriterionComparison.selectOption({ label: 'is greater than or equal to' });
325+
const firstCriterionInput = page.locator('[aria-label="Criterion Input"] >> nth=0');
326+
await firstCriterionInput.fill('0');
339327

340-
const secondCriterionMetadata = await page.locator(
341-
'[aria-label="Criterion Metadata Selection"] >> nth=1'
328+
// Modify First Criterion
329+
const secondCriterionTelemetry = page.locator(
330+
'[aria-label="Criterion Telemetry Selection"] >> nth=1'
342331
);
343-
secondCriterionMetadata.selectOption({ label: 'Sine' });
332+
secondCriterionTelemetry.selectOption({ label: exampleTelemetry.name });
344333

345-
const firstCriterionComparison = await page.locator(
346-
'[aria-label="Criterion Comparison Selection"] >> nth=0'
334+
const secondCriterionMetadata = page.locator(
335+
'[aria-label="Criterion Metadata Selection"] >> nth=1'
347336
);
348-
firstCriterionComparison.selectOption({ label: 'is greater than or equal to' });
337+
secondCriterionMetadata.selectOption({ label: 'Sine' });
349338

350-
const secondCriterionComparison = await page.locator(
339+
const secondCriterionComparison = page.locator(
351340
'[aria-label="Criterion Comparison Selection"] >> nth=1'
352341
);
353342
secondCriterionComparison.selectOption({ label: 'is less than' });
354343

355-
const firstCriterionInput = await page.locator('[aria-label="Criterion Input"] >> nth=0');
356-
await firstCriterionInput.fill('0');
357-
358-
const secondCriterionInput = await page.locator('[aria-label="Criterion Input"] >> nth=1');
344+
const secondCriterionInput = page.locator('[aria-label="Criterion Input"] >> nth=1');
359345
await secondCriterionInput.fill('0');
360346

361-
const saveButtonLocator = page.locator('button[title="Save"]');
362-
await saveButtonLocator.click();
347+
// Save ConditionSet
348+
await page.locator('button[title="Save"]').click();
363349
await page.getByRole('listitem', { name: 'Save and Finish Editing' }).click();
364350

365-
const outputValue = await page.locator('[aria-label="Current Output Value"]');
351+
// Validate that the condition set is evaluating and outputting
352+
// the correct value when the underlying telemetry subscription is active.
353+
let outputValue = page.locator('[aria-label="Current Output Value"]');
354+
await expect(outputValue).toHaveText('false');
355+
356+
await page.goto(exampleTelemetry.url);
357+
358+
// Edit SWG to add 8 second loading delay to simulate the case
359+
// where telemetry is not available.
360+
await page.getByTitle('More options').click();
361+
await page.getByRole('menuitem', { name: 'Edit Properties...' }).click();
362+
await page.getByRole('spinbutton', { name: 'Loading Delay (ms)' }).fill('8000');
363+
await page.getByLabel('Save').click();
364+
365+
// Expect that the output value is blank or '---' if the
366+
// underlying telemetry subscription is not active.
367+
await page.goto(conditionSet.url);
366368
await expect(outputValue).toHaveText('---');
367369
});
368370
});

0 commit comments

Comments
 (0)