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
Merge branch 'main' into jurredr/dockerized-testing
  • Loading branch information
Jurredr committed Feb 4, 2025
commit be5bae032eed7e6f74e2c6280445369bc9f15c44
3 changes: 2 additions & 1 deletion docs/CONFIG.md
Original file line number Diff line number Diff line change
@@ -12,6 +12,7 @@ interface ConfigModel {
texts: {
mainTitle?: string;
feedbackFormTitle?: string;
feedbackFormDescription?: string;
feedbackFormOptionsLabel?: string;
feedbackFormCommentLabel?: string;
feedbackThanks?: string;
@@ -124,7 +125,7 @@ Default tab title text if it is not set through store data for that tab.

---

## feedbackFormTitle, feedbackFormOptionsLabel, feedbackFormCommentLabel, submit, cancel
## feedbackFormTitle, feedbackFormDescription, feedbackFormOptionsLabel, feedbackFormCommentLabel, submit, cancel
<p align="center">
<img src="./img/texts/feedbackForm.png" alt="feedbackForm" style="max-width:500px; width:100%;border: 1px solid #e0e0e0;">
</p>
28 changes: 28 additions & 0 deletions docs/PROPERTIES.md
Original file line number Diff line number Diff line change
@@ -102,6 +102,10 @@ export interface MynahUIProps {
link: string,
mouseEvent?: MouseEvent,
eventId?: string) => void;
onFormLinkClick?: (
link: string,
mouseEvent?: MouseEvent,
eventId?: string) => void;
onInfoLinkClick?: (
tabId: string,
link: string,
@@ -745,6 +749,30 @@ onLinkClick?: (
```
---

### `onFormLinkClick`

This event will be fired when user clicks a link inside the description field on feedback or custom forms. It will pass `link`, for the clicked link and the `mouseEvent` and the to check userIntent the `eventId`.

**Note:** For example, JetBrains JCEF WebView opens the links in a new browser view of its own. However to prevent this action and navigate to user's own preferred browser to open the links, you may want to cancel the default behaviour and run your own function to open the OS default browser.


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

```typescript
...
onFormLinkClick?: (
link: string,
mouseEvent?: MouseEvent):void => {
console.log(`Sent from Form`);
console.log(`link: ${link}`);
// mouseEvent.preventDefault();
}
...
```
---

### `onInfoLinkClick`

This event will be fired when user clicks a link inside the footer information message below the prompt input field for that tab. It will pass `tabId`, `link` for the clicked link and the `mouseEvent` for the event object in case if it needs to be prevented as the arguments.
Binary file added docs/img/onFormLinkClick.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/img/texts/feedbackForm.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions example/src/main.ts
Original file line number Diff line number Diff line change
@@ -68,6 +68,9 @@ export const createMynahUI = (initialData?: MynahUIDataModel): MynahUI => {
maxTabsTooltipDuration: 5000,
noMoreTabsTooltip: 'You can only open five conversation tabs at a time.',
autoFocus: true,
texts: {
feedbackFormDescription: '_Feedback is anonymous. For issue updates, please contact us on [GitHub](https://github.com/aws/mynah-ui/issues)._'
},
tabBarButtons: [
{
id: 'clear',
@@ -398,6 +401,9 @@ export const createMynahUI = (initialData?: MynahUIDataModel): MynahUI => {
}
Log(`Link inside body clicked: <b>${link}</b>`);
},
onFormLinkClick: (link, mouseEvent) => {
Log(`Link inside form clicked: <b>${link}</b>`);
},
onSourceLinkClick: (tabId, messageId, link, mouseEvent) => {
Log(`Link in sources clicked: <b>${link}</b>`);
},
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@aws/mynah-ui",
"displayName": "AWS Mynah UI",
"version": "4.21.6",
"version": "4.22.1",
"description": "AWS Toolkit VSCode and Intellij IDE Extension Mynah UI",
"publisher": "Amazon Web Services",
"license": "Apache License 2.0",
25 changes: 24 additions & 1 deletion src/components/feedback-form/feedback-form.ts
Original file line number Diff line number Diff line change
@@ -14,6 +14,7 @@ import { Select } from '../form-items/select';
import { CustomFormWrapper } from './custom-form';
import '../../styles/components/_feedback-form.scss';
import testIds from '../../helper/test-ids';
import { CardBody } from '../card/card-body';

export interface FeedbackFormProps {
initPayload?: FeedbackPayload;
@@ -116,7 +117,13 @@ export class FeedbackForm {
this.feedbackFormContainer = DomBuilder.getInstance().build({
type: 'div',
classNames: [ 'mynah-feedback-form' ],
events: { click: cancelEvent },
events: {
click: (e) => {
if (e.target != null && !(e.target as HTMLElement).classList.contains('mynah-ui-clickable-item')) {
cancelEvent(e);
}
}
},
children: [
{
type: 'div',
@@ -137,6 +144,22 @@ export class FeedbackForm {
}).render
]
},
{
type: 'div',
classNames: [ 'mynah-feedback-form-description' ],
testId: testIds.feedbackForm.description,
children: [ Config.getInstance().config.texts.feedbackFormDescription !== ''
? new CardBody({
body: Config.getInstance().config.texts.feedbackFormDescription,
onLinkClick: (link, event) => {
MynahUIGlobalEvents.getInstance().dispatch(MynahEventNames.FORM_LINK_CLICK, {
link,
event,
});
},
}).render
: '' ]
},
this.feedbackOptionsWrapper.render,
{
type: 'span',
1 change: 1 addition & 0 deletions src/helper/config.ts
Original file line number Diff line number Diff line change
@@ -55,6 +55,7 @@ const configDefaults: ConfigFullModel = {
copy: 'Copy',
insertAtCursorLabel: 'Insert at cursor',
feedbackFormTitle: 'Report an issue',
feedbackFormDescription: '',
feedbackFormOptionsLabel: 'What type of issue would you like to report?',
feedbackFormCommentLabel: 'Description of issue (optional):',
feedbackThanks: 'Thanks!',
1 change: 1 addition & 0 deletions src/helper/test-ids.ts
Original file line number Diff line number Diff line change
@@ -102,6 +102,7 @@ export default {
feedbackForm: {
wrapper: 'feedback-form-wrapper',
title: 'feedback-form-title',
description: 'feedback-form-description',
optionsSelectWrapper: 'feedback-form-options-select-wrapper',
optionsSelect: 'feedback-form-options-select',
comment: 'feedback-form-comment-text-area',
15 changes: 14 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
@@ -214,6 +214,10 @@ export interface MynahUIProps {
link: string,
mouseEvent?: MouseEvent,
eventId?: string) => void;
onFormLinkClick?: (
link: string,
mouseEvent?: MouseEvent,
eventId?: string) => void;
onSendFeedback?: (
tabId: string,
feedbackPayload: FeedbackPayload,
@@ -273,7 +277,7 @@ ${item.task ? `<input ${item.checked === true ? 'checked' : ''} disabled type="c
${(item.task ? marked.parseInline : marked.parse)(item.text, { breaks: false }) as string}
</li>`,
link: (token) => {
const pattern = /^\[([^\]]+)\]\(([^)]+)\)$/;
const pattern = /^\[(?:\[([^\]]+)\]|([^\]]+))\]\(([^)]+)\)$/;
// Expect raw formatted only in [TEXT](URL)
if (!pattern.test(token.raw)) {
return token.href;
@@ -581,6 +585,15 @@ ${(item.task ? marked.parseInline : marked.parse)(item.text, { breaks: false })
);
}
});
MynahUIGlobalEvents.getInstance().addListener(MynahEventNames.FORM_LINK_CLICK, (data) => {
if (this.props.onFormLinkClick !== undefined) {
this.props.onFormLinkClick(
data.link,
data.event,
this.getUserEventId()
);
}
});
MynahUIGlobalEvents.getInstance().addListener(MynahEventNames.INFO_LINK_CLICK, (data) => {
if (this.props.onInfoLinkClick !== undefined) {
this.props.onInfoLinkClick(
2 changes: 2 additions & 0 deletions src/static.ts
Original file line number Diff line number Diff line change
@@ -152,6 +152,7 @@ export enum MynahEventNames {
CARD_VOTE = 'cardVote',
SOURCE_LINK_CLICK = 'sourceLinkClick',
INFO_LINK_CLICK = 'infoLinkClick',
FORM_LINK_CLICK = 'formLinkClick',
LINK_CLICK = 'linkClick',
CHAT_ITEM_ENGAGEMENT = 'chatItemEngagement',
COPY_CODE_TO_CLIPBOARD = 'copyCodeToClipboard',
@@ -472,6 +473,7 @@ export type CodeBlockActions = Record<'copy' | 'insert-to-cursor' | string, Code
export interface ConfigTexts {
mainTitle: string;
feedbackFormTitle: string;
feedbackFormDescription: string;
feedbackFormOptionsLabel: string;
feedbackFormCommentLabel: string;
feedbackThanks: string;
6 changes: 6 additions & 0 deletions src/styles/components/_feedback-form.scss
Original file line number Diff line number Diff line change
@@ -140,4 +140,10 @@
gap: var(--mynah-sizing-1);
box-sizing: border-box;
}
> .mynah-feedback-form-description {
pointer-events: all;
&:empty {
display: none;
}
}
}
Original file line number Diff line number Diff line change
@@ -34,6 +34,9 @@ export const renderFeedbackForm = async (page: Page, skipScreenshots?: boolean):
await commentInput.fill('This is some feedback comment');
await waitForAnimationEnd(page);

const descriptionText = page.locator(getSelector(testIds.feedbackForm.description));
expect(descriptionText).toBeDefined();

const submitButton = page.locator(getSelector(testIds.feedbackForm.submitButton));
expect(submitButton).toBeDefined();

5 changes: 4 additions & 1 deletion ui-tests/src/main.ts
Original file line number Diff line number Diff line change
@@ -28,7 +28,10 @@ export const createMynahUI = (): MynahUI => {
config: {
noMoreTabsTooltip: 'Tabs limit.',
autoFocus: true,
test: true
test: true,
texts: {
feedbackFormDescription: '_Feedback description. A link [GitHub](https://github.com/aws/mynah-ui/issues)._'
}
},
tabs: {
'tab-1': {
You are viewing a condensed version of this merge commit. You can view the full changes here.