From c27ad6e3b4b3984daa95ebb3471dbb202b350ccb Mon Sep 17 00:00:00 2001 From: leilzh Date: Thu, 28 Nov 2019 15:06:04 +0800 Subject: [PATCH 1/2] update the e2e env.COMPOSER_BOTS_FOLDER --- Composer/cypress/integration/NotificationPage.spec.ts | 2 +- Composer/cypress/support/commands.ts | 5 +++++ Composer/package.json | 2 +- azure-pipelines.yml | 4 ++-- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Composer/cypress/integration/NotificationPage.spec.ts b/Composer/cypress/integration/NotificationPage.spec.ts index 7a3d9fe657..f9132a1c23 100644 --- a/Composer/cypress/integration/NotificationPage.spec.ts +++ b/Composer/cypress/integration/NotificationPage.spec.ts @@ -5,6 +5,7 @@ context('Notification Page', () => { beforeEach(() => { cy.visit(Cypress.env('COMPOSER_URL')); cy.createBot('TodoSample'); + cy.visitPage('Notifications'); }); it('can show lg syntax error ', () => { @@ -17,7 +18,6 @@ context('Notification Page', () => { 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.ts b/Composer/cypress/support/commands.ts index de5939e41f..6032899e72 100644 --- a/Composer/cypress/support/commands.ts +++ b/Composer/cypress/support/commands.ts @@ -23,4 +23,9 @@ Cypress.Commands.add('withinEditor', (editorName, cb) => { Cypress.Commands.add('visitPage', page => { cy.findByTestId(`LeftNav-CommandBarButton${page}`).click(); + cy.wait(3000); +}); + +Cypress.on('uncaught:exception', (err, runnable) => { + return false; }); diff --git a/Composer/package.json b/Composer/package.json index 742387b7b8..21b3b3df5e 100644 --- a/Composer/package.json +++ b/Composer/package.json @@ -34,7 +34,7 @@ "test:coverage": "yarn test --coverage --no-cache --reporters=default", "test:integration": "cypress run --browser chrome", "test:integration:open": "cypress open", - "test:integration:clean": "rimraf TestBots/*", + "test:integration:clean": "rimraf ../MyBots/__Test*", "lint": "wsrun --exclude-missing --collect-logs --report lint", "lint:fix": "wsrun --exclude-missing --collect-logs --report lint:fix", "typecheck": "concurrently --kill-others-on-fail \"npm:typecheck:*\"", diff --git a/azure-pipelines.yml b/azure-pipelines.yml index f0b2fa4364..bb64d91660 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -5,7 +5,7 @@ pr: autoCancel: true branches: include: - - '*' + - "*" variables: YARN_CACHE_FOLDER: $(Pipeline.Workspace)/.yarn @@ -52,7 +52,7 @@ jobs: CYPRESS_SCREENSHOTS_FOLDER: $(Build.ArtifactStagingDirectory)/cypress/screenshots CYPRESS_VIDEOS_FOLDER: $(Build.ArtifactStagingDirectory)/cypress/videos TERM: xterm - COMPOSER_BOTS_FOLDER: $(Pipeline.Workspace)/Composer/TestBots + COMPOSER_BOTS_FOLDER: $(System.DefaultWorkingDirectory)/MyBots - task: PublishPipelineArtifact@1 condition: failed() continueOnError: true From 61045ac1cb8ec9c69e8fca7cd6b54973c855a852 Mon Sep 17 00:00:00 2001 From: leilzh Date: Thu, 28 Nov 2019 23:28:09 +0800 Subject: [PATCH 2/2] test --- Composer/cypress/integration/Breadcrumb.spec.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Composer/cypress/integration/Breadcrumb.spec.ts b/Composer/cypress/integration/Breadcrumb.spec.ts index 8c647ee409..f611c8e0f1 100644 --- a/Composer/cypress/integration/Breadcrumb.spec.ts +++ b/Composer/cypress/integration/Breadcrumb.spec.ts @@ -13,7 +13,7 @@ context('breadcrumb', () => { }); function hasBreadcrumbItems(cy: Cypress.cy, items: (string | RegExp)[]) { - cy.findByTestId('Breadcrumb') + cy.get('[data-testid="Breadcrumb"]') .get('li') .should($li => { items.forEach((item, idx) => { @@ -37,7 +37,7 @@ context('breadcrumb', () => { cy.findByText('__TestTodoSample.Main').click(); }); - hasBreadcrumbItems(cy, ['__TestTodoSample']); + hasBreadcrumbItems(cy, ['__TestTodoSample.Main']); }); it('can show event name in breadcrumb', () => {