2024-03-06 22:26:03 +08:00
|
|
|
const { test } = require('../fixtures');
|
2023-09-01 04:21:48 +08:00
|
|
|
const { fullyParallel } = require('../playwright.config');
|
2021-11-26 02:23:58 +08:00
|
|
|
const { Polling } = require('./poll');
|
2024-01-20 00:42:01 +08:00
|
|
|
const { initializePages } = require('../core/helpers');
|
2024-04-06 00:35:32 +08:00
|
|
|
const { encodeCustomParams } = require('../parameters/util');
|
|
|
|
const { PARAMETER_HIDE_PRESENTATION_TOAST } = require('../core/constants');
|
|
|
|
|
|
|
|
const hidePresentationToast = encodeCustomParams(PARAMETER_HIDE_PRESENTATION_TOAST);
|
2021-11-26 02:23:58 +08:00
|
|
|
|
2024-07-08 21:42:57 +08:00
|
|
|
test.describe('Polling', { tag: '@ci' }, async () => {
|
2023-04-28 20:30:29 +08:00
|
|
|
const polling = new Polling();
|
2023-09-01 04:21:48 +08:00
|
|
|
|
2024-01-20 00:42:01 +08:00
|
|
|
test.describe.configure({ mode: fullyParallel ? 'parallel' : 'serial' });
|
|
|
|
test[fullyParallel ? 'beforeEach' : 'beforeAll'](async ({ browser }) => {
|
2024-04-06 00:35:32 +08:00
|
|
|
await initializePages(polling, browser, { isMultiUser: true, joinParameter: hidePresentationToast });
|
2023-04-28 20:30:29 +08:00
|
|
|
});
|
2022-01-20 03:50:59 +08:00
|
|
|
|
2023-04-28 20:30:29 +08:00
|
|
|
// Manage
|
2024-05-15 05:07:58 +08:00
|
|
|
test('Create poll', async () => {
|
2023-04-28 20:30:29 +08:00
|
|
|
await polling.createPoll();
|
|
|
|
});
|
2022-01-20 03:50:59 +08:00
|
|
|
|
2024-05-15 05:07:58 +08:00
|
|
|
test('Create anonymous poll', async () => {
|
2023-04-28 20:30:29 +08:00
|
|
|
await polling.pollAnonymous();
|
|
|
|
});
|
2022-01-20 03:50:59 +08:00
|
|
|
|
2024-05-15 05:07:58 +08:00
|
|
|
test('Create quick poll - from the slide', async () => {
|
2023-04-28 20:30:29 +08:00
|
|
|
await polling.quickPoll();
|
|
|
|
});
|
2022-01-20 03:50:59 +08:00
|
|
|
|
2024-05-15 05:07:58 +08:00
|
|
|
test('Create poll with user response', async () => {
|
2023-04-28 20:30:29 +08:00
|
|
|
await polling.pollUserResponse();
|
|
|
|
});
|
|
|
|
|
2024-05-15 05:07:58 +08:00
|
|
|
test('Stop a poll manually', async () => {
|
2023-04-28 20:30:29 +08:00
|
|
|
await polling.stopPoll();
|
|
|
|
});
|
|
|
|
|
|
|
|
test('Manage response choices', async () => {
|
|
|
|
await polling.manageResponseChoices();
|
|
|
|
});
|
|
|
|
|
|
|
|
test('Not able to start new poll without presentation', async () => {
|
|
|
|
await polling.notAbleStartNewPollWithoutPresentation();
|
|
|
|
});
|
2023-05-06 02:12:32 +08:00
|
|
|
|
2024-05-15 05:07:58 +08:00
|
|
|
test('Custom input', async () => {
|
2023-05-06 02:12:32 +08:00
|
|
|
await polling.customInput();
|
|
|
|
});
|
|
|
|
|
2024-05-15 05:07:58 +08:00
|
|
|
test('Allow multiple choices', async () => {
|
2023-05-06 02:12:32 +08:00
|
|
|
await polling.allowMultipleChoices();
|
|
|
|
});
|
|
|
|
|
2023-05-08 21:14:26 +08:00
|
|
|
test('Smart slides questions', async () => {
|
2023-05-06 02:12:32 +08:00
|
|
|
await polling.smartSlidesQuestions();
|
2022-01-20 03:50:59 +08:00
|
|
|
});
|
|
|
|
|
2023-05-08 21:14:26 +08:00
|
|
|
// Results
|
2024-05-15 05:07:58 +08:00
|
|
|
test('Poll results in chat message', async () => {
|
2023-05-08 21:14:26 +08:00
|
|
|
await polling.pollResultsOnChat();
|
|
|
|
});
|
2022-01-20 03:50:59 +08:00
|
|
|
|
2024-08-24 01:32:58 +08:00
|
|
|
test('Poll results on whiteboard', { tag: '@flaky' } , async () => {
|
2023-05-08 21:14:26 +08:00
|
|
|
await polling.pollResultsOnWhiteboard();
|
|
|
|
});
|
2022-01-20 03:50:59 +08:00
|
|
|
|
2024-04-04 02:56:38 +08:00
|
|
|
test('Poll results in a different presentation', async ({}, testInfo) => {
|
|
|
|
test.fixme(!testInfo.config.fullyParallel, 'Currently only works in parallel mode. Poll results not being displayed in the presentation');
|
2023-05-08 21:14:26 +08:00
|
|
|
await polling.pollResultsInDifferentPresentation();
|
2021-11-26 02:23:58 +08:00
|
|
|
});
|
2021-12-04 01:01:36 +08:00
|
|
|
});
|