Skip to content
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

Test PR for testing new Dockerized testing #233

Open
wants to merge 52 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
83e104e
Updated tests:e2e script for compatibility with new dockerized testin…
Jurredr Jan 27, 2025
4268066
Modified e2e docker script and added local e2e testing script
Jurredr Jan 27, 2025
9be18d0
Added dockerfile for E2E testing
Jurredr Jan 27, 2025
a8bd82d
Added trace npm scripts for Playwright tracing
Jurredr Jan 27, 2025
e8382d9
Renamed docker image and container names
Jurredr Jan 28, 2025
6738907
Updated node version in Dockerfile
Jurredr Jan 28, 2025
f104dc8
Added separate npm script for building docker image
Jurredr Jan 28, 2025
3a63184
Changed trace mode to upload traces for each failed test
Jurredr Jan 28, 2025
c4aebd8
Added JUnit xml reporter to Playwright
Jurredr Jan 28, 2025
0aae515
Updated Docker run command
Jurredr Jan 28, 2025
8a2b3f1
Added command to inspect Docker E2E test results
Jurredr Jan 28, 2025
1a9bf77
Changed docker inspect target name to "flarechatui-e2e-container"
Jurredr Jan 28, 2025
f04f641
Added docker clean script / step to container runner
Jurredr Jan 28, 2025
a21663d
Removed test results / last run file from default ui-tests dir
Jurredr Jan 28, 2025
0ae6c09
Added JUnit reporter for Playwright
Jurredr Jan 29, 2025
bffafdc
Migrated jest-playwright to playwright/test
Jurredr Jan 29, 2025
438608b
Added test reports to git ignore
Jurredr Jan 30, 2025
b5f193f
Generate all test results in one separate root directory
Jurredr Jan 30, 2025
9ee2bda
Ignore Dockerfile from eslint
Jurredr Jan 30, 2025
ba9a8aa
Merge branch 'main' into jurredr/dockerized-testing
Jurredr Jan 30, 2025
23b144a
Use npm install instead of ci in docker image
Jurredr Jan 30, 2025
a5acfea
Test fixes for playwright library migration
Jurredr Jan 30, 2025
119bb9b
Removed all existing image snapshots
Jurredr Feb 3, 2025
1775fbb
Updated dockerfile to only include relevant files and folders in dock…
Jurredr Feb 3, 2025
0633e6b
Implemented new GitHub CI script for E2E testing through Docker
Jurredr Feb 3, 2025
623fbb4
Ignore e2e-results folder from eslint
Jurredr Feb 3, 2025
af44e63
ci: only send slack message on non-draft prs
Jurredr Feb 4, 2025
5e3675d
Fixed GitHub new_pr workflow, only runs for non-draft PRs properly now
Jurredr Feb 4, 2025
cb221ed
Fixed non-draft PR check in GitHub workflow
Jurredr Feb 4, 2025
be5bae0
Merge branch 'main' into jurredr/dockerized-testing
Jurredr Feb 4, 2025
c5913b9
Merge branch 'main' into jurredr/dockerized-testing
Jurredr Feb 4, 2025
e4d226c
Made all individual E2E tests run on their own
Jurredr Feb 5, 2025
1bca731
Added and tested form tests to work individually with new E2E flow
Jurredr Feb 5, 2025
dcb6ddf
Fully run all tests in parallel
Jurredr Feb 5, 2025
3fad9f3
Fixed all existing test flows to work with new parallel runner
Jurredr Feb 5, 2025
2c5583e
Remove failure check on uploading of artifacts in new_pr test workflow
Jurredr Feb 11, 2025
9eec00e
Extracted e2e testing to separate workflow, added dockerized E2E step…
Jurredr Feb 11, 2025
67bea9b
Temporarily disabled slack messager for new prs while testing e2e wor…
Jurredr Feb 11, 2025
ef60fd0
Attempt at fixing linting errors
Jurredr Feb 11, 2025
069a00b
Added build step before linting
Jurredr Feb 11, 2025
87151df
New lint fix attempt
Jurredr Feb 11, 2025
0e6f7b2
Fixed incorrect npm install command in e2e build step
Jurredr Feb 11, 2025
ad6321a
e2e build fix
Jurredr Feb 11, 2025
361080a
Force Playwright workers to be 6
Jurredr Feb 11, 2025
6b448da
continue e2e workflow on test suite error
Jurredr Feb 11, 2025
26e985c
Merged main into dockerized testing branch
Jurredr Mar 4, 2025
41aa55e
Updated test result reporter type to jest-junit
Jurredr Mar 4, 2025
36e37a0
Removed commented code
Jurredr Mar 4, 2025
e4e600a
Removed console log from e2e test
Jurredr Mar 4, 2025
59373dd
Updated incorrect ui-test result paths
Jurredr Mar 4, 2025
785be97
Specify branch for snapshot replacement commit, change test reporter …
Jurredr Mar 4, 2025
fc46244
Ignore zip and xml files from eslint
Jurredr Mar 4, 2025
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
Prev Previous commit
Next Next commit
Merged main into dockerized testing branch
  • Loading branch information
