Skip to content

Commit

Permalink
Merge branch 'master' into zeye/design/trigger
Browse files Browse the repository at this point in the history
  • Loading branch information
yeze322 authored Nov 22, 2019
2 parents 6f75849 + 2f96b52 commit 91eea69
Show file tree
Hide file tree
Showing 97 changed files with 767 additions and 1,123 deletions.
17 changes: 5 additions & 12 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,11 @@ jobs:
- name: yarn test:coverage
run: yarn test:coverage
working-directory: Composer
# secrets are not exposed to PRs opened by forks, so just skip this step if it is not defined
- name: Publish coverage results
run: |
if [[ -z $COVERALLS_REPO_TOKEN ]]; then
echo "Coveralls token not found. Skipping."
else
cat coverage/lcov.info | ./node_modules/.bin/coveralls
fi
working-directory: Composer
env:
COVERALLS_SERVICE_NAME: "Github Actions"
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./Composer/coverage/lcov.info

botproject:
name: BotProject
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/validate-pr.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: Pull Request Validation

on:
pull_request:
types: [opened, reopened, edited]
on: pull_request

jobs:
conventional-pr:
Expand Down
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Changelog

## Releases

### 11-20-2019

#### Added
* linting and validation UI (#1518) (@lei9444)

#### Changed
* improve build speed and bundle size (#1555) (@a-b-r-o-w-n)
* update `Conversation Started` trigger to `Greeting (Conversation Update)` (#1584) (@liweitian)

#### Fixed
* write QnA Maker endpointKey to settings (#1571) (@VanyLaw)
* fix docs typos (#1575) (@v-kydela)
* prevent double render in visual editor (#1601) (@yeze322)
* fix issue installing lubuild (#1606) (@lei9444)
* fix docker build (#1615) (@cwhitten)
1 change: 0 additions & 1 deletion Composer/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
5 changes: 3 additions & 2 deletions Composer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:10-alpine as build
FROM node:12-alpine as build
WORKDIR /src/Composer

# yes, docker copy is really this stupid, https://github.com/moby/moby/issues/15858
Expand All @@ -13,6 +13,7 @@ COPY packages/lib/code-editor/package.json ./packages/lib/code-editor/
COPY packages/lib/shared/package.json ./packages/lib/shared/
COPY packages/lib/indexers/package.json ./packages/lib/indexers/
COPY packages/extensions/package.json ./packages/extensions/
COPY packages/lib/eslint-plugin-bfcomposer/package.json ./packages/lib/eslint-plugin-bfcomposer/
COPY packages/extensions/obiformeditor/package.json ./packages/extensions/obiformeditor/
COPY packages/extensions/visual-designer/package.json ./packages/extensions/visual-designer/

Expand All @@ -23,7 +24,7 @@ COPY . .
RUN yarn build:prod

# use a multi-stage build to reduce the final image size
FROM node:10-alpine
FROM node:12-alpine

WORKDIR /app/Composer/server
COPY --from=build /src/Composer/.npmrc .
Expand Down
4 changes: 2 additions & 2 deletions Composer/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[![Build Status](https://github.com/microsoft/BotFramework-Composer/workflows/Composer%20CI/badge.svg?branch=stable)](https://github.com/microsoft/BotFramework-Composer/actions?query=branch%3Astable)
[![Coverage Status](https://coveralls.io/repos/github/microsoft/BotFramework-Composer/badge.svg?branch=stable)](https://coveralls.io/github/microsoft/BotFramework-Composer?branch=stable)
[![Build Status](https://github.com/microsoft/BotFramework-Composer/workflows/Composer%20CI/badge.svg?branch=master)](https://github.com/microsoft/BotFramework-Composer/actions?query=branch%3Amaster)
[![Coverage Status](https://coveralls.io/repos/github/microsoft/BotFramework-Composer/badge.svg?branch=master)](https://coveralls.io/github/microsoft/BotFramework-Composer?branch=master)
[![Total alerts](https://img.shields.io/lgtm/alerts/g/microsoft/BotFramework-Composer.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/microsoft/BotFramework-Composer/alerts/)

# Composer
Expand Down
1 change: 1 addition & 0 deletions Composer/cypress.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"**/examples/*",
"*.hot-update.js"
],
"supportFile": "cypress/support/index.ts",
"video": false,
"videoUploadOnPasses": false,
"viewportWidth": 1600,
Expand Down
3 changes: 3 additions & 0 deletions Composer/cypress/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: ['../.eslintrc.js', 'plugin:cypress/recommended'],
};
75 changes: 0 additions & 75 deletions Composer/cypress/integration/Breadcrumb.spec.js

This file was deleted.

66 changes: 66 additions & 0 deletions Composer/cypress/integration/Breadcrumb.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
// 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();
});

hasBreadcrumbItems(cy, ['AddToDo', 'Dialog started (BeginDialog)']);
});

it('can show action name in breadcrumb', () => {
cy.findByTestId('ProjectTree').within(() => {
cy.findByText('Greeting (ConversationUpdate)').click();
});

// 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']);
});
});
44 changes: 0 additions & 44 deletions Composer/cypress/integration/CreateNewBot.spec.js

This file was deleted.

35 changes: 35 additions & 0 deletions Composer/cypress/integration/CreateNewBot.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

context('Creating a new bot', () => {
beforeEach(() => {
cy.visit(Cypress.env('COMPOSER_URL'));
cy.findByTestId('LeftNav-CommandBarButtonHome').click();
cy.findByTestId('homePage-ToolBar-New').within(() => {
cy.findByText('New').click();
});
});

it('can create a new bot', () => {
cy.findByTestId('Create from scratch').click();
cy.findByTestId('NextStepButton').click();
cy.findByTestId('NewDialogName').type('{selectall}__TestNewProject{enter}');
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('{selectall}__TestNewProject{enter}');
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');
});
});
});
22 changes: 22 additions & 0 deletions Composer/cypress/integration/HomePage.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// 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.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.findByTestId('homePage-ToolBar-Open').click();
cy.findByText('Select a Bot').should('exist');
cy.findByText('Cancel').should('exist');
cy.findByText('Cancel').click();
cy.findByTestId('homePage-body-New').click();
cy.findByText('Create from scratch?').should('exist');
});
});
Original file line number Diff line number Diff line change
@@ -1,31 +1,36 @@
/// <reference types="Cypress" />
// 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');

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');
Expand Down
Loading

0 comments on commit 91eea69

Please sign in to comment.