Skip to content

Commit

Permalink
Merge pull request #18266 from gabriellpr/pin-notes-restore-presentat…
Browse files Browse the repository at this point in the history
…ion-test

test: restore presentation on pin notes to whiteboard
  • Loading branch information
ramonlsouza committed Jul 4, 2023
2 parents b7a193a + f689ae2 commit 42c59c5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 deletions.
29 changes: 17 additions & 12 deletions bigbluebutton-tests/playwright/sharednotes/sharednotes.js
Expand Up @@ -131,7 +131,7 @@ class SharedNotes extends MultiUsers {
await this.modPage.waitAndClick(e.sendNotesToWhiteboard);

await this.modPage.hasText(e.currentSlideText, /test/, 30000);
await this.userPage1.hasText(e.currentSlideText, /test/, 20000);
await this.userPage.hasText(e.currentSlideText, /test/, 20000);

await notesLocator.press('Control+Z');

Expand All @@ -147,17 +147,17 @@ class SharedNotes extends MultiUsers {
const notesLocator = getNotesLocator(this.modPage);
await notesLocator.type(e.message);

await startSharedNotes(this.userPage1);
const notesLocatorUser = getNotesLocator(this.userPage1);
await startSharedNotes(this.userPage);
const notesLocatorUser = getNotesLocator(this.userPage);
await notesLocatorUser.press('Delete');
await notesLocatorUser.type('J');

await expect(notesLocator).toContainText(/Jello/, { timeout: ELEMENT_WAIT_TIME });
await expect(notesLocatorUser).toContainText(/Jello/, { timeout: ELEMENT_WAIT_TIME });
await this.modPage.waitAndClick(e.hideNotesLabel);
await this.modPage.wasRemoved(e.hideNotesLabel);
await this.userPage1.waitAndClick(e.hideNotesLabel);
await this.userPage1.wasRemoved(e.hideNotesLabel);
await this.userPage.waitAndClick(e.hideNotesLabel);
await this.userPage.wasRemoved(e.hideNotesLabel);
}

async seeNotesWithoutEditPermission() {
Expand All @@ -168,16 +168,16 @@ class SharedNotes extends MultiUsers {
const notesLocator = getNotesLocator(this.modPage);
await notesLocator.type('Hello');

await startSharedNotes(this.userPage1);
await startSharedNotes(this.userPage);

await this.modPage.waitAndClick(e.manageUsers);
await this.modPage.waitAndClick(e.lockViewersButton);
await this.modPage.waitAndClickElement(e.lockEditSharedNotes);
await this.modPage.waitAndClick(e.applyLockSettings);

const notesLocatorUser = getSharedNotesUserWithoutPermission(this.userPage1);
const notesLocatorUser = getSharedNotesUserWithoutPermission(this.userPage);
await expect(notesLocatorUser).toContainText(/Hello/, { timeout: 20000 });
await this.userPage1.wasRemoved(e.etherpadFrame);
await this.userPage.wasRemoved(e.etherpadFrame);

await this.modPage.waitAndClick(e.manageUsers);
await this.modPage.waitAndClick(e.lockViewersButton);
Expand All @@ -187,23 +187,28 @@ class SharedNotes extends MultiUsers {
await this.modPage.waitAndClick(e.hideNotesLabel);
await this.modPage.wasRemoved(e.hideNotesLabel);

await this.userPage1.waitAndClick(e.hideNotesLabel);
await this.userPage1.wasRemoved(e.hideNotesLabel);
await this.userPage.waitAndClick(e.hideNotesLabel);
await this.userPage.wasRemoved(e.hideNotesLabel);
}

async pinNotesOntoWhiteboard() {
const { sharedNotesEnabled } = getSettings();
test.fail(!sharedNotesEnabled, 'Shared notes is disabled');

await this.userPage.waitAndClick(e.minimizePresentation);
await this.userPage.hasElement(e.restorePresentation);

await startSharedNotes(this.modPage);
await this.modPage.waitAndClick(e.notesOptions);
await this.modPage.waitAndClick(e.pinNotes);
await this.modPage.hasElement(e.unpinNotes);

await this.userPage.hasElement(e.minimizePresentation);

const notesLocator = getNotesLocator(this.modPage);
await notesLocator.type('Hello');
const notesLocatorUser = getNotesLocator(this.userPage1);
const notesLocatorUser = getNotesLocator(this.userPage);

await expect(notesLocator).toContainText(/Hello/, { timeout: 20000 });
await expect(notesLocatorUser).toContainText(/Hello/);
}
Expand Down
Expand Up @@ -8,7 +8,7 @@ test.describe.parallel('Shared Notes', () => {
const context = await browser.newContext();
const page = await context.newPage();
await sharedNotes.initModPage(page, true);
await sharedNotes.initUserPage1(true);
await sharedNotes.initUserPage(true, context);
});
test('Open shared notes @ci', async () => {
await sharedNotes.openSharedNotes();
Expand Down

0 comments on commit 42c59c5

Please sign in to comment.