Jurredr committed Mar 4, 2025
commit 26e985c401536191e3bb4f21bdd97ac64ae69378
11 changes: 5 additions & 6 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -4,17 +4,16 @@

<!---
REMINDER:
- Read CONTRIBUTING.md first.
- Add test coverage for your changes.
- Update the changelog using `npm run newChange`.
- Link to related issues/commits.
- Testing: how did you test your changes?
- Screenshots
- Read contributing and developer guidelines first.
- Check your changes are not breaking anything on current VSCode and JetBrains extensions
- Add or update the documentation if applicable, this is mandatory
- Put screenshots if possible
-->

## Tests
- [ ] I have tested this change on VSCode
- [ ] I have tested this change on JetBrains
- [ ] I have added/updated the documentation (if applicable)

## License

6 changes: 6 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -19,6 +19,12 @@ jobs:
run: npm run tests:unit
- name: Build demo app
run: npm run packdemo
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: test-snapshots
path: ./ui-tests/__test__/__image_snapshots__
retention-days: 30
- name: Get release info
id: get_release
uses: bruceadams/get-release@v1.3.2
200 changes: 186 additions & 14 deletions docs/DATAMODEL.md
Original file line number Diff line number Diff line change
@@ -312,32 +312,127 @@ const mynahUI = new MynahUI({
});

