Compare commits

...

23 Commits

Author SHA1 Message Date
John Hill
c268afe1cd add user2 close 2022-09-08 08:09:52 -07:00
John Hill
24f1149f08 add both tests 2022-09-07 13:46:04 -07:00
Jamie V
6a7b8dcdbf cleaning up code 2022-09-02 13:27:39 -07:00
Jamie V
2a8741313d removing debug code 2022-09-02 13:24:07 -07:00
John Hill
0af340042d tests 2022-09-01 13:02:18 -07:00
John Hill
1a125f819c Merge branch 'master' of https://github.com/nasa/openmct into multi-nb-fix 2022-09-01 12:25:10 -07:00
Jamie V
7acd94feb1 debug 2022-08-31 10:30:10 -07:00
Jamie V
5268b50cf2 debug 2022-08-31 09:33:03 -07:00
Jamie V
3253410dee debug 2022-08-31 09:12:07 -07:00
Jamie V
305f210ca4 debug 2022-08-30 20:46:56 -07:00
Jamie V
4beb8b42bc debug 2022-08-30 20:20:10 -07:00
Jamie V
d981d21ab1 debug 2022-08-30 19:44:00 -07:00
Jamie V
063e4c4c71 debuggin 2022-08-30 17:26:55 -07:00
Jamie V
4fe0634170 logging 2022-08-30 15:40:16 -07:00
Jamie V
e358b52c28 logging 2022-08-30 15:31:39 -07:00
Jamie V
3bacc75049 logging 2022-08-30 13:55:22 -07:00
Jamie V
54650999ee logging 2022-08-30 13:13:42 -07:00
Jamie V
17bf045fc8 more logging 2022-08-30 11:58:00 -07:00
Jamie V
3440789a5f added restricted notebook to object sync, logging 2022-08-30 11:01:55 -07:00
Jamie V
e2517e447d adding debug logs 2022-08-29 14:14:06 -07:00
Jamie V
5d357053ea checking inf binding is the issue 2022-08-29 13:56:40 -07:00
Jamie V
06de9a160c syntax issue 2022-08-26 10:09:02 -07:00
Jamie V
495c15cd21 log to test that branch being used by viper for testing 2022-08-26 09:28:08 -07:00
2 changed files with 94 additions and 1 deletions

View File

@@ -0,0 +1,93 @@
/*****************************************************************************
* Open MCT, Copyright (c) 2014-2022, 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 covers the multi user functionality of notebooks
*
*/
//Structure: Some standard Imports. Please update the required pathing
const { test, expect } = require('../../../../baseFixtures');
const { createDomainObjectWithDefaults } = require('../../../../appActions');
//this test suite requires 2 browser contexts and couchdb
test.describe('Multi user notebook tests @unstable @2p @couchdb', () => {
test('A fresh notebook entry entered by User1 will appear for User2 within 60 seconds', async ({ browser, page: user1 }) => {
await user1.goto('./', { waitUntil: 'networkidle' });
// Create Notebook
const notebookObject = await createDomainObjectWithDefaults(user1, {
type: 'Notebook',
name: "Test Notebook"
});
//Create a Separate Browser Context to ensure that
const context2 = await browser.newContext();
const user2 = await context2.newPage();
await user2.goto(notebookObject.url, {waitUntil: 'networkidle'});
await user2.waitForLoadState('networkidle');
// Ensure that the Notebook is fresh
// eslint-disable-next-line playwright/no-useless-not
await expect(user1.locator('text=AAA')).not.toBeVisible();
//Enter AAA into notebook entry
await enterTextEntry(user1);
await expect(user1.locator('text=AAA')).toBeVisible();
await expect(user2.locator('text=AAA')).toBeVisible();
//Need to explicitly close this tab
await user2.close();
});
test('A fresh notebook entry entered by User1 will appear for User1s second tab within 60 seconds', async ({ context, page: page1 }) => {
await page1.goto('./', { waitUntil: 'networkidle' });
// Create Notebook
const notebookObject = await createDomainObjectWithDefaults(page1, {
type: 'Notebook',
name: "Test Notebook"
});
//Create a Separate Browser Context to ensure that
const page2 = await context.newPage();
await page2.goto(notebookObject.url, {waitUntil: 'networkidle'});
await page2.waitForLoadState('networkidle');
// Ensure that the Notebook is fresh
// eslint-disable-next-line playwright/no-useless-not
await expect(page1.locator('text=AAA')).not.toBeVisible();
//Enter AAA into notebook entry
await enterTextEntry(page1);
await expect(page1.locator('text=AAA')).toBeVisible();
await expect(page2.locator('text=AAA')).toBeVisible();
});
});
/**
* @param {import('@playwright/test').Page} page
*/
async function enterTextEntry(page) {
// Click .c-notebook__drag-area
await page.locator('.c-notebook__drag-area').click();
// enter text
await page.locator('div.c-ne__text').click();
await page.locator('div.c-ne__text').fill('AAA');
await page.locator('div.c-ne__text').press('Enter');
}

View File

@@ -88,7 +88,7 @@ export default class ObjectAPI {
this.cache = {};
this.interceptorRegistry = new InterceptorRegistry();
this.SYNCHRONIZED_OBJECT_TYPES = ['notebook', 'plan', 'annotation'];
this.SYNCHRONIZED_OBJECT_TYPES = ['notebook', 'restricted-notebook', 'plan', 'annotation'];
this.errors = {
Conflict: ConflictError