From 354716be34b8abc6f372ca2ac41d5a9902ddef28 Mon Sep 17 00:00:00 2001 From: venarius Date: Wed, 24 Nov 2021 12:43:04 +0100 Subject: [PATCH] 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') + }) +})