mynahUI.updateStore('tab-1', {
contextCommands: [
contextCommands: [
{
groupName: 'Mention code',
commands:[
commands: [
{
command: '@ws',
description: '(BETA) Reference all code in workspace.'
command: 'workspace',
icon: MynahIcons.ASTERISK,
placeholder: 'Yes, you selected workspace :P',
description: 'Reference all code in workspace.'
},
{
command: '@folder',
placeholder: 'mention a specific folder',
command: 'folder',
icon: MynahIcons.FOLDER,
children: [
{
groupName: 'Folders',
commands: [
{
command: 'src',
icon: MynahIcons.FOLDER,
children: [
{
groupName: 'src/',
commands: [
{
command: 'index.ts',
icon: MynahIcons.FILE,
}
]
}
]
},
{
command: 'main',
description: './src/',
icon: MynahIcons.FOLDER,
},
{
command: 'src',
description: './example/',
icon: MynahIcons.FOLDER,
}
]
}
],
placeholder: 'Mention a specific folder',
description: 'All files within a specific folder'
},
{
command: '@file',
placeholder: 'mention a specific file',
command: 'file',
icon: MynahIcons.FILE,
children: [
{
groupName: 'Files',
commands: [
{
command: 'monarch.ts',
description: './src/',
icon: MynahIcons.FILE,
},
{
command: '_dark.scss',
description: './src/styles/',
icon: MynahIcons.FILE,
}
]
}
],
placeholder: 'Mention a specific file',
description: 'Reference a specific file'
},
{
command: '@code',
placeholder: 'mention a specific file/folder, or leave blank for full project',
command: 'symbols',
icon: MynahIcons.CODE_BLOCK,
children: [
{
groupName: 'Symbols',
commands: [
{
command: 'DomBuilder',
icon: MynahIcons.CODE_BLOCK,
description: 'The DomGeneration function in dom.ts file'
}
]
}
],
placeholder: 'Select a symbol',
description: 'After that mention a specific file/folder, or leave blank for full project'
},
{
command: '@gitlab',
description: 'Ask about data in gitlab account'
command: 'prompts',
icon: MynahIcons.CHAT,
description: 'Saved prompts, to reuse them in your current prompt',
children: [
{
groupName: 'Prompts',
actions: [
{
id: 'add-new-prompt',
icon: 'plus',
text: 'Add',
description: 'Add new prompt'
}
],
commands: [
{
command: 'python_expert',
icon: MynahIcons.CHAT,
description: 'Expert on python stuff'
},
{
command: 'javascript_expert',
icon: MynahIcons.CHAT,
description: 'Expert on Javascript and typescript'
},
{
command: 'Add Prompt',
icon: MynahIcons.PLUS,
}
]
}
]
}
]
}
@@ -349,7 +444,25 @@ mynahUI.updateStore('tab-1', {
<img src="./img/data-model/tabStore/contextCommands.png" alt="contextCommands" style="max-width:500px; width:100%;border: 1px solid #e0e0e0;">
</p>

To see which context is used, check the incoming array in the prompt object comes with the `onChatPrompt` event.
When hovered, context items will display a tooltip with the same information provided in the context menu list:

<p align="center">
<img src="./img/data-model/tabStore/contextItem.png" alt="contextItem" style="max-width:140px; width:100%;border: 1px solid #e0e0e0;">
</p>

Groups can have as many children as you'd like, which allows for a tree-like structure. Items with children will display a right-arrow icon when hovered / focused:

<p align="center">
<img src="./img/data-model/tabStore/hoveredContextItem.png" alt="hoveredContextItem" style="max-width:500px; width:100%;border: 1px solid #e0e0e0;">
</p>

Groups can have actions (see `add-new-prompt` action in the example code block above), which adds an action button on the top right:

<p align="center">
<img src="./img/data-model/tabStore/groupAction.png" alt="groupAction" style="max-width:500px; width:100%;border: 1px solid #e0e0e0;">
</p>

To see which context is used, check the incoming string array in the prompt object comes with the `onChatPrompt` event.

```typescript
const mynahUI = new MynahUI({
@@ -868,6 +981,7 @@ type CodeBlockActions = Record<'copy' | 'insert-to-cursor' | string, CodeBlockAc

// #################################
interface ChatItemContent {
header?: ChatItemContent | null;
body?: string | null;
customRenderer?: string | ChatItemBodyRenderer | ChatItemBodyRenderer[] | null;
followUp?: {
@@ -884,6 +998,10 @@ interface ChatItemContent {
rootFolderTitle?: string;
filePaths?: string[];
deletedFiles?: string[];
flatList?: boolean;
folderIcon?: MynahIcons | MynahIconsType | null;
collapsed?: boolean;
hideFileCount?: boolean;
actions?: Record<string, FileNodeAction[]>;
details?: Record<string, TreeNodeDetails>;
} | null;
@@ -1075,6 +1193,43 @@ mynahUI.addChatItem('tab-1', {

---

## `header`
With this parameter, you can add a `ChatItem` at the top of a ChatItem, before the body, but still within the card itself.

```typescript
const mynahUI = new MynahUI({
tabs: {
'tab-1': {
...
}
}
});

mynahUI.addChatItem(tabId, {
type: ChatItemType.ANSWER,
body: `SOME CONTENT`,
header: {
fileList: { // For example, want to show which file is used to generate that answer
rootFolderTitle: undefined,
fileTreeTitle: '',
filePaths: ['./src/index.ts'],
details: {
'./src/index.ts': {
icon: MynahIcons.FILE,
description: `SOME DESCRIPTION.`
}
}
}
}
});
```

<p align="center">
<img src="./img/data-model/chatItems/header.png" alt="header" style="max-width:600px; width:100%;border: 1px solid #e0e0e0;">
</p>

---

## `body`
Basically the body of the card. Which you can send a full markdown string. Allows code blocks, links etc.

@@ -1732,6 +1887,10 @@ mynahUI.addChatItem(tabId, {
deletedFiles: ['src/devfile.yaml'],
// fileTreeTitle: "Custom file tree card title";
// rootFolderTitle: "Custom root folder title";
// collapsed: true // Collapse the root folder by default
// hideFileCount: true // Hide the file counter next to folders
// flatList: true // Enable to generate a flat list with one parent folder and no sub folders
// folderIcon: 'folder' // Specify a custom icon for folders
actions: {
'src/App.tsx': [
{
@@ -1776,6 +1935,8 @@ mynahUI.addChatItem(tabId, {

**NOTE 3:** In case you want to show one single file (or folder by giving it a folder icon) and not make it clickable, use the `details` section with the file name and set the `clickable` to `false`.

**NOTE 4:** In case you want a flat list, where all subfolders are not rendered but just all the files, you can pass `true` to the `flatList` prop.

<p align="center">
<img src="./img/data-model/chatItems/codeResult.png" alt="mainTitle" style="max-width:500px; width:100%;border: 1px solid #e0e0e0;">
</p>
@@ -2034,8 +2195,16 @@ interface ChatItemFormItem {
type: 'select' | 'textarea' | 'textinput' | 'numericinput' | 'stars' | 'radiogroup'; // type (see below for each of them)
mandatory?: boolean; // If it is set to true, buttons in the same card with waitMandatoryFormItems set to true will wait them to be filled
title?: string; // Label of the input
autoFocus: boolean; // focus to the input when it is created, default=> false. (Only for textual form items)
description?: string; // The description, showing under the input field itself
validationPatterns?: {
operator?: 'and' | 'or';
genericValidationErrorMessage?: string;
patterns: ValidationPattern[];
};
placeholder?: string; // Placeholder for input, but only applicable to textarea, textinput and numericinput
value?: string; // Initial value of the item. All types of form items will get and return string values, conversion of the value type is up to you
checkModifierEnterKeyPress?: boolean; // Only applicable to textual inputs: whether the onFormModifierEnterPress event can be triggered from this input field
options?: Array<{ // Only applicable to select and radiogroup types
value: string;
label: string;
@@ -2045,6 +2214,8 @@ interface ChatItemFormItem {

Since you can give unlimited form items with several different types, it might be good to know that some attributes are only applicable to some types. Like `options` attribute is only getting used by `select` and `radiogroup` items. Or `placeholder` is only getting used by `textarea`, `textinput` and `numericinput`.

`validationPattenrs` works only for textual inputs. You can define one or more validation regex patterns, use an operator between them as `AND` or `OR`. You can show individual error messages for each validation or use one generic message if the combined validation fails (Might be useful for `OR` operator).

**Another thing which might be interesting** is to know that if you set the `select` or the `radiogroup` mandatory, they'll be rendered as the first item's of them selected if you don't provide an initial value. And you cannot deselet a radio item in any case. For select, if it is mandatory there won't be the option `Please select...`


@@ -2122,6 +2293,7 @@ mynahUI.addChatItem(tabId, {
mandatory: true,
title: `Email`,
placeholder: 'email',
checkModifierEnterKeyPress: true
},
{
id: 'name',
Loading
Oops, something went wrong.
Loading
Oops, something went wrong.
You are viewing a condensed version of this merge commit. You can view the full changes here.