From bec6122af030fb94d07582873b7a418f517c1318 Mon Sep 17 00:00:00 2001 From: venarius Date: Fri, 19 Nov 2021 23:39:09 +0100 Subject: [PATCH 1/3] Added E2E test for MM-T4284 --- webapp/cypress/integration/groups.js | 30 ++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 webapp/cypress/integration/groups.js diff --git a/webapp/cypress/integration/groups.js b/webapp/cypress/integration/groups.js new file mode 100644 index 000000000..e90d6dadc --- /dev/null +++ b/webapp/cypress/integration/groups.js @@ -0,0 +1,30 @@ +// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. +// See LICENSE.txt for license information. + +/* eslint-disable max-nested-callbacks */ + +/// + +describe('Manage groups', () => { + beforeEach(() => { + localStorage.setItem('focalboardSessionId', 'TESTTOKEN'); + localStorage.setItem('language', 'en'); + cy.expect(localStorage.getItem('focalboardSessionId')).to.eq('TESTTOKEN'); + localStorage.setItem('welcomePageViewed', 'true'); + }); + + it('MM-T4284 Adding a group', () => { + cy.visit('/'); + cy.contains('+ Add board').click({force: true}); + cy.contains('Empty board').click({force: true}); + + cy.contains('+ Add a group').click({force: true}); + cy.get(`.KanbanColumnHeader .Editable[value='New group']`).should('exist'); + + cy.get(`.KanbanColumnHeader .Editable[value='New group']`). + clear(). + type('Group 1'). + blur(); + cy.get(`.KanbanColumnHeader .Editable[value='Group 1']`).should('exist'); + }); +}); From 354716be34b8abc6f372ca2ac41d5a9902ddef28 Mon Sep 17 00:00:00 2001 From: venarius Date: Wed, 24 Nov 2021 12:43:04 +0100 Subject: [PATCH 2/3] cypress group tests are now ts --- webapp/cypress.json | 3 ++- webapp/cypress/integration/groups.js | 30 ---------------------- webapp/cypress/integration/manageGroups.ts | 24 +++++++++++++++++ 3 files changed, 26 insertions(+), 31 deletions(-) delete mode 100644 webapp/cypress/integration/groups.js create mode 100644 webapp/cypress/integration/manageGroups.ts diff --git a/webapp/cypress.json b/webapp/cypress.json index 7447aa6d7..9a2d4f5f9 100644 --- a/webapp/cypress.json +++ b/webapp/cypress.json @@ -3,7 +3,8 @@ "baseUrl": "http://localhost:8088", "testFiles": [ "**/login*.ts", - "**/create*.ts" + "**/create*.ts", + "**/manage*.ts" ], "env": { "username": "test-user", diff --git a/webapp/cypress/integration/groups.js b/webapp/cypress/integration/groups.js deleted file mode 100644 index e90d6dadc..000000000 --- a/webapp/cypress/integration/groups.js +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See LICENSE.txt for license information. - -/* eslint-disable max-nested-callbacks */ - -/// - -describe('Manage groups', () => { - beforeEach(() => { - localStorage.setItem('focalboardSessionId', 'TESTTOKEN'); - localStorage.setItem('language', 'en'); - cy.expect(localStorage.getItem('focalboardSessionId')).to.eq('TESTTOKEN'); - localStorage.setItem('welcomePageViewed', 'true'); - }); - - it('MM-T4284 Adding a group', () => { - cy.visit('/'); - cy.contains('+ Add board').click({force: true}); - cy.contains('Empty board').click({force: true}); - - cy.contains('+ Add a group').click({force: true}); - cy.get(`.KanbanColumnHeader .Editable[value='New group']`).should('exist'); - - cy.get(`.KanbanColumnHeader .Editable[value='New group']`). - clear(). - type('Group 1'). - blur(); - cy.get(`.KanbanColumnHeader .Editable[value='Group 1']`).should('exist'); - }); -}); diff --git a/webapp/cypress/integration/manageGroups.ts b/webapp/cypress/integration/manageGroups.ts new file mode 100644 index 000000000..b5db23770 --- /dev/null +++ b/webapp/cypress/integration/manageGroups.ts @@ -0,0 +1,24 @@ +// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. +// See LICENSE.txt for license information. + +describe('Manage groups', () => { + beforeEach(() => { + cy.apiInitServer() + localStorage.setItem('welcomePageViewed', 'true') + }) + + it('MM-T4284 Adding a group', () => { + cy.visit('/') + cy.contains('+ Add board').click({force: true}) + cy.contains('Empty board').click({force: true}) + + cy.contains('+ Add a group').click({force: true}) + cy.get(`.KanbanColumnHeader .Editable[value='New group']`).should('exist') + + cy.get(`.KanbanColumnHeader .Editable[value='New group']`). + clear(). + type('Group 1'). + blur() + cy.get(`.KanbanColumnHeader .Editable[value='Group 1']`).should('exist') + }) +}) From 1c2a165003712e2377a290988c3682f1e979f074 Mon Sep 17 00:00:00 2001 From: venarius Date: Wed, 24 Nov 2021 13:24:14 +0100 Subject: [PATCH 3/3] satisfy eslint --- webapp/cypress/integration/manageGroups.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/webapp/cypress/integration/manageGroups.ts b/webapp/cypress/integration/manageGroups.ts index b5db23770..79f6855cf 100644 --- a/webapp/cypress/integration/manageGroups.ts +++ b/webapp/cypress/integration/manageGroups.ts @@ -13,12 +13,12 @@ describe('Manage groups', () => { cy.contains('Empty board').click({force: true}) cy.contains('+ Add a group').click({force: true}) - cy.get(`.KanbanColumnHeader .Editable[value='New group']`).should('exist') + cy.get('.KanbanColumnHeader .Editable[value=\'New group\']').should('exist') - cy.get(`.KanbanColumnHeader .Editable[value='New group']`). + cy.get('.KanbanColumnHeader .Editable[value=\'New group\']'). clear(). type('Group 1'). blur() - cy.get(`.KanbanColumnHeader .Editable[value='Group 1']`).should('exist') + cy.get('.KanbanColumnHeader .Editable[value=\'Group 1\']').should('exist') }) })