1
0
mirror of https://github.com/mattermost/focalboard.git synced 2024-12-24 13:43:12 +02:00
focalboard/webapp/cypress/integration/groupByProperty.ts
kamre 7cb25b9e17
[GH-1826] Cypress test for group by different property (#1966)
* Cypress command for resetting boards added.

* Cypress test for group board by different property added:
 - using @testing-library/cypress
 - minor fixes for `PropertyMenu` and `Dialog` components
 - bug in `ViewHeaderGroupByMenu` fixed: use `groupByProperty` passed in props instead of one from active view

* Jest snapshots updated.

* Use only case-sensitive strings for names in Cypress test.

* Cypress commands for adding new board and new group added.

* Jest snapshot for new test updated.

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-12-15 09:57:58 -07:00

59 lines
2.3 KiB
TypeScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
describe('Group board by different properties', () => {
beforeEach(() => {
cy.apiInitServer()
cy.apiResetBoards()
localStorage.setItem('welcomePageViewed', 'true')
})
it('MM-T4291 Group by different property', () => {
cy.visit('/')
// Create new board
cy.uiCreateNewBoard('Testing')
// Add a new group
cy.uiAddNewGroup('Group 1')
// Add a new card to the group
cy.log('**Add a new card to the group**')
cy.findAllByRole('button', {name: '+ New'}).eq(1).click()
cy.findByRole('dialog').should('exist')
cy.findByTestId('select-non-editable').findByText('Group 1').should('exist')
cy.get('#mainBoardBody').findByText('Untitled').should('exist')
// Add new select property
cy.log('**Add new select property**')
cy.findAllByRole('button', {name: '+ Add a property'}).click()
cy.findAllByRole('button', {name: 'Select'}).click()
cy.findByRole('textbox', {name: 'Select'}).type('{enter}')
cy.findByRole('dialog').findByRole('button', {name: 'Select'}).should('exist')
// Close card dialog
cy.log('**Close card dialog**')
cy.findByRole('button', {name: 'Close dialog'}).click()
cy.findByRole('dialog').should('not.exist')
// Group by new select property
cy.log('**Group by new select property**')
cy.findByRole('button', {name: /Group by:/}).click()
cy.findByRole('button', {name: 'Status'}).get('.CheckIcon').should('exist')
cy.findByRole('button', {name: 'Select'}).click()
cy.findByTitle(/empty Select property/).contains('No Select')
cy.get('#mainBoardBody').findByText('Untitled').should('exist')
// Add another new group
cy.log('**Add another new group**')
cy.findByRole('button', {name: '+ Add a group'}).click()
cy.findByRole('textbox', {name: 'New group'}).should('exist')
// Add a new card to another group
cy.log('**Add a new card to another group**')
cy.findAllByRole('button', {name: '+ New'}).eq(1).click()
cy.findByRole('dialog').should('exist')
cy.findAllByTestId('select-non-editable').last().findByText('New group').should('exist')
})
})