Skip to content

Feature: add welcome screen #69

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions e2e/extension-tests/azure-configurable-arguments.spec.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { expect, test } from '@playwright/test';
import { config } from '../tests/utils/config';
import {
addAzureModelToConfiguration,
addAzureModelToWizardConfiguration,
addSystemPromptToConfiguration,
configureAssistantByUser,
createConfiguration,
enterAdminArea,
createAssistant,
enterUserArea,
login,
goToWelcomePage,
loginFirstTime,
newChat,
selectConfiguration,
sendMessage,
Expand All @@ -20,18 +20,17 @@ if (!config.AZURE_OPEN_AI_API_KEY) {
const configuration = { name: '', description: '' };

await test.step('should login', async () => {
await login(page);
await loginFirstTime(page);
await goToWelcomePage(page);
});

await test.step('add assistant', async () => {
configuration.name = `E2E-Test-Configurable-Arguments-${Date.now()}`;
configuration.description = `Description for ${configuration.name}`;
await enterAdminArea(page);
await createConfiguration(page, configuration);
await createAssistant(page, configuration.name);
});

await test.step('add model', async () => {
await addAzureModelToConfiguration(page, configuration, { deployment: 'gpt-4o-mini' });
await addAzureModelToWizardConfiguration(page, { deployment: 'gpt-4o-mini' });
});

await test.step('add prompt', async () => {
Expand Down
4 changes: 2 additions & 2 deletions e2e/extension-tests/azure-mcp-server.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { expect, test } from '@playwright/test';
import { config } from '../tests/utils/config';
import {
addAzureModelToConfiguration,
addAzureModelToWizardConfiguration,
addMCPToConfiguration,
addSystemPromptToConfiguration,
createConfiguration,
Expand Down Expand Up @@ -31,7 +31,7 @@ if (!config.AZURE_OPEN_AI_API_KEY) {
});

await test.step('add model', async () => {
await addAzureModelToConfiguration(page, configuration, { deployment: 'gpt-4o-mini' });
await addAzureModelToWizardConfiguration(page, { deployment: 'gpt-4o-mini' });
});

await test.step('add prompt', async () => {
Expand Down
13 changes: 6 additions & 7 deletions e2e/extension-tests/azure-open-ai-new-chat.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import { randomInt } from 'crypto';
import test, { expect } from '@playwright/test';
import { config } from '../tests/utils/config';
import {
addAzureModelToConfiguration,
addAzureModelToWizardConfiguration,
cleanup,
createConfiguration,
enterAdminArea,
createAssistant,
enterUserArea,
goToWelcomePage,
login,
newChat,
selectConfiguration,
Expand All @@ -21,17 +21,16 @@ if (!config.AZURE_OPEN_AI_API_KEY) {
await test.step('should login', async () => {
await login(page);
await cleanup(page);
await goToWelcomePage(page);
});

await test.step('add assistant', async () => {
configuration.name = `Azure-OpenAI-Chat-${randomInt(10000)}`;
configuration.description = `Description for ${configuration.name}`;
await enterAdminArea(page);
await createConfiguration(page, configuration);
await createAssistant(page, configuration.name);
});

await test.step('add model', async () => {
await addAzureModelToConfiguration(page, configuration, { deployment: 'gpt-4o-mini' });
await addAzureModelToWizardConfiguration(page, { deployment: 'gpt-4o-mini' });
});

await test.step('should start chat in new configuration', async () => {
Expand Down
14 changes: 8 additions & 6 deletions e2e/extension-tests/azure-open-ai-whole-file.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ import { randomInt } from 'crypto';
import { expect, Locator, test } from '@playwright/test';
import { config } from './../tests/utils/config';
import {
addAzureModelToConfiguration,
addAzureModelToWizardConfiguration,
addFilesInChatExtensionToConfiguration,
addSystemPromptToConfiguration,
addVisionFileExtensionToConfiguration,
addWholeFileExtensionToConfiguration,
cleanup,
createAssistant,
createBucket,
createConfiguration,
deactivateFileInChatExtensionToConfiguration,
Expand All @@ -16,6 +17,7 @@ import {
editBucket,
enterAdminArea,
enterUserArea,
goToWelcomePage,
login,
newChat,
selectConfiguration,
Expand All @@ -38,17 +40,16 @@ if (!config.AZURE_OPEN_AI_API_KEY) {
await test.step('should login', async () => {
await login(page);
await cleanup(page);
await goToWelcomePage(page);
});

await test.step('add assistant', async () => {
configuration.name = `E2E-Whole-File-${randomInt(10000)}`;
configuration.description = `Description for ${configuration.name}`;
await enterAdminArea(page);
await createConfiguration(page, configuration);
await createAssistant(page, configuration.name);
});

await test.step('add model', async () => {
await addAzureModelToConfiguration(page, configuration, { deployment: 'gpt-4o-mini' });
await addAzureModelToWizardConfiguration(page, { deployment: 'gpt-4o-mini' });
});

await test.step('add prompt', async () => {
Expand Down Expand Up @@ -180,7 +181,8 @@ if (!config.AZURE_OPEN_AI_API_KEY) {
configuration.name = `E2E-Test-Other-${Date.now()}`;
configuration.description = `Description for ${configuration.name}`;
await createConfiguration(page, configuration);
await addAzureModelToConfiguration(page, configuration, { deployment: 'gpt-4o-mini' });
//await addAzureModelToConfiguration(page, configuration, { deployment: 'gpt-4o-mini' });
await addAzureModelToWizardConfiguration(page, { deployment: 'gpt-4o-mini' });
await addSystemPromptToConfiguration(page, configuration, { text: 'Your are a helpful assistant.' });
await editBucket(page, { name: conversationFilesBucket, fileSizeLimits: { general: 10 } });
});
Expand Down
10 changes: 8 additions & 2 deletions e2e/extension-tests/azure-open-ai.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
enterAdminArea,
enterUserArea,
expectElementInYRange,
goToWelcomePage,
login,
selectConfiguration,
sendMessage,
Expand All @@ -27,10 +28,14 @@ if (!config.AZURE_OPEN_AI_API_KEY) {
await test.step('should login', async () => {
await login(page);
await cleanup(page);
await goToWelcomePage(page);
});
await test.step('should not add Configuration without required fields', async () => {
await enterAdminArea(page);
await createConfiguration(page, configuration, { detached: false });
await page.getByRole('link', { name: 'Setup an Assistant' }).click();
await expect(page).toHaveURL(/\/admin\/assistants\?create/);
await page.getByRole('textbox', { name: 'Name' }).fill(configuration.name);
await page.getByRole('textbox', { name: 'Description' }).fill(configuration.description);
await page.getByRole('button', { name: 'Save' }).click();

const testoutput = await page.waitForSelector(`:has-text("String must contain at least")`);
expect(testoutput).toBeDefined();
Expand All @@ -41,6 +46,7 @@ if (!config.AZURE_OPEN_AI_API_KEY) {
await test.step('should add Configuration', async () => {
configuration.description = `Example for the ${configuration.name}`;
await createConfiguration(page, configuration);
await page.getByRole('dialog', { name: 'Create Extension' }).getByRole('button').click();
});

await test.step('should add OpenAI LLM Extension', async () => {
Expand Down
1 change: 1 addition & 0 deletions e2e/extension-tests/azure-user-args.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ if (!config.AZURE_OPEN_AI_API_KEY) {
configuration.description = `Description for ${configuration.name}`;
await enterAdminArea(page);
await createConfiguration(page, configuration);
await page.getByRole('dialog', { name: 'Create Extension' }).getByRole('button').click();
});

await test.step('add model', async () => {
Expand Down
42 changes: 32 additions & 10 deletions e2e/tests/administration/chat.spec.ts
Original file line number Diff line number Diff line change
@@ -1,29 +1,48 @@
import { expect, test } from '@playwright/test';
import {
addVisionFileExtensionToConfiguration,
checkSelectedConfiguration,
cleanup,
createConfiguration,
enterUserArea,
login,
goToWelcomePage,
loginFirstTime,
navigateToConfigurationAdministration,
newChat,
save,
selectConfiguration,
selectOption,
} from '../utils/helper';

const assistantName = 'Configuration without llm';

test('Chat', async ({ page, browserName }) => {
await test.step('should login', async () => {
await login(page);
await cleanup(page);
await loginFirstTime(page);
await goToWelcomePage(page);
});

await test.step('will navigate to configuration administration page', async () => {
await navigateToConfigurationAdministration(page);
await test.step('should add a new assistant when login the first time', async () => {
await page.getByRole('link', { name: 'Setup an Assistant' }).click();
await expect(page).toHaveURL(/\/admin\/assistants\?create/);
await page.getByRole('textbox', { name: 'Name' }).fill('First Assistant');
await page.getByRole('textbox', { name: 'Description' }).fill('First Assistant Description');
await page.getByRole('button', { name: 'Save' }).click();
});

await test.step('should add a new model', async () => {
await page
.locator('div')
.filter({ hasText: /^Azure OpenAIOpen AI LLM integrationllm$/ })
.first()
.click();
await page.getByLabel('API Key').click();
await page.getByLabel('API Key').fill('123');
await page.getByLabel('Deployment Name').fill('deployment');
await page.getByLabel('Instance Name').fill('cccc-testing');
await selectOption(page, 'API Version', '2023-05-15');
await save(page);
});

await test.step('should add empty configuration', async () => {
await test.step('should add a new configuration', async () => {
await page.getByRole('link', { name: 'Assistants' }).click();
await page
.locator('*')
Expand All @@ -35,8 +54,9 @@ test('Chat', async ({ page, browserName }) => {
await page.getByRole('button', { name: 'Save' }).click();
});

await test.step('should add empty configuration', async () => {
await addVisionFileExtensionToConfiguration(page, { name: assistantName });
await test.step('should add vision extension to configuration', async () => {
await page.getByRole('heading', { name: 'Files Vision', exact: true }).click();
await save(page);
});

await test.step('should upload avatar logo', async () => {
Expand All @@ -63,7 +83,9 @@ test('Chat', async ({ page, browserName }) => {
await test.step('should add more configurations', async () => {
await navigateToConfigurationAdministration(page);
await createConfiguration(page, { name: 'Assistant', description: 'Assistant Description' });
await page.getByRole('dialog', { name: 'Create Extension' }).getByRole('button').click();
await createConfiguration(page, { name: 'Other Assistant', description: 'Other Assistant Description' });
await page.getByRole('dialog', { name: 'Create Extension' }).getByRole('button').click();
await enterUserArea(page);
});

Expand Down
30 changes: 12 additions & 18 deletions e2e/tests/administration/configurations.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { faker } from '@faker-js/faker';
import { expect, test } from '@playwright/test';
import { cleanup, login, navigateToConfigurationAdministration } from '../utils/helper';
import { cleanup, goToWelcomePage, login } from '../utils/helper';

const configName = faker.commerce.productName();
const configDescription = faker.commerce.productDescription();
Expand All @@ -11,24 +11,18 @@ test('Configuration Management', async ({ page }) => {
await test.step('should login', async () => {
await login(page);
await cleanup(page);
await goToWelcomePage(page);
});

await test.step('will navigate to configuration administration page', async () => {
await navigateToConfigurationAdministration(page);
});
await test.step('should add a new assistant when login the first time', async () => {
await page.getByRole('link', { name: 'Setup an Assistant' }).click();
await expect(page).toHaveURL(/\/admin\/assistants\?create/);
await page.getByRole('textbox', { name: 'Name' }).fill(configName);
await page.getByRole('textbox', { name: 'Description' }).fill(configDescription);
await page.getByRole('button', { name: 'Save' }).click();

await test.step('create a configuration', async () => {
await page
.locator('div')
.filter({ hasText: /^Assistants$/ })
.getByRole('button')
.click();
await page.getByLabel('Name').click();
await page.getByLabel('Name').fill(configName);
await page.getByLabel('Description').click();
await page.getByLabel('Description').fill(configDescription);
await page.getByRole('dialog', { name: 'Create Extension' }).getByRole('button').click();

await page.getByRole('button', { name: 'Save' }).click();
const createConfigurationModal = page.getByRole('heading', { name: 'Create Configuration' });

await createConfigurationModal.waitFor({ state: 'detached' });
Expand Down Expand Up @@ -71,7 +65,7 @@ test('Configuration Management', async ({ page }) => {
await page.getByRole('list', { name: 'assistants' }).getByRole('listitem').filter({ hasText: configNewName }).click();

await page.getByRole('heading', { name: 'Extensions' }).waitFor();
await page.getByRole('button', { name: 'Add Extension' }).click();
await page.getByRole('button', { name: 'Add Extension' }).first().click();
await page
.locator('div')
.filter({ hasText: /^OpenAIOpen AI LLM integrationllm$/ })
Expand Down Expand Up @@ -103,7 +97,7 @@ test('Configuration Management', async ({ page }) => {

await test.step('alert when API Key is empty and Model field is not selected with an option', async () => {
await page.getByRole('list', { name: 'assistants' }).getByRole('listitem').filter({ hasText: configNewName }).click();
await page.getByRole('button', { name: 'Add Extension' }).click();
await page.getByRole('button', { name: 'Add Extension' }).first().click();
await page.getByRole('group').getByRole('heading', { name: 'OpenAI', exact: true }).click();
await page.getByRole('button', { name: 'Save' }).click();

Expand All @@ -117,7 +111,7 @@ test('Configuration Management', async ({ page }) => {
await page.getByRole('list', { name: 'assistants' }).getByRole('listitem').filter({ hasText: configNewName }).click();

await page.getByRole('heading', { name: 'Extensions' }).waitFor();
await page.getByRole('button', { name: 'Add Extension' }).click();
await page.getByRole('button', { name: 'Add Extension' }).first().click();
await page
.locator('div')
.filter({ hasText: /^OpenAIOpen AI LLM integrationllm$/ })
Expand Down
18 changes: 14 additions & 4 deletions e2e/tests/administration/docs.spec.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@
import { expect, test } from '@playwright/test';
import { enterAdminArea, login } from '../utils/helper';
import { enterAdminArea, enterUserArea, goToWelcomePage, loginFirstTime } from '../utils/helper';

test('Documentation on Admin page', async ({ page }) => {
await test.step('should login', async () => {
await login(page);
await loginFirstTime(page);
await goToWelcomePage(page);
await page.getByRole('link', { name: 'Setup an Assistant' }).click();
await expect(page).toHaveURL(/\/admin\/assistants\?create/);
await page.getByRole('textbox', { name: 'Name' }).fill('Assistant');
await page.getByRole('textbox', { name: 'Description' }).fill('Assistant Description');
await page.getByRole('button', { name: 'Save' }).click();
await page.getByRole('dialog', { name: 'Create Extension' }).getByRole('button').click();

await enterUserArea(page);
});

await test.step('should not show documentation on chat page', async () => {
/* await test.step('should not show documentation on chat page', async () => {
await page.waitForTimeout(2000); // such that docs have some time to load
await expect(page.getByTestId('docs-icon')).toBeHidden();
});
}); */

await test.step('should show documentation on button click in admin area', async () => {
await enterAdminArea(page);
Expand Down Expand Up @@ -70,6 +79,7 @@ test('Documentation on Admin page', async ({ page }) => {
await page.getByRole('textbox', { name: 'Name' }).fill('Fake Assistant');
await page.getByRole('textbox', { name: 'Description' }).fill('Test');
await page.getByRole('button', { name: 'Save' }).click();
await page.getByRole('dialog', { name: 'Create Extension' }).getByRole('button').click();
await page.getByRole('link', { name: 'Fake Assistant' }).click();
await page.getByRole('heading', { name: 'The Assistants Page' }).click();
});
Expand Down
2 changes: 2 additions & 0 deletions e2e/tests/administration/suggestions.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ test('When using suggestions c4', async ({ page }) => {
await page.getByLabel(/^Name/).fill(ASSISTANT_NAME_GLOBAL);
await page.getByLabel(/^Description/).fill('without llm');
await page.getByRole('button', { name: 'Save' }).click();
await page.getByRole('dialog', { name: 'Create Extension' }).getByRole('button').click();
});

await test.step('will open create dialog for new assistant', async () => {
Expand Down Expand Up @@ -77,6 +78,7 @@ test('When using suggestions c4', async ({ page }) => {

await test.step('will allow saving the maximum amount of assistant suggestions', async () => {
await page.getByRole('button', { name: 'Save' }).click();
await page.getByRole('dialog', { name: 'Create Extension' }).getByRole('button').click();
});

await test.step('will list saved suggestions in chat with correct assistant', async () => {
Expand Down
Loading