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
69 commits
Select commit Hold shift + click to select a range
57cabee
rename e2e script to e2e-ci
a-b-r-o-w-n Apr 8, 2020
16414a7
[wip] start cross env e2e script
a-b-r-o-w-n Apr 8, 2020
b8ed52c
add assertion on visit page method
a-b-r-o-w-n Apr 10, 2020
e197a99
add @bfc/test-utils package
a-b-r-o-w-n Apr 13, 2020
cedaca1
update visual designer to use test-utils
a-b-r-o-w-n Apr 13, 2020
7ec67ce
mark test-utils private
a-b-r-o-w-n Apr 13, 2020
e0df0c0
update adaptive-form to use test-utils
a-b-r-o-w-n Apr 13, 2020
5ccba08
migrate extension to test-utils
a-b-r-o-w-n Apr 13, 2020
3a11e6a
migrate client to test-utils
a-b-r-o-w-n Apr 13, 2020
28dd56c
update config function interfaces
a-b-r-o-w-n Apr 13, 2020
6e93158
add node configuration
a-b-r-o-w-n Apr 13, 2020
9972cb5
Merge branch 'master' into ci/easy-e2e
a-b-r-o-w-n Apr 14, 2020
cc5e354
update lockfile
a-b-r-o-w-n Apr 14, 2020
382e1d5
migrate electron-server to test-utils
a-b-r-o-w-n Apr 14, 2020
41b1d11
migrate lib to test-utils
a-b-r-o-w-n Apr 14, 2020
0ffe554
migrate server to test-utils
a-b-r-o-w-n Apr 14, 2020
6569f63
migrate tools to test-utils
a-b-r-o-w-n Apr 14, 2020
fa09de6
migrate ui-plugins to test-utils
a-b-r-o-w-n Apr 14, 2020
b805b1e
update lock file
a-b-r-o-w-n Apr 14, 2020
8d1633c
update documentation
a-b-r-o-w-n Apr 14, 2020
5348e96
add typings for test-utils
a-b-r-o-w-n Apr 14, 2020
a634d2d
convert all test imports to test-utils
a-b-r-o-w-n Apr 14, 2020
ed795e3
allow configuration of babel options
a-b-r-o-w-n Apr 14, 2020
7104981
convert missing js files to jsx
a-b-r-o-w-n Apr 14, 2020
d7da1b5
remove ability for babel overrides
a-b-r-o-w-n Apr 15, 2020
0ec5cb7
remove babel overrides from type
a-b-r-o-w-n Apr 15, 2020
099b991
migrate ui-shared to test-utils
a-b-r-o-w-n Apr 15, 2020
d4391e3
do not load other babel configs for tests
a-b-r-o-w-n Apr 15, 2020
f8bbbc7
add e2e scripts to run app and clean artifacts in cross plat way
a-b-r-o-w-n Apr 16, 2020
507c0d8
add more logging
a-b-r-o-w-n Apr 16, 2020
550609b
add yarn script to start composer for e2e
a-b-r-o-w-n Apr 16, 2020
0ce2627
Merge branch 'master' into ci/easy-e2e
a-b-r-o-w-n Apr 16, 2020
e8b574e
Merge branch 'master' into ci/easy-e2e
a-b-r-o-w-n Apr 16, 2020
88d4f38
update typescript
a-b-r-o-w-n Apr 16, 2020
a62ab83
update eslint & prettier
a-b-r-o-w-n Apr 16, 2020
a40a487
snap to latest prettier defaults
a-b-r-o-w-n Apr 16, 2020
499e6f4
add more react eslint config
a-b-r-o-w-n Apr 16, 2020
3ec2b86
apply new react eslint rules
a-b-r-o-w-n Apr 16, 2020
18733dd
rename files to .jsx
a-b-r-o-w-n Apr 16, 2020
9e2731f
add jsx-a11y rules
a-b-r-o-w-n Apr 16, 2020
e13c805
Merge branch 'master' into abrown/build/update-typescript
a-b-r-o-w-n May 4, 2020
03c772b
add lint script to plugin-loader
a-b-r-o-w-n May 4, 2020
cbdd675
apply fixable lint fixes
a-b-r-o-w-n May 4, 2020
f47f265
Merge branch 'master' into abrown/build/update-typescript
a-b-r-o-w-n May 18, 2020
ccb1291
clean up merge conflicts
a-b-r-o-w-n May 18, 2020
055bbdd
apply lint rules
a-b-r-o-w-n May 18, 2020
aecc843
update packages, fix build errors
a-b-r-o-w-n May 19, 2020
43eef4d
fix test error
a-b-r-o-w-n May 19, 2020
b54881c
fix lint error
a-b-r-o-w-n May 19, 2020
896029f
Merge branch 'master' into abrown/build/update-typescript
a-b-r-o-w-n May 19, 2020
a504ce8
add base path for coveralls action
a-b-r-o-w-n May 19, 2020
5164986
update pr action to specify repo-token input
a-b-r-o-w-n May 19, 2020
02a20f4
try adding coveralls debug
a-b-r-o-w-n May 19, 2020
97a652e
revert coveralls action changes
a-b-r-o-w-n May 19, 2020
ab76191
Merge branch 'master' into abrown/build/update-typescript
a-b-r-o-w-n May 19, 2020
dd1907a
apply new prettier rules to cypress tests
a-b-r-o-w-n May 19, 2020
ae65a26
add delay after typing to allow error to propagate
a-b-r-o-w-n May 19, 2020
30d327c
Merge branch 'master' into abrown/build/update-typescript
beyackle May 19, 2020
31aa3a7
Merge branch 'master' into abrown/build/update-typescript
a-b-r-o-w-n May 20, 2020
df33f4f
remove ext option from eslint
a-b-r-o-w-n May 20, 2020
5210d68
add options to sort props rule
a-b-r-o-w-n May 20, 2020
715df8b
apply sort props rule
a-b-r-o-w-n May 20, 2020
153b96e
Merge branch 'master' into abrown/build/update-typescript
a-b-r-o-w-n May 20, 2020
b325104
remove unused files
a-b-r-o-w-n May 20, 2020
6f75411
add ext back to eslint
a-b-r-o-w-n May 20, 2020
1ca58aa
re-apply lint fixes to some files
a-b-r-o-w-n May 20, 2020
c314313
pr feedback
a-b-r-o-w-n May 20, 2020
8d1c309
Merge branch 'master' into abrown/build/update-typescript
a-b-r-o-w-n May 20, 2020
197209f
Merge branch 'master' into abrown/build/update-typescript
a-b-r-o-w-n May 21, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 4 additions & 0 deletions .github/actions/conventional-pr/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@ runs:
branding:
icon: "briefcase"
color: "purple"
inputs:
repo-token:
description: "Token used to interact with the Github API."
required: true
6 changes: 3 additions & 3 deletions .github/actions/conventional-pr/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 .github/actions/conventional-pr/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
"@actions/github": "^1.1.0"
},
"devDependencies": {
"typescript": "^3.7.2"
"typescript": "3.9.2"
}
}
3 changes: 3 additions & 0 deletions Composer/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

