From 6bef8c44a7704885068857186eb14e5fa116e9be Mon Sep 17 00:00:00 2001 From: Andy Brown Date: Tue, 19 Nov 2019 12:04:26 -0800 Subject: [PATCH 01/30] remove eslint typechecking rules causes too many issues with vscode for now --- Composer/.eslintrc.js | 1 - 1 file changed, 1 deletion(-) diff --git a/Composer/.eslintrc.js b/Composer/.eslintrc.js index 678fddde71..ed316fe804 100644 --- a/Composer/.eslintrc.js +++ b/Composer/.eslintrc.js @@ -3,7 +3,6 @@ module.exports = { 'eslint:recommended', 'plugin:prettier/recommended', 'plugin:@typescript-eslint/recommended', - 'plugin:@typescript-eslint/recommended-requiring-type-checking', 'plugin:@typescript-eslint/eslint-recommended', 'prettier/@typescript-eslint', 'plugin:@bfc/bfcomposer/recommended', From dd03ea0244d727a3e18c5811518effe79bf6776c Mon Sep 17 00:00:00 2001 From: Andy Brown Date: Tue, 19 Nov 2019 12:11:15 -0800 Subject: [PATCH 02/30] consolidate tsconfig --- Composer/packages/client/tsconfig.json | 15 +++---------- .../extensions/visual-designer/tsconfig.json | 19 ++--------------- .../packages/lib/code-editor/tsconfig.json | 18 +++------------- Composer/packages/lib/indexers/tsconfig.json | 18 +++------------- Composer/packages/lib/shared/tsconfig.json | 19 +++-------------- Composer/packages/server/tsconfig.json | 21 ++++--------------- Composer/tsconfig.base.json | 20 ++++++++++++++++++ 7 files changed, 38 insertions(+), 92 deletions(-) create mode 100644 Composer/tsconfig.base.json diff --git a/Composer/packages/client/tsconfig.json b/Composer/packages/client/tsconfig.json index 46407dba78..42032f429e 100644 --- a/Composer/packages/client/tsconfig.json +++ b/Composer/packages/client/tsconfig.json @@ -1,18 +1,9 @@ { + "extends": "../../tsconfig.base.json", "compilerOptions": { - "noImplicitAny": false, + "allowJs": true, + "declaration": false, "module": "esnext", - "target": "es5", - "jsx": "react", - "sourceMap": true, - "moduleResolution": "node", - "esModuleInterop": true, - "strict": true, - "resolveJsonModule": true, - "allowJs": true }, "include": ["./src/**/*", "./__tests__/**/*"], - "exclude": [ - "node_modules" - ], } diff --git a/Composer/packages/extensions/visual-designer/tsconfig.json b/Composer/packages/extensions/visual-designer/tsconfig.json index 294df87cb6..8eab2df086 100644 --- a/Composer/packages/extensions/visual-designer/tsconfig.json +++ b/Composer/packages/extensions/visual-designer/tsconfig.json @@ -1,23 +1,8 @@ { + "extends": "../../../tsconfig.base.json", "compilerOptions": { "outDir": "./lib/", - "noImplicitAny": false, "module": "esnext", - "target": "es5", - "jsx": "react", - "sourceMap": true, - "moduleResolution": "node", - "esModuleInterop": true, - "strict": true, - "resolveJsonModule": true, - "allowJs": false }, - "include": [ - "./src/**/*", - "./__tests__/**/*" - ], - "exclude": [ - "node_modules", - "lib" - ], + "include": ["./src/**/*", "./__tests__/**/*"] } diff --git a/Composer/packages/lib/code-editor/tsconfig.json b/Composer/packages/lib/code-editor/tsconfig.json index 24ff942876..bdcff025b4 100644 --- a/Composer/packages/lib/code-editor/tsconfig.json +++ b/Composer/packages/lib/code-editor/tsconfig.json @@ -1,19 +1,7 @@ { + "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./lib/", - "noImplicitAny": false, - "module": "es6", - "target": "es5", - "jsx": "react", - "sourceMap": true, - "declaration": true, - "moduleResolution": "node", - "esModuleInterop": true, - "strict": true, - "resolveJsonModule": true + "outDir": "lib" }, - "include": ["./src/**/*", "./__tests__/**/*"], - "exclude": [ - "node_modules" - ], + "include": ["./src/**/*", "./__tests__/**/*"] } diff --git a/Composer/packages/lib/indexers/tsconfig.json b/Composer/packages/lib/indexers/tsconfig.json index 8dc920c722..bdcff025b4 100644 --- a/Composer/packages/lib/indexers/tsconfig.json +++ b/Composer/packages/lib/indexers/tsconfig.json @@ -1,19 +1,7 @@ { + "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./lib/", - "noImplicitAny": false, - "module": "commonjs", - "target": "es6", - "sourceMap": true, - "declaration": true, - "moduleResolution": "node", - "esModuleInterop": true, - "strict": true, - "noUnusedLocals": true, - "resolveJsonModule": true + "outDir": "lib" }, - "include": ["./src/**/*", "./__tests__/**/*"], - "exclude": [ - "node_modules" - ], + "include": ["./src/**/*", "./__tests__/**/*"] } diff --git a/Composer/packages/lib/shared/tsconfig.json b/Composer/packages/lib/shared/tsconfig.json index 9b9f5d74ef..bdcff025b4 100644 --- a/Composer/packages/lib/shared/tsconfig.json +++ b/Composer/packages/lib/shared/tsconfig.json @@ -1,20 +1,7 @@ { + "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./lib/", - "noImplicitAny": false, - "module": "commonjs", - "target": "es5", - "jsx": "react", - "sourceMap": true, - "declaration": true, - "moduleResolution": "node", - "esModuleInterop": true, - "strict": true, - "noUnusedLocals": true, - "resolveJsonModule": true + "outDir": "lib" }, - "include": ["./src/**/*", "./__tests__/**/*"], - "exclude": [ - "node_modules" - ], + "include": ["./src/**/*", "./__tests__/**/*"] } diff --git a/Composer/packages/server/tsconfig.json b/Composer/packages/server/tsconfig.json index 6b25f32993..b105534557 100644 --- a/Composer/packages/server/tsconfig.json +++ b/Composer/packages/server/tsconfig.json @@ -1,23 +1,10 @@ { - /* Options used for linting (tests included) */ + "extends": "../../tsconfig.base.json", "compilerOptions": { + "declaration": false, "outDir": "./build/", - "noImplicitAny": false, - "module": "commonjs", - "target": "es6", "sourceMap": true, - "declaration": true, - "moduleResolution": "node", - "esModuleInterop": true, - "strict": true, - "noUnusedLocals": true, - "resolveJsonModule": true + "target": "es6" }, - "exclude": [ - "node_modules", - ], - "include": [ - "src/**/*.ts", - "__tests__/**/*.test.ts" - ] + "include": ["src/**/*.ts", "__tests__/**/*.test.ts"] } diff --git a/Composer/tsconfig.base.json b/Composer/tsconfig.base.json new file mode 100644 index 0000000000..41801b32e2 --- /dev/null +++ b/Composer/tsconfig.base.json @@ -0,0 +1,20 @@ +{ + "compilerOptions": { + "allowJs": false, + "declaration": true, + "esModuleInterop": true, + "jsx": "react", + "module": "commonjs", + "moduleResolution": "node", + "noImplicitAny": false, + "noUnusedLocals": true, + "resolveJsonModule": true, + "skipLibCheck": true, + "sourceMap": true, + "strict": true, + "target": "es5" + }, + "exclude": [ + "node_modules" + ], +} From e40931586e1f6248b71143b63bcd19dbda0cf33e Mon Sep 17 00:00:00 2001 From: Andy Brown Date: Tue, 19 Nov 2019 12:14:19 -0800 Subject: [PATCH 03/30] set up cypress for typescript --- Composer/cypress/plugins/index.js | 22 +++++++--------------- Composer/cypress/tsconfig.json | 10 ++++++++++ Composer/package.json | 3 +++ 3 files changed, 20 insertions(+), 15 deletions(-) create mode 100644 Composer/cypress/tsconfig.json diff --git a/Composer/cypress/plugins/index.js b/Composer/cypress/plugins/index.js index fd170fba69..3105358402 100644 --- a/Composer/cypress/plugins/index.js +++ b/Composer/cypress/plugins/index.js @@ -1,17 +1,9 @@ -// *********************************************************** -// This example plugins/index.js can be used to load plugins -// -// You can change the location of this file or turn off loading -// the plugins file with the 'pluginsFile' configuration option. -// -// You can read more here: -// https://on.cypress.io/plugins-guide -// *********************************************************** +/* eslint-disable @typescript-eslint/no-var-requires */ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. -// This function is called when a project is opened or re-opened (e.g. due to -// the project's config changing) +const cypressTypeScriptPreprocessor = require('./cy-ts-preprocessor'); -module.exports = (on, config) => { - // `on` is used to hook into various events Cypress emits - // `config` is the resolved Cypress config -} +module.exports = on => { + on('file:preprocessor', cypressTypeScriptPreprocessor); +}; diff --git a/Composer/cypress/tsconfig.json b/Composer/cypress/tsconfig.json new file mode 100644 index 0000000000..ee9ae6f970 --- /dev/null +++ b/Composer/cypress/tsconfig.json @@ -0,0 +1,10 @@ +{ + "compilerOptions": { + "strict": true, + "baseUrl": "../node_modules", + "target": "es5", + "lib": ["es5", "dom"], + "types": ["cypress", "@types/testing-library__cypress"] + }, + "include": ["**/*.ts"] +} diff --git a/Composer/package.json b/Composer/package.json index 4901453bb5..c296c6cf03 100644 --- a/Composer/package.json +++ b/Composer/package.json @@ -59,7 +59,9 @@ "@babel/preset-react": "^7.0.0", "@babel/preset-typescript": "^7.3.3", "@bfc/eslint-plugin-bfcomposer": "*", + "@cypress/webpack-preprocessor": "^4.1.1", "@emotion/babel-preset-css-prop": "^10.0.17", + "@testing-library/cypress": "^5.0.2", "@typescript-eslint/eslint-plugin": "2.6.0", "@typescript-eslint/parser": "2.6.0", "babel-jest": "24.0.0", @@ -92,6 +94,7 @@ "prettier": "^1.15.3", "react-testing-library": "^6.0.2", "rimraf": "^2.6.3", + "ts-loader": "^6.2.1", "typescript": "3.6.4", "wsrun": "^3.6.4" }, From 8057cf7a3de6aca29e26a52862464372d924e058 Mon Sep 17 00:00:00 2001 From: Andy Brown Date: Tue, 19 Nov 2019 13:58:21 -0800 Subject: [PATCH 04/30] remove unused files --- .../extensions/visual-designer/.eslintignore | 2 -- .../extensions/visual-designer/.travis.yml | 16 ---------------- 2 files changed, 18 deletions(-) delete mode 100644 Composer/packages/extensions/visual-designer/.eslintignore delete mode 100644 Composer/packages/extensions/visual-designer/.travis.yml diff --git a/Composer/packages/extensions/visual-designer/.eslintignore b/Composer/packages/extensions/visual-designer/.eslintignore deleted file mode 100644 index c18ed016a7..0000000000 --- a/Composer/packages/extensions/visual-designer/.eslintignore +++ /dev/null @@ -1,2 +0,0 @@ -node_modules/ -lib/ \ No newline at end of file diff --git a/Composer/packages/extensions/visual-designer/.travis.yml b/Composer/packages/extensions/visual-designer/.travis.yml deleted file mode 100644 index 06e30d936d..0000000000 --- a/Composer/packages/extensions/visual-designer/.travis.yml +++ /dev/null @@ -1,16 +0,0 @@ -sudo: false - -language: node_js -node_js: - - 8 - -before_install: - - npm install codecov.io coveralls - -after_success: - - cat ./coverage/lcov.info | ./node_modules/codecov.io/bin/codecov.io.js - - cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js - -branches: - only: - - master From bf4fd91cf7100502af9ca7fb13ae268c809bb1b5 Mon Sep 17 00:00:00 2001 From: Andy Brown Date: Tue, 19 Nov 2019 13:59:50 -0800 Subject: [PATCH 05/30] only need to lint ts and tsx --- Composer/packages/extensions/obiformeditor/package.json | 2 +- Composer/packages/extensions/visual-designer/package.json | 2 +- Composer/packages/lib/code-editor/package.json | 2 +- Composer/packages/lib/indexers/package.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Composer/packages/extensions/obiformeditor/package.json b/Composer/packages/extensions/obiformeditor/package.json index 83afabd09b..419e102656 100644 --- a/Composer/packages/extensions/obiformeditor/package.json +++ b/Composer/packages/extensions/obiformeditor/package.json @@ -18,7 +18,7 @@ "prepublishOnly": "npm run build", "start": "webpack-dev-server --config demo/webpack.config.demo.js", "test": "jest", - "lint": "eslint --quiet --ext .js,.jsx,.ts,.tsx ./src ./__tests__", + "lint": "eslint --quiet --ext .ts,.tsx ./src ./__tests__", "lint:fix": "yarn lint --fix", "lint:typecheck": "tsc --noEmit", "watch": "yarn build:ts --watch" diff --git a/Composer/packages/extensions/visual-designer/package.json b/Composer/packages/extensions/visual-designer/package.json index 157a576892..5fbdf33761 100644 --- a/Composer/packages/extensions/visual-designer/package.json +++ b/Composer/packages/extensions/visual-designer/package.json @@ -17,7 +17,7 @@ "prepublishOnly": "npm run build", "start": "webpack-dev-server --config demo/webpack.config.demo.js --port 3002", "test": "jest --no-cache", - "lint": "eslint --quiet --ext .js,.jsx,.ts,.tsx ./src ./__tests__", + "lint": "eslint --quiet --ext .ts,.tsx ./src ./__tests__", "lint:fix": "yarn lint --fix" }, "dependencies": { diff --git a/Composer/packages/lib/code-editor/package.json b/Composer/packages/lib/code-editor/package.json index e01574348a..31db849c38 100644 --- a/Composer/packages/lib/code-editor/package.json +++ b/Composer/packages/lib/code-editor/package.json @@ -14,7 +14,7 @@ "prepublishOnly": "npm run build", "start": "webpack-dev-server --config demo/webpack.config.demo.js", "test": "jest", - "lint": "eslint --quiet --ext .js,.jsx,.ts,.tsx ./src", + "lint": "eslint --quiet --ext .ts,.tsx ./src", "lint:fix": "yarn lint --fix", "lint:typecheck": "tsc --noEmit", "watch": "yarn build:ts --watch" diff --git a/Composer/packages/lib/indexers/package.json b/Composer/packages/lib/indexers/package.json index aede41bb43..c6bacc6cf0 100644 --- a/Composer/packages/lib/indexers/package.json +++ b/Composer/packages/lib/indexers/package.json @@ -13,7 +13,7 @@ "prepublishOnly": "npm run build", "start": "webpack-dev-server --config demo/webpack.config.demo.js", "test": "jest", - "lint": "eslint --quiet --ext .js,.jsx,.ts,.tsx ./src", + "lint": "eslint --quiet --ext .ts,.tsx ./src", "lint:fix": "yarn lint --fix", "lint:typecheck": "tsc --noEmit", "watch": "yarn build:ts --watch" From bc9cbed869f170ea0942597c844fb25416a769f0 Mon Sep 17 00:00:00 2001 From: Andy Brown Date: Tue, 19 Nov 2019 14:02:19 -0800 Subject: [PATCH 06/30] use base tsconifg --- .../extensions/obiformeditor/tsconfig.json | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/Composer/packages/extensions/obiformeditor/tsconfig.json b/Composer/packages/extensions/obiformeditor/tsconfig.json index d6f621d54c..8eab2df086 100644 --- a/Composer/packages/extensions/obiformeditor/tsconfig.json +++ b/Composer/packages/extensions/obiformeditor/tsconfig.json @@ -1,20 +1,8 @@ { + "extends": "../../../tsconfig.base.json", "compilerOptions": { "outDir": "./lib/", - "noImplicitAny": false, "module": "esnext", - "target": "es5", - "jsx": "react", - "sourceMap": true, - "moduleResolution": "node", - "esModuleInterop": true, - "strict": true, - "resolveJsonModule": true, - "noUnusedLocals": true, - "allowJs": false }, - "include": ["./src/**/*", "./__tests__/**/*"], - "exclude": [ - "node_modules" - ], + "include": ["./src/**/*", "./__tests__/**/*"] } From ed25d993a387381b54a8a2ac9298f4771fc3d1f3 Mon Sep 17 00:00:00 2001 From: Andy Brown Date: Tue, 19 Nov 2019 14:19:00 -0800 Subject: [PATCH 07/30] fix lint errors and TS errors --- Composer/packages/client/src/ShellApi.ts | 13 +---- .../ProjectTree/TriggerCreationModal.tsx | 4 -- .../src/extension-container/EditorMap.ts | 2 +- .../ExtensionContainer.tsx | 50 +++++++------------ .../pages/language-generation/code-editor.tsx | 10 ++-- .../client/src/store/action/setting.ts | 2 +- .../src/store/middlewares/undo/history.ts | 5 -- .../obiformeditor/demo/src/index.tsx | 4 -- .../obiformeditor/src/Form/utils.ts | 8 +-- .../obiformeditor/src/FormEditor.tsx | 2 +- .../components/lib/EdgeComponents.test.tsx | 3 ++ .../components/lib/Collapse/CollapseStyles.ts | 3 ++ .../src/components/lib/Collapse/index.tsx | 7 ++- .../src/components/lib/DragScroll.tsx | 3 ++ .../src/components/lib/EdgeComponents.tsx | 3 ++ .../src/components/lib/KeyboardZone.tsx | 3 ++ .../src/components/lib/OffsetContainer.tsx | 3 ++ .../src/components/lib/Panel.tsx | 5 +- .../visual-designer/src/editors/ObiEditor.tsx | 2 +- .../extensions/visual-designer/src/index.tsx | 31 +++++------- .../src/store/NodeRendererContext.ts | 30 +++++++---- .../visual-designer/src/utils/hooks.ts | 2 +- .../lib/code-editor/src/BaseEditor.tsx | 9 ++-- .../lib/code-editor/src/RichEditor.tsx | 2 +- .../packages/lib/shared/src/types/shell.ts | 16 ++++-- Composer/packages/server/src/server.ts | 2 +- 26 files changed, 110 insertions(+), 114 deletions(-) diff --git a/Composer/packages/client/src/ShellApi.ts b/Composer/packages/client/src/ShellApi.ts index fcdfc80b54..391946b4ad 100644 --- a/Composer/packages/client/src/ShellApi.ts +++ b/Composer/packages/client/src/ShellApi.ts @@ -13,7 +13,7 @@ import ApiClient from './messenger/ApiClient'; import { getDialogData, setDialogData, sanitizeDialogData } from './utils'; import { isAbsHosted } from './utils/envUtil'; import { OpenAlertModal, DialogStyle } from './components/Modal'; -import { getFocusPath, navigateTo } from './utils/navigation'; +import { getFocusPath } from './utils/navigation'; // this is the api interface provided by shell to extensions this is the single // place handles all incoming request from extensions, VisualDesigner or @@ -42,16 +42,6 @@ const FileTargetTypes = { LG: 'lg', }; -const shellNavigator = (shellPage: string, opts: { id?: string } = {}) => { - switch (shellPage) { - case 'lu': - navigateTo(`/language-understanding/${opts.id}`); - return; - default: - return; - } -}; - export const ShellApi: React.FC = () => { const { state, actions } = useContext(StoreContext); @@ -332,7 +322,6 @@ export const ShellApi: React.FC = () => { apiClient.registerApi('onFocusSteps', focusSteps); apiClient.registerApi('onSelect', onSelect); apiClient.registerApi('onCopy', onCopy); - apiClient.registerApi('shellNavigate', ({ shellPage, opts }) => shellNavigator(shellPage, opts)); apiClient.registerApi('isExpression', ({ expression }) => isExpression(expression)); apiClient.registerApi('createDialog', () => { return new Promise(resolve => { diff --git a/Composer/packages/client/src/components/ProjectTree/TriggerCreationModal.tsx b/Composer/packages/client/src/components/ProjectTree/TriggerCreationModal.tsx index e052d54eba..6a6988b3cc 100644 --- a/Composer/packages/client/src/components/ProjectTree/TriggerCreationModal.tsx +++ b/Composer/packages/client/src/components/ProjectTree/TriggerCreationModal.tsx @@ -31,10 +31,6 @@ import { StoreContext } from '../../store'; import { styles, dropdownStyles, dialogWindow } from './styles'; -const isValidName = name => { - const nameRegex = /^[a-zA-Z0-9-_.]+$/; - return nameRegex.test(name); -}; const validateForm = (data: TriggerFormData): TriggerFormDataErrors => { const errors: TriggerFormDataErrors = {}; const { $type, specifiedType } = data; diff --git a/Composer/packages/client/src/extension-container/EditorMap.ts b/Composer/packages/client/src/extension-container/EditorMap.ts index 819c5fa2e0..325ff50a72 100644 --- a/Composer/packages/client/src/extension-container/EditorMap.ts +++ b/Composer/packages/client/src/extension-container/EditorMap.ts @@ -5,7 +5,7 @@ import FormEditor from '@bfc/extensions/obiformeditor'; import VisualDesigner from '@bfc/extensions/visual-designer'; -const getEditor = (): VisualDesigner | typeof FormEditor | null => { +const getEditor = (): typeof VisualDesigner | typeof FormEditor | null => { // i'm now more towarding pick editor based on name, not data // because we want shell to totally control file read/save // which means each editor cann't be differiante by data diff --git a/Composer/packages/client/src/extension-container/ExtensionContainer.tsx b/Composer/packages/client/src/extension-container/ExtensionContainer.tsx index 7ac8814c49..8603f6b565 100644 --- a/Composer/packages/client/src/extension-container/ExtensionContainer.tsx +++ b/Composer/packages/client/src/extension-container/ExtensionContainer.tsx @@ -3,7 +3,7 @@ import React, { useState, useEffect } from 'react'; import { initializeIcons } from '@uifabric/icons'; -import { LuFile, ShellData } from '@bfc/shared'; +import { ShellData, ShellApi } from '@bfc/shared'; import ApiClient from '../messenger/ApiClient'; @@ -29,8 +29,8 @@ const apiClient = new ApiClient(); const subEditorCallbacks = {}; -const shellApi = { - getState: (): Promise => { +const shellApi: ShellApi = { + getState: () => { return apiClient.apiCall('getState', {}); }, @@ -38,71 +38,59 @@ const shellApi = { return apiClient.apiCall('saveData', { newData, updatePath }); }, - navTo: (path: string, rest) => { + navTo: (path, rest) => { return apiClient.apiCall('navTo', { path, rest }); }, - navDown: (subPath: string) => { - return apiClient.apiCall('navDown', { subPath: subPath }); - }, - - focusTo: (subPath: string) => { - return apiClient.apiCall('focusTo', { subPath: subPath }); - }, - - onFocusEvent: (subPath: string) => { + onFocusEvent: subPath => { return apiClient.apiCall('onFocusEvent', { subPath }); }, - onFocusSteps: (subPaths: string[], fragment?: string) => { + onFocusSteps: (subPaths, fragment) => { return apiClient.apiCall('onFocusSteps', { subPaths, fragment }); }, - onSelect: (ids: string[]) => { + onSelect: ids => { return apiClient.apiCall('onSelect', ids); }, - onCopy: (actions: any[]) => { + onCopy: actions => { return apiClient.apiCall('onCopy', actions); }, - shellNavigate: (shellPage, opts = {}) => { - return apiClient.apiCall('shellNavigate', { shellPage, opts }); - }, - - createLuFile: (id: string) => { + createLuFile: id => { return apiClient.apiCall('createLuFile', { id }); }, - updateLuFile: (luFile: LuFile) => { + updateLuFile: luFile => { return apiClient.apiCall('updateLuFile', luFile); }, - updateLgFile: (id: string, content: string) => { + updateLgFile: (id, content) => { return apiClient.apiCall('updateLgFile', { id, content }); }, - getLgTemplates: (id: string) => { + getLgTemplates: id => { return apiClient.apiCall('getLgTemplates', { id }); }, - createLgTemplate: (id: string, template: string, position?: number) => { + createLgTemplate: (id, template, position) => { return apiClient.apiCall('createLgTemplate', { id, template, position }); }, - removeLgTemplate: (id: string, templateName: string) => { + removeLgTemplate: (id, templateName) => { return apiClient.apiCall('removeLgTemplate', { id, templateName }); }, - removeLgTemplates: (id: string, templateNames: string[]) => { + removeLgTemplates: (id, templateNames) => { return apiClient.apiCall('removeLgTemplates', { id, templateNames }); }, - copyLgTemplate: (id: string, fromTemplateName: string, toTemplateName: string) => { + copyLgTemplate: (id, fromTemplateName, toTemplateName) => { return apiClient.apiCall('copyLgTemplate', { id, fromTemplateName, toTemplateName }); }, - updateLgTemplate: (id: string, templateName: string, template: string) => { + updateLgTemplate: (id, templateName, template) => { return apiClient.apiCall('updateLgTemplate', { id, templateName, @@ -114,7 +102,7 @@ const shellApi = { return apiClient.apiCall('createDialog'); }, - validateExpression: (expression: string) => { + validateExpression: expression => { return apiClient.apiCall('isExpression', { expression }); }, @@ -126,7 +114,7 @@ const shellApi = { return apiClient.apiCall('redo'); }, - addCoachMarkRef: (target: any) => { + addCoachMarkRef: target => { return apiClient.apiCall('addCoachMarkPosition', target); }, }; diff --git a/Composer/packages/client/src/pages/language-generation/code-editor.tsx b/Composer/packages/client/src/pages/language-generation/code-editor.tsx index 075e01b43d..247e26a2a7 100644 --- a/Composer/packages/client/src/pages/language-generation/code-editor.tsx +++ b/Composer/packages/client/src/pages/language-generation/code-editor.tsx @@ -7,17 +7,17 @@ import { LgEditor } from '@bfc/code-editor'; import get from 'lodash/get'; import debounce from 'lodash/debounce'; import isEmpty from 'lodash/isEmpty'; -import { CodeRange } from '@bfc/shared'; +import { CodeRange, LgFile } from '@bfc/shared'; import * as lgUtil from '../../utils/lgUtil'; interface CodeEditorProps { - file: object; + file: LgFile; onChange: (value: string) => void; - codeRange: Partial; + codeRange?: Partial | null; } -export default function CodeEditor(props) { +export default function CodeEditor(props: CodeEditorProps) { const { file, codeRange } = props; const onChange = debounce(props.onChange, 500); const [diagnostics, setDiagnostics] = useState(get(file, 'diagnostics', [])); @@ -53,7 +53,7 @@ export default function CodeEditor(props) { lineDecorationsWidth: undefined, lineNumbersMinChars: false, }} - codeRange={codeRange} + codeRange={codeRange || -1} errorMsg={errorMsg} value={content} onChange={_onChange} diff --git a/Composer/packages/client/src/store/action/setting.ts b/Composer/packages/client/src/store/action/setting.ts index e4d17f681e..8dd79ac515 100644 --- a/Composer/packages/client/src/store/action/setting.ts +++ b/Composer/packages/client/src/store/action/setting.ts @@ -50,7 +50,7 @@ export const setDialogSettingsSlot = async ({ dispatch }, editing: boolean, slot const url = `/projects/opened/settings${suffix}${query}`; try { - const response = await httpClient.get(`/projects/opened/settings${suffix}`); + const response = await httpClient.get(url); const settings = response.data; dispatch({ type: ActionTypes.GET_ENV_SETTING, diff --git a/Composer/packages/client/src/store/middlewares/undo/history.ts b/Composer/packages/client/src/store/middlewares/undo/history.ts index e2024dc17a..2f698078f9 100644 --- a/Composer/packages/client/src/store/middlewares/undo/history.ts +++ b/Composer/packages/client/src/store/middlewares/undo/history.ts @@ -16,7 +16,6 @@ class UndoHistory { private stacks: { [key: string]: UndoStack } = {}; private history: History[] = []; private pointer = -1; - private _limit = 5; public createStack(undo: ActionCreator, redo: ActionCreator) { const stack = new UndoStack(undo, redo); @@ -64,10 +63,6 @@ class UndoHistory { }); } - public set limit(limit: number) { - this._limit = limit; - } - canUndo = () => this.pointer > -1; canRedo = () => this.pointer < this.history.length - 1; } diff --git a/Composer/packages/extensions/obiformeditor/demo/src/index.tsx b/Composer/packages/extensions/obiformeditor/demo/src/index.tsx index 0b5257ce8c..8dee3657fe 100644 --- a/Composer/packages/extensions/obiformeditor/demo/src/index.tsx +++ b/Composer/packages/extensions/obiformeditor/demo/src/index.tsx @@ -148,12 +148,8 @@ function getDefaultMemory() { const mockShellApi = [ 'getState', 'getData', - 'getDialogs', 'saveData', 'navTo', - 'navDown', - 'focusTo', - 'shellNavigate', 'updateLuFile', 'updateLgFile', 'createLuFile', diff --git a/Composer/packages/extensions/obiformeditor/src/Form/utils.ts b/Composer/packages/extensions/obiformeditor/src/Form/utils.ts index 0eb0d6677d..334fd2e522 100644 --- a/Composer/packages/extensions/obiformeditor/src/Form/utils.ts +++ b/Composer/packages/extensions/obiformeditor/src/Form/utils.ts @@ -114,7 +114,9 @@ export function insertAt(arr: T[], item: T, idx: number): T[] { return newArr; } -function getOptions(memory: FormMemory, scope: MemoryScope): IDropdownOption[] { +function getOptions(memory: FormMemory | undefined, scope: MemoryScope): IDropdownOption[] { + if (!memory || !memory[scope]) return []; + const options: IDropdownOption[] = []; for (const key in memory[scope]) { options.push({ key: `${scope}.${key}`, text: `${memory[scope][key]}` }); @@ -122,7 +124,7 @@ function getOptions(memory: FormMemory, scope: MemoryScope): IDropdownOption[] { return options; } -function buildScope(memory: FormMemory, scope: MemoryScope): IDropdownOption[] { +function buildScope(memory: FormMemory | undefined, scope: MemoryScope): IDropdownOption[] { if (!memory || !memory[scope]) return []; const options = getOptions(memory, scope); @@ -136,7 +138,7 @@ function buildScope(memory: FormMemory, scope: MemoryScope): IDropdownOption[] { ]; } -export function getMemoryOptions(memory: FormMemory): IDropdownOption[] { +export function getMemoryOptions(memory?: FormMemory): IDropdownOption[] { return [ ...buildScope(memory, MemoryScope.user), ...buildScope(memory, MemoryScope.conversation), diff --git a/Composer/packages/extensions/obiformeditor/src/FormEditor.tsx b/Composer/packages/extensions/obiformeditor/src/FormEditor.tsx index 789788cedb..30c1a2642b 100644 --- a/Composer/packages/extensions/obiformeditor/src/FormEditor.tsx +++ b/Composer/packages/extensions/obiformeditor/src/FormEditor.tsx @@ -19,7 +19,7 @@ const getType = (data: FormData): string | undefined => { }; export interface FormEditorProps extends ShellData { - memory: FormMemory; + memory?: FormMemory; onBlur?: () => void; onChange: (newData: object, updatePath?: string) => void; shellApi: ShellApi; diff --git a/Composer/packages/extensions/visual-designer/__tests__/components/lib/EdgeComponents.test.tsx b/Composer/packages/extensions/visual-designer/__tests__/components/lib/EdgeComponents.test.tsx index 37981d1570..b17af1b688 100644 --- a/Composer/packages/extensions/visual-designer/__tests__/components/lib/EdgeComponents.test.tsx +++ b/Composer/packages/extensions/visual-designer/__tests__/components/lib/EdgeComponents.test.tsx @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + import React from 'react'; import { render } from 'react-testing-library'; diff --git a/Composer/packages/extensions/visual-designer/src/components/lib/Collapse/CollapseStyles.ts b/Composer/packages/extensions/visual-designer/src/components/lib/Collapse/CollapseStyles.ts index 0ce784cd7f..6a1cfc1de0 100644 --- a/Composer/packages/extensions/visual-designer/src/components/lib/Collapse/CollapseStyles.ts +++ b/Composer/packages/extensions/visual-designer/src/components/lib/Collapse/CollapseStyles.ts @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + import { css } from '@emotion/core'; export const collapseContainer = css` diff --git a/Composer/packages/extensions/visual-designer/src/components/lib/Collapse/index.tsx b/Composer/packages/extensions/visual-designer/src/components/lib/Collapse/index.tsx index bdf5ff0d86..e15f07be03 100644 --- a/Composer/packages/extensions/visual-designer/src/components/lib/Collapse/index.tsx +++ b/Composer/packages/extensions/visual-designer/src/components/lib/Collapse/index.tsx @@ -1,7 +1,10 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + /** @jsx jsx */ -import { jsx, css } from '@emotion/core'; +import { jsx } from '@emotion/core'; import { useState } from 'react'; -import { IconButton } from 'office-ui-fabric-react'; +import { IconButton } from 'office-ui-fabric-react/lib/Button'; import { collapseContainer, diff --git a/Composer/packages/extensions/visual-designer/src/components/lib/DragScroll.tsx b/Composer/packages/extensions/visual-designer/src/components/lib/DragScroll.tsx index d25dc77ab2..793310e320 100644 --- a/Composer/packages/extensions/visual-designer/src/components/lib/DragScroll.tsx +++ b/Composer/packages/extensions/visual-designer/src/components/lib/DragScroll.tsx @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + /** @jsx jsx */ import { jsx } from '@emotion/core'; import { useRef } from 'react'; diff --git a/Composer/packages/extensions/visual-designer/src/components/lib/EdgeComponents.tsx b/Composer/packages/extensions/visual-designer/src/components/lib/EdgeComponents.tsx index 934c3ce60d..d6dc2431bc 100644 --- a/Composer/packages/extensions/visual-designer/src/components/lib/EdgeComponents.tsx +++ b/Composer/packages/extensions/visual-designer/src/components/lib/EdgeComponents.tsx @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + /** @jsx jsx */ import { jsx } from '@emotion/core'; import { Fragment } from 'react'; diff --git a/Composer/packages/extensions/visual-designer/src/components/lib/KeyboardZone.tsx b/Composer/packages/extensions/visual-designer/src/components/lib/KeyboardZone.tsx index a567728cb6..eef1a4e25a 100644 --- a/Composer/packages/extensions/visual-designer/src/components/lib/KeyboardZone.tsx +++ b/Composer/packages/extensions/visual-designer/src/components/lib/KeyboardZone.tsx @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + /** @jsx jsx */ import { jsx } from '@emotion/core'; import { FC } from 'react'; diff --git a/Composer/packages/extensions/visual-designer/src/components/lib/OffsetContainer.tsx b/Composer/packages/extensions/visual-designer/src/components/lib/OffsetContainer.tsx index 6854f97deb..fd06d825b0 100644 --- a/Composer/packages/extensions/visual-designer/src/components/lib/OffsetContainer.tsx +++ b/Composer/packages/extensions/visual-designer/src/components/lib/OffsetContainer.tsx @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + /** @jsx jsx */ import { jsx } from '@emotion/core'; // eslint-disable-next-line no-unused-vars diff --git a/Composer/packages/extensions/visual-designer/src/components/lib/Panel.tsx b/Composer/packages/extensions/visual-designer/src/components/lib/Panel.tsx index 5b4f8a3001..1709584a14 100644 --- a/Composer/packages/extensions/visual-designer/src/components/lib/Panel.tsx +++ b/Composer/packages/extensions/visual-designer/src/components/lib/Panel.tsx @@ -1,7 +1,10 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + /** @jsx jsx */ import { jsx } from '@emotion/core'; import { useState, useLayoutEffect } from 'react'; -import { IconButton } from 'office-ui-fabric-react'; +import { IconButton } from 'office-ui-fabric-react/lib/Button'; import { PanelSize } from '../../constants/ElementSizes'; diff --git a/Composer/packages/extensions/visual-designer/src/editors/ObiEditor.tsx b/Composer/packages/extensions/visual-designer/src/editors/ObiEditor.tsx index d5dad318a0..e71ab326cf 100644 --- a/Composer/packages/extensions/visual-designer/src/editors/ObiEditor.tsx +++ b/Composer/packages/extensions/visual-designer/src/editors/ObiEditor.tsx @@ -267,7 +267,7 @@ export const ObiEditor: FC = ({ } break; case KeyboardPrimaryTypes.Cursor: { - const currentSelectedId = selectionContext.selectedIds[0] || focusedId; + const currentSelectedId = selectionContext.selectedIds[0] || focusedId || ''; const { selected, focused, tab } = moveCursor(selectableElements, currentSelectedId, command); setSelectionContext({ getNodeIndex: selectionContext.getNodeIndex, diff --git a/Composer/packages/extensions/visual-designer/src/index.tsx b/Composer/packages/extensions/visual-designer/src/index.tsx index 4b1a47ba44..c54693165d 100644 --- a/Composer/packages/extensions/visual-designer/src/index.tsx +++ b/Composer/packages/extensions/visual-designer/src/index.tsx @@ -7,6 +7,7 @@ import createCache from '@emotion/cache'; import React, { useRef } from 'react'; import isEqual from 'lodash/isEqual'; import formatMessage from 'format-message'; +import { ShellData, ShellApi } from '@bfc/shared'; import { ObiEditor } from './editors/ObiEditor'; import { NodeRendererContext } from './store/NodeRendererContext'; @@ -88,7 +89,7 @@ const VisualDesigner: React.FC = ({ focusedEvent={focusedEvent} onFocusEvent={onFocusEvent} onClipboardChange={onCopy} - onOpen={(x, rest) => navTo(x, rest)} + onOpen={x => navTo(x)} onChange={x => saveData(x)} onSelect={onSelect} undo={undo} @@ -102,32 +103,24 @@ const VisualDesigner: React.FC = ({ ); }; -interface VisualDesignerProps { - data: object; - dialogId: string; - focusedEvent: string; - focusedActions: string[]; - focusedSteps: string[]; - focusedTab: string; - clipboardActions: any[]; - shellApi: any; - hosted: boolean; - currentDialog: { id: string; displayName: string; isRoot: boolean }; +interface VisualDesignerProps extends ShellData { + onChange: (newData: object, updatePath?: string) => void; + shellApi: ShellApi; } VisualDesigner.defaultProps = { dialogId: '', focusedEvent: '', focusedSteps: [], - data: {}, - shellApi: { + data: { $type: '' }, + shellApi: ({ navTo: () => {}, - onFocusEvent: (_eventId: string) => {}, - onFocusSteps: (_stepIds: string[], _fragment?: string) => {}, - onSelect: (_ids: string[]) => {}, + onFocusEvent: () => {}, + onFocusSteps: () => {}, + onSelect: () => {}, saveData: () => {}, - addCoachMarkRef: (_: any) => {}, - }, + addCoachMarkRef: () => {}, + } as unknown) as ShellApi, }; export default VisualDesigner; diff --git a/Composer/packages/extensions/visual-designer/src/store/NodeRendererContext.ts b/Composer/packages/extensions/visual-designer/src/store/NodeRendererContext.ts index 535ed58533..36aa1abd0f 100644 --- a/Composer/packages/extensions/visual-designer/src/store/NodeRendererContext.ts +++ b/Composer/packages/extensions/visual-designer/src/store/NodeRendererContext.ts @@ -2,20 +2,30 @@ // Licensed under the MIT License. import React from 'react'; +import { ShellApi } from '@bfc/shared'; -interface LgTemplate { - Name: string; - Body: string; +type ShellApiFuncs = + | 'getLgTemplates' + | 'copyLgTemplate' + | 'removeLgTemplate' + | 'removeLgTemplates' + | 'updateLgTemplate'; + +interface NodeRendererContextValue extends Pick { + focusedId?: string; + focusedEvent?: string; + focusedTab?: string; + clipboardActions: any[]; } -export const NodeRendererContext = React.createContext({ +export const NodeRendererContext = React.createContext({ focusedId: '', focusedEvent: '', focusedTab: '', - clipboardActions: [] as any[], - getLgTemplates: (_id: string, _templateName: string) => Promise.resolve([] as LgTemplate[]), - copyLgTemplate: (_id: string, _fromTemplateName: string, _toTemplateName: string) => Promise.resolve(''), - removeLgTemplate: (_id: string, _templateName: string) => Promise.resolve(), - removeLgTemplates: (_id: string, _templateNames: string[]) => Promise.resolve(), - updateLgTemplate: (_id: string, _templateName: string, _template: string) => Promise.resolve('' as string), + clipboardActions: [], + getLgTemplates: () => Promise.resolve([]), + copyLgTemplate: () => Promise.resolve(''), + removeLgTemplate: () => Promise.resolve(), + removeLgTemplates: () => Promise.resolve(), + updateLgTemplate: () => Promise.resolve(), }); diff --git a/Composer/packages/extensions/visual-designer/src/utils/hooks.ts b/Composer/packages/extensions/visual-designer/src/utils/hooks.ts index 8e1a401c49..eddd11f52d 100644 --- a/Composer/packages/extensions/visual-designer/src/utils/hooks.ts +++ b/Composer/packages/extensions/visual-designer/src/utils/hooks.ts @@ -37,7 +37,7 @@ export const useLgTemplate = (str?: string, dialogId?: string) => { setTemplateText(str || ''); } - const templates = getLgTemplates ? await getLgTemplates('common', `${templateId}`) : []; + const templates = getLgTemplates ? await getLgTemplates('common') : []; const [template] = templates.filter(template => { return template.Name === templateId; }); diff --git a/Composer/packages/lib/code-editor/src/BaseEditor.tsx b/Composer/packages/lib/code-editor/src/BaseEditor.tsx index 8013661b26..7d5cb02801 100644 --- a/Composer/packages/lib/code-editor/src/BaseEditor.tsx +++ b/Composer/packages/lib/code-editor/src/BaseEditor.tsx @@ -32,7 +32,7 @@ export interface BaseEditorProps extends Omit { onChange: (newValue: string) => void; placeholder?: string; value?: string; - codeRange?: ICodeRange | -1; + codeRange?: Partial | -1; } export function BaseEditor(props: BaseEditorProps) { @@ -42,8 +42,6 @@ export function BaseEditor(props: BaseEditorProps) { options.folding = false; } const containerRef = useRef(null); - // editor.setHiddenAreas is an internal api, not included in , so here mark it - const [editor, setEditor] = useState(null); const [rect, setRect] = useState({ height: 0, width: 0 }); const updateRect = throttle(() => { @@ -93,10 +91,10 @@ export function BaseEditor(props: BaseEditorProps) { const hiddenRanges = [ { startLineNumber: 1, - endLineNumber: codeRange.startLineNumber - 1, + endLineNumber: (codeRange.startLineNumber || 1) - 1, }, { - startLineNumber: codeRange.endLineNumber + 1, + startLineNumber: (codeRange.endLineNumber || 1) + 1, endLineNumber: lineCount, }, ]; @@ -117,7 +115,6 @@ export function BaseEditor(props: BaseEditorProps) { if (typeof props.editorDidMount === 'function') { props.editorDidMount(editor, monaco); } - setEditor(editor); updateEditorCodeRangeUI(editor); }; diff --git a/Composer/packages/lib/code-editor/src/RichEditor.tsx b/Composer/packages/lib/code-editor/src/RichEditor.tsx index b532812248..a882ff41f4 100644 --- a/Composer/packages/lib/code-editor/src/RichEditor.tsx +++ b/Composer/packages/lib/code-editor/src/RichEditor.tsx @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import React, { Fragment, useMemo, useState } from 'react'; +import React, { Fragment, useState } from 'react'; import { SharedColors, NeutralColors } from '@uifabric/fluent-theme'; import formatMessage from 'format-message'; diff --git a/Composer/packages/lib/shared/src/types/shell.ts b/Composer/packages/lib/shared/src/types/shell.ts index a694b24622..10087b4165 100644 --- a/Composer/packages/lib/shared/src/types/shell.ts +++ b/Composer/packages/lib/shared/src/types/shell.ts @@ -117,19 +117,25 @@ export interface ShellData { export interface ShellApi { getState: () => Promise; - getDialogs: () => Promise; - saveData: (newData: T, updatePath: string) => Promise; - navTo: (path: string) => Promise; + saveData: (newData: T, updatePath?: string) => Promise; + navTo: (path: string, rest?: any) => Promise; onFocusSteps: (stepIds: string[], focusedTab?: string) => Promise; onFocusEvent: (eventId: string) => Promise; + onSelect: (ids: string[]) => Promise; createLuFile: (id: string) => Promise; - updateLuFile: (id: string, content: string) => Promise; + updateLuFile: (luFile: { id: string; content: string }) => Promise; updateLgFile: (id: string, content: string) => Promise; getLgTemplates: (id: string) => Promise; copyLgTemplate: (id: string, fromTemplateName: string, toTemplateName?: string) => Promise; - createLgTemplate: (id: string, template: LgTemplate, position: number) => Promise; + createLgTemplate: (id: string, template: Partial, position: number) => Promise; updateLgTemplate: (id: string, templateName: string, templateStr: string) => Promise; removeLgTemplate: (id: string, templateName: string) => Promise; + removeLgTemplates: (id: string, templateNames: string[]) => Promise; createDialog: () => Promise; validateExpression: (expression?: string) => Promise; + // TODO: fix these types + addCoachMarkRef: any; + onCopy: any; + undo: any; + redo: any; } diff --git a/Composer/packages/server/src/server.ts b/Composer/packages/server/src/server.ts index 58d74569c9..0114f67a97 100644 --- a/Composer/packages/server/src/server.ts +++ b/Composer/packages/server/src/server.ts @@ -56,7 +56,7 @@ app.all('*', function(req: Request, res: Response, next: NextFunction) { next(); }); -app.use(`${BASEURL}/`, express.static(path.join(__dirname, './public'))); +app.use(`${BASEURL}/`, express.static(path.join(__dirname, './public'), { immutable: true, maxAge: 31536000 })); app.use(morgan('dev')); app.use(bodyParser.json({ limit: '50mb' })); From 6a00450dbb0edc1af595e02d15271a800a8ae719 Mon Sep 17 00:00:00 2001 From: Andy Brown Date: Tue, 19 Nov 2019 14:41:19 -0800 Subject: [PATCH 08/30] set up integration tests for typescript --- .../cypress/integration/Breadcrumb.spec.js | 75 ------------ .../cypress/integration/Breadcrumb.spec.ts | 68 +++++++++++ .../cypress/integration/CreateNewBot.spec.js | 44 ------- .../cypress/integration/CreateNewBot.spec.ts | 41 +++++++ .../cypress/integration/LuisDeploy.spec.js | 14 +-- .../cypress/integration/NewDialog.spec.js | 4 +- .../cypress/integration/Onboarding.spec.js | 2 +- .../cypress/integration/RemoveDialog.spec.js | 12 +- Composer/cypress/integration/SaveAs.spec.js | 6 +- .../integration/SwitchCondition.spec.js | 42 +++---- Composer/cypress/integration/ToDoBot.spec.js | 20 ++-- .../integration/VisualDesigner.spec.js | 9 +- Composer/cypress/integration/homePage.spec.js | 14 +-- .../cypress/plugins/cy-ts-preprocessor.js | 31 +++++ Composer/cypress/plugins/index.js | 3 +- Composer/cypress/support/commands.ts | 108 ++++++++++++++++++ Composer/cypress/support/index.d.ts | 19 +++ 17 files changed, 332 insertions(+), 180 deletions(-) delete mode 100644 Composer/cypress/integration/Breadcrumb.spec.js create mode 100644 Composer/cypress/integration/Breadcrumb.spec.ts delete mode 100644 Composer/cypress/integration/CreateNewBot.spec.js create mode 100644 Composer/cypress/integration/CreateNewBot.spec.ts create mode 100644 Composer/cypress/plugins/cy-ts-preprocessor.js create mode 100644 Composer/cypress/support/commands.ts create mode 100644 Composer/cypress/support/index.d.ts diff --git a/Composer/cypress/integration/Breadcrumb.spec.js b/Composer/cypress/integration/Breadcrumb.spec.js deleted file mode 100644 index 3a00e21e28..0000000000 --- a/Composer/cypress/integration/Breadcrumb.spec.js +++ /dev/null @@ -1,75 +0,0 @@ -/// - -context('breadcrumb', () => { - - beforeEach(() => { - cy.visit(Cypress.env('COMPOSER_URL')); - cy.createBot('TodoSample'); - cy.wait(100); - - // Return to Main.dialog - cy.get('[data-testid="ProjectTree"]').within(() => { - cy.wait(1000); - cy.getByText('__TestTodoSample.Main').click(); - cy.wait(1000); - }); - }); - - it('can show dialog name in breadcrumb', () => { - // Should path = main dialog at first render - cy.getByTestId('Breadcrumb') - .invoke('text') - .should('contain', '__TestTodoSample.Main'); - - // Click on AddToDo dialog - cy.get('[data-testid="ProjectTree"]').within(() => { - cy.getByText('AddToDo').click(); - }); - cy.getByTestId('Breadcrumb') - .invoke('text') - .should('contain', 'AddToDo'); - cy.wait(1000); - // Return to Main.dialog - cy.get('[data-testid="ProjectTree"]').within(() => { - cy.getByText('__TestTodoSample.Main').click(); - cy.wait(100); - }); - - cy.getByTestId('Breadcrumb') - .invoke('text') - .should('contain', '__TestTodoSample'); - }); - - it('can show event name in breadcrumb', () => { - cy.get('[data-testid="ProjectTree"]').within(() => { - cy.getByText('AddToDo').click(); - cy.wait(100); - cy.getByText('Dialog started (BeginDialog)').click(); - cy.wait(100); - }); - - cy.getByTestId('Breadcrumb') - .invoke('text') - .should('match', /AddToDo.*Dialog started (BeginDialog)*/); - }); - - it('can show action name in breadcrumb', () => { - cy.wait(100); - cy.get('[data-testid="ProjectTree"]').within(() => { - cy.getByText('Greeting (ConversationUpdate)').click(); - cy.wait(500); - }); - - // Click on an action - cy.withinEditor('VisualEditor', () => { - cy.getByTestId('RuleEditor').within(() => { - cy.getByText('Send a response').click(); - cy.wait(500); - }); - }); - - cy.getByTestId('Breadcrumb') - .invoke('text') - .should('match', /__TestTodoSample.Main.*Greeting \(ConversationUpdate\).*Send a response/); - }); -}); diff --git a/Composer/cypress/integration/Breadcrumb.spec.ts b/Composer/cypress/integration/Breadcrumb.spec.ts new file mode 100644 index 0000000000..5e6d0af7b2 --- /dev/null +++ b/Composer/cypress/integration/Breadcrumb.spec.ts @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +context('breadcrumb', () => { + beforeEach(() => { + cy.visit(Cypress.env('COMPOSER_URL')); + cy.createBot('TodoSample'); + + // Return to Main.dialog + cy.findByTestId('ProjectTree').within(() => { + cy.findByText('__TestTodoSample.Main').click(); + }); + }); + + function hasBreadcrumbItems(cy: Cypress.cy, items: (string | RegExp)[]) { + cy.findByTestId('Breadcrumb') + .get('li') + .should($li => { + items.forEach((item, idx) => { + expect($li.eq(idx)).to.contain(item); + }); + }); + } + + it('can show dialog name in breadcrumb', () => { + // Should path = main dialog at first render + hasBreadcrumbItems(cy, ['__TestTodoSample.Main']); + + // Click on AddToDo dialog + cy.findByTestId('ProjectTree').within(() => { + cy.findByText('AddToDo').click(); + }); + hasBreadcrumbItems(cy, ['AddToDo']); + + // Return to Main.dialog + cy.findByTestId('ProjectTree').within(() => { + cy.findByText('__TestTodoSample.Main').click(); + }); + + hasBreadcrumbItems(cy, ['__TestTodoSample']); + }); + + it('can show event name in breadcrumb', () => { + cy.findByTestId('ProjectTree').within(() => { + cy.findByText('AddToDo').click(); + cy.findByText('Dialog started (BeginDialog)').click(); + cy.wait(100); + }); + + hasBreadcrumbItems(cy, ['AddToDo', 'Dialog started (BeginDialog)']); + }); + + it('can show action name in breadcrumb', () => { + cy.findByTestId('ProjectTree').within(() => { + cy.findByText('Greeting (ConversationUpdate)').click(); + cy.wait(100); + }); + + // Click on an action + cy.withinEditor('VisualEditor', () => { + cy.findByTestId('RuleEditor').within(() => { + cy.findByText('Send a response').click(); + }); + }); + + hasBreadcrumbItems(cy, ['__TestTodoSample.Main', 'Greeting (ConversationUpdate)', 'Send a response']); + }); +}); diff --git a/Composer/cypress/integration/CreateNewBot.spec.js b/Composer/cypress/integration/CreateNewBot.spec.js deleted file mode 100644 index dff154be2a..0000000000 --- a/Composer/cypress/integration/CreateNewBot.spec.js +++ /dev/null @@ -1,44 +0,0 @@ -/// - -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('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(() => { - cy.getByText('__TestNewProject.Main').should('exist'); - }); - }); - - it('can create a bot from the ToDo template', () => { - cy.get('input[data-testid="Create from template"]').click({ force: true }); - cy.wait(100); - cy.get('[data-testid="TodoSample"]').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(() => { - cy.getByText('__TestNewProject.Main').should('exist'); - cy.getByText('AddToDo').should('exist'); - cy.getByText('ClearToDos').should('exist'); - cy.getByText('DeleteToDo').should('exist'); - cy.getByText('ShowToDos').should('exist'); - }); - }); -}); diff --git a/Composer/cypress/integration/CreateNewBot.spec.ts b/Composer/cypress/integration/CreateNewBot.spec.ts new file mode 100644 index 0000000000..e10bf7e534 --- /dev/null +++ b/Composer/cypress/integration/CreateNewBot.spec.ts @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +context('Creating a new bot', () => { + beforeEach(() => { + cy.visit(Cypress.env('COMPOSER_URL')); + cy.wait(1000); + cy.findByTestId('LeftNav-CommandBarButtonHome').click(); + cy.findByTestId('homePage-ToolBar-New').within(() => { + cy.findByText('New').click(); + }); + cy.wait(1000); + }); + + it('can create a new bot', () => { + cy.findByTestId('Create from scratch').click(); + cy.findByTestId('NextStepButton').click(); + cy.findByTestId('NewDialogName').type('__TestNewProject'); + cy.findByTestId('NewDialogName').type('{enter}'); + cy.wait(100); + cy.findByTestId('ProjectTree').within(() => { + cy.findByText('__TestNewProject.Main').should('exist'); + }); + }); + + it('can create a bot from the ToDo template', () => { + cy.findByTestId('Create from template').click(); + cy.findByTestId('TodoSample').click(); + cy.findByTestId('NextStepButton').click(); + cy.findByTestId('NewDialogName').type('__TestNewProject'); + cy.findByTestId('NewDialogName').type('{enter}'); + cy.wait(100); + cy.findByTestId('ProjectTree').within(() => { + cy.findByText('__TestNewProject.Main').should('exist'); + cy.findByText('AddToDo').should('exist'); + cy.findByText('ClearToDos').should('exist'); + cy.findByText('DeleteToDo').should('exist'); + cy.findByText('ShowToDos').should('exist'); + }); + }); +}); diff --git a/Composer/cypress/integration/LuisDeploy.spec.js b/Composer/cypress/integration/LuisDeploy.spec.js index d6c3172d06..59fc644724 100644 --- a/Composer/cypress/integration/LuisDeploy.spec.js +++ b/Composer/cypress/integration/LuisDeploy.spec.js @@ -19,7 +19,7 @@ context('Luis Deploy', () => { status: 200, response: 'fixture:luPublish/success', }); - cy.getByText('Start Bot').click(); + cy.findByText('Start Bot').click(); cy.wait(5000); // clear its settings before cy.get('[data-testid="ProjectNameInput"]') @@ -33,10 +33,10 @@ context('Luis Deploy', () => { .type('0d4991873f334685a9686d1b48e0ff48'); // wait for the debounce interval of sync settings cy.wait(1000); - cy.getByText('OK').click(); + cy.findByText('OK').click(); cy.wait(1000); - cy.getByText('Restart Bot').should('exist'); - cy.getByText('Test in Emulator').should('exist'); + cy.findByText('Restart Bot').should('exist'); + cy.findByText('Test in Emulator').should('exist'); cy.route({ method: 'POST', @@ -44,11 +44,11 @@ context('Luis Deploy', () => { status: 400, response: 'fixture:luPublish/error', }); - cy.getByText('Restart Bot').click(); + cy.findByText('Restart Bot').click(); cy.wait(1000); - cy.getByText('Try again').click(); + cy.findByText('Try again').click(); cy.wait(1000); cy.get('[data-testid="AuthoringKeyInput"]').type('no-id'); - cy.getByText('OK').click(); + cy.findByText('OK').click(); }); }); diff --git a/Composer/cypress/integration/NewDialog.spec.js b/Composer/cypress/integration/NewDialog.spec.js index dedb0be001..5c17ff969e 100644 --- a/Composer/cypress/integration/NewDialog.spec.js +++ b/Composer/cypress/integration/NewDialog.spec.js @@ -8,11 +8,11 @@ context('Creating a new Dialog', () => { }); it('can create a new dialog from project tree', () => { - cy.getByText('New Dialog ..').click(); + cy.findByText('New Dialog ..').click(); cy.get('input[data-testid="NewDialogName"]').type('__TestNewDialog2'); cy.get('input[data-testid="NewDialogName"]').type('{enter}'); cy.get('[data-testid="ProjectTree"]').within(() => { - cy.getByText('__TestNewDialog2').should('exist'); + cy.findByText('__TestNewDialog2').should('exist'); }); }); }); diff --git a/Composer/cypress/integration/Onboarding.spec.js b/Composer/cypress/integration/Onboarding.spec.js index 595cb0be40..bc7d116014 100644 --- a/Composer/cypress/integration/Onboarding.spec.js +++ b/Composer/cypress/integration/Onboarding.spec.js @@ -5,7 +5,7 @@ context('onboarding', () => { cy.visit(`${Cypress.env('COMPOSER_URL')}/home`, { enableOnboarding: true }); cy.wait(1000); cy.get('[data-testid="homePage-ToolBar-New"]').within(() => { - cy.getByText('New').click(); + cy.findByText('New').click(); }); cy.wait(5000); diff --git a/Composer/cypress/integration/RemoveDialog.spec.js b/Composer/cypress/integration/RemoveDialog.spec.js index 16f8faa26a..d25fce5e87 100644 --- a/Composer/cypress/integration/RemoveDialog.spec.js +++ b/Composer/cypress/integration/RemoveDialog.spec.js @@ -7,20 +7,20 @@ context('RemoveDialog', () => { }); it('can remove dialog', () => { - cy.getByTestId('ProjectTree').within(() => { - cy.getByTestId('DialogTreeItemtriggers[4]').within(() => { - cy.getByTestId('dialogMoreButton') + cy.findByTestId('ProjectTree').within(() => { + cy.findByTestId('DialogTreeItemtriggers[4]').within(() => { + cy.findByTestId('dialogMoreButton') .first() .invoke('attr', 'style', 'visibility: visible') .click(); - }); }); + }); cy.get('.ms-ContextualMenu-linkContent > .ms-ContextualMenu-itemText').within(() => { - cy.getByText('Delete').click(); + cy.findByText('Delete').click(); }); - cy.getByTestId('ProjectTree').within(() => { + cy.findByTestId('ProjectTree').within(() => { cy.get('[title="AddItem"]').should('not.exist'); }); }); diff --git a/Composer/cypress/integration/SaveAs.spec.js b/Composer/cypress/integration/SaveAs.spec.js index bd71d8a748..a18faee533 100644 --- a/Composer/cypress/integration/SaveAs.spec.js +++ b/Composer/cypress/integration/SaveAs.spec.js @@ -8,15 +8,15 @@ context('Saving As', () => { it('can create a new bot from an existing bot', () => { cy.createBot('ToDoBotWithLuisSample'); cy.get('[data-testid="LeftNav-CommandBarButtonHome"]').click(); - cy.getByText('Save as').click(); + cy.findByText('Save as').click(); cy.get('input[data-testid="NewDialogName"]').type('__TestSaveAs'); cy.get('input[data-testid="NewDialogName"]').type('{enter}'); cy.wait(1000); cy.get('[data-testid="ProjectTree"]').within(() => { - cy.getByText('__TestSaveAs.Main').should('exist'); - cy.getByText('ViewCollection').should('exist'); + cy.findByText('__TestSaveAs.Main').should('exist'); + cy.findByText('ViewCollection').should('exist'); }); }); }); diff --git a/Composer/cypress/integration/SwitchCondition.spec.js b/Composer/cypress/integration/SwitchCondition.spec.js index 8a98afc186..f8755ba5de 100644 --- a/Composer/cypress/integration/SwitchCondition.spec.js +++ b/Composer/cypress/integration/SwitchCondition.spec.js @@ -17,20 +17,20 @@ context.skip('SwitchCondition', () => { cy.wait(100); cy.getByText(/UnknownIntent/).click({ force: true }); cy.wait(100); - cy.getByTestId('StepGroupAdd').click({ force: true }); - cy.getByText('Flow').click({ force: true }); - cy.getByText('Branch: Switch').click({ force: true }); - cy.getByTestId('SwitchConditionDiamond').click({ force: true }); + cy.findByTestId('StepGroupAdd').click({ force: true }); + cy.findByText('Flow').click({ force: true }); + cy.findByText('Branch: Switch').click({ force: true }); + cy.findByTestId('SwitchConditionDiamond').click({ force: true }); }); // Add case and add/delete/edit steps cy.withinEditor('FormEditor', () => { // Edit condition - cy.getByLabelText('Condition').type('user.age >= 21'); + cy.findByLabelText('Condition').type('user.age >= 21'); // Add new case - cy.getByText('Add New Case').click({ force: true }); - cy.getByLabelText('Value') + cy.findByText('Add New Case').click({ force: true }); + cy.findByLabelText('Value') .type('Case1') .type('{enter}'); @@ -39,33 +39,33 @@ context.skip('SwitchCondition', () => { // Send activity // Use { force: true } can disable error checking like dom not visible or width and height '0 * 0' pixels. // So if a button is in a popup window, using { force: true } to button click can make the tests more stable. - cy.getByText('Add New Action for Case1').click({ force: true }); - cy.getByText('Send Messages').click({ force: true }); - cy.getByText('Send an Activity').click({ force: true }); + cy.findByText('Add New Action for Case1').click({ force: true }); + cy.findByText('Send Messages').click({ force: true }); + cy.findByText('Send an Activity').click({ force: true }); cy.wait(300); }); cy.withinEditor('VisualEditor', () => { - cy.getByText('Branch: Switch').click({ force: true }); + cy.findByText('Branch: Switch').click({ force: true }); }); cy.withinEditor('FormEditor', () => { // Edit array - cy.getByText('Add New Action for Case1').click({ force: true }); - cy.getByText('Memory manipulation').click({ force: true }); - cy.getByText('Edit an Array Property').click({ force: true }); + cy.findByText('Add New Action for Case1').click({ force: true }); + cy.findByText('Memory manipulation').click({ force: true }); + cy.findByText('Edit an Array Property').click({ force: true }); cy.wait(300); }); cy.withinEditor('VisualEditor', () => { - cy.getByText('Branch: Switch').click({ force: true }); + cy.findByText('Branch: Switch').click({ force: true }); }); cy.withinEditor('FormEditor', () => { // Log step - cy.getByText('Add New Action for Case1').click({ force: true }); - cy.getByText('Debugging').click({ force: true }); - cy.getByText('Log to console').click({ force: true }); + cy.findByText('Add New Action for Case1').click({ force: true }); + cy.findByText('Debugging').click({ force: true }); + cy.findByText('Log to console').click({ force: true }); cy.wait(300); }); cy.withinEditor('VisualEditor', () => { - cy.getByText('Branch: Switch').click({ force: true }); + cy.findByText('Branch: Switch').click({ force: true }); }); cy.withinEditor('FormEditor', () => { cy.get('[data-automationid="DetailsRow"]') @@ -112,9 +112,9 @@ context.skip('SwitchCondition', () => { .should('contain.text', 'Send an Activity'); // Add another new case - cy.getByText('Add New Case').click({ force: true }); + cy.findByText('Add New Case').click({ force: true }); cy.wait(100); - cy.getByLabelText('Value') + cy.findByLabelText('Value') .type('Case2') .type('{enter}'); diff --git a/Composer/cypress/integration/ToDoBot.spec.js b/Composer/cypress/integration/ToDoBot.spec.js index 13d349d89d..6c06b6b09b 100644 --- a/Composer/cypress/integration/ToDoBot.spec.js +++ b/Composer/cypress/integration/ToDoBot.spec.js @@ -8,55 +8,55 @@ context('ToDo Bot', () => { it('can open the main dialog', () => { cy.get('[data-testid="ProjectTree"]').within(() => { - cy.getByText('__TestTodoSample.Main').click(); + cy.findByText('__TestTodoSample.Main').click(); cy.wait(100); }); cy.withinEditor('FormEditor', () => { - cy.getByDisplayValue('__TestTodoSample').should('exist'); + cy.findByDisplayValue('__TestTodoSample').should('exist'); }); }); it('can open the AddToDo dialog', () => { cy.get('[data-testid="ProjectTree"]').within(() => { - cy.getByText('AddToDo').click(); + cy.findByText('AddToDo').click(); cy.wait(100); }); cy.withinEditor('FormEditor', () => { - cy.getByDisplayValue('AddToDo').should('exist'); + cy.findByDisplayValue('AddToDo').should('exist'); }); }); it('can open the ClearToDos dialog', () => { cy.get('[data-testid="ProjectTree"]').within(() => { - cy.getByText('ClearToDos').click(); + cy.findByText('ClearToDos').click(); cy.wait(100); }); cy.withinEditor('FormEditor', () => { - cy.getByDisplayValue('ClearToDos').should('exist'); + cy.findByDisplayValue('ClearToDos').should('exist'); }); }); it('can open the DeleteToDo dialog', () => { cy.get('[data-testid="ProjectTree"]').within(() => { - cy.getByText('DeleteToDo').click(); + cy.findByText('DeleteToDo').click(); cy.wait(100); }); cy.withinEditor('FormEditor', () => { - cy.getByDisplayValue('DeleteToDo').should('exist'); + cy.findByDisplayValue('DeleteToDo').should('exist'); }); }); it('can open the ShowToDos dialog', () => { cy.get('[data-testid="ProjectTree"]').within(() => { - cy.getByText('ShowToDos').click(); + cy.findByText('ShowToDos').click(); cy.wait(100); }); cy.withinEditor('FormEditor', () => { - cy.getByDisplayValue('ShowToDos').should('exist'); + cy.findByDisplayValue('ShowToDos').should('exist'); }); }); }); diff --git a/Composer/cypress/integration/VisualDesigner.spec.js b/Composer/cypress/integration/VisualDesigner.spec.js index 06f2e5a759..6ce38f3d8e 100644 --- a/Composer/cypress/integration/VisualDesigner.spec.js +++ b/Composer/cypress/integration/VisualDesigner.spec.js @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + /// context('Visual Designer', () => { @@ -10,19 +13,19 @@ context('Visual Designer', () => { beforeEach(() => { // Return to Main.dialog cy.get('[data-testid="ProjectTree"]').within(() => { - cy.getByText('__TestTodoSample.Main').click(); + cy.findByText('__TestTodoSample.Main').click(); cy.wait(100); }); }); it('can find Visual Designer default trigger in container', () => { cy.get('[data-testid="ProjectTree"]').within(() => { - cy.getByText('Greeting (ConversationUpdate)').click(); + cy.findByText('Greeting (ConversationUpdate)').click(); cy.wait(500); }); cy.withinEditor('VisualEditor', () => { - cy.getByText('Trigger').should('exist'); + cy.findByText('Trigger').should('exist'); }); }); }); diff --git a/Composer/cypress/integration/homePage.spec.js b/Composer/cypress/integration/homePage.spec.js index 15fddc136b..133465a5bb 100644 --- a/Composer/cypress/integration/homePage.spec.js +++ b/Composer/cypress/integration/homePage.spec.js @@ -6,14 +6,14 @@ context('check Nav Expandion ', () => { it('can open buttons in home page', () => { cy.get('[data-testid="LeftNav-CommandBarButtonHome"]').click(); cy.get('[data-testid="homePage-ToolBar-New"]').click(); - cy.getByText('Create from scratch?').should('exist'); - cy.getByText('Cancel').should('exist'); - cy.getByText('Cancel').click(); + cy.findByText('Create from scratch?').should('exist'); + cy.findByText('Cancel').should('exist'); + cy.findByText('Cancel').click(); cy.get('[data-testid="homePage-ToolBar-Open"]').click(); - cy.getByText('Select a Bot').should('exist'); - cy.getByText('Cancel').should('exist'); - cy.getByText('Cancel').click(); + cy.findByText('Select a Bot').should('exist'); + cy.findByText('Cancel').should('exist'); + cy.findByText('Cancel').click(); cy.get('[data-testid="homePage-body-New"]').click(); - cy.getByText('Create from scratch?').should('exist'); + cy.findByText('Create from scratch?').should('exist'); }); }); diff --git a/Composer/cypress/plugins/cy-ts-preprocessor.js b/Composer/cypress/plugins/cy-ts-preprocessor.js new file mode 100644 index 0000000000..149b4a8052 --- /dev/null +++ b/Composer/cypress/plugins/cy-ts-preprocessor.js @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/* eslint-disable @typescript-eslint/no-var-requires */ + +const wp = require('@cypress/webpack-preprocessor'); + +const webpackOptions = { + resolve: { + extensions: ['.ts', '.js'], + }, + module: { + rules: [ + { + test: /\.ts$/, + exclude: [/node_modules/], + use: [ + { + loader: 'ts-loader', + }, + ], + }, + ], + }, +}; + +const options = { + webpackOptions, +}; + +module.exports = wp(options); diff --git a/Composer/cypress/plugins/index.js b/Composer/cypress/plugins/index.js index 3105358402..e107f2de30 100644 --- a/Composer/cypress/plugins/index.js +++ b/Composer/cypress/plugins/index.js @@ -1,7 +1,8 @@ -/* eslint-disable @typescript-eslint/no-var-requires */ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +/* eslint-disable @typescript-eslint/no-var-requires */ + const cypressTypeScriptPreprocessor = require('./cy-ts-preprocessor'); module.exports = on => { diff --git a/Composer/cypress/support/commands.ts b/Composer/cypress/support/commands.ts new file mode 100644 index 0000000000..110f2666c7 --- /dev/null +++ b/Composer/cypress/support/commands.ts @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +// *********************************************** This example commands.js +// shows you how to create various custom commands and overwrite existing +// commands. +// +// For more comprehensive examples of custom commands please read more here: +// https://on.cypress.io/custom-commands +// *********************************************** +// +// +// -- This is a parent command -- Cypress.Commands.add("login", (email, +// password) => { ... }) +// +// +// -- This is a child command -- Cypress.Commands.add("drag", { prevSubject: +// 'element'}, (subject, options) => { ... }) +// +// +// -- This is a dual command -- Cypress.Commands.add("dismiss", { prevSubject: +// 'optional'}, (subject, options) => { ... }) +// +// + +import 'cypress-testing-library/add-commands'; + +Cypress.Commands.overwrite('visit', (originalFn, url, { enableOnboarding } = {}) => { + if (!enableOnboarding) { + cy.window().then(window => + window.localStorage.setItem('composer:OnboardingState', JSON.stringify({ complete: true })) + ); + } + originalFn(url); +}); + +Cypress.Commands.add('createBot', botName => { + cy.get('[data-testid="LeftNav-CommandBarButtonHome"]').click(); + cy.get('[data-testid="homePage-ToolBar-New"]').within(() => { + cy.findByText('New').click(); + }); + cy.get('input[data-testid="Create from template"]').click({ force: true }); + cy.get(`[data-testid=${botName}]`).click(); + cy.get('button[data-testid="NextStepButton"]').click(); + cy.get('input[data-testid="NewDialogName"]').type(`__Test${botName}`); + cy.get('input[data-testid="NewDialogName"]').type('{enter}'); + cy.wait(1000); +}); + +Cypress.Commands.add('openBot', botName => { + cy.get('[data-testid="LeftNav-CommandBarButtonHome"]').click(); + cy.get('[data-testid="homePage-ToolBar-Open"]').within(() => { + cy.findByText('Open').click(); + }); + cy.get('[data-testid="SelectLocation"]').within(() => { + cy.get(`[aria-label="${botName}"]`).click({ force: true }); + cy.wait(500); + }); + cy.wait(500); +}); + +Cypress.Commands.add('withinEditor', (editorName, cb) => { + cy.get(`iframe[name="${editorName}"]`).then(editor => { + cy.wrap(editor.contents().find('body') as JQuery).within(cb); + }); +}); + +Cypress.Commands.add('openDialog', dialogName => { + cy.get('[data-testid="ProjectTree"]').within(() => { + cy.findByText(dialogName).click(); + cy.wait(500); + }); +}); + +Cypress.Commands.add('startFromTemplate', (template, name) => { + cy.get('[data-testid="LeftNav-CommandBarButtonHome"]').click(); + cy.findByTestId(`TemplateCopy-${template}`).click(); + cy.get('input[data-testid="NewDialogName"]').type(`__Test${name}`); + cy.get('input[data-testid="NewDialogName"]').type('{enter}'); + cy.wait(1000); +}); + +Cypress.Commands.add('copyBot', (bot, name) => { + cy.createBot(bot); + cy.get('[data-testid="LeftNav-CommandBarButtonHome"]').click(); + cy.findByText('Save as').click(); + + cy.get('input[data-testid="NewDialogName"]').type(`__Test${name}`); + cy.get('input[data-testid="NewDialogName"]').type('{enter}'); + cy.wait(1000); +}); + +Cypress.Commands.add('addEventHandler', handler => { + cy.get('[data-testid="ProjectTree"]').within(() => { + cy.findByText(/New Trigger ../).click(); + }); + cy.get(`[data-testid="triggerTypeDropDown"]`).click(); + cy.findByText(handler).click(); + if (handler === 'Dialog trigger') { + cy.get(`[data-testid="eventTypeDropDown"]`).click(); + cy.findByText('consultDialog').click(); + } + cy.get(`[data-testid="triggerFormSubmit"]`).click(); +}); + +Cypress.Commands.add('visitPage', (page) => { + cy.get(`[data-testid="LeftNav-CommandBarButton${page}"]`).click(); +}); diff --git a/Composer/cypress/support/index.d.ts b/Composer/cypress/support/index.d.ts new file mode 100644 index 0000000000..e21b6ba6ff --- /dev/null +++ b/Composer/cypress/support/index.d.ts @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +declare namespace Cypress { + interface Chainable { + /** + * Creates a bot based on template id + * @example cy.createBot('TodoSample') + */ + createBot(botName: string): void; + /** + * Invokes callback inside editor context + * @example cy.withinEditor('VisualEditor', () => { + * cy.findByText('SomeText'); + * }); + */ + withinEditor(editor: string, cb: (currentSubject: JQuery) => void): void; + } +} From a2a88cb35aa8526a3283b867acbfd468a6e94041 Mon Sep 17 00:00:00 2001 From: Andy Brown Date: Tue, 19 Nov 2019 14:50:21 -0800 Subject: [PATCH 09/30] remove old js files --- Composer/cypress/support/commands.js | 107 --------------------------- Composer/cypress/support/index.js | 29 -------- Composer/cypress/support/index.ts | 9 +++ 3 files changed, 9 insertions(+), 136 deletions(-) delete mode 100644 Composer/cypress/support/commands.js delete mode 100644 Composer/cypress/support/index.js create mode 100644 Composer/cypress/support/index.ts diff --git a/Composer/cypress/support/commands.js b/Composer/cypress/support/commands.js deleted file mode 100644 index a82d72318c..0000000000 --- a/Composer/cypress/support/commands.js +++ /dev/null @@ -1,107 +0,0 @@ -// *********************************************** This example commands.js -// shows you how to create various custom commands and overwrite existing -// commands. -// -// For more comprehensive examples of custom commands please read more here: -// https://on.cypress.io/custom-commands -// *********************************************** -// -// -// -- This is a parent command -- Cypress.Commands.add("login", (email, -// password) => { ... }) -// -// -// -- This is a child command -- Cypress.Commands.add("drag", { prevSubject: -// 'element'}, (subject, options) => { ... }) -// -// -// -- This is a dual command -- Cypress.Commands.add("dismiss", { prevSubject: -// 'optional'}, (subject, options) => { ... }) -// -// - -Cypress.Commands.overwrite("visit", (originalFn, url, { enableOnboarding } = {}) => { - if (!enableOnboarding) { - cy.window().then(window => window.localStorage.setItem('composer:OnboardingState', JSON.stringify({ complete: true }))); - } - originalFn(url); - }); - -import 'cypress-testing-library/add-commands'; - -Cypress.Commands.add('createBot', botName => { - cy.get('[data-testid="LeftNav-CommandBarButtonHome"]').click(); - cy.wait(500); - cy.get('[data-testid="homePage-ToolBar-New"]').within(() => { - cy.getByText('New').click(); - }); - cy.wait(500); - cy.get('input[data-testid="Create from template"]').click({ force: true }); - cy.wait(100); - cy.get(`[data-testid=${botName}]`).click(); - cy.wait(100); - cy.get('button[data-testid="NextStepButton"]').click(); - cy.wait(100); - cy.get('input[data-testid="NewDialogName"]').type(`__Test${botName}`); - cy.get('input[data-testid="NewDialogName"]').type('{enter}'); -}); - -Cypress.Commands.add('openBot', botName => { - cy.get('[data-testid="LeftNav-CommandBarButtonHome"]').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); - }); - cy.wait(500); -}); - -Cypress.Commands.add('withinEditor', (editorName, cb) => { - cy.get(`iframe[name="${editorName}"]`).then(editor => { - cy.wrap(editor.contents().find('body')).within(cb); - }); -}); - -Cypress.Commands.add('openDialog', dialogName => { - cy.get('[data-testid="ProjectTree"]').within(() => { - cy.getByText(dialogName).click(); - cy.wait(500); - }); -}); - -Cypress.Commands.add('startFromTemplate', (template, name) => { - cy.get('[data-testid="LeftNav-CommandBarButtonHome"]').click(); - cy.getByTestId(`TemplateCopy-${template}`).click(); - cy.get('input[data-testid="NewDialogName"]').type(`__Test${name}`); - cy.get('input[data-testid="NewDialogName"]').type('{enter}'); - cy.wait(1000); -}); - -Cypress.Commands.add('copyBot', (bot, name) => { - cy.createBot(bot); - cy.get('[data-testid="LeftNav-CommandBarButtonHome"]').click(); - cy.getByText('Save as').click(); - - cy.get('input[data-testid="NewDialogName"]').type(`__Test${name}`); - cy.get('input[data-testid="NewDialogName"]').type('{enter}'); - cy.wait(1000); -}); - -Cypress.Commands.add('addEventHandler', handler => { - cy.get('[data-testid="ProjectTree"]').within(() => { - cy.getByText(/New Trigger ../).click(); - }); - cy.get(`[data-testid="triggerTypeDropDown"]`).click(); - cy.getByText(handler).click(); - if (handler === 'Dialog trigger') { - cy.get(`[data-testid="eventTypeDropDown"]`).click(); - cy.getByText('consultDialog').click(); - } - cy.get(`[data-testid="triggerFormSubmit"]`).click(); -}); - -Cypress.Commands.add('visitPage', (page) => { - cy.get(`[data-testid="LeftNav-CommandBarButton${page}"]`).click(); -}); diff --git a/Composer/cypress/support/index.js b/Composer/cypress/support/index.js deleted file mode 100644 index 5c76e07023..0000000000 --- a/Composer/cypress/support/index.js +++ /dev/null @@ -1,29 +0,0 @@ -// *********************************************************** -// This example support/index.js is processed and -// loaded automatically before your test files. -// -// This is a great place to put global configuration and -// behavior that modifies Cypress. -// -// You can change the location of this file or turn off -// automatically serving support files with the -// 'supportFile' configuration option. -// -// You can read more here: -// https://on.cypress.io/configuration -// *********************************************************** - -// Import commands.js using ES2015 syntax: -import './commands'; - -// Alternatively you can use CommonJS syntax: -// require('./commands') - -beforeEach(() => { - cy.exec('yarn test:integration:clean'); -}); - -after(() => { - cy.wait(500); - cy.exec('yarn test:integration:clean'); -}); diff --git a/Composer/cypress/support/index.ts b/Composer/cypress/support/index.ts new file mode 100644 index 0000000000..777768c74f --- /dev/null +++ b/Composer/cypress/support/index.ts @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import './commands'; + +after(() => { + cy.wait(500); + cy.exec('yarn test:integration:clean'); +}); From 2d22ec7be3fc113f5c32f0b3ec4b4f45a09dd167 Mon Sep 17 00:00:00 2001 From: Andy Brown Date: Tue, 19 Nov 2019 15:54:09 -0800 Subject: [PATCH 10/30] configure eslint for cypress --- Composer/cypress/.eslintrc.js | 3 + Composer/package.json | 2 +- Composer/yarn.lock | 629 ++++++++++++++++++++++++++++++++-- 3 files changed, 599 insertions(+), 35 deletions(-) create mode 100644 Composer/cypress/.eslintrc.js diff --git a/Composer/cypress/.eslintrc.js b/Composer/cypress/.eslintrc.js new file mode 100644 index 0000000000..89d2a80a8c --- /dev/null +++ b/Composer/cypress/.eslintrc.js @@ -0,0 +1,3 @@ +module.exports = { + extends: ['../.eslintrc.js', 'plugin:cypress/recommended'], +}; diff --git a/Composer/package.json b/Composer/package.json index c296c6cf03..d269fc9fbe 100644 --- a/Composer/package.json +++ b/Composer/package.json @@ -69,9 +69,9 @@ "coveralls": "^3.0.7", "cypress": "^3.6.1", "cypress-plugin-tab": "^1.0.1", - "cypress-testing-library": "^3.0.1", "eslint": "^5.15.1", "eslint-config-prettier": "^4.1.0", + "eslint-plugin-cypress": "^2.7.0", "eslint-plugin-emotion": "^10.0.14", "eslint-plugin-format-message": "^6.2.3", "eslint-plugin-import": "^2.16.0", diff --git a/Composer/yarn.lock b/Composer/yarn.lock index 92871f5d82..fc01994dec 100644 --- a/Composer/yarn.lock +++ b/Composer/yarn.lock @@ -54,6 +54,13 @@ dependencies: "@babel/highlight" "^7.0.0" +"@babel/code-frame@^7.5.5": + version "7.5.5" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.5.5.tgz#bc0782f6d69f7b7d49531219699b988f669a8f9d" + integrity sha512-27d4lZoomVyo51VegxI20xZPuSHusqbQag/ztrBC7wegWoQ1nLREPVSKSW8byhTlzTKyNE4ifaTA6lCp7JjpFw== + dependencies: + "@babel/highlight" "^7.0.0" + "@babel/core@7.2.2": version "7.2.2" resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.2.2.tgz#07adba6dde27bb5ad8d8672f15fde3e08184a687" @@ -94,6 +101,26 @@ semver "^5.4.1" source-map "^0.5.0" +"@babel/core@^7.0.1": + version "7.7.2" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.7.2.tgz#ea5b99693bcfc058116f42fa1dd54da412b29d91" + integrity sha512-eeD7VEZKfhK1KUXGiyPFettgF3m513f8FoBSWiQ1xTvl1RAopLs42Wp9+Ze911I6H0N9lNqJMDgoZT7gHsipeQ== + dependencies: + "@babel/code-frame" "^7.5.5" + "@babel/generator" "^7.7.2" + "@babel/helpers" "^7.7.0" + "@babel/parser" "^7.7.2" + "@babel/template" "^7.7.0" + "@babel/traverse" "^7.7.2" + "@babel/types" "^7.7.2" + convert-source-map "^1.7.0" + debug "^4.1.0" + json5 "^2.1.0" + lodash "^4.17.13" + resolve "^1.3.2" + semver "^5.4.1" + source-map "^0.5.0" + "@babel/core@^7.1.0", "@babel/core@^7.1.6", "@babel/core@^7.3.4": version "7.4.0" resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.4.0.tgz#248fd6874b7d755010bfe61f557461d4f446d9e9" @@ -156,6 +183,16 @@ source-map "^0.5.0" trim-right "^1.0.1" +"@babel/generator@^7.7.2": + version "7.7.2" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.7.2.tgz#2f4852d04131a5e17ea4f6645488b5da66ebf3af" + integrity sha512-WthSArvAjYLz4TcbKOi88me+KmDJdKSlfwwN8CnUYn9jBkzhq0ZEPuBfkAWIvjJ3AdEV1Cf/+eSQTnp3IDJKlQ== + dependencies: + "@babel/types" "^7.7.2" + jsesc "^2.5.1" + lodash "^4.17.13" + source-map "^0.5.0" + "@babel/helper-annotate-as-pure@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.0.0.tgz#323d39dd0b50e10c7c06ca7d7638e6864d8c5c32" @@ -163,6 +200,13 @@ dependencies: "@babel/types" "^7.0.0" +"@babel/helper-annotate-as-pure@^7.7.0": + version "7.7.0" + resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.7.0.tgz#efc54032d43891fe267679e63f6860aa7dbf4a5e" + integrity sha512-k50CQxMlYTYo+GGyUGFwpxKVtxVJi9yh61sXZji3zYHccK9RYliZGSTOgci85T+r+0VFN2nWbGM04PIqwfrpMg== + dependencies: + "@babel/types" "^7.7.0" + "@babel/helper-builder-binary-assignment-operator-visitor@^7.1.0": version "7.1.0" resolved "https://registry.yarnpkg.com/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.1.0.tgz#6b69628dfe4087798e0c4ed98e3d4a6b2fbd2f5f" @@ -221,6 +265,14 @@ "@babel/helper-replace-supers" "^7.4.4" "@babel/helper-split-export-declaration" "^7.4.4" +"@babel/helper-create-regexp-features-plugin@^7.7.0": + version "7.7.2" + resolved "https://registry.yarnpkg.com/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.7.2.tgz#6f20443778c8fce2af2ff4206284afc0ced65db6" + integrity sha512-pAil/ZixjTlrzNpjx+l/C/wJk002Wo7XbbZ8oujH/AoJ3Juv0iN/UTcPUHXKMFLqsfS0Hy6Aow8M31brUYBlQQ== + dependencies: + "@babel/helper-regex" "^7.4.4" + regexpu-core "^4.6.0" + "@babel/helper-define-map@^7.1.0", "@babel/helper-define-map@^7.4.0": version "7.4.0" resolved "https://registry.yarnpkg.com/@babel/helper-define-map/-/helper-define-map-7.4.0.tgz#cbfd8c1b2f12708e262c26f600cd16ed6a3bc6c9" @@ -239,6 +291,15 @@ "@babel/types" "^7.4.4" lodash "^4.17.11" +"@babel/helper-define-map@^7.7.0": + version "7.7.0" + resolved "https://registry.yarnpkg.com/@babel/helper-define-map/-/helper-define-map-7.7.0.tgz#60b0e9fd60def9de5054c38afde8c8ee409c7529" + integrity sha512-kPKWPb0dMpZi+ov1hJiwse9dWweZsz3V9rP4KdytnX1E7z3cTNmFGglwklzFPuqIcHLIY3bgKSs4vkwXXdflQA== + dependencies: + "@babel/helper-function-name" "^7.7.0" + "@babel/types" "^7.7.0" + lodash "^4.17.13" + "@babel/helper-explode-assignable-expression@^7.1.0": version "7.1.0" resolved "https://registry.yarnpkg.com/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.1.0.tgz#537fa13f6f1674df745b0c00ec8fe4e99681c8f6" @@ -256,6 +317,15 @@ "@babel/template" "^7.1.0" "@babel/types" "^7.0.0" +"@babel/helper-function-name@^7.7.0": + version "7.7.0" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.7.0.tgz#44a5ad151cfff8ed2599c91682dda2ec2c8430a3" + integrity sha512-tDsJgMUAP00Ugv8O2aGEua5I2apkaQO7lBGUq1ocwN3G23JE5Dcq0uh3GvFTChPa4b40AWiAsLvCZOA2rdnQ7Q== + dependencies: + "@babel/helper-get-function-arity" "^7.7.0" + "@babel/template" "^7.7.0" + "@babel/types" "^7.7.0" + "@babel/helper-get-function-arity@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0.tgz#83572d4320e2a4657263734113c42868b64e49c3" @@ -263,6 +333,13 @@ dependencies: "@babel/types" "^7.0.0" +"@babel/helper-get-function-arity@^7.7.0": + version "7.7.0" + resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.7.0.tgz#c604886bc97287a1d1398092bc666bc3d7d7aa2d" + integrity sha512-tLdojOTz4vWcEnHWHCuPN5P85JLZWbm5Fx5ZsMEMPhF3Uoe3O7awrbM2nQ04bDOUToH/2tH/ezKEOR8zEYzqyw== + dependencies: + "@babel/types" "^7.7.0" + "@babel/helper-hoist-variables@^7.4.0": version "7.4.0" resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.4.0.tgz#25b621399ae229869329730a62015bbeb0a6fbd6" @@ -277,6 +354,13 @@ dependencies: "@babel/types" "^7.4.4" +"@babel/helper-hoist-variables@^7.7.0": + version "7.7.0" + resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.7.0.tgz#b4552e4cfe5577d7de7b183e193e84e4ec538c81" + integrity sha512-LUe/92NqsDAkJjjCEWkNe+/PcpnisvnqdlRe19FahVapa4jndeuJ+FBiTX1rcAKWKcJGE+C3Q3tuEuxkSmCEiQ== + dependencies: + "@babel/types" "^7.7.0" + "@babel/helper-member-expression-to-functions@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.0.0.tgz#8cd14b0a0df7ff00f009e7d7a436945f47c7a16f" @@ -284,6 +368,13 @@ dependencies: "@babel/types" "^7.0.0" +"@babel/helper-member-expression-to-functions@^7.7.0": + version "7.7.0" + resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.7.0.tgz#472b93003a57071f95a541ea6c2b098398bcad8a" + integrity sha512-QaCZLO2RtBcmvO/ekOLp8p7R5X2JriKRizeDpm5ChATAFWrrYDcDxPuCIBXKyBjY+i1vYSdcUTMIb8psfxHDPA== + dependencies: + "@babel/types" "^7.7.0" + "@babel/helper-module-imports@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.0.0.tgz#96081b7111e486da4d2cd971ad1a4fe216cc2e3d" @@ -291,6 +382,13 @@ dependencies: "@babel/types" "^7.0.0" +"@babel/helper-module-imports@^7.7.0": + version "7.7.0" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.7.0.tgz#99c095889466e5f7b6d66d98dffc58baaf42654d" + integrity sha512-Dv3hLKIC1jyfTkClvyEkYP2OlkzNvWs5+Q8WgPbxM5LMeorons7iPP91JM+DU7tRbhqA1ZeooPaMFvQrn23RHw== + dependencies: + "@babel/types" "^7.7.0" + "@babel/helper-module-transforms@^7.1.0": version "7.2.2" resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.2.2.tgz#ab2f8e8d231409f8370c883d20c335190284b963" @@ -315,6 +413,18 @@ "@babel/types" "^7.4.4" lodash "^4.17.11" +"@babel/helper-module-transforms@^7.7.0": + version "7.7.0" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.7.0.tgz#154a69f0c5b8fd4d39e49750ff7ac4faa3f36786" + integrity sha512-rXEefBuheUYQyX4WjV19tuknrJFwyKw0HgzRwbkyTbB+Dshlq7eqkWbyjzToLrMZk/5wKVKdWFluiAsVkHXvuQ== + dependencies: + "@babel/helper-module-imports" "^7.7.0" + "@babel/helper-simple-access" "^7.7.0" + "@babel/helper-split-export-declaration" "^7.7.0" + "@babel/template" "^7.7.0" + "@babel/types" "^7.7.0" + lodash "^4.17.13" + "@babel/helper-optimise-call-expression@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.0.0.tgz#a2920c5702b073c15de51106200aa8cad20497d5" @@ -322,6 +432,13 @@ dependencies: "@babel/types" "^7.0.0" +"@babel/helper-optimise-call-expression@^7.7.0": + version "7.7.0" + resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.7.0.tgz#4f66a216116a66164135dc618c5d8b7a959f9365" + integrity sha512-48TeqmbazjNU/65niiiJIJRc5JozB8acui1OS7bSd6PgxfuovWsvjfWSzlgx+gPFdVveNzUdpdIg5l56Pl5jqg== + dependencies: + "@babel/types" "^7.7.0" + "@babel/helper-plugin-utils@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.0.0.tgz#bbb3fbee98661c569034237cc03967ba99b4f250" @@ -352,6 +469,17 @@ "@babel/traverse" "^7.1.0" "@babel/types" "^7.0.0" +"@babel/helper-remap-async-to-generator@^7.7.0": + version "7.7.0" + resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.7.0.tgz#4d69ec653e8bff5bce62f5d33fc1508f223c75a7" + integrity sha512-pHx7RN8X0UNHPB/fnuDnRXVZ316ZigkO8y8D835JlZ2SSdFKb6yH9MIYRU4fy/KPe5sPHDFOPvf8QLdbAGGiyw== + dependencies: + "@babel/helper-annotate-as-pure" "^7.7.0" + "@babel/helper-wrap-function" "^7.7.0" + "@babel/template" "^7.7.0" + "@babel/traverse" "^7.7.0" + "@babel/types" "^7.7.0" + "@babel/helper-replace-supers@^7.1.0", "@babel/helper-replace-supers@^7.4.0": version "7.4.0" resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.4.0.tgz#4f56adb6aedcd449d2da9399c2dcf0545463b64c" @@ -372,6 +500,16 @@ "@babel/traverse" "^7.4.4" "@babel/types" "^7.4.4" +"@babel/helper-replace-supers@^7.5.5", "@babel/helper-replace-supers@^7.7.0": + version "7.7.0" + resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.7.0.tgz#d5365c8667fe7cbd13b8ddddceb9bd7f2b387512" + integrity sha512-5ALYEul5V8xNdxEeWvRsBzLMxQksT7MaStpxjJf9KsnLxpAKBtfw5NeMKZJSYDa0lKdOcy0g+JT/f5mPSulUgg== + dependencies: + "@babel/helper-member-expression-to-functions" "^7.7.0" + "@babel/helper-optimise-call-expression" "^7.7.0" + "@babel/traverse" "^7.7.0" + "@babel/types" "^7.7.0" + "@babel/helper-simple-access@^7.1.0": version "7.1.0" resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.1.0.tgz#65eeb954c8c245beaa4e859da6188f39d71e585c" @@ -380,6 +518,14 @@ "@babel/template" "^7.1.0" "@babel/types" "^7.0.0" +"@babel/helper-simple-access@^7.7.0": + version "7.7.0" + resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.7.0.tgz#97a8b6c52105d76031b86237dc1852b44837243d" + integrity sha512-AJ7IZD7Eem3zZRuj5JtzFAptBw7pMlS3y8Qv09vaBWoFsle0d1kAn5Wq6Q9MyBXITPOKnxwkZKoAm4bopmv26g== + dependencies: + "@babel/template" "^7.7.0" + "@babel/types" "^7.7.0" + "@babel/helper-split-export-declaration@^7.0.0", "@babel/helper-split-export-declaration@^7.4.0": version "7.4.0" resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.4.0.tgz#571bfd52701f492920d63b7f735030e9a3e10b55" @@ -394,6 +540,13 @@ dependencies: "@babel/types" "^7.4.4" +"@babel/helper-split-export-declaration@^7.7.0": + version "7.7.0" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.7.0.tgz#1365e74ea6c614deeb56ebffabd71006a0eb2300" + integrity sha512-HgYSI8rH08neWlAH3CcdkFg9qX9YsZysZI5GD8LjhQib/mM0jGOZOVkoUiiV2Hu978fRtjtsGsW6w0pKHUWtqA== + dependencies: + "@babel/types" "^7.7.0" + "@babel/helper-wrap-function@^7.1.0": version "7.2.0" resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.2.0.tgz#c4e0012445769e2815b55296ead43a958549f6fa" @@ -404,6 +557,16 @@ "@babel/traverse" "^7.1.0" "@babel/types" "^7.2.0" +"@babel/helper-wrap-function@^7.7.0": + version "7.7.0" + resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.7.0.tgz#15af3d3e98f8417a60554acbb6c14e75e0b33b74" + integrity sha512-sd4QjeMgQqzshSjecZjOp8uKfUtnpmCyQhKQrVJBBgeHAB/0FPi33h3AbVlVp07qQtMD4QgYSzaMI7VwncNK/w== + dependencies: + "@babel/helper-function-name" "^7.7.0" + "@babel/template" "^7.7.0" + "@babel/traverse" "^7.7.0" + "@babel/types" "^7.7.0" + "@babel/helpers@^7.2.0", "@babel/helpers@^7.4.0": version "7.4.2" resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.4.2.tgz#3bdfa46a552ca77ef5a0f8551be5f0845ae989be" @@ -422,6 +585,15 @@ "@babel/traverse" "^7.4.4" "@babel/types" "^7.4.4" +"@babel/helpers@^7.7.0": + version "7.7.0" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.7.0.tgz#359bb5ac3b4726f7c1fde0ec75f64b3f4275d60b" + integrity sha512-VnNwL4YOhbejHb7x/b5F39Zdg5vIQpUUNzJwx0ww1EcVRt41bbGRZWhAURrfY32T5zTT3qwNOQFWpn+P0i0a2g== + dependencies: + "@babel/template" "^7.7.0" + "@babel/traverse" "^7.7.0" + "@babel/types" "^7.7.0" + "@babel/highlight@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.0.0.tgz#f710c38c8d458e6dd9a201afb637fcb781ce99e4" @@ -441,6 +613,11 @@ resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.4.5.tgz#04af8d5d5a2b044a2a1bffacc1e5e6673544e872" integrity sha512-9mUqkL1FF5T7f0WDFfAoDdiMVPWsdD1gZYzSnaXsxUCUqzuch/8of9G3VUSNiZmMBoRxT3neyVsqeiL/ZPcjew== +"@babel/parser@^7.7.0", "@babel/parser@^7.7.2": + version "7.7.3" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.7.3.tgz#5fad457c2529de476a248f75b0f090b3060af043" + integrity sha512-bqv+iCo9i+uLVbI0ILzKkvMorqxouI+GbV13ivcARXn9NNEabi2IEz912IgNpT/60BNXac5dgcfjb94NjsF33A== + "@babel/plugin-proposal-async-generator-functions@^7.2.0": version "7.2.0" resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.2.0.tgz#b289b306669dce4ad20b0252889a15768c9d417e" @@ -450,6 +627,15 @@ "@babel/helper-remap-async-to-generator" "^7.1.0" "@babel/plugin-syntax-async-generators" "^7.2.0" +"@babel/plugin-proposal-async-generator-functions@^7.7.0": + version "7.7.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.7.0.tgz#83ef2d6044496b4c15d8b4904e2219e6dccc6971" + integrity sha512-ot/EZVvf3mXtZq0Pd0+tSOfGWMizqmOohXmNZg6LNFjHOV+wOPv7BvVYh8oPR8LhpIP3ye8nNooKL50YRWxpYA== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-remap-async-to-generator" "^7.7.0" + "@babel/plugin-syntax-async-generators" "^7.2.0" + "@babel/plugin-proposal-class-properties@7.3.0": version "7.3.0" resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.3.0.tgz#272636bc0fa19a0bc46e601ec78136a173ea36cd" @@ -483,6 +669,14 @@ "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-syntax-decorators" "^7.2.0" +"@babel/plugin-proposal-dynamic-import@^7.7.0": + version "7.7.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.7.0.tgz#dc02a8bad8d653fb59daf085516fa416edd2aa7f" + integrity sha512-7poL3Xi+QFPC7sGAzEIbXUyYzGJwbc2+gSD0AkiC5k52kH2cqHdqxm5hNFfLW3cRSTcx9bN0Fl7/6zWcLLnKAQ== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-syntax-dynamic-import" "^7.2.0" + "@babel/plugin-proposal-json-strings@^7.2.0": version "7.2.0" resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.2.0.tgz#568ecc446c6148ae6b267f02551130891e29f317" @@ -515,6 +709,14 @@ "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-syntax-object-rest-spread" "^7.2.0" +"@babel/plugin-proposal-object-rest-spread@^7.6.2": + version "7.6.2" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.6.2.tgz#8ffccc8f3a6545e9f78988b6bf4fe881b88e8096" + integrity sha512-LDBXlmADCsMZV1Y9OQwMc0MyGZ8Ta/zlD9N67BfQT8uYwkRswiu2hU6nJKrjrt/58aH/vqfQlR/9yId/7A2gWw== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-syntax-object-rest-spread" "^7.2.0" + "@babel/plugin-proposal-optional-catch-binding@^7.2.0": version "7.2.0" resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.2.0.tgz#135d81edb68a081e55e56ec48541ece8065c38f5" @@ -541,6 +743,14 @@ "@babel/helper-regex" "^7.4.4" regexpu-core "^4.5.4" +"@babel/plugin-proposal-unicode-property-regex@^7.7.0": + version "7.7.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.7.0.tgz#549fe1717a1bd0a2a7e63163841cb37e78179d5d" + integrity sha512-mk34H+hp7kRBWJOOAR0ZMGCydgKMD4iN9TpDRp3IIcbunltxEY89XSimc6WbtSLCDrwcdy/EEw7h5CFCzxTchw== + dependencies: + "@babel/helper-create-regexp-features-plugin" "^7.7.0" + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-syntax-async-generators@^7.2.0": version "7.2.0" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.2.0.tgz#69e1f0db34c6f5a0cf7e2b3323bf159a76c8cb7f" @@ -555,7 +765,7 @@ dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-syntax-dynamic-import@7.2.0": +"@babel/plugin-syntax-dynamic-import@7.2.0", "@babel/plugin-syntax-dynamic-import@^7.2.0": version "7.2.0" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.2.0.tgz#69c159ffaf4998122161ad8ebc5e6d1f55df8612" integrity sha512-mVxuJ0YroI/h/tbFTPGZR8cv6ai+STMKNBq0f8hFxsxWjl94qqhsb+wXbpNMDPU3cfR1TIsVFzU3nXyZMqyK4w== @@ -597,6 +807,13 @@ dependencies: "@babel/helper-plugin-utils" "^7.0.0" +"@babel/plugin-syntax-top-level-await@^7.7.0": + version "7.7.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.7.0.tgz#f5699549f50bbe8d12b1843a4e82f0a37bb65f4d" + integrity sha512-hi8FUNiFIY1fnUI2n1ViB1DR0R4QeK4iHcTlW6aJkrPoTdb8Rf1EMQ6GT3f67DDkYyWgew9DFoOZ6gOoEsdzTA== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-syntax-typescript@^7.2.0": version "7.3.3" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.3.3.tgz#a7cc3f66119a9f7ebe2de5383cce193473d65991" @@ -629,6 +846,15 @@ "@babel/helper-plugin-utils" "^7.0.0" "@babel/helper-remap-async-to-generator" "^7.1.0" +"@babel/plugin-transform-async-to-generator@^7.7.0": + version "7.7.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.7.0.tgz#e2b84f11952cf5913fe3438b7d2585042772f492" + integrity sha512-vLI2EFLVvRBL3d8roAMqtVY0Bm9C1QzLkdS57hiKrjUBSqsQYrBsMCeOg/0KK7B0eK9V71J5mWcha9yyoI2tZw== + dependencies: + "@babel/helper-module-imports" "^7.7.0" + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-remap-async-to-generator" "^7.7.0" + "@babel/plugin-transform-block-scoped-functions@^7.2.0": version "7.2.0" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.2.0.tgz#5d3cc11e8d5ddd752aa64c9148d0db6cb79fd190" @@ -652,6 +878,14 @@ "@babel/helper-plugin-utils" "^7.0.0" lodash "^4.17.11" +"@babel/plugin-transform-block-scoping@^7.6.3": + version "7.6.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.6.3.tgz#6e854e51fbbaa84351b15d4ddafe342f3a5d542a" + integrity sha512-7hvrg75dubcO3ZI2rjYTzUrEuh1E9IyDEhhB6qfcooxhDA33xx2MasuLVgdxzcP6R/lipAC6n9ub9maNW6RKdw== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + lodash "^4.17.13" + "@babel/plugin-transform-classes@7.2.2": version "7.2.2" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.2.2.tgz#6c90542f210ee975aa2aa8c8b5af7fa73a126953" @@ -694,6 +928,20 @@ "@babel/helper-split-export-declaration" "^7.4.4" globals "^11.1.0" +"@babel/plugin-transform-classes@^7.7.0": + version "7.7.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.7.0.tgz#b411ecc1b8822d24b81e5d184f24149136eddd4a" + integrity sha512-/b3cKIZwGeUesZheU9jNYcwrEA7f/Bo4IdPmvp7oHgvks2majB5BoT5byAql44fiNQYOPzhk2w8DbgfuafkMoA== + dependencies: + "@babel/helper-annotate-as-pure" "^7.7.0" + "@babel/helper-define-map" "^7.7.0" + "@babel/helper-function-name" "^7.7.0" + "@babel/helper-optimise-call-expression" "^7.7.0" + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-replace-supers" "^7.7.0" + "@babel/helper-split-export-declaration" "^7.7.0" + globals "^11.1.0" + "@babel/plugin-transform-computed-properties@^7.2.0": version "7.2.0" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.2.0.tgz#83a7df6a658865b1c8f641d510c6f3af220216da" @@ -722,6 +970,13 @@ dependencies: "@babel/helper-plugin-utils" "^7.0.0" +"@babel/plugin-transform-destructuring@^7.6.0": + version "7.6.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.6.0.tgz#44bbe08b57f4480094d57d9ffbcd96d309075ba6" + integrity sha512-2bGIS5P1v4+sWTCnKNDZDxbGvEqi0ijeqM/YqHtVGrvG2y0ySgnEEhXErvE9dA0bnIzY9bIzdFK0jFA46ASIIQ== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-transform-dotall-regex@^7.2.0": version "7.2.0" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.2.0.tgz#f0aabb93d120a8ac61e925ea0ba440812dbe0e49" @@ -740,6 +995,14 @@ "@babel/helper-regex" "^7.4.4" regexpu-core "^4.5.4" +"@babel/plugin-transform-dotall-regex@^7.7.0": + version "7.7.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.7.0.tgz#c5c9ecacab3a5e0c11db6981610f0c32fd698b3b" + integrity sha512-3QQlF7hSBnSuM1hQ0pS3pmAbWLax/uGNCbPBND9y+oJ4Y776jsyujG2k0Sn2Aj2a0QwVOiOFL5QVPA7spjvzSA== + dependencies: + "@babel/helper-create-regexp-features-plugin" "^7.7.0" + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-transform-duplicate-keys@^7.2.0": version "7.2.0" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.2.0.tgz#d952c4930f312a4dbfff18f0b2914e60c35530b3" @@ -747,6 +1010,13 @@ dependencies: "@babel/helper-plugin-utils" "^7.0.0" +"@babel/plugin-transform-duplicate-keys@^7.5.0": + version "7.5.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.5.0.tgz#c5dbf5106bf84cdf691222c0974c12b1df931853" + integrity sha512-igcziksHizyQPlX9gfSjHkE2wmoCH3evvD2qR5w29/Dk0SMKE/eOI7f1HhBdNhR/zxJDqrgpoDTq5YSLH/XMsQ== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-transform-exponentiation-operator@^7.2.0": version "7.2.0" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.2.0.tgz#a63868289e5b4007f7054d46491af51435766008" @@ -793,6 +1063,14 @@ "@babel/helper-function-name" "^7.1.0" "@babel/helper-plugin-utils" "^7.0.0" +"@babel/plugin-transform-function-name@^7.7.0": + version "7.7.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.7.0.tgz#0fa786f1eef52e3b7d4fc02e54b2129de8a04c2a" + integrity sha512-P5HKu0d9+CzZxP5jcrWdpe7ZlFDe24bmqP6a6X8BHEBl/eizAsY8K6LX8LASZL0Jxdjm5eEfzp+FIrxCm/p8bA== + dependencies: + "@babel/helper-function-name" "^7.7.0" + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-transform-literals@^7.2.0": version "7.2.0" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-literals/-/plugin-transform-literals-7.2.0.tgz#690353e81f9267dad4fd8cfd77eafa86aba53ea1" @@ -815,6 +1093,15 @@ "@babel/helper-module-transforms" "^7.1.0" "@babel/helper-plugin-utils" "^7.0.0" +"@babel/plugin-transform-modules-amd@^7.5.0": + version "7.5.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.5.0.tgz#ef00435d46da0a5961aa728a1d2ecff063e4fb91" + integrity sha512-n20UsQMKnWrltocZZm24cRURxQnWIvsABPJlw/fvoy9c6AgHZzoelAIzajDHAQrDpuKFFPPcFGd7ChsYuIUMpg== + dependencies: + "@babel/helper-module-transforms" "^7.1.0" + "@babel/helper-plugin-utils" "^7.0.0" + babel-plugin-dynamic-import-node "^2.3.0" + "@babel/plugin-transform-modules-commonjs@^7.2.0", "@babel/plugin-transform-modules-commonjs@^7.4.0": version "7.4.0" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.4.0.tgz#3b8ec61714d3b75d20c5ccfa157f2c2e087fd4ca" @@ -833,6 +1120,16 @@ "@babel/helper-plugin-utils" "^7.0.0" "@babel/helper-simple-access" "^7.1.0" +"@babel/plugin-transform-modules-commonjs@^7.7.0": + version "7.7.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.7.0.tgz#3e5ffb4fd8c947feede69cbe24c9554ab4113fe3" + integrity sha512-KEMyWNNWnjOom8vR/1+d+Ocz/mILZG/eyHHO06OuBQ2aNhxT62fr4y6fGOplRx+CxCSp3IFwesL8WdINfY/3kg== + dependencies: + "@babel/helper-module-transforms" "^7.7.0" + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-simple-access" "^7.7.0" + babel-plugin-dynamic-import-node "^2.3.0" + "@babel/plugin-transform-modules-systemjs@^7.2.0", "@babel/plugin-transform-modules-systemjs@^7.4.0": version "7.4.0" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.4.0.tgz#c2495e55528135797bc816f5d50f851698c586a1" @@ -849,6 +1146,15 @@ "@babel/helper-hoist-variables" "^7.4.4" "@babel/helper-plugin-utils" "^7.0.0" +"@babel/plugin-transform-modules-systemjs@^7.7.0": + version "7.7.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.7.0.tgz#9baf471213af9761c1617bb12fd278e629041417" + integrity sha512-ZAuFgYjJzDNv77AjXRqzQGlQl4HdUM6j296ee4fwKVZfhDR9LAGxfvXjBkb06gNETPnN0sLqRm9Gxg4wZH6dXg== + dependencies: + "@babel/helper-hoist-variables" "^7.7.0" + "@babel/helper-plugin-utils" "^7.0.0" + babel-plugin-dynamic-import-node "^2.3.0" + "@babel/plugin-transform-modules-umd@^7.2.0": version "7.2.0" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.2.0.tgz#7678ce75169f0877b8eb2235538c074268dd01ae" @@ -857,6 +1163,14 @@ "@babel/helper-module-transforms" "^7.1.0" "@babel/helper-plugin-utils" "^7.0.0" +"@babel/plugin-transform-modules-umd@^7.7.0": + version "7.7.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.7.0.tgz#d62c7da16670908e1d8c68ca0b5d4c0097b69966" + integrity sha512-u7eBA03zmUswQ9LQ7Qw0/ieC1pcAkbp5OQatbWUzY1PaBccvuJXUkYzoN1g7cqp7dbTu6Dp9bXyalBvD04AANA== + dependencies: + "@babel/helper-module-transforms" "^7.7.0" + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-transform-named-capturing-groups-regex@^7.3.0", "@babel/plugin-transform-named-capturing-groups-regex@^7.4.2": version "7.4.2" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.4.2.tgz#800391136d6cbcc80728dbdba3c1c6e46f86c12e" @@ -871,6 +1185,13 @@ dependencies: regexp-tree "^0.1.6" +"@babel/plugin-transform-named-capturing-groups-regex@^7.7.0": + version "7.7.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.7.0.tgz#358e6fd869b9a4d8f5cbc79e4ed4fc340e60dcaf" + integrity sha512-+SicSJoKouPctL+j1pqktRVCgy+xAch1hWWTMy13j0IflnyNjaoskj+DwRQFimHbLqO3sq2oN2CXMvXq3Bgapg== + dependencies: + "@babel/helper-create-regexp-features-plugin" "^7.7.0" + "@babel/plugin-transform-new-target@^7.0.0", "@babel/plugin-transform-new-target@^7.4.0": version "7.4.0" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.4.0.tgz#67658a1d944edb53c8d4fa3004473a0dd7838150" @@ -893,6 +1214,14 @@ "@babel/helper-plugin-utils" "^7.0.0" "@babel/helper-replace-supers" "^7.1.0" +"@babel/plugin-transform-object-super@^7.5.5": + version "7.5.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.5.5.tgz#c70021df834073c65eb613b8679cc4a381d1a9f9" + integrity sha512-un1zJQAhSosGFBduPgN/YFNvWVpRuHKU7IHBglLoLZsGmruJPOo6pbInneflUdmq7YvSVqhpPs5zdBvLnteltQ== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-replace-supers" "^7.5.5" + "@babel/plugin-transform-parameters@^7.2.0", "@babel/plugin-transform-parameters@^7.4.0": version "7.4.0" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.4.0.tgz#a1309426fac4eecd2a9439a4c8c35124a11a48a9" @@ -972,6 +1301,13 @@ dependencies: regenerator-transform "^0.14.0" +"@babel/plugin-transform-regenerator@^7.7.0": + version "7.7.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.7.0.tgz#f1b20b535e7716b622c99e989259d7dd942dd9cc" + integrity sha512-AXmvnC+0wuj/cFkkS/HFHIojxH3ffSXE+ttulrqWjZZRaUOonfJc60e1wSNT4rV8tIunvu/R3wCp71/tLAa9xg== + dependencies: + regenerator-transform "^0.14.0" + "@babel/plugin-transform-reserved-words@^7.2.0": version "7.2.0" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.2.0.tgz#4792af87c998a49367597d07fedf02636d2e1634" @@ -1023,6 +1359,13 @@ dependencies: "@babel/helper-plugin-utils" "^7.0.0" +"@babel/plugin-transform-spread@^7.6.2": + version "7.6.2" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.6.2.tgz#fc77cf798b24b10c46e1b51b1b88c2bf661bb8dd" + integrity sha512-DpSvPFryKdK1x+EDJYCy28nmAaIMdxmhot62jAXF/o99iA33Zj2Lmcp3vDmz+MUh0LNYVPvfj5iC3feb3/+PFg== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-transform-sticky-regex@^7.2.0": version "7.2.0" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.2.0.tgz#a1e454b5995560a9c1e0d537dfc15061fd2687e1" @@ -1080,6 +1423,14 @@ "@babel/helper-regex" "^7.4.4" regexpu-core "^4.5.4" +"@babel/plugin-transform-unicode-regex@^7.7.0": + version "7.7.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.7.0.tgz#743d9bcc44080e3cc7d49259a066efa30f9187a3" + integrity sha512-RrThb0gdrNwFAqEAAx9OWgtx6ICK69x7i9tCnMdVrxQwSDp/Abu9DXFU5Hh16VP33Rmxh04+NGW28NsIkFvFKA== + dependencies: + "@babel/helper-create-regexp-features-plugin" "^7.7.0" + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/preset-env@7.3.0": version "7.3.0" resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.3.0.tgz#9777a1f61f99fb6cc8bda969541ecc122924317b" @@ -1178,6 +1529,63 @@ js-levenshtein "^1.1.3" semver "^5.3.0" +"@babel/preset-env@^7.0.0": + version "7.7.1" + resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.7.1.tgz#04a2ff53552c5885cf1083e291c8dd5490f744bb" + integrity sha512-/93SWhi3PxcVTDpSqC+Dp4YxUu3qZ4m7I76k0w73wYfn7bGVuRIO4QUz95aJksbS+AD1/mT1Ie7rbkT0wSplaA== + dependencies: + "@babel/helper-module-imports" "^7.7.0" + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-proposal-async-generator-functions" "^7.7.0" + "@babel/plugin-proposal-dynamic-import" "^7.7.0" + "@babel/plugin-proposal-json-strings" "^7.2.0" + "@babel/plugin-proposal-object-rest-spread" "^7.6.2" + "@babel/plugin-proposal-optional-catch-binding" "^7.2.0" + "@babel/plugin-proposal-unicode-property-regex" "^7.7.0" + "@babel/plugin-syntax-async-generators" "^7.2.0" + "@babel/plugin-syntax-dynamic-import" "^7.2.0" + "@babel/plugin-syntax-json-strings" "^7.2.0" + "@babel/plugin-syntax-object-rest-spread" "^7.2.0" + "@babel/plugin-syntax-optional-catch-binding" "^7.2.0" + "@babel/plugin-syntax-top-level-await" "^7.7.0" + "@babel/plugin-transform-arrow-functions" "^7.2.0" + "@babel/plugin-transform-async-to-generator" "^7.7.0" + "@babel/plugin-transform-block-scoped-functions" "^7.2.0" + "@babel/plugin-transform-block-scoping" "^7.6.3" + "@babel/plugin-transform-classes" "^7.7.0" + "@babel/plugin-transform-computed-properties" "^7.2.0" + "@babel/plugin-transform-destructuring" "^7.6.0" + "@babel/plugin-transform-dotall-regex" "^7.7.0" + "@babel/plugin-transform-duplicate-keys" "^7.5.0" + "@babel/plugin-transform-exponentiation-operator" "^7.2.0" + "@babel/plugin-transform-for-of" "^7.4.4" + "@babel/plugin-transform-function-name" "^7.7.0" + "@babel/plugin-transform-literals" "^7.2.0" + "@babel/plugin-transform-member-expression-literals" "^7.2.0" + "@babel/plugin-transform-modules-amd" "^7.5.0" + "@babel/plugin-transform-modules-commonjs" "^7.7.0" + "@babel/plugin-transform-modules-systemjs" "^7.7.0" + "@babel/plugin-transform-modules-umd" "^7.7.0" + "@babel/plugin-transform-named-capturing-groups-regex" "^7.7.0" + "@babel/plugin-transform-new-target" "^7.4.4" + "@babel/plugin-transform-object-super" "^7.5.5" + "@babel/plugin-transform-parameters" "^7.4.4" + "@babel/plugin-transform-property-literals" "^7.2.0" + "@babel/plugin-transform-regenerator" "^7.7.0" + "@babel/plugin-transform-reserved-words" "^7.2.0" + "@babel/plugin-transform-shorthand-properties" "^7.2.0" + "@babel/plugin-transform-spread" "^7.6.2" + "@babel/plugin-transform-sticky-regex" "^7.2.0" + "@babel/plugin-transform-template-literals" "^7.4.4" + "@babel/plugin-transform-typeof-symbol" "^7.2.0" + "@babel/plugin-transform-unicode-regex" "^7.7.0" + "@babel/types" "^7.7.1" + browserslist "^4.6.0" + core-js-compat "^3.1.1" + invariant "^2.2.2" + js-levenshtein "^1.1.3" + semver "^5.5.0" + "@babel/preset-env@^7.1.6": version "7.4.2" resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.4.2.tgz#2f5ba1de2daefa9dcca653848f96c7ce2e406676" @@ -1331,7 +1739,7 @@ dependencies: regenerator-runtime "^0.12.0" -"@babel/runtime@^7.0.0": +"@babel/runtime@^7.0.0", "@babel/runtime@^7.6.2": version "7.7.2" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.7.2.tgz#111a78002a5c25fc8e3361bedc9529c696b85a6a" integrity sha512-JONRbXbTXc9WQE2mAZd1p0Z3DZ/6vaQIkgYMSTP3KjRCyd7rCZCcfhCyX+YjwcKxcZ82UrxbRD358bpExNgrjw== @@ -1384,6 +1792,15 @@ "@babel/parser" "^7.4.4" "@babel/types" "^7.4.4" +"@babel/template@^7.7.0": + version "7.7.0" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.7.0.tgz#4fadc1b8e734d97f56de39c77de76f2562e597d0" + integrity sha512-OKcwSYOW1mhWbnTBgQY5lvg1Fxg+VyfQGjcBduZFljfc044J5iDlnDSfhQ867O17XHiSCxYHUxHg2b7ryitbUQ== + dependencies: + "@babel/code-frame" "^7.0.0" + "@babel/parser" "^7.7.0" + "@babel/types" "^7.7.0" + "@babel/traverse@^7.0.0", "@babel/traverse@^7.1.0", "@babel/traverse@^7.2.2", "@babel/traverse@^7.3.4", "@babel/traverse@^7.4.0": version "7.4.0" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.4.0.tgz#14006967dd1d2b3494cdd650c686db9daf0ddada" @@ -1414,6 +1831,21 @@ globals "^11.1.0" lodash "^4.17.11" +"@babel/traverse@^7.7.0", "@babel/traverse@^7.7.2": + version "7.7.2" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.7.2.tgz#ef0a65e07a2f3c550967366b3d9b62a2dcbeae09" + integrity sha512-TM01cXib2+rgIZrGJOLaHV/iZUAxf4A0dt5auY6KNZ+cm6aschuJGqKJM3ROTt3raPUdIDk9siAufIFEleRwtw== + dependencies: + "@babel/code-frame" "^7.5.5" + "@babel/generator" "^7.7.2" + "@babel/helper-function-name" "^7.7.0" + "@babel/helper-split-export-declaration" "^7.7.0" + "@babel/parser" "^7.7.2" + "@babel/types" "^7.7.2" + debug "^4.1.0" + globals "^11.1.0" + lodash "^4.17.13" + "@babel/types@^7.0.0", "@babel/types@^7.1.6", "@babel/types@^7.2.0", "@babel/types@^7.2.2", "@babel/types@^7.3.0", "@babel/types@^7.3.4", "@babel/types@^7.4.0": version "7.4.0" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.4.0.tgz#670724f77d24cce6cc7d8cf64599d511d164894c" @@ -1432,6 +1864,15 @@ lodash "^4.17.11" to-fast-properties "^2.0.0" +"@babel/types@^7.7.0", "@babel/types@^7.7.1", "@babel/types@^7.7.2": + version "7.7.2" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.7.2.tgz#550b82e5571dcd174af576e23f0adba7ffc683f7" + integrity sha512-YTf6PXoh3+eZgRCBzzP25Bugd2ngmpQVrk7kXX0i5N9BO7TFBtIgZYs7WtxtOGs8e6A4ZI7ECkbBCEHeXocvOA== + dependencies: + esutils "^2.0.2" + lodash "^4.17.13" + to-fast-properties "^2.0.0" + "@bfcomposer/monaco-editor-webpack-plugin@^1.7.2": version "1.7.2" resolved "https://botbuilder.myget.org/F/botbuilder-declarative/npm/@bfcomposer/monaco-editor-webpack-plugin/-/@bfcomposer/monaco-editor-webpack-plugin-1.7.2.tgz#f00ac5cec496dc3d44713d9142956b3336033eab" @@ -1487,6 +1928,18 @@ date-fns "^1.27.2" figures "^1.7.0" +"@cypress/webpack-preprocessor@^4.1.1": + version "4.1.1" + resolved "https://registry.yarnpkg.com/@cypress/webpack-preprocessor/-/webpack-preprocessor-4.1.1.tgz#3c0b5b8de6eaac605dac3b1f1c3f5916c1c6eaea" + integrity sha512-SfzDqOvWBSlfGRm8ak/XHUXAnndwHU2qJIRr1LIC7j2UqWcZoJ+286CuNloJbkwfyEAO6tQggLd4E/WHUAcKZQ== + dependencies: + bluebird "3.7.1" + debug "4.1.1" + optionalDependencies: + "@babel/core" "^7.0.1" + "@babel/preset-env" "^7.0.0" + babel-loader "^8.0.2" + "@cypress/xvfb@1.2.4": version "1.2.4" resolved "https://registry.yarnpkg.com/@cypress/xvfb/-/xvfb-1.2.4.tgz#2daf42e8275b39f4aa53c14214e557bd14e7748a" @@ -1889,6 +2342,15 @@ "@types/istanbul-reports" "^1.1.1" "@types/yargs" "^12.0.9" +"@jest/types@^24.9.0": + version "24.9.0" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-24.9.0.tgz#63cb26cb7500d069e5a389441a7c6ab5e909fc59" + integrity sha512-XKK7ze1apu5JWQ5eZjHITP66AX+QsLlbaJRBGYr8pNzwcAE2JVkwnf0yqjHTsDRcjR0mujy/NmZMXw5kl+kGBw== + dependencies: + "@types/istanbul-lib-coverage" "^2.0.0" + "@types/istanbul-reports" "^1.1.1" + "@types/yargs" "^13.0.0" + "@microsoft/load-themed-styles@^1.7.13": version "1.9.5" resolved "https://registry.yarnpkg.com/@microsoft/load-themed-styles/-/load-themed-styles-1.9.5.tgz#b9f063bafa568e356b4d99a5b522d0bab60bda85" @@ -2057,6 +2519,27 @@ dependencies: defer-to-connect "^1.0.1" +"@testing-library/cypress@^5.0.2": + version "5.0.2" + resolved "https://registry.yarnpkg.com/@testing-library/cypress/-/cypress-5.0.2.tgz#68746fc9db11dabcc4bf883e25b64316f637be71" + integrity sha512-AmvBLE+isA/vpdBTXpJ5tu+UYMDgqNW015RVa0nBPJHrv5UXNlmDZyu8tpkxGTFhcf+iFSA2pHuK1jUCQ8PnXQ== + dependencies: + "@babel/runtime" "^7.5.5" + "@testing-library/dom" "^6.0.0" + "@types/testing-library__cypress" "^5.0.0" + +"@testing-library/dom@^6.0.0": + version "6.10.1" + resolved "https://registry.yarnpkg.com/@testing-library/dom/-/dom-6.10.1.tgz#da5bf5065d3f9e484aef4cc495f4e1a5bea6df2e" + integrity sha512-5BPKxaO+zSJDUbVZBRNf9KrmDkm/EcjjaHSg3F9+031VZyPACKXlwLBjVzZxheunT9m72DoIq7WvyE457/Xweg== + dependencies: + "@babel/runtime" "^7.6.2" + "@sheerun/mutationobserver-shim" "^0.3.2" + "@types/testing-library__dom" "^6.0.0" + aria-query "3.0.0" + pretty-format "^24.9.0" + wait-for-expect "^3.0.0" + "@types/anymatch@*": version "1.3.1" resolved "https://registry.yarnpkg.com/@types/anymatch/-/anymatch-1.3.1.tgz#336badc1beecb9dacc38bea2cf32adf627a8421a" @@ -2433,6 +2916,21 @@ dependencies: "@types/estree" "*" +"@types/testing-library__cypress@^5.0.0": + version "5.0.1" + resolved "https://registry.yarnpkg.com/@types/testing-library__cypress/-/testing-library__cypress-5.0.1.tgz#d05a264eb5d5a45659699a4e0309a7cebe57b344" + integrity sha512-z2JKxVTh3PDeLbATRofwDUImEwuytsBeu8Si6YLzxwc2HK4xGIDs50HFlwYD9MPlclGDQRm0QL7ynnaIjRtCGg== + dependencies: + "@types/testing-library__dom" "*" + cypress "^3.5.0" + +"@types/testing-library__dom@*", "@types/testing-library__dom@^6.0.0": + version "6.10.0" + resolved "https://registry.yarnpkg.com/@types/testing-library__dom/-/testing-library__dom-6.10.0.tgz#590d76e3875a7c536dc744eb530cbf51b6483404" + integrity sha512-mL/GMlyQxiZplbUuFNwA0vAI3k3uJNSf6slr5AVve9TXmfLfyefNT0uHHnxwdYuPMxYD5gI/+dgAvc/5opW9JQ== + dependencies: + pretty-format "^24.3.0" + "@types/tunnel@0.0.0": version "0.0.0" resolved "https://registry.yarnpkg.com/@types/tunnel/-/tunnel-0.0.0.tgz#c2a42943ee63c90652a5557b8c4e56cda77f944e" @@ -2490,11 +2988,23 @@ "@types/webpack-sources" "*" source-map "^0.6.0" +"@types/yargs-parser@*": + version "13.1.0" + resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-13.1.0.tgz#c563aa192f39350a1d18da36c5a8da382bbd8228" + integrity sha512-gCubfBUZ6KxzoibJ+SCUc/57Ms1jz5NjHe4+dI2krNmU5zCPAphyLJYyTOg06ueIyfj+SaCUqmzun7ImlxDcKg== + "@types/yargs@^12.0.2", "@types/yargs@^12.0.9": version "12.0.10" resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-12.0.10.tgz#17a8ec65cd8e88f51b418ceb271af18d3137df67" integrity sha512-WsVzTPshvCSbHThUduGGxbmnwcpkgSctHGHTqzWyFg4lYAuV5qXlyFPOsP3OWqCINfmg/8VXP+zJaa4OxEsBQQ== +"@types/yargs@^13.0.0": + version "13.0.3" + resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-13.0.3.tgz#76482af3981d4412d65371a318f992d33464a380" + integrity sha512-K8/LfZq2duW33XW/tFwEAfnZlqIfVsoyRB3kfXdPXYhl0nfM8mmh7GS0jg7WrX2Dgq/0Ha/pR1PaR+BvmWwjiQ== + dependencies: + "@types/yargs-parser" "*" + "@typescript-eslint/eslint-plugin@2.6.0": version "2.6.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.6.0.tgz#e82ed43fc4527b21bfe35c20a2d6e4ed49fc7957" @@ -3087,7 +3597,7 @@ argparse@^1.0.7: dependencies: sprintf-js "~1.0.2" -aria-query@^3.0.0: +aria-query@3.0.0, aria-query@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/aria-query/-/aria-query-3.0.0.tgz#65b3fcc1ca1155a8c9ae64d6eee297f15d5133cc" integrity sha1-ZbP8wcoRVajJrmTW7uKX8V1RM8w= @@ -3405,6 +3915,16 @@ babel-loader@8.0.5: mkdirp "^0.5.1" util.promisify "^1.0.0" +babel-loader@^8.0.2: + version "8.0.6" + resolved "https://registry.yarnpkg.com/babel-loader/-/babel-loader-8.0.6.tgz#e33bdb6f362b03f4bb141a0c21ab87c501b70dfb" + integrity sha512-4BmWKtBOBm13uoUwd08UwjZlaw3O9GWf456R9j+5YykFZ6LUIjIKLc0zEZf+hauxPOJs96C8k6FvYD09vWzhYw== + dependencies: + find-cache-dir "^2.0.0" + loader-utils "^1.0.2" + mkdirp "^0.5.1" + pify "^4.0.1" + babel-plugin-dynamic-import-node@2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.2.0.tgz#c0adfb07d95f4a4495e9aaac6ec386c4d7c2524e" @@ -3412,6 +3932,13 @@ babel-plugin-dynamic-import-node@2.2.0: dependencies: object.assign "^4.1.0" +babel-plugin-dynamic-import-node@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.0.tgz#f00f507bdaa3c3e3ff6e7e5e98d90a7acab96f7f" + integrity sha512-o6qFkpeQEBxcqt0XYlWzAVxNCSCZdUgcR8IRlhD/8DylxjjO4foPcvTW0GGKa/cVt3rvxZ7o5ippJ+/0nvLhlQ== + dependencies: + object.assign "^4.1.0" + babel-plugin-emotion@^10.0.14: version "10.0.16" resolved "https://registry.yarnpkg.com/babel-plugin-emotion/-/babel-plugin-emotion-10.0.16.tgz#cb306798058b102a634ca80e69b012caa345bb09" @@ -3653,6 +4180,11 @@ bluebird@3.5.0: resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.0.tgz#791420d7f551eea2897453a8a77653f96606d67c" integrity sha1-eRQg1/VR7qKJdFOop3ZT+WYG1nw= +bluebird@3.7.1, bluebird@^3.5.5: + version "3.7.1" + resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.1.tgz#df70e302b471d7473489acf26a93d63b53f874de" + integrity sha512-DdmyoGCleJnkbp3nkbxTLJ18rjDsE4yCggEwKNXkeV123sPNfOCYeDoeuOY+F2FrSjO1YXcTU+dsy96KMy+gcg== + bluebird@^3.5.0: version "3.5.5" resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.5.tgz#a8d0afd73251effbbd5fe384a77d73003c17a71f" @@ -3663,11 +4195,6 @@ bluebird@^3.5.1, bluebird@^3.5.3: resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.3.tgz#7d01c6f9616c9a51ab0f8c549a79dfe6ec33efa7" integrity sha512-/qKPUQlaW1OyR51WeCPBvRnAlnZFUJkCSG5HzGnuIqhgyJtF+T94lFnn33eiazjRm2LAHVy2guNnaq48X9SJuw== -bluebird@^3.5.5: - version "3.7.1" - resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.1.tgz#df70e302b471d7473489acf26a93d63b53f874de" - integrity sha512-DdmyoGCleJnkbp3nkbxTLJ18rjDsE4yCggEwKNXkeV123sPNfOCYeDoeuOY+F2FrSjO1YXcTU+dsy96KMy+gcg== - bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.1.1, bn.js@^4.4.0: version "4.11.8" resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.8.tgz#2cde09eb5ee341f484746bb0309b3253b1b1442f" @@ -4794,7 +5321,7 @@ convert-source-map@^1.1.0, convert-source-map@^1.4.0, convert-source-map@^1.5.0: dependencies: safe-buffer "~5.1.1" -convert-source-map@^1.6.0: +convert-source-map@^1.6.0, convert-source-map@^1.7.0: version "1.7.0" resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.7.0.tgz#17a2cb882d7f77d3490585e2ce6c524424a3a442" integrity sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA== @@ -5374,15 +5901,7 @@ cypress-plugin-tab@^1.0.1: dependencies: ally.js "^1.4.1" -cypress-testing-library@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/cypress-testing-library/-/cypress-testing-library-3.0.1.tgz#cd5f4ce4423cbb20cafdb869b435b35d01d11b66" - integrity sha512-vpGRbcYS229KP/FOASKQuT717GxpO9mG7rnFz2dOe7sz7JPnIHIP5M3KoPvoLfAN1TictFFv05jndyJi2OLa3A== - dependencies: - "@babel/runtime" "^7.4.3" - dom-testing-library "^4.0.0" - -cypress@^3.6.1: +cypress@^3.5.0, cypress@^3.6.1: version "3.6.1" resolved "https://registry.yarnpkg.com/cypress/-/cypress-3.6.1.tgz#4420957923879f60b7a5146ccbf81841a149b653" integrity sha512-6n0oqENdz/oQ7EJ6IgESNb2M7Bo/70qX9jSJsAziJTC3kICfEMmJUlrAnP9bn+ut24MlXQST5nRXhUP5nRIx6A== @@ -5979,7 +6498,7 @@ debug@3.2.6, debug@^3.1.0, debug@^3.1.1, debug@^3.2.5, debug@^3.2.6: dependencies: ms "^2.1.1" -debug@^4.0.1, debug@^4.1.0, debug@^4.1.1: +debug@4.1.1, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791" integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw== @@ -6293,16 +6812,6 @@ dom-testing-library@^3.19.0: pretty-format "^24.5.0" wait-for-expect "^1.1.0" -dom-testing-library@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/dom-testing-library/-/dom-testing-library-4.0.1.tgz#f21ef42aea0bd635969b4227a487e4704dbea735" - integrity sha512-Yr0yWlpI2QdTDEgPEk0TEekwP4VyZlJpl9E7nKP2FCKni44cb1jzjsy9KX6hBDsNA7EVlPpq9DHzO2eoEaqDZg== - dependencies: - "@babel/runtime" "^7.4.3" - "@sheerun/mutationobserver-shim" "^0.3.2" - pretty-format "^24.7.0" - wait-for-expect "^1.1.1" - domain-browser@^1.1.1: version "1.2.0" resolved "https://registry.yarnpkg.com/domain-browser/-/domain-browser-1.2.0.tgz#3d31f50191a6749dd1375a7f522e823d42e54eda" @@ -6589,6 +7098,13 @@ eslint-module-utils@^2.4.0: debug "^2.6.8" pkg-dir "^2.0.0" +eslint-plugin-cypress@^2.7.0: + version "2.7.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-cypress/-/eslint-plugin-cypress-2.7.0.tgz#117f14ce63698e4c4f3afea3d7e27025c8d504f0" + integrity sha512-52Lq5ePCD/8jc536e1RqtLfj33BAy1s7BlYgCjbG39J5kqUitcTlRY5i3NRoeAyPHueDwETsq0eASF44ugLosQ== + dependencies: + globals "^11.12.0" + eslint-plugin-emotion@^10.0.14: version "10.0.14" resolved "https://registry.yarnpkg.com/eslint-plugin-emotion/-/eslint-plugin-emotion-10.0.14.tgz#c643ff2f34f85ae77a65b2056915e939cf7e8129" @@ -7776,6 +8292,11 @@ globals@^11.1.0, globals@^11.7.0: resolved "https://registry.yarnpkg.com/globals/-/globals-11.11.0.tgz#dcf93757fa2de5486fbeed7118538adf789e9c2e" integrity sha512-WHq43gS+6ufNOEqlrDBxVEbb8ntfXrfAUU2ZOpCxrBdGKW3gyv8mCxAfIBD0DroPKGrJ2eSsXsLtY9MPntsyTw== +globals@^11.12.0: + version "11.12.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" + integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== + globby@*, globby@^9.1.0: version "9.1.0" resolved "https://registry.yarnpkg.com/globby/-/globby-9.1.0.tgz#e90f4d5134109e6d855abdd31bdb1b085428592e" @@ -10238,7 +10759,7 @@ lodash.uniq@^4.5.0: resolved "https://botbuilder.myget.org/F/botbuilder-declarative/npm/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773" integrity sha1-0CJTc662Uq3BvILklFM5qEJ1R3M= -lodash@4.17.15, lodash@^4.17.14, lodash@^4.17.15: +lodash@4.17.15, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.15: version "4.17.15" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548" integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A== @@ -12741,6 +13262,16 @@ pretty-format@^24.0.0, pretty-format@^24.7.0: ansi-styles "^3.2.0" react-is "^16.8.4" +pretty-format@^24.3.0, pretty-format@^24.9.0: + version "24.9.0" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-24.9.0.tgz#12fac31b37019a4eea3c11aa9a959eb7628aa7c9" + integrity sha512-00ZMZUiHaJrNfk33guavqgvfJS30sLYf0f8+Srklv0AMPodGGHcoHgksZ3OThYnIvOd+8yMCn0YiEOogjlgsnA== + dependencies: + "@jest/types" "^24.9.0" + ansi-regex "^4.0.0" + ansi-styles "^3.2.0" + react-is "^16.8.4" + pretty-format@^24.5.0: version "24.5.0" resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-24.5.0.tgz#cc69a0281a62cd7242633fc135d6930cd889822d" @@ -13299,6 +13830,13 @@ regenerate-unicode-properties@^8.0.2: dependencies: regenerate "^1.4.0" +regenerate-unicode-properties@^8.1.0: + version "8.1.0" + resolved "https://registry.yarnpkg.com/regenerate-unicode-properties/-/regenerate-unicode-properties-8.1.0.tgz#ef51e0f0ea4ad424b77bf7cb41f3e015c70a3f0e" + integrity sha512-LGZzkgtLY79GeXLm8Dp0BVLdQlWICzBnJz/ipWUgo59qBaZ+BHtq51P2q1uVZlppMuUAT37SDk39qUbjTWB7bA== + dependencies: + regenerate "^1.4.0" + regenerate@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.4.0.tgz#4a856ec4b56e4077c557589cae85e7a4c8869a11" @@ -13368,6 +13906,18 @@ regexpu-core@^4.1.3, regexpu-core@^4.5.4: unicode-match-property-ecmascript "^1.0.4" unicode-match-property-value-ecmascript "^1.1.0" +regexpu-core@^4.6.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-4.6.0.tgz#2037c18b327cfce8a6fea2a4ec441f2432afb8b6" + integrity sha512-YlVaefl8P5BnFYOITTNzDvan1ulLOiXJzCNZxduTIosN17b87h3bvG9yHMoHaRuo88H4mQ06Aodj5VtYGGGiTg== + dependencies: + regenerate "^1.4.0" + regenerate-unicode-properties "^8.1.0" + regjsgen "^0.5.0" + regjsparser "^0.6.0" + unicode-match-property-ecmascript "^1.0.4" + unicode-match-property-value-ecmascript "^1.1.0" + registry-auth-token@^3.0.1, registry-auth-token@^3.3.2, registry-auth-token@^3.4.0: version "3.4.0" resolved "https://registry.yarnpkg.com/registry-auth-token/-/registry-auth-token-3.4.0.tgz#d7446815433f5d5ed6431cd5dca21048f66b397e" @@ -15016,6 +15566,17 @@ ts-loader@^6.0.3: micromatch "^4.0.0" semver "^6.0.0" +ts-loader@^6.2.1: + version "6.2.1" + resolved "https://registry.yarnpkg.com/ts-loader/-/ts-loader-6.2.1.tgz#67939d5772e8a8c6bdaf6277ca023a4812da02ef" + integrity sha512-Dd9FekWuABGgjE1g0TlQJ+4dFUfYGbYcs52/HQObE0ZmUNjQlmLAS7xXsSzy23AMaMwipsx5sNHvoEpT2CZq1g== + dependencies: + chalk "^2.3.0" + enhanced-resolve "^4.0.0" + loader-utils "^1.0.2" + micromatch "^4.0.0" + semver "^6.0.0" + ts-node@^8.4.1: version "8.4.1" resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-8.4.1.tgz#270b0dba16e8723c9fa4f9b4775d3810fd994b4f" @@ -15520,10 +16081,10 @@ wait-for-expect@^1.1.0: resolved "https://registry.yarnpkg.com/wait-for-expect/-/wait-for-expect-1.1.0.tgz#6607375c3f79d32add35cd2c87ce13f351a3d453" integrity sha512-vQDokqxyMyknfX3luCDn16bSaRcOyH6gGuUXMIbxBLeTo6nWuEWYqMTT9a+44FmW8c2m6TRWBdNvBBjA1hwEKg== -wait-for-expect@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/wait-for-expect/-/wait-for-expect-1.1.1.tgz#9cd10e07d52810af9e0aaf509872e38f3c3d81ae" - integrity sha512-vd9JOqqEcBbCDhARWhW85ecjaEcfBLuXgVBqatfS3iw6oU4kzAcs+sCNjF+TC9YHPImCW7ypsuQc+htscIAQCw== +wait-for-expect@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/wait-for-expect/-/wait-for-expect-3.0.1.tgz#ec204a76b0038f17711e575720aaf28505ac7185" + integrity sha512-3Ha7lu+zshEG/CeHdcpmQsZnnZpPj/UsG3DuKO8FskjuDbkx3jE3845H+CuwZjA2YWYDfKMU2KhnCaXMLd3wVw== walker@~1.0.5: version "1.0.7" From ed374eaa9fb9c4eb28e1290e2f8159cf875b05bb Mon Sep 17 00:00:00 2001 From: Andy Brown Date: Tue, 19 Nov 2019 15:54:32 -0800 Subject: [PATCH 11/30] convert support files to typescript --- Composer/cypress.json | 1 + .../support/{index.d.ts => commands.d.ts} | 4 +- Composer/cypress/support/commands.ts | 68 +++++++------------ Composer/cypress/tsconfig.json | 2 +- 4 files changed, 28 insertions(+), 47 deletions(-) rename Composer/cypress/support/{index.d.ts => commands.d.ts} (89%) diff --git a/Composer/cypress.json b/Composer/cypress.json index 2146eadef4..a1ba87574c 100644 --- a/Composer/cypress.json +++ b/Composer/cypress.json @@ -4,6 +4,7 @@ "**/examples/*", "*.hot-update.js" ], + "supportFile": "cypress/support/index.ts", "video": false, "videoUploadOnPasses": false, "viewportWidth": 1600, diff --git a/Composer/cypress/support/index.d.ts b/Composer/cypress/support/commands.d.ts similarity index 89% rename from Composer/cypress/support/index.d.ts rename to Composer/cypress/support/commands.d.ts index e21b6ba6ff..25eea2e6a2 100644 --- a/Composer/cypress/support/index.d.ts +++ b/Composer/cypress/support/commands.d.ts @@ -1,8 +1,10 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +/// + declare namespace Cypress { - interface Chainable { + interface Chainable { /** * Creates a bot based on template id * @example cy.createBot('TodoSample') diff --git a/Composer/cypress/support/commands.ts b/Composer/cypress/support/commands.ts index 110f2666c7..7d7561ec10 100644 --- a/Composer/cypress/support/commands.ts +++ b/Composer/cypress/support/commands.ts @@ -1,29 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -// *********************************************** This example commands.js -// shows you how to create various custom commands and overwrite existing -// commands. -// -// For more comprehensive examples of custom commands please read more here: -// https://on.cypress.io/custom-commands -// *********************************************** -// -// -// -- This is a parent command -- Cypress.Commands.add("login", (email, -// password) => { ... }) -// -// -// -- This is a child command -- Cypress.Commands.add("drag", { prevSubject: -// 'element'}, (subject, options) => { ... }) -// -// -// -- This is a dual command -- Cypress.Commands.add("dismiss", { prevSubject: -// 'optional'}, (subject, options) => { ... }) -// -// - -import 'cypress-testing-library/add-commands'; +import '@testing-library/cypress/add-commands'; Cypress.Commands.overwrite('visit', (originalFn, url, { enableOnboarding } = {}) => { if (!enableOnboarding) { @@ -35,24 +13,24 @@ Cypress.Commands.overwrite('visit', (originalFn, url, { enableOnboarding } = {}) }); Cypress.Commands.add('createBot', botName => { - cy.get('[data-testid="LeftNav-CommandBarButtonHome"]').click(); - cy.get('[data-testid="homePage-ToolBar-New"]').within(() => { + cy.findByTestId('LeftNav-CommandBarButtonHome').click(); + cy.findByTestId('homePage-ToolBar-New').within(() => { cy.findByText('New').click(); }); - cy.get('input[data-testid="Create from template"]').click({ force: true }); - cy.get(`[data-testid=${botName}]`).click(); + cy.findByTestId('Create from template').click({ force: true }); + cy.findByTestId(`${botName}`).click(); cy.get('button[data-testid="NextStepButton"]').click(); - cy.get('input[data-testid="NewDialogName"]').type(`__Test${botName}`); - cy.get('input[data-testid="NewDialogName"]').type('{enter}'); + cy.findByTestId('NewDialogName').type(`__Test${botName}`); + cy.findByTestId('NewDialogName').type('{enter}'); cy.wait(1000); }); Cypress.Commands.add('openBot', botName => { - cy.get('[data-testid="LeftNav-CommandBarButtonHome"]').click(); - cy.get('[data-testid="homePage-ToolBar-Open"]').within(() => { + cy.findByTestId('LeftNav-CommandBarButtonHome').click(); + cy.findByTestId('homePage-ToolBar-Open').within(() => { cy.findByText('Open').click(); }); - cy.get('[data-testid="SelectLocation"]').within(() => { + cy.findByTestId('SelectLocation').within(() => { cy.get(`[aria-label="${botName}"]`).click({ force: true }); cy.wait(500); }); @@ -66,43 +44,43 @@ Cypress.Commands.add('withinEditor', (editorName, cb) => { }); Cypress.Commands.add('openDialog', dialogName => { - cy.get('[data-testid="ProjectTree"]').within(() => { + cy.findByTestId('ProjectTree').within(() => { cy.findByText(dialogName).click(); cy.wait(500); }); }); Cypress.Commands.add('startFromTemplate', (template, name) => { - cy.get('[data-testid="LeftNav-CommandBarButtonHome"]').click(); + cy.findByTestId('LeftNav-CommandBarButtonHome').click(); cy.findByTestId(`TemplateCopy-${template}`).click(); - cy.get('input[data-testid="NewDialogName"]').type(`__Test${name}`); - cy.get('input[data-testid="NewDialogName"]').type('{enter}'); + cy.findByTestId('NewDialogName').type(`__Test${name}`); + cy.findByTestId('NewDialogName').type('{enter}'); cy.wait(1000); }); Cypress.Commands.add('copyBot', (bot, name) => { cy.createBot(bot); - cy.get('[data-testid="LeftNav-CommandBarButtonHome"]').click(); + cy.findByTestId('LeftNav-CommandBarButtonHome').click(); cy.findByText('Save as').click(); - cy.get('input[data-testid="NewDialogName"]').type(`__Test${name}`); - cy.get('input[data-testid="NewDialogName"]').type('{enter}'); + cy.findByTestId('NewDialogName').type(`__Test${name}`); + cy.findByTestId('NewDialogName').type('{enter}'); cy.wait(1000); }); Cypress.Commands.add('addEventHandler', handler => { - cy.get('[data-testid="ProjectTree"]').within(() => { + cy.findByTestId('ProjectTree').within(() => { cy.findByText(/New Trigger ../).click(); }); - cy.get(`[data-testid="triggerTypeDropDown"]`).click(); + cy.findByTestId('triggerTypeDropDown').click(); cy.findByText(handler).click(); if (handler === 'Dialog trigger') { - cy.get(`[data-testid="eventTypeDropDown"]`).click(); + cy.findByTestId('eventTypeDropDown').click(); cy.findByText('consultDialog').click(); } - cy.get(`[data-testid="triggerFormSubmit"]`).click(); + cy.findByTestId('triggerFormSubmit').click(); }); -Cypress.Commands.add('visitPage', (page) => { - cy.get(`[data-testid="LeftNav-CommandBarButton${page}"]`).click(); +Cypress.Commands.add('visitPage', page => { + cy.findByTestId(`LeftNav-CommandBarButton${page}`).click(); }); diff --git a/Composer/cypress/tsconfig.json b/Composer/cypress/tsconfig.json index ee9ae6f970..6a00ad6e70 100644 --- a/Composer/cypress/tsconfig.json +++ b/Composer/cypress/tsconfig.json @@ -4,7 +4,7 @@ "baseUrl": "../node_modules", "target": "es5", "lib": ["es5", "dom"], - "types": ["cypress", "@types/testing-library__cypress"] + "types": ["cypress", "@types/testing-library__cypress", "./support/commands"] }, "include": ["**/*.ts"] } From 9d20479fb1340a891cb0b546dbbc513fa3d8897a Mon Sep 17 00:00:00 2001 From: Andy Brown Date: Tue, 19 Nov 2019 16:19:46 -0800 Subject: [PATCH 12/30] fix create bot command --- Composer/cypress/support/commands.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Composer/cypress/support/commands.ts b/Composer/cypress/support/commands.ts index 7d7561ec10..2eb85f5721 100644 --- a/Composer/cypress/support/commands.ts +++ b/Composer/cypress/support/commands.ts @@ -19,9 +19,8 @@ Cypress.Commands.add('createBot', botName => { }); cy.findByTestId('Create from template').click({ force: true }); cy.findByTestId(`${botName}`).click(); - cy.get('button[data-testid="NextStepButton"]').click(); - cy.findByTestId('NewDialogName').type(`__Test${botName}`); - cy.findByTestId('NewDialogName').type('{enter}'); + cy.findByTestId('NextStepButton').click(); + cy.findByTestId('NewDialogName').type(`{selectall}__Test${botName}{enter}`); cy.wait(1000); }); From 5983495196f659634294863bc5b662fc7501771e Mon Sep 17 00:00:00 2001 From: Andy Brown Date: Tue, 19 Nov 2019 16:20:02 -0800 Subject: [PATCH 13/30] remove waits --- Composer/cypress/integration/Breadcrumb.spec.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/Composer/cypress/integration/Breadcrumb.spec.ts b/Composer/cypress/integration/Breadcrumb.spec.ts index 5e6d0af7b2..8c647ee409 100644 --- a/Composer/cypress/integration/Breadcrumb.spec.ts +++ b/Composer/cypress/integration/Breadcrumb.spec.ts @@ -44,7 +44,6 @@ context('breadcrumb', () => { cy.findByTestId('ProjectTree').within(() => { cy.findByText('AddToDo').click(); cy.findByText('Dialog started (BeginDialog)').click(); - cy.wait(100); }); hasBreadcrumbItems(cy, ['AddToDo', 'Dialog started (BeginDialog)']); @@ -53,7 +52,6 @@ context('breadcrumb', () => { it('can show action name in breadcrumb', () => { cy.findByTestId('ProjectTree').within(() => { cy.findByText('Greeting (ConversationUpdate)').click(); - cy.wait(100); }); // Click on an action From 4cc6f9196c36b3298096657a16ff7ef5083133b5 Mon Sep 17 00:00:00 2001 From: Andy Brown Date: Tue, 19 Nov 2019 16:36:47 -0800 Subject: [PATCH 14/30] update create bot spec --- Composer/cypress/integration/CreateNewBot.spec.ts | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/Composer/cypress/integration/CreateNewBot.spec.ts b/Composer/cypress/integration/CreateNewBot.spec.ts index e10bf7e534..a02d28cc9a 100644 --- a/Composer/cypress/integration/CreateNewBot.spec.ts +++ b/Composer/cypress/integration/CreateNewBot.spec.ts @@ -4,20 +4,16 @@ context('Creating a new bot', () => { beforeEach(() => { cy.visit(Cypress.env('COMPOSER_URL')); - cy.wait(1000); cy.findByTestId('LeftNav-CommandBarButtonHome').click(); cy.findByTestId('homePage-ToolBar-New').within(() => { cy.findByText('New').click(); }); - cy.wait(1000); }); it('can create a new bot', () => { cy.findByTestId('Create from scratch').click(); cy.findByTestId('NextStepButton').click(); - cy.findByTestId('NewDialogName').type('__TestNewProject'); - cy.findByTestId('NewDialogName').type('{enter}'); - cy.wait(100); + cy.findByTestId('NewDialogName').type('{selectall}__TestNewProject{enter}'); cy.findByTestId('ProjectTree').within(() => { cy.findByText('__TestNewProject.Main').should('exist'); }); @@ -27,9 +23,7 @@ context('Creating a new bot', () => { cy.findByTestId('Create from template').click(); cy.findByTestId('TodoSample').click(); cy.findByTestId('NextStepButton').click(); - cy.findByTestId('NewDialogName').type('__TestNewProject'); - cy.findByTestId('NewDialogName').type('{enter}'); - cy.wait(100); + cy.findByTestId('NewDialogName').type('{selectall}__TestNewProject{enter}'); cy.findByTestId('ProjectTree').within(() => { cy.findByText('__TestNewProject.Main').should('exist'); cy.findByText('AddToDo').should('exist'); From a27d1755cee1600dae4d22ba31872a8c9a60a356 Mon Sep 17 00:00:00 2001 From: Andy Brown Date: Tue, 19 Nov 2019 16:37:03 -0800 Subject: [PATCH 15/30] restore before each cleanup task --- Composer/cypress/support/index.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Composer/cypress/support/index.ts b/Composer/cypress/support/index.ts index 777768c74f..d54e1b0ecc 100644 --- a/Composer/cypress/support/index.ts +++ b/Composer/cypress/support/index.ts @@ -3,6 +3,10 @@ import './commands'; +beforeEach(() => { + cy.exec('yarn test:integration:clean'); +}); + after(() => { cy.wait(500); cy.exec('yarn test:integration:clean'); From da9d1fd7b89848b6f4df6293711c3c445f558cfe Mon Sep 17 00:00:00 2001 From: Andy Brown Date: Wed, 20 Nov 2019 16:32:04 -0800 Subject: [PATCH 16/30] convert home page spec to typescript --- .../{homePage.spec.js => HomePage.spec.ts} | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) rename Composer/cypress/integration/{homePage.spec.js => HomePage.spec.ts} (58%) diff --git a/Composer/cypress/integration/homePage.spec.js b/Composer/cypress/integration/HomePage.spec.ts similarity index 58% rename from Composer/cypress/integration/homePage.spec.js rename to Composer/cypress/integration/HomePage.spec.ts index 133465a5bb..cdd82aa5aa 100644 --- a/Composer/cypress/integration/homePage.spec.js +++ b/Composer/cypress/integration/HomePage.spec.ts @@ -1,19 +1,22 @@ -/// -context('check Nav Expandion ', () => { +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +context('Home Page ', () => { beforeEach(() => { cy.visit(Cypress.env('COMPOSER_URL')); }); + it('can open buttons in home page', () => { - cy.get('[data-testid="LeftNav-CommandBarButtonHome"]').click(); - cy.get('[data-testid="homePage-ToolBar-New"]').click(); + cy.findByTestId('LeftNav-CommandBarButtonHome').click(); + cy.findByTestId('homePage-ToolBar-New').click(); cy.findByText('Create from scratch?').should('exist'); cy.findByText('Cancel').should('exist'); cy.findByText('Cancel').click(); - cy.get('[data-testid="homePage-ToolBar-Open"]').click(); + cy.findByTestId('homePage-ToolBar-Open').click(); cy.findByText('Select a Bot').should('exist'); cy.findByText('Cancel').should('exist'); cy.findByText('Cancel').click(); - cy.get('[data-testid="homePage-body-New"]').click(); + cy.findByTestId('homePage-body-New').click(); cy.findByText('Create from scratch?').should('exist'); }); }); From 7e573e15d06c9e2b02cf87ffe7882e2981180473 Mon Sep 17 00:00:00 2001 From: Andy Brown Date: Thu, 21 Nov 2019 08:56:12 -0800 Subject: [PATCH 17/30] convert LeftNavBar spec to typescript --- .../cypress/integration/LeftNavBar.spec.js | 18 ----------------- .../cypress/integration/LeftNavBar.spec.ts | 20 +++++++++++++++++++ 2 files changed, 20 insertions(+), 18 deletions(-) delete mode 100644 Composer/cypress/integration/LeftNavBar.spec.js create mode 100644 Composer/cypress/integration/LeftNavBar.spec.ts diff --git a/Composer/cypress/integration/LeftNavBar.spec.js b/Composer/cypress/integration/LeftNavBar.spec.js deleted file mode 100644 index 130c66ead2..0000000000 --- a/Composer/cypress/integration/LeftNavBar.spec.js +++ /dev/null @@ -1,18 +0,0 @@ -/// -context('check Nav Expandion ', () => { - beforeEach(() => { - cy.visit(Cypress.env('COMPOSER_URL')); - cy.createBot('TodoSample'); - }); - - it('can expand left Nav Bar', () => { - cy.get('[data-testid="LeftNavButton"]').click(); - cy.get('[data-testid="LeftNav-CommandBarButtonDesign Flow"]').should('exist'); - cy.get('[data-testid="LeftNav-CommandBarButtonBot Responses"]').click(); - cy.url().should('include', 'language-generation'); - cy.get('[data-testid="LeftNav-CommandBarButtonUser Input"]').click(); - cy.url().should('include', 'language-understanding'); - cy.get('[data-testid="LeftNav-CommandBarButtonSettings"]').click(); - cy.url().should('include', 'setting'); - }); -}); diff --git a/Composer/cypress/integration/LeftNavBar.spec.ts b/Composer/cypress/integration/LeftNavBar.spec.ts new file mode 100644 index 0000000000..780189025d --- /dev/null +++ b/Composer/cypress/integration/LeftNavBar.spec.ts @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +context('Left Nav Bar', () => { + beforeEach(() => { + cy.visit(Cypress.env('COMPOSER_URL')); + cy.createBot('TodoSample'); + }); + + it('can expand left Nav Bar', () => { + cy.findByTestId('LeftNavButton').click(); + cy.findByTestId('LeftNav-CommandBarButtonDesign Flow').should('exist'); + cy.findByTestId('LeftNav-CommandBarButtonBot Responses').click(); + cy.url().should('include', 'language-generation'); + cy.findByTestId('LeftNav-CommandBarButtonUser Input').click(); + cy.url().should('include', 'language-understanding'); + cy.findByTestId('LeftNav-CommandBarButtonSettings').click(); + cy.url().should('include', 'setting'); + }); +}); From 64b6228a1e0ae559405d3d2f29cc3e52285d5b04 Mon Sep 17 00:00:00 2001 From: Andy Brown Date: Thu, 21 Nov 2019 08:58:14 -0800 Subject: [PATCH 18/30] convert LGPage spec to typescript --- .../{LGPage.spec.js => LGPage.spec.ts} | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) rename Composer/cypress/integration/{LGPage.spec.js => LGPage.spec.ts} (64%) diff --git a/Composer/cypress/integration/LGPage.spec.js b/Composer/cypress/integration/LGPage.spec.ts similarity index 64% rename from Composer/cypress/integration/LGPage.spec.js rename to Composer/cypress/integration/LGPage.spec.ts index cf9d281e7b..a10f2c7c82 100644 --- a/Composer/cypress/integration/LGPage.spec.js +++ b/Composer/cypress/integration/LGPage.spec.ts @@ -1,13 +1,14 @@ -/// +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. -context('check language generation page', () => { +context('LG Page', () => { beforeEach(() => { cy.visit(Cypress.env('COMPOSER_URL')); cy.createBot('TodoSample'); }); it('can open language generation page', () => { - cy.get('[data-testid="LeftNav-CommandBarButtonBot Responses"]').click(); + cy.findByTestId('LeftNav-CommandBarButtonBot Responses').click(); // left nav tree cy.contains('TodoSample.Main'); cy.contains('All'); @@ -15,17 +16,21 @@ context('check language generation page', () => { cy.get('.toggleEditMode button').as('switchButton'); // by default is table view - cy.get('[data-testid="LGEditor"] [data-testid="table-view"]').should('exist'); + cy.findByTestId('LGEditor') + .findByTestId('table-view') + .should('exist'); // goto edit-mode cy.get('@switchButton').click(); - cy.get('[data-testid="LGEditor"] .monaco-editor').should('exist'); + cy.findByTestId('LGEditor') + .get('.monaco-editor') + .should('exist'); // back to table view cy.get('@switchButton').click(); // nav to Main dialog cy.get('.dialogNavTree a[title="__TestTodoSample.Main"]').click(); - cy.wait(300); + // cy.wait(300); // dialog filter, edit mode button is disabled. cy.get('@switchButton').should('be.disabled'); From 929ccc872a0ec117bc82df5515cff71509707511 Mon Sep 17 00:00:00 2001 From: Andy Brown Date: Thu, 21 Nov 2019 08:59:55 -0800 Subject: [PATCH 19/30] convert LuisDeploy spec to typescript --- ...{LuisDeploy.spec.js => LuisDeploy.spec.ts} | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) rename Composer/cypress/integration/{LuisDeploy.spec.js => LuisDeploy.spec.ts} (75%) diff --git a/Composer/cypress/integration/LuisDeploy.spec.js b/Composer/cypress/integration/LuisDeploy.spec.ts similarity index 75% rename from Composer/cypress/integration/LuisDeploy.spec.js rename to Composer/cypress/integration/LuisDeploy.spec.ts index 59fc644724..3283bf6cd6 100644 --- a/Composer/cypress/integration/LuisDeploy.spec.js +++ b/Composer/cypress/integration/LuisDeploy.spec.ts @@ -1,4 +1,5 @@ -/// +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. context('Luis Deploy', () => { beforeEach(() => { @@ -11,7 +12,7 @@ context('Luis Deploy', () => { }); it('can deploy luis success', () => { - cy.get('[data-testid="LeftNav-CommandBarButtonUser Input"]').click(); + cy.findByTestId('LeftNav-CommandBarButtonUser Input').click(); cy.route({ method: 'POST', @@ -20,21 +21,19 @@ context('Luis Deploy', () => { response: 'fixture:luPublish/success', }); cy.findByText('Start Bot').click(); - cy.wait(5000); + // clear its settings before - cy.get('[data-testid="ProjectNameInput"]') + cy.findByTestId('ProjectNameInput') .clear() .type('MyProject'); - cy.get('[data-testid="EnvironmentInput"]') + cy.findByTestId('EnvironmentInput') .clear() .type('composer'); - cy.get('[data-testid="AuthoringKeyInput"]') + cy.findByTestId('AuthoringKeyInput') .clear() .type('0d4991873f334685a9686d1b48e0ff48'); // wait for the debounce interval of sync settings - cy.wait(1000); cy.findByText('OK').click(); - cy.wait(1000); cy.findByText('Restart Bot').should('exist'); cy.findByText('Test in Emulator').should('exist'); @@ -45,10 +44,8 @@ context('Luis Deploy', () => { response: 'fixture:luPublish/error', }); cy.findByText('Restart Bot').click(); - cy.wait(1000); cy.findByText('Try again').click(); - cy.wait(1000); - cy.get('[data-testid="AuthoringKeyInput"]').type('no-id'); + cy.findByTestId('AuthoringKeyInput').type('no-id'); cy.findByText('OK').click(); }); }); From bbc1a5cc273947d69178b93275b9c3ec712aee5b Mon Sep 17 00:00:00 2001 From: Andy Brown Date: Thu, 21 Nov 2019 09:02:10 -0800 Subject: [PATCH 20/30] convert LUPage spec to typescript --- .../{LUPage.spec.js => LUPage.spec.ts} | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) rename Composer/cypress/integration/{LUPage.spec.js => LUPage.spec.ts} (63%) diff --git a/Composer/cypress/integration/LUPage.spec.js b/Composer/cypress/integration/LUPage.spec.ts similarity index 63% rename from Composer/cypress/integration/LUPage.spec.js rename to Composer/cypress/integration/LUPage.spec.ts index c10e15bc76..4f762924b1 100644 --- a/Composer/cypress/integration/LUPage.spec.js +++ b/Composer/cypress/integration/LUPage.spec.ts @@ -1,13 +1,14 @@ -/// +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. -context('check language understanding page', () => { +context('LU Page', () => { before(() => { cy.visit(Cypress.env('COMPOSER_URL')); cy.createBot('ToDoBotWithLuisSample'); }); it('can open language understanding page', () => { - cy.get('[data-testid="LeftNav-CommandBarButtonUser Input"]').click(); + cy.findByTestId('LeftNav-CommandBarButtonUser Input').click(); // left nav tree cy.contains('ToDoBotWithLuisSample.Main'); @@ -19,18 +20,23 @@ context('check language understanding page', () => { cy.get('@switchButton').should('be.disabled'); // by default is table view - cy.get('[data-testid="LUEditor"] [data-testid="table-view"]').should('exist'); + cy.findByTestId('LUEditor') + .findByTestId('table-view') + .should('exist'); // nav to ToDoBotWithLuisSample.main dialog cy.get('.dialogNavTree button[title="__TestToDoBotWithLuisSample.Main"]').click({ multiple: true }); - cy.wait(300); // goto edit-mode cy.get('@switchButton').click(); - cy.get('[data-testid="LUEditor"] .monaco-editor').should('exist'); + cy.findByTestId('LUEditor') + .get('.monaco-editor') + .should('exist'); // back to all table view cy.get('.dialogNavTree button[title="All"]').click(); - cy.get('[data-testid="LUEditor"] [data-testid="table-view"]').should('exist'); + cy.findByTestId('LUEditor') + .findByTestId('table-view') + .should('exist'); }); }); From 569169ac678b43abf4cdfb9977f92310020fc563 Mon Sep 17 00:00:00 2001 From: Andy Brown Date: Thu, 21 Nov 2019 09:18:48 -0800 Subject: [PATCH 21/30] convert NewDialog spec to typescript --- Composer/cypress/integration/NewDialog.spec.js | 18 ------------------ Composer/cypress/integration/NewDialog.spec.ts | 18 ++++++++++++++++++ Composer/cypress/support/commands.d.ts | 9 ++++++--- Composer/cypress/support/commands.ts | 16 +++------------- 4 files changed, 27 insertions(+), 34 deletions(-) delete mode 100644 Composer/cypress/integration/NewDialog.spec.js create mode 100644 Composer/cypress/integration/NewDialog.spec.ts diff --git a/Composer/cypress/integration/NewDialog.spec.js b/Composer/cypress/integration/NewDialog.spec.js deleted file mode 100644 index 5c17ff969e..0000000000 --- a/Composer/cypress/integration/NewDialog.spec.js +++ /dev/null @@ -1,18 +0,0 @@ -/// - -context('Creating a new Dialog', () => { - beforeEach(() => { - cy.visit(Cypress.env('COMPOSER_URL')); - cy.copyBot('TodoSample', 'ToDoBotCopy'); - cy.get('[data-testid="LeftNav-CommandBarButtonDesign Flow"]').click(); - }); - - it('can create a new dialog from project tree', () => { - cy.findByText('New Dialog ..').click(); - cy.get('input[data-testid="NewDialogName"]').type('__TestNewDialog2'); - cy.get('input[data-testid="NewDialogName"]').type('{enter}'); - cy.get('[data-testid="ProjectTree"]').within(() => { - cy.findByText('__TestNewDialog2').should('exist'); - }); - }); -}); diff --git a/Composer/cypress/integration/NewDialog.spec.ts b/Composer/cypress/integration/NewDialog.spec.ts new file mode 100644 index 0000000000..23c379ddfd --- /dev/null +++ b/Composer/cypress/integration/NewDialog.spec.ts @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +context('Creating a new Dialog', () => { + beforeEach(() => { + cy.visit(Cypress.env('COMPOSER_URL')); + cy.createBot('TodoSample'); + cy.findByTestId('LeftNav-CommandBarButtonDesign Flow').click(); + }); + + it('can create a new dialog from project tree', () => { + cy.findByText('New Dialog ..').click(); + cy.findByTestId('NewDialogName').type('{selectall}__TestNewDialog2{enter}'); + cy.findByTestId('ProjectTree').within(() => { + cy.findByText('__TestNewDialog2').should('exist'); + }); + }); +}); diff --git a/Composer/cypress/support/commands.d.ts b/Composer/cypress/support/commands.d.ts index 25eea2e6a2..8714660d46 100644 --- a/Composer/cypress/support/commands.d.ts +++ b/Composer/cypress/support/commands.d.ts @@ -6,10 +6,13 @@ declare namespace Cypress { interface Chainable { /** - * Creates a bot based on template id - * @example cy.createBot('TodoSample') + * Creates a bot based on template id. + * If botName not provided, names the bot __Test${botId}, + * otherwise, __Test&{botName}. + * @example cy.createBot('TodoSample', 'NewBotName') */ - createBot(botName: string): void; + createBot(botId: string, botName?: string): void; + /** * Invokes callback inside editor context * @example cy.withinEditor('VisualEditor', () => { diff --git a/Composer/cypress/support/commands.ts b/Composer/cypress/support/commands.ts index 2eb85f5721..891ae72d8a 100644 --- a/Composer/cypress/support/commands.ts +++ b/Composer/cypress/support/commands.ts @@ -12,15 +12,15 @@ Cypress.Commands.overwrite('visit', (originalFn, url, { enableOnboarding } = {}) originalFn(url); }); -Cypress.Commands.add('createBot', botName => { +Cypress.Commands.add('createBot', (bobotId: string, botName?: string) => { cy.findByTestId('LeftNav-CommandBarButtonHome').click(); cy.findByTestId('homePage-ToolBar-New').within(() => { cy.findByText('New').click(); }); cy.findByTestId('Create from template').click({ force: true }); - cy.findByTestId(`${botName}`).click(); + cy.findByTestId(`${bobotId}`).click(); cy.findByTestId('NextStepButton').click(); - cy.findByTestId('NewDialogName').type(`{selectall}__Test${botName}{enter}`); + cy.findByTestId('NewDialogName').type(`{selectall}__Test${botName || bobotId}{enter}`); cy.wait(1000); }); @@ -57,16 +57,6 @@ Cypress.Commands.add('startFromTemplate', (template, name) => { cy.wait(1000); }); -Cypress.Commands.add('copyBot', (bot, name) => { - cy.createBot(bot); - cy.findByTestId('LeftNav-CommandBarButtonHome').click(); - cy.findByText('Save as').click(); - - cy.findByTestId('NewDialogName').type(`__Test${name}`); - cy.findByTestId('NewDialogName').type('{enter}'); - cy.wait(1000); -}); - Cypress.Commands.add('addEventHandler', handler => { cy.findByTestId('ProjectTree').within(() => { cy.findByText(/New Trigger ../).click(); From 5c4eaac28347753d13ce3c0d5aa69964f269971e Mon Sep 17 00:00:00 2001 From: Andy Brown Date: Thu, 21 Nov 2019 09:21:53 -0800 Subject: [PATCH 22/30] convert NotificationPage spec to typescript --- .../integration/NotificationPage.spec.js | 25 ------------------- .../integration/NotificationPage.spec.ts | 25 +++++++++++++++++++ Composer/cypress/support/commands.d.ts | 6 +++++ 3 files changed, 31 insertions(+), 25 deletions(-) delete mode 100644 Composer/cypress/integration/NotificationPage.spec.js create mode 100644 Composer/cypress/integration/NotificationPage.spec.ts diff --git a/Composer/cypress/integration/NotificationPage.spec.js b/Composer/cypress/integration/NotificationPage.spec.js deleted file mode 100644 index 0618ed70ba..0000000000 --- a/Composer/cypress/integration/NotificationPage.spec.js +++ /dev/null @@ -1,25 +0,0 @@ -/// - -context('check notifications page', () => { - beforeEach(() => { - cy.visit(Cypress.env('COMPOSER_URL')); - cy.createBot('TodoSample'); - }); - - it('can show lg syntax error ', () => { - cy.visitPage("Bot Responses"); - // left nav tree - cy.contains('TodoSample.Main'); - cy.contains('All'); - - cy.get('.toggleEditMode button').click(); - cy.get('textarea').type('test lg syntax error'); - - cy.visitPage("Notifications"); - - cy.get('[data-testid="notifications-table-view"]').within(() => { - cy.getByText('common.lg').should('exist'); - }); - - }); -}); diff --git a/Composer/cypress/integration/NotificationPage.spec.ts b/Composer/cypress/integration/NotificationPage.spec.ts new file mode 100644 index 0000000000..7a3d9fe657 --- /dev/null +++ b/Composer/cypress/integration/NotificationPage.spec.ts @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +context('Notification Page', () => { + beforeEach(() => { + cy.visit(Cypress.env('COMPOSER_URL')); + cy.createBot('TodoSample'); + }); + + it('can show lg syntax error ', () => { + cy.visitPage('Bot Responses'); + // left nav tree + cy.contains('TodoSample.Main'); + cy.contains('All'); + + cy.get('.toggleEditMode button').click(); + cy.get('textarea').type('test lg syntax error'); + + cy.visitPage('Notifications'); + + cy.get('[data-testid="notifications-table-view"]').within(() => { + cy.findByText('common.lg').should('exist'); + }); + }); +}); diff --git a/Composer/cypress/support/commands.d.ts b/Composer/cypress/support/commands.d.ts index 8714660d46..d9e9e141b4 100644 --- a/Composer/cypress/support/commands.d.ts +++ b/Composer/cypress/support/commands.d.ts @@ -13,6 +13,12 @@ declare namespace Cypress { */ createBot(botId: string, botName?: string): void; + /** + * Visits a page from the left nav bar using the page's testid + * @example visitPage('Bot Responses'); + */ + visitPage(page: string): void; + /** * Invokes callback inside editor context * @example cy.withinEditor('VisualEditor', () => { From c15e29bb4e4cfdc49734fd6674280731cdd54ca7 Mon Sep 17 00:00:00 2001 From: Andy Brown Date: Thu, 21 Nov 2019 09:41:13 -0800 Subject: [PATCH 23/30] convert Onboarding spec to typescript --- .../cypress/integration/Onboarding.spec.js | 51 ------------------- .../cypress/integration/Onboarding.spec.ts | 47 +++++++++++++++++ Composer/cypress/support/commands.ts | 9 ---- Composer/cypress/support/index.ts | 1 + 4 files changed, 48 insertions(+), 60 deletions(-) delete mode 100644 Composer/cypress/integration/Onboarding.spec.js create mode 100644 Composer/cypress/integration/Onboarding.spec.ts diff --git a/Composer/cypress/integration/Onboarding.spec.js b/Composer/cypress/integration/Onboarding.spec.js deleted file mode 100644 index bc7d116014..0000000000 --- a/Composer/cypress/integration/Onboarding.spec.js +++ /dev/null @@ -1,51 +0,0 @@ -/// - -context('onboarding', () => { - beforeEach(() => { - cy.visit(`${Cypress.env('COMPOSER_URL')}/home`, { enableOnboarding: true }); - cy.wait(1000); - cy.get('[data-testid="homePage-ToolBar-New"]').within(() => { - cy.findByText('New').click(); - }); - cy.wait(5000); - - cy.get('input[data-testid="Create from template"]').click({ force: true }); - cy.wait(100); - cy.get('[data-testid="TodoSample"]').click(); - cy.wait(100); - cy.get('button[data-testid="NextStepButton"]').click(); - cy.wait(100); - cy.get('input[data-testid="NewDialogName"]').type('__TestOnboarding'); - cy.get('input[data-testid="NewDialogName"]').type('{enter}'); - cy.wait(2000); - - //enable onboarding setting - cy.visitPage("Settings"); - cy.wait(2000); - cy.get('[data-testid="ProjectTree"]').within(() => { - cy.get('[title="Onboarding"]').click(); - }); - cy.get('button[data-testid="onboardingToggle"]').click(); - cy.visitPage("Design Flow"); - }); - - it('walk through product tour teaching bubbles', () => { - cy.getByTestId('onboardingNextSet', { force: true }).click(); - cy.getByTestId('onboardingNext', { force: true }).click(); - cy.getByTestId('onboardingNext', { force: true }).click(); - cy.getByTestId('onboardingNext', { force: true }).click(); - cy.getByTestId('onboardingNext', { force: true }).click(); - cy.getByTestId('onboardingNext', { force: true }).click(); - - cy.getByTestId('onboardingNextSet', { force: true }).click(); - cy.getByTestId('onboardingNext', { force: true }).click(); - - cy.getByTestId('onboardingNextSet', { force: true }).click(); - cy.getByTestId('onboardingNext', { force: true }).click(); - - cy.getByTestId('onboardingNextSet', { force: true }).click(); - cy.getByTestId('onboardingNext', { force: true }).click(); - - cy.getByTestId('onboardingDone', { force: true }).click(); - }); -}); diff --git a/Composer/cypress/integration/Onboarding.spec.ts b/Composer/cypress/integration/Onboarding.spec.ts new file mode 100644 index 0000000000..c10eb38e04 --- /dev/null +++ b/Composer/cypress/integration/Onboarding.spec.ts @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +context('Onboarding', () => { + beforeEach(() => { + window.localStorage.setItem('composer:OnboardingState', JSON.stringify({ complete: false })); + + cy.visit(`${Cypress.env('COMPOSER_URL')}/home`); + cy.findByTestId('homePage-ToolBar-New').within(() => { + cy.findByText('New').click(); + }); + // cy.wait(5000); + + cy.findByTestId('Create from template').click({ force: true }); + cy.findByTestId('TodoSample').click(); + cy.findByTestId('NextStepButton').click(); + cy.findByTestId('NewDialogName').type('{selectall}__TestOnboarding{enter}'); + // cy.wait(2000); + + //enable onboarding setting + cy.visitPage('Settings'); + // cy.wait(2000); + cy.findByText('Onboarding').click(); + cy.findByTestId('onboardingToggle').click(); + cy.visitPage('Design Flow'); + }); + + it('walk through product tour teaching bubbles', () => { + cy.findByTestId('onboardingNextSet').click(); + cy.findByTestId('onboardingNext').click(); + cy.findByTestId('onboardingNext').click(); + cy.findByTestId('onboardingNext').click(); + cy.findByTestId('onboardingNext').click(); + cy.findByTestId('onboardingNext').click(); + + cy.findByTestId('onboardingNextSet').click(); + cy.findByTestId('onboardingNext').click(); + + cy.findByTestId('onboardingNextSet').click(); + cy.findByTestId('onboardingNext').click(); + + cy.findByTestId('onboardingNextSet').click(); + cy.findByTestId('onboardingNext').click(); + + cy.findByTestId('onboardingDone').click(); + }); +}); diff --git a/Composer/cypress/support/commands.ts b/Composer/cypress/support/commands.ts index 891ae72d8a..4143235c66 100644 --- a/Composer/cypress/support/commands.ts +++ b/Composer/cypress/support/commands.ts @@ -3,15 +3,6 @@ import '@testing-library/cypress/add-commands'; -Cypress.Commands.overwrite('visit', (originalFn, url, { enableOnboarding } = {}) => { - if (!enableOnboarding) { - cy.window().then(window => - window.localStorage.setItem('composer:OnboardingState', JSON.stringify({ complete: true })) - ); - } - originalFn(url); -}); - Cypress.Commands.add('createBot', (bobotId: string, botName?: string) => { cy.findByTestId('LeftNav-CommandBarButtonHome').click(); cy.findByTestId('homePage-ToolBar-New').within(() => { diff --git a/Composer/cypress/support/index.ts b/Composer/cypress/support/index.ts index d54e1b0ecc..0bbb874401 100644 --- a/Composer/cypress/support/index.ts +++ b/Composer/cypress/support/index.ts @@ -5,6 +5,7 @@ import './commands'; beforeEach(() => { cy.exec('yarn test:integration:clean'); + window.localStorage.setItem('composer:OnboardingState', JSON.stringify({ complete: true })); }); after(() => { From 7245e446f4f47220957a67b859a372e9de4bf8bf Mon Sep 17 00:00:00 2001 From: Andy Brown Date: Thu, 21 Nov 2019 09:42:41 -0800 Subject: [PATCH 24/30] convert RemoveDialog spec to typescript --- .../{RemoveDialog.spec.js => RemoveDialog.spec.ts} | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) rename Composer/cypress/integration/{RemoveDialog.spec.js => RemoveDialog.spec.ts} (85%) diff --git a/Composer/cypress/integration/RemoveDialog.spec.js b/Composer/cypress/integration/RemoveDialog.spec.ts similarity index 85% rename from Composer/cypress/integration/RemoveDialog.spec.js rename to Composer/cypress/integration/RemoveDialog.spec.ts index d25fce5e87..cbe924757e 100644 --- a/Composer/cypress/integration/RemoveDialog.spec.js +++ b/Composer/cypress/integration/RemoveDialog.spec.ts @@ -1,9 +1,10 @@ -/// +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. context('RemoveDialog', () => { beforeEach(() => { cy.visit(Cypress.env('COMPOSER_URL')); - cy.copyBot('ToDoBotWithLuisSample', 'ToDoBotWithLuisSampleSpec'); + cy.createBot('ToDoBotWithLuisSample'); }); it('can remove dialog', () => { From 5dde9746bd51e127333010db0db6092d0dc02a50 Mon Sep 17 00:00:00 2001 From: Andy Brown Date: Thu, 21 Nov 2019 09:43:19 -0800 Subject: [PATCH 25/30] remove commented waits --- Composer/cypress/integration/Onboarding.spec.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/Composer/cypress/integration/Onboarding.spec.ts b/Composer/cypress/integration/Onboarding.spec.ts index c10eb38e04..e6f714fb16 100644 --- a/Composer/cypress/integration/Onboarding.spec.ts +++ b/Composer/cypress/integration/Onboarding.spec.ts @@ -9,17 +9,14 @@ context('Onboarding', () => { cy.findByTestId('homePage-ToolBar-New').within(() => { cy.findByText('New').click(); }); - // cy.wait(5000); cy.findByTestId('Create from template').click({ force: true }); cy.findByTestId('TodoSample').click(); cy.findByTestId('NextStepButton').click(); cy.findByTestId('NewDialogName').type('{selectall}__TestOnboarding{enter}'); - // cy.wait(2000); //enable onboarding setting cy.visitPage('Settings'); - // cy.wait(2000); cy.findByText('Onboarding').click(); cy.findByTestId('onboardingToggle').click(); cy.visitPage('Design Flow'); From cb0ea6494bdba3f8a22a705a86a3cd1c6b3507d1 Mon Sep 17 00:00:00 2001 From: Andy Brown Date: Thu, 21 Nov 2019 09:44:48 -0800 Subject: [PATCH 26/30] convert SaveAs spec to typescript --- .../integration/{SaveAs.spec.js => SaveAs.spec.ts} | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) rename Composer/cypress/integration/{SaveAs.spec.js => SaveAs.spec.ts} (54%) diff --git a/Composer/cypress/integration/SaveAs.spec.js b/Composer/cypress/integration/SaveAs.spec.ts similarity index 54% rename from Composer/cypress/integration/SaveAs.spec.js rename to Composer/cypress/integration/SaveAs.spec.ts index a18faee533..300776f0db 100644 --- a/Composer/cypress/integration/SaveAs.spec.js +++ b/Composer/cypress/integration/SaveAs.spec.ts @@ -1,20 +1,19 @@ -/// +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. context('Saving As', () => { beforeEach(() => { cy.visit(Cypress.env('COMPOSER_URL')); + cy.createBot('ToDoBotWithLuisSample'); }); it('can create a new bot from an existing bot', () => { - cy.createBot('ToDoBotWithLuisSample'); - cy.get('[data-testid="LeftNav-CommandBarButtonHome"]').click(); + cy.findByTestId('LeftNav-CommandBarButtonHome').click(); cy.findByText('Save as').click(); - cy.get('input[data-testid="NewDialogName"]').type('__TestSaveAs'); - cy.get('input[data-testid="NewDialogName"]').type('{enter}'); - cy.wait(1000); + cy.findByTestId('NewDialogName').type('{selectall}__TestSaveAs{enter}'); - cy.get('[data-testid="ProjectTree"]').within(() => { + cy.findByTestId('ProjectTree').within(() => { cy.findByText('__TestSaveAs.Main').should('exist'); cy.findByText('ViewCollection').should('exist'); }); From 176314e4ef2efc28591103f86e00a02dfbaa25f2 Mon Sep 17 00:00:00 2001 From: Andy Brown Date: Thu, 21 Nov 2019 09:45:43 -0800 Subject: [PATCH 27/30] remove switch condition spec too unstable --- .../integration/SwitchCondition.spec.js | 164 ------------------ 1 file changed, 164 deletions(-) delete mode 100644 Composer/cypress/integration/SwitchCondition.spec.js diff --git a/Composer/cypress/integration/SwitchCondition.spec.js b/Composer/cypress/integration/SwitchCondition.spec.js deleted file mode 100644 index f8755ba5de..0000000000 --- a/Composer/cypress/integration/SwitchCondition.spec.js +++ /dev/null @@ -1,164 +0,0 @@ -/// - -// this test is too unstable right now -// re-enable when stablized -context.skip('SwitchCondition', () => { - beforeEach(() => { - cy.visit(Cypress.env('COMPOSER_URL')); - cy.startFromTemplate('EmptyBot', 'SwitchConditionSpec'); - }); - - //will remove skip after add trigger is ok - it('can manage cases', () => { - cy.addEventHandler('Handle Unknown Intent'); - - cy.withinEditor('VisualEditor', () => { - cy.getByText(/OnUnknownIntent/).click({ force: true }); - cy.wait(100); - cy.getByText(/UnknownIntent/).click({ force: true }); - cy.wait(100); - cy.findByTestId('StepGroupAdd').click({ force: true }); - cy.findByText('Flow').click({ force: true }); - cy.findByText('Branch: Switch').click({ force: true }); - cy.findByTestId('SwitchConditionDiamond').click({ force: true }); - }); - - // Add case and add/delete/edit steps - cy.withinEditor('FormEditor', () => { - // Edit condition - cy.findByLabelText('Condition').type('user.age >= 21'); - - // Add new case - cy.findByText('Add New Case').click({ force: true }); - cy.findByLabelText('Value') - .type('Case1') - .type('{enter}'); - - // Add some steps - - // Send activity - // Use { force: true } can disable error checking like dom not visible or width and height '0 * 0' pixels. - // So if a button is in a popup window, using { force: true } to button click can make the tests more stable. - cy.findByText('Add New Action for Case1').click({ force: true }); - cy.findByText('Send Messages').click({ force: true }); - cy.findByText('Send an Activity').click({ force: true }); - cy.wait(300); - }); - cy.withinEditor('VisualEditor', () => { - cy.findByText('Branch: Switch').click({ force: true }); - }); - cy.withinEditor('FormEditor', () => { - // Edit array - cy.findByText('Add New Action for Case1').click({ force: true }); - cy.findByText('Memory manipulation').click({ force: true }); - cy.findByText('Edit an Array Property').click({ force: true }); - cy.wait(300); - }); - cy.withinEditor('VisualEditor', () => { - cy.findByText('Branch: Switch').click({ force: true }); - }); - cy.withinEditor('FormEditor', () => { - // Log step - cy.findByText('Add New Action for Case1').click({ force: true }); - cy.findByText('Debugging').click({ force: true }); - cy.findByText('Log to console').click({ force: true }); - cy.wait(300); - }); - cy.withinEditor('VisualEditor', () => { - cy.findByText('Branch: Switch').click({ force: true }); - }); - cy.withinEditor('FormEditor', () => { - cy.get('[data-automationid="DetailsRow"]') - .as('steps') - .should('have.length', 3); - - // re-order steps - const btn0 = cy - .get('@steps') - .eq(0) - .find('button') - .click({ force: true }); - btn0.invoke('attr', 'aria-owns').then(menuId => { - cy.get(`#${menuId}`) - .getByText('Move Down') - .click({ force: true }); - cy.wait(100); - }); - - const btn2 = cy - .get('@steps') - .eq(2) - .find('button') - .click({ force: true }); - btn2.invoke('attr', 'aria-owns').then(menuId => { - cy.get(`#${menuId}`) - .getByText('Move Up') - .click({ force: true }); - cy.wait(100); - }); - - // assert that the steps are in correct order - cy.get('@steps') - .get('[data-automationid="DetailsRowCell"][data-automation-key="name"]') - .eq(0) - .should('contain.text', 'Edit an Array Property'); - cy.get('@steps') - .get('[data-automationid="DetailsRowCell"][data-automation-key="name"]') - .eq(1) - .should('contain.text', 'Log to console'); - cy.get('@steps') - .get('[data-automationid="DetailsRowCell"][data-automation-key="name"]') - .eq(2) - .should('contain.text', 'Send an Activity'); - - // Add another new case - cy.findByText('Add New Case').click({ force: true }); - cy.wait(100); - cy.findByLabelText('Value') - .type('Case2') - .type('{enter}'); - - cy.wait(100); - - // move first case - let btn = cy - .get('.CasesFieldConditionsMenu') - .first() - .find('button'); - btn.click({ force: true }); - btn.invoke('attr', 'aria-owns').then(menuId => { - cy.get(`#${menuId}`) - .getByText('Move Down') - .click({ force: true }); - cy.wait(100); - }); - - cy.get('[role="separator"]') - .filter(':not(:contains(Branch: Switch))') - .should('have.length', 3) - .eq(1) - .should('have.text', 'Branch: Case1'); - - cy.wait(100); - - // remove case1 - btn = cy - .get('.CasesFieldConditionsMenu') - .first() - .find('button'); - btn.click({ force: true }); - btn.invoke('attr', 'aria-owns').then(menuId => { - cy.get(`#${menuId}`) - .getByText('Remove') - .click({ force: true }); - cy.wait(100); - }); - - cy.get('[role="separator"]') - .filter(':not(:contains(Branch: Switch))') - .should('have.length', 2) - .eq(1) - .should('have.text', 'Default'); - }); - }); -}); From 51450a11919de40f4cc7f3e5723d531f039d0998 Mon Sep 17 00:00:00 2001 From: Andy Brown Date: Thu, 21 Nov 2019 09:47:04 -0800 Subject: [PATCH 28/30] convert ToDo spec to typescript --- .../{ToDoBot.spec.js => ToDoBot.spec.ts} | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) rename Composer/cypress/integration/{ToDoBot.spec.js => ToDoBot.spec.ts} (74%) diff --git a/Composer/cypress/integration/ToDoBot.spec.js b/Composer/cypress/integration/ToDoBot.spec.ts similarity index 74% rename from Composer/cypress/integration/ToDoBot.spec.js rename to Composer/cypress/integration/ToDoBot.spec.ts index 6c06b6b09b..6af6943b15 100644 --- a/Composer/cypress/integration/ToDoBot.spec.js +++ b/Composer/cypress/integration/ToDoBot.spec.ts @@ -1,4 +1,5 @@ -/// +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. context('ToDo Bot', () => { beforeEach(() => { @@ -7,9 +8,8 @@ context('ToDo Bot', () => { }); it('can open the main dialog', () => { - cy.get('[data-testid="ProjectTree"]').within(() => { + cy.findByTestId('ProjectTree').within(() => { cy.findByText('__TestTodoSample.Main').click(); - cy.wait(100); }); cy.withinEditor('FormEditor', () => { cy.findByDisplayValue('__TestTodoSample').should('exist'); @@ -17,9 +17,8 @@ context('ToDo Bot', () => { }); it('can open the AddToDo dialog', () => { - cy.get('[data-testid="ProjectTree"]').within(() => { + cy.findByTestId('ProjectTree').within(() => { cy.findByText('AddToDo').click(); - cy.wait(100); }); cy.withinEditor('FormEditor', () => { @@ -28,9 +27,8 @@ context('ToDo Bot', () => { }); it('can open the ClearToDos dialog', () => { - cy.get('[data-testid="ProjectTree"]').within(() => { + cy.findByTestId('ProjectTree').within(() => { cy.findByText('ClearToDos').click(); - cy.wait(100); }); cy.withinEditor('FormEditor', () => { @@ -39,9 +37,8 @@ context('ToDo Bot', () => { }); it('can open the DeleteToDo dialog', () => { - cy.get('[data-testid="ProjectTree"]').within(() => { + cy.findByTestId('ProjectTree').within(() => { cy.findByText('DeleteToDo').click(); - cy.wait(100); }); cy.withinEditor('FormEditor', () => { @@ -50,9 +47,8 @@ context('ToDo Bot', () => { }); it('can open the ShowToDos dialog', () => { - cy.get('[data-testid="ProjectTree"]').within(() => { + cy.findByTestId('ProjectTree').within(() => { cy.findByText('ShowToDos').click(); - cy.wait(100); }); cy.withinEditor('FormEditor', () => { From f94ceb1aa74b5895730e75423f7ce9634937992e Mon Sep 17 00:00:00 2001 From: Andy Brown Date: Thu, 21 Nov 2019 09:48:43 -0800 Subject: [PATCH 29/30] convert VisualDesigner spec to typescript --- .../{VisualDesigner.spec.js => VisualDesigner.spec.ts} | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) rename Composer/cypress/integration/{VisualDesigner.spec.js => VisualDesigner.spec.ts} (73%) diff --git a/Composer/cypress/integration/VisualDesigner.spec.js b/Composer/cypress/integration/VisualDesigner.spec.ts similarity index 73% rename from Composer/cypress/integration/VisualDesigner.spec.js rename to Composer/cypress/integration/VisualDesigner.spec.ts index 6ce38f3d8e..7ecdabfaa2 100644 --- a/Composer/cypress/integration/VisualDesigner.spec.js +++ b/Composer/cypress/integration/VisualDesigner.spec.ts @@ -1,27 +1,22 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/// - context('Visual Designer', () => { before(() => { cy.visit(Cypress.env('COMPOSER_URL')); cy.createBot('TodoSample'); - cy.wait(100); }); beforeEach(() => { // Return to Main.dialog - cy.get('[data-testid="ProjectTree"]').within(() => { + cy.findByTestId('ProjectTree').within(() => { cy.findByText('__TestTodoSample.Main').click(); - cy.wait(100); }); }); it('can find Visual Designer default trigger in container', () => { - cy.get('[data-testid="ProjectTree"]').within(() => { + cy.findByTestId('ProjectTree').within(() => { cy.findByText('Greeting (ConversationUpdate)').click(); - cy.wait(500); }); cy.withinEditor('VisualEditor', () => { From 507da0f4d55dbc888e4ceb46afb93992db559554 Mon Sep 17 00:00:00 2001 From: Andy Brown Date: Thu, 21 Nov 2019 09:56:31 -0800 Subject: [PATCH 30/30] remove unused cypress commands --- Composer/cypress/support/commands.ts | 40 ---------------------------- 1 file changed, 40 deletions(-) diff --git a/Composer/cypress/support/commands.ts b/Composer/cypress/support/commands.ts index 4143235c66..de5939e41f 100644 --- a/Composer/cypress/support/commands.ts +++ b/Composer/cypress/support/commands.ts @@ -15,52 +15,12 @@ Cypress.Commands.add('createBot', (bobotId: string, botName?: string) => { cy.wait(1000); }); -Cypress.Commands.add('openBot', botName => { - cy.findByTestId('LeftNav-CommandBarButtonHome').click(); - cy.findByTestId('homePage-ToolBar-Open').within(() => { - cy.findByText('Open').click(); - }); - cy.findByTestId('SelectLocation').within(() => { - cy.get(`[aria-label="${botName}"]`).click({ force: true }); - cy.wait(500); - }); - cy.wait(500); -}); - Cypress.Commands.add('withinEditor', (editorName, cb) => { cy.get(`iframe[name="${editorName}"]`).then(editor => { cy.wrap(editor.contents().find('body') as JQuery).within(cb); }); }); -Cypress.Commands.add('openDialog', dialogName => { - cy.findByTestId('ProjectTree').within(() => { - cy.findByText(dialogName).click(); - cy.wait(500); - }); -}); - -Cypress.Commands.add('startFromTemplate', (template, name) => { - cy.findByTestId('LeftNav-CommandBarButtonHome').click(); - cy.findByTestId(`TemplateCopy-${template}`).click(); - cy.findByTestId('NewDialogName').type(`__Test${name}`); - cy.findByTestId('NewDialogName').type('{enter}'); - cy.wait(1000); -}); - -Cypress.Commands.add('addEventHandler', handler => { - cy.findByTestId('ProjectTree').within(() => { - cy.findByText(/New Trigger ../).click(); - }); - cy.findByTestId('triggerTypeDropDown').click(); - cy.findByText(handler).click(); - if (handler === 'Dialog trigger') { - cy.findByTestId('eventTypeDropDown').click(); - cy.findByText('consultDialog').click(); - } - cy.findByTestId('triggerFormSubmit').click(); -}); - Cypress.Commands.add('visitPage', page => { cy.findByTestId(`LeftNav-CommandBarButton${page}`).click(); });