Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
c2a09a4
add clipboard data into shared state
yeze322 Sep 17, 2019
82c3f09
copy paste ring
yeze322 Sep 17, 2019
b2d2d4d
forbid pasting to events level
yeze322 Sep 17, 2019
a300f5a
fix KeyboardZone state bug
yeze322 Sep 17, 2019
a5561cc
add Mac short cuts
yeze322 Sep 17, 2019
daddae8
Merge branch 'master' into zeye/copypaste
yeze322 Sep 18, 2019
8d59f12
remove keyboard shortcuts (not included in ignite)
yeze322 Sep 18, 2019
4a98c72
saveDate rate control
yeze322 Sep 18, 2019
bc51a49
sync VisualEditor & Shell state via window
yeze322 Sep 18, 2019
c7b91b5
support selection deletion
yeze322 Sep 18, 2019
4417db4
consume deleteSelection in shell
yeze322 Sep 18, 2019
cd78a5c
fix test case
yeze322 Sep 18, 2019
0464896
support insertion to non-exisiting path
yeze322 Sep 18, 2019
75e4ad9
revert to debounce in ShellAPI to avoid first-time update error
yeze322 Sep 19, 2019
c146ccc
fix a typo: debounce -> debounced
yeze322 Sep 19, 2019
0e7fad0
Merge branch 'master' into zeye/copypaste
yeze322 Sep 20, 2019
5bcca7b
implement FrameAPI to lazy visit frame window, fix selction state
yeze322 Sep 20, 2019
ff97706
make trigger unselectable
yeze322 Sep 20, 2019
3e91611
use ObiTypes instead of string
yeze322 Sep 20, 2019
fe24899
use global config to control keyboard features
yeze322 Sep 20, 2019
818efba
bind copy paste shortcuts & enable it in demo mode
yeze322 Sep 20, 2019
8c39b2b
optimize keyboard command switcher
yeze322 Sep 20, 2019
a7af9a3
merge from #923
yeze322 Sep 20, 2019
c2324d4
use apiClient mechanism on VisualEditorAPI
yeze322 Sep 20, 2019
cfe7aff
toolbar always enabled (temporary fix)
yeze322 Sep 20, 2019
d015164
Revert "toolbar always enabled (temporary fix)"
yeze322 Sep 20, 2019
b0f605b
sync selection and focusedId
yeze322 Sep 21, 2019
4e4a6eb
Merge branch 'master' into zeye/copypaste
yeze322 Sep 21, 2019
dad91dc
Merge branch 'zeye/copypaste' of https://github.com/Microsoft/BotFram…
yeze322 Sep 21, 2019
b7c53e6
Fix Breadcrub CI
yeze322 Sep 21, 2019
53ad1d6
increase wait time in Breadcrub test
yeze322 Sep 21, 2019
85ca61d
update Breadcrumb CI test
yeze322 Sep 21, 2019
63ae5a4
Fix ToDoBot spec
yeze322 Sep 21, 2019
35eca63
fix CreateNewBot spec
yeze322 Sep 21, 2019
094d156
use before hook instead of beforeEach hook
yeze322 Sep 21, 2019
c9798bc
make cypress `openBot` more stable
yeze322 Sep 21, 2019
487ece8
fix cursor move CI test
yeze322 Sep 21, 2019
016d0e8
increase Breadcrumb CI wait time to make it more stable
yeze322 Sep 21, 2019
f1e0dc3
cheat Cypress to not call iframe APIs to make CI more stable
yeze322 Sep 21, 2019
d8eac38
fix Breadcrumb, RemoveDialog CI
yeze322 Sep 21, 2019
0b65968
make LuisDeploy spec more stable
yeze322 Sep 21, 2019
e5e8ada
Fix CI test VisualDesigner
yeze322 Sep 21, 2019
e100dad
fix CI CreateNewBot
yeze322 Sep 21, 2019
ed20665
revert unnecessary changes
yeze322 Sep 21, 2019
9491bac
fix CreateNewBot spec
yeze322 Sep 21, 2019
e6098ed
fix LuisDeploy spec
yeze322 Sep 21, 2019
1347719
revert to AddToDo in CursorMove spec
yeze322 Sep 21, 2019
cabe58f
use cy.wait to fix fragile CreateNewBot spec
yeze322 Sep 21, 2019
c1db7d3
fix CI test of CreateNewBot
yeze322 Sep 21, 2019
0c43d60
increase wait time in LUISDeploy
yeze322 Sep 21, 2019
b48f523
fix LuisDeplot spec
yeze322 Sep 21, 2019
777ac7a
Merge branch 'master' into zeye/copypaste
yeze322 Sep 22, 2019
f88fa05
delete test
alanlong9278 Sep 23, 2019
b6b175a
Merge branch 'master' into zeye/copypaste
lei9444 Sep 23, 2019
283e580
Merge branch 'master' into zeye/copypaste
liweitian Sep 23, 2019
cfb1079
Merge branch 'master' into zeye/copypaste
cwhitten Sep 25, 2019
5863477
(zeye) optimize selection effect
liweitian Sep 26, 2019
44ecf5e
revert some cypress 'before' to 'beforeEach' to avoid unnecessaary ch…
liweitian Sep 26, 2019
2828ac1
Merge branch 'master' into zeye/copypaste
cwhitten Sep 26, 2019
af15774
Merge branch 'master' into zeye/copypaste
cwhitten Sep 26, 2019
97c7c19
Merge branch 'master' into zeye/copypaste
luhan2017 Sep 29, 2019
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
47 changes: 40 additions & 7 deletions Composer/cypress/integration/Breadcrumb.spec.js
Original file line number Diff line number Diff line change
@@ -1,39 +1,72 @@
/// <reference types="Cypress" />

context('breadcrumb', () => {
beforeEach(() => {
before(() => {
cy.visit(Cypress.env('COMPOSER_URL'));
cy.openBot('ToDoBot');
});

beforeEach(() => {
// Return to Main.dialog
cy.get('[data-testid="ProjectTree"]').within(() => {
cy.getByText('ToDoBot.Main').click();
});
});

it('can show dialog name in breadcrumb', () => {
// Should path = main dialog at first render
cy.getByTestId('Breadcrumb')
.invoke('text')
.should('contain', 'ToDoBot.Main');

// Click on AddToDo dialog
cy.get('[data-testid="ProjectTree"]').within(() => {
cy.getByText('AddToDo').click();
});

cy.getByTestId('Breadcrumb')
.invoke('text')
.should('contain', 'AddToDo');

// Return to Main.dialog
cy.get('[data-testid="ProjectTree"]').within(() => {
cy.getByText('ToDoBot.Main').click();
cy.getByText('#AddIntent').click();
});

cy.withinEditor('VisualEditor', () => {
cy.getByText('AddIntent').click();
cy.getByTestId('Breadcrumb')
.invoke('text')
.should('contain', 'ToDoBot');
});

it('can show event name in breadcrumb', () => {
cy.get('[data-testid="ProjectTree"]').within(() => {
cy.getByText('AddToDo').click();
cy.wait(100);
cy.getByText('Handle an Event: BeginDialog').click();
cy.wait(100);
});

cy.getByTestId('Breadcrumb')
.invoke('text')
.should('match', /AddToDo.*Handle an Event.*/);
});

it('can show action name in breadcrumb', () => {
cy.wait(100);
cy.get('[data-testid="ProjectTree"]').within(() => {
cy.getByText('ToDoBot.Main').click();
cy.wait(500);
});

// Click on an action
cy.withinEditor('VisualEditor', () => {
cy.getByTestId('RuleEditor').within(() => {
cy.getByText('AddToDo').click();
cy.getByText('Send an Activity').click();
cy.wait(500);
});
});

cy.getByTestId('Breadcrumb')
.invoke('text')
.should('match', /ToDoBot.+AddToDo/);
.should('match', /ToDoBot.+Send an Activity/);
});
});
15 changes: 12 additions & 3 deletions Composer/cypress/integration/CreateNewBot.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,20 @@
context('Creating a new bot', () => {
beforeEach(() => {
cy.visit(Cypress.env('COMPOSER_URL'));
cy.wait(1000);
cy.get('[data-testid="LeftNav-CommandBarButtonHome"]').click();
cy.wait(5000);
cy.get('[data-testid="homePage-ToolBar-New"]').within(() => {
cy.getByText('New').click();
});
cy.wait(5000);
});

it('can create a new bot', () => {
cy.get('[data-testid="LeftNav-CommandBarButtonHome"]').click();
cy.get('[data-testid="homePage-ToolBar-New"]').click();
cy.get('input[data-testid="Create from scratch"]').click();
cy.wait(100);
cy.get('button[data-testid="NextStepButton"]').click();
cy.wait(100);
cy.get('input[data-testid="NewDialogName"]').type('__TestNewProject');
cy.get('input[data-testid="NewDialogName"]').type('{enter}');
cy.get('[data-testid="ProjectTree"]').within(() => {
Expand All @@ -18,10 +25,12 @@ context('Creating a new bot', () => {
});

it('can create a bot from the ToDo template', () => {
cy.get('[data-testid="homePage-ToolBar-New"]').click();
cy.get('input[data-testid="Create from template"]').click({ force: true });
cy.wait(100);
cy.get('[data-testid="ToDoBot"]').click();
cy.wait(100);
cy.get('button[data-testid="NextStepButton"]').click();
cy.wait(100);
cy.get('input[data-testid="NewDialogName"]').type('__TestNewProject');
cy.get('input[data-testid="NewDialogName"]').type('{enter}');
cy.get('[data-testid="ProjectTree"]').within(() => {
Expand Down
73 changes: 0 additions & 73 deletions Composer/cypress/integration/CursorMove.spec.js

This file was deleted.

2 changes: 1 addition & 1 deletion Composer/cypress/integration/LUPage.spec.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/// <reference types="Cypress" />

context('check language understanding page', () => {
beforeEach(() => {
before(() => {
cy.visit(Cypress.env('COMPOSER_URL'));
cy.openBot('ToDoLuisBot');
});
Expand Down
4 changes: 4 additions & 0 deletions Composer/cypress/integration/LuisDeploy.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ context('Luis Deploy', () => {
response: 'fixture:luPublish/success',
});
cy.getByText('Start Bot').click();
cy.wait(5000);
// clear its settings before
cy.get('[data-testid="ProjectNameInput"]')
.clear()
Expand All @@ -44,6 +45,7 @@ context('Luis Deploy', () => {
// wait for the debounce interval of sync settings
cy.wait(1000);
cy.getByText('Publish').click();
cy.wait(1000);
cy.getByText('Restart Bot').should('exist');
cy.getByText('Test in Emulator').should('exist');

Expand All @@ -54,7 +56,9 @@ context('Luis Deploy', () => {
response: 'fixture:luPublish/error',
});
cy.getByText('Restart Bot').click();
cy.wait(1000);
cy.getByText('Try again').click();
cy.wait(1000);
cy.get('[data-testid="AuthoringKeyInput"]').type('no-id');
cy.getByText('Publish').click();
});
Expand Down
4 changes: 3 additions & 1 deletion Composer/cypress/integration/RemoveDialog.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ context('RemoveDialog', () => {
.invoke('attr', 'style', 'visibility: visible')
.click();
});
cy.getByText('Delete').click();
cy.get('.ms-ContextualMenu-linkContent > .ms-ContextualMenu-itemText').within(() => {
cy.getByText('Delete').click();
});
cy.getByText('Yes').click();
cy.get('[data-testid="ProjectTree"]').within(() => {
cy.get('[title="AddItem"]').should('not.exist');
Expand Down
6 changes: 5 additions & 1 deletion Composer/cypress/integration/ToDoBot.spec.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
/// <reference types="Cypress" />

context('ToDo Bot', () => {
beforeEach(() => {
before(() => {
cy.visit(Cypress.env('COMPOSER_URL'));
cy.openBot('ToDoBot');
});

it('can open the main dialog', () => {
cy.get('[data-testid="ProjectTree"]').within(() => {
cy.getByText('ToDoBot.Main').click();
cy.wait(100);
});
cy.withinEditor('FormEditor', () => {
cy.getByDisplayValue('ToDoBot.Main').should('exist');
Expand All @@ -33,6 +34,7 @@ context('ToDo Bot', () => {
it('can open the ClearToDos dialog', () => {
cy.get('[data-testid="ProjectTree"]').within(() => {
cy.getByText('ClearToDos').click();
cy.wait(100);
});

cy.withinEditor('FormEditor', () => {
Expand All @@ -46,6 +48,7 @@ context('ToDo Bot', () => {
it('can open the DeleteToDo dialog', () => {
cy.get('[data-testid="ProjectTree"]').within(() => {
cy.getByText('DeleteToDo').click();
cy.wait(100);
});

cy.withinEditor('FormEditor', () => {
Expand All @@ -59,6 +62,7 @@ context('ToDo Bot', () => {
it('can open the ShowToDos dialog', () => {
cy.get('[data-testid="ProjectTree"]').within(() => {
cy.getByText('ShowToDos').click();
cy.wait(100);
});

cy.withinEditor('FormEditor', () => {
Expand Down
33 changes: 4 additions & 29 deletions Composer/cypress/integration/VisualDesigner.spec.js
Original file line number Diff line number Diff line change
@@ -1,39 +1,14 @@
/// <reference types="Cypress" />

context('Visual Designer', () => {
beforeEach(() => {
before(() => {
cy.visit(Cypress.env('COMPOSER_URL'));
cy.startFromTemplate('EmptyBot', 'VisualDesignerTest');
cy.openBot('ToDoBot');
});

//will remove skip after add trigger is ok
it('can add a rule from the visual designer', () => {
cy.addEventHandler('Handle a Dialog Event');
cy.wait(100);

cy.withinEditor('VisualEditor', () => {
cy.contains('Handle a Dialog Event').should('exist');
});

cy.addEventHandler('Handle an Intent');
cy.wait(100);

cy.withinEditor('VisualEditor', () => {
cy.contains('Handle an Intent').should('exist');
});

cy.addEventHandler('Handle Unknown Intent');
cy.wait(100);

cy.withinEditor('VisualEditor', () => {
cy.contains('Handle Unknown Intent').should('exist');
});

cy.addEventHandler('Handle ConversationUpdate');
cy.wait(100);

it('can find Visual Designer default trigger in container', () => {
cy.withinEditor('VisualEditor', () => {
cy.contains('Handle ConversationUpdate').should('exist');
cy.getByText('Trigger').should('exist');
});
});
});
4 changes: 3 additions & 1 deletion Composer/cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ import 'cypress-testing-library/add-commands';

Cypress.Commands.add('openBot', botName => {
cy.get('[data-testid="LeftNav-CommandBarButtonHome"]').click();
cy.getByText('Open').click();
cy.get('[data-testid="homePage-ToolBar-Open"]').within(() => {
cy.getByText('Open').click();
});
cy.get('[data-testid="SelectLocation"]').within(() => {
cy.get(`[aria-label="${botName}"]`).click({ force: true });
cy.wait(500);
Expand Down
9 changes: 1 addition & 8 deletions Composer/packages/client/src/ShellApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const shellNavigator = (shellPage: string, opts: { id?: string } = {}) => {
export const ShellApi: React.FC = () => {
const { state, actions } = useContext(StoreContext);
const { dialogs, schemas, lgFiles, luFiles, designPageLocation, focusPath, breadcrumb } = state;
const updateDialog = useDebouncedFunc(actions.updateDialog);
const updateDialog = actions.updateDialog;
const updateLuFile = actions.updateLuFile; //if debounced, error can't pass to form
const updateLgFile = useDebouncedFunc(actions.updateLgFile);
const updateLgTemplate = useDebouncedFunc(actions.updateLgTemplate);
Expand Down Expand Up @@ -278,12 +278,6 @@ export const ShellApi: React.FC = () => {
}
}

function flushUpdates() {
if (updateDialog.flush) {
updateDialog.flush();
}
}

function cleanData() {
const cleanedData = sanitizeDialogData(dialogsMap[dialogId]);
if (!isEqual(dialogsMap[dialogId], cleanedData)) {
Expand All @@ -293,7 +287,6 @@ export const ShellApi: React.FC = () => {
};
updateDialog(payload);
}
flushUpdates();
}

function navTo({ path }) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,16 @@ function ExtensionContainer() {
}
});

apiClient.registerApi('rpc', (method, ...params) => {
const handler = (window as any)[method];
let result;
if (handler) {
result = handler(...params);
}

return result;
});

shellApi.getState().then(result => {
setShellData(result);
});
Expand Down
Loading