module.exports = {
extends: [
'eslint:recommended',
Expand Down
110 changes: 109 additions & 1 deletion Composer/.eslintrc.react.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

module.exports = {
extends: ['./.eslintrc.js', 'plugin:react/recommended'],
plugins: ['react-hooks', 'format-message', 'emotion'],
plugins: ['react-hooks', 'format-message', 'emotion', 'jsx-a11y'],
settings: {
react: {
version: '16.9.16',
Expand Down Expand Up @@ -28,9 +31,114 @@ module.exports = {
'react/no-danger': 'error',
'react/no-deprecated': 'warn',
'react/prop-types': 'warn',
'react/no-unknown-property': 'error',
'react/jsx-boolean-value': ['error', 'never'],
'react/jsx-filename-extension': ['error', { extensions: ['.jsx', '.tsx'] }],
// https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/jsx-sort-props.md
'react/jsx-sort-props': [
'error',
{ callbacksLast: true, ignoreCase: true, shorthandFirst: true, reservedFirst: true },
],

// emotion
'emotion/jsx-import': 'error',

// jsx-a11y
// taken from https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/src/index.js
'jsx-a11y/accessible-emoji': 'warn',
'jsx-a11y/alt-text': 'warn',
'jsx-a11y/anchor-has-content': 'warn',
'jsx-a11y/anchor-is-valid': 'warn',
'jsx-a11y/aria-activedescendant-has-tabindex': 'warn',
'jsx-a11y/aria-props': 'warn',
'jsx-a11y/aria-proptypes': 'warn',
'jsx-a11y/aria-role': 'warn',
'jsx-a11y/aria-unsupported-elements': 'warn',
'jsx-a11y/click-events-have-key-events': 'warn',
'jsx-a11y/control-has-associated-label': [
'off',
{
ignoreElements: ['audio', 'canvas', 'embed', 'input', 'textarea', 'tr', 'video'],
ignoreRoles: [
'grid',
'listbox',
'menu',
'menubar',
'radiogroup',
'row',
'tablist',
'toolbar',
'tree',
'treegrid',
],
includeRoles: ['alert', 'dialog'],
},
],
'jsx-a11y/heading-has-content': 'warn',
'jsx-a11y/html-has-lang': 'warn',
'jsx-a11y/iframe-has-title': 'warn',
'jsx-a11y/img-redundant-alt': 'warn',
'jsx-a11y/interactive-supports-focus': [
'warn',
{
tabbable: ['button', 'checkbox', 'link', 'searchbox', 'spinbutton', 'switch', 'textbox'],
},
],
'jsx-a11y/label-has-associated-control': 'warn',
'jsx-a11y/label-has-for': 'off',
'jsx-a11y/media-has-caption': 'warn',
'jsx-a11y/mouse-events-have-key-events': 'warn',
'jsx-a11y/no-access-key': 'warn',
'jsx-a11y/no-autofocus': 'warn',
'jsx-a11y/no-distracting-elements': 'warn',
'jsx-a11y/no-interactive-element-to-noninteractive-role': [
'warn',
{
tr: ['none', 'presentation'],
},
],
'jsx-a11y/no-noninteractive-element-interactions': [
'warn',
{
handlers: ['onClick', 'onError', 'onLoad', 'onMouseDown', 'onMouseUp', 'onKeyPress', 'onKeyDown', 'onKeyUp'],
alert: ['onKeyUp', 'onKeyDown', 'onKeyPress'],
body: ['onError', 'onLoad'],
dialog: ['onKeyUp', 'onKeyDown', 'onKeyPress'],
iframe: ['onError', 'onLoad'],
img: ['onError', 'onLoad'],
},
],
'jsx-a11y/no-noninteractive-element-to-interactive-role': [
'warn',
{
ul: ['listbox', 'menu', 'menubar', 'radiogroup', 'tablist', 'tree', 'treegrid'],
ol: ['listbox', 'menu', 'menubar', 'radiogroup', 'tablist', 'tree', 'treegrid'],
li: ['menuitem', 'option', 'row', 'tab', 'treeitem'],
table: ['grid'],
td: ['gridcell'],
},
],
'jsx-a11y/no-noninteractive-tabindex': [
'warn',
{
tags: [],
roles: ['tabpanel'],
allowExpressionValues: true,
},
],
'jsx-a11y/no-onchange': 'warn',
'jsx-a11y/no-redundant-roles': 'warn',
'jsx-a11y/no-static-element-interactions': [
'warn',
{
allowExpressionValues: true,
handlers: ['onClick', 'onMouseDown', 'onMouseUp', 'onKeyPress', 'onKeyDown', 'onKeyUp'],
},
],
'jsx-a11y/role-has-required-aria-props': 'warn',
'jsx-a11y/role-supports-aria-props': 'warn',
'jsx-a11y/scope': 'warn',
'jsx-a11y/tabindex-no-positive': 'warn',
},
overrides: [
{
Expand Down
5 changes: 2 additions & 3 deletions Composer/.prettierrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"printWidth": 120,
"parser": "typescript",
"trailingComma": "es5",
"singleQuote": true,
"tabWidth": 2,
}
"tabWidth": 2
}
2 changes: 1 addition & 1 deletion Composer/cypress/integration/Breadcrumb.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ context('breadcrumb', () => {
cy.get('[data-testid="Breadcrumb"]')
.last()
.get('li')
.should($li => {
.should(($li) => {
items.forEach((item, idx) => {
expect($li.eq(idx)).to.contain(item);
});
Expand Down
8 changes: 2 additions & 6 deletions Composer/cypress/integration/LGPage.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,10 @@ context('LG Page', () => {
cy.get('.toggleEditMode button').as('switchButton');

// by default is table view
cy.findByTestId('LGPage')
.findByTestId('table-view')
.should('exist');
cy.findByTestId('LGPage').findByTestId('table-view').should('exist');
// goto edit-mode
cy.get('@switchButton').click();
cy.findByTestId('LGPage')
.get('.monaco-editor')
.should('exist');
cy.findByTestId('LGPage').get('.monaco-editor').should('exist');

// back to table view
cy.get('@switchButton').click();
Expand Down
12 changes: 3 additions & 9 deletions Composer/cypress/integration/LUPage.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ context('LU Page', () => {
cy.get('.toggleEditMode button').should('not.exist');

// by default is table view
cy.findByTestId('LUPage')
.findByTestId('table-view')
.should('exist');
cy.findByTestId('LUPage').findByTestId('table-view').should('exist');

// nav to ToDoBotWithLuisSample.main dialog
cy.findByTestId('ProjectTree').within(() => {
Expand All @@ -27,16 +25,12 @@ context('LU Page', () => {
cy.get('.toggleEditMode button').as('switchButton');
// goto edit-mode
cy.get('@switchButton').click();
cy.findByTestId('LUPage')
.get('.monaco-editor')
.should('exist');
cy.findByTestId('LUPage').get('.monaco-editor').should('exist');

// back to all table view
cy.findByTestId('ProjectTree').within(() => {
cy.findByText('All').click();
});
cy.findByTestId('LUPage')
.findByTestId('table-view')
.should('exist');
cy.findByTestId('LUPage').findByTestId('table-view').should('exist');
});
});
29 changes: 7 additions & 22 deletions Composer/cypress/integration/NotificationPage.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,20 @@

context('Notification Page', () => {
beforeEach(() => {
cy.visit('/home');
cy.createBot('ToDoBotWithLuisSample');
cy.visitPage('Notifications');
});

it('can show lg syntax error ', () => {
cy.visitPage('Bot Responses');

cy.get('.toggleEditMode button').as('switchButton');
cy.get('@switchButton').click();
cy.get('textarea').type('#');
cy.get('textarea').type('#', { delay: 200 });

cy.findByTestId('LeftNav-CommandBarButtonNotifications').click();

cy.findByTestId('notifications-table-view').within(() => {
cy.findAllByText('common.en-us.lg')
.should('exist')
.first()
.click();
cy.findAllByText('common.en-us.lg').should('exist').first().click();
});

cy.findAllByText('Bot Responses').should('exist');
Expand All @@ -35,15 +30,12 @@ context('Notification Page', () => {
});

cy.get('.toggleEditMode button').click();
cy.get('textarea').type('t');
cy.get('textarea').type('t', { delay: 200 });

cy.findByTestId('LeftNav-CommandBarButtonNotifications').click();

cy.findByTestId('notifications-table-view').within(() => {
cy.findAllByText('__testtodobotwithluissample.en-us.lu')
.should('exist')
.first()
.dblclick();
cy.findAllByText('__testtodobotwithluissample.en-us.lu').should('exist').first().dblclick();
});

cy.findAllByText('__TestToDoBotWithLuisSample').should('exist');
Expand All @@ -62,22 +54,15 @@ context('Notification Page', () => {

cy.withinEditor('PropertyEditor', () => {
cy.findByText('Condition').should('exist');
cy.findByTestId('expression-type-dropdown-Condition')
.focus()
.should('contain.text', 'expression');
cy.get('#root\\.condition')
.click()
.type('foo = bar');
cy.findByTestId('expression-type-dropdown-Condition').focus().should('contain.text', 'expression');
cy.get('#root\\.condition').click().type('foo = bar', { delay: 200 });
cy.findByTestId('FieldErrorMessage').should('exist');
});

cy.findByTestId('LeftNav-CommandBarButtonNotifications').click();

cy.findByTestId('notifications-table-view').within(() => {
cy.findAllByText('__testtodobotwithluissample.dialog')
.should('exist')
.first()
.dblclick();
cy.findAllByText('__testtodobotwithluissample.dialog').should('exist').first().dblclick();
});

cy.findAllByText('WelcomeUser').should('exist');
Expand Down
5 changes: 1 addition & 4 deletions Composer/cypress/integration/RemoveDialog.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ context('RemoveDialog', () => {
it('can remove dialog', () => {
cy.findByTestId('ProjectTree').within(() => {
cy.findByTestId('DialogTreeItemtriggers[4]').within(() => {
cy.findByTestId('dialogMoreButton')
.first()
.invoke('attr', 'style', 'visibility: visible')
.click();
cy.findByTestId('dialogMoreButton').first().invoke('attr', 'style', 'visibility: visible').click();
});
});

Expand Down
10 changes: 4 additions & 6 deletions Composer/cypress/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Cypress.Commands.add('createBot', (botId: string, botName?: string) => {
templateId: botId,
};

cy.request('post', '/api/projects', params).then(res => {
cy.request('post', '/api/projects', params).then((res) => {
const { id: projectId } = res.body;
cy.visit(`/bot/${projectId}/dialogs/${name.toLowerCase()}`);
});
Expand All @@ -23,21 +23,19 @@ Cypress.Commands.add('withinEditor', (editorName, cb) => {
cy.findByTestId(editorName).within(cb);
});

Cypress.Commands.add('visitPage', page => {
Cypress.Commands.add('visitPage', (page) => {
cy.findByTestId(`LeftNav-CommandBarButton${page}`).click();
cy.findByTestId('ActiveLeftNavItem').should('contain', page);
});

Cypress.Commands.add('enterTextAndSubmit', (textElement: string, text: string, submitBtn?: string) => {
cy.findByTestId(textElement)
.clear()
.type(text);
cy.findByTestId(textElement).clear().type(text);
if (submitBtn) {
cy.findByTestId(submitBtn).click();
}
});

Cypress.on('uncaught:exception', err => {
Cypress.on('uncaught:exception', (err) => {
// eslint-disable-next-line no-console
console.log('uncaught exception', err);
return false;
Expand Down
Loading