[GH-42] Cypress tests for login actions (#1679)
* Testing API added to server:
- registered only if `enableTestingAPI` is set to `true` in the config file
- has only one route `test/reset`
- reset clears the tables in db for blocks, users, sessions
- functions `DeleteAllBlocks` and `DeleteAllUsers` added to `Store` interface
- new functions implemented for `SQLStore`
* Cypress tests (initial version) for login actions added:
- redirect to login page,
- register user,
- test for loading home page deleted,
- allow js in `tsconfig.json` for cypress tests.
* Cypress tests for login actions:
- check that main page with workspace is visible after registration,
- initial version of test for login of register user.
* Cypress tests for login actions:
- function for checking that workspace is available added,
- functions for login and logout added,
- test for password change added,
- session parameters added to server config for cypress testing.
* Switch Cypress tests to typescript.
* Use ids for inputs instead of placeholder text.
* Use cypress request for login without loading login page.
* Cypress custom command for login added.
* Cypress tests fixed:
- new cypress commands for server reset, register/login user
- single test for "create and delete board/card"
- fixes for `BoardPage` component useEffect callbacks
- npm script `runserver-test` doesn't use single user mode
* Deletion of all blocks changed:
- also deletes blocks from history
- public function renamed to DeleteAllBlocksPermanently
- code for mocks and public methods generated
* Server tests for files fixed on windows.
* Cypress tests for the registration of second user via invite link added.
* Added `baseUrl` in main `tsconfig.json` (required by cypress configuration).
* Cypress test fixed. Comments as well as log messages added.
* Log a message if testing API is enabled.
* Single cypress test for register/login actions.
* Revert changes to server.
* More convenient cypress commands:
- all API calls made as separate commands
- declarations for commands moved to separate global.d.ts file
- utility functions moved after test actions in 'Login actions' test
2021-11-22 16:59:01 +01:00
|
|
|
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
|
|
// See LICENSE.txt for license information.
|
|
|
|
|
|
|
|
describe('Create and delete board / card', () => {
|
|
|
|
const timestamp = new Date().toLocaleString()
|
|
|
|
const boardTitle = `Test Board (${timestamp})`
|
|
|
|
const cardTitle = `Test Card (${timestamp})`
|
|
|
|
|
|
|
|
beforeEach(() => {
|
|
|
|
cy.apiInitServer()
|
2021-12-15 17:57:58 +01:00
|
|
|
cy.apiResetBoards()
|
2022-02-28 12:28:16 +01:00
|
|
|
cy.apiGetMe().then((userID) => cy.apiSkipTour(userID))
|
[GH-42] Cypress tests for login actions (#1679)
* Testing API added to server:
- registered only if `enableTestingAPI` is set to `true` in the config file
- has only one route `test/reset`
- reset clears the tables in db for blocks, users, sessions
- functions `DeleteAllBlocks` and `DeleteAllUsers` added to `Store` interface
- new functions implemented for `SQLStore`
* Cypress tests (initial version) for login actions added:
- redirect to login page,
- register user,
- test for loading home page deleted,
- allow js in `tsconfig.json` for cypress tests.
* Cypress tests for login actions:
- check that main page with workspace is visible after registration,
- initial version of test for login of register user.
* Cypress tests for login actions:
- function for checking that workspace is available added,
- functions for login and logout added,
- test for password change added,
- session parameters added to server config for cypress testing.
* Switch Cypress tests to typescript.
* Use ids for inputs instead of placeholder text.
* Use cypress request for login without loading login page.
* Cypress custom command for login added.
* Cypress tests fixed:
- new cypress commands for server reset, register/login user
- single test for "create and delete board/card"
- fixes for `BoardPage` component useEffect callbacks
- npm script `runserver-test` doesn't use single user mode
* Deletion of all blocks changed:
- also deletes blocks from history
- public function renamed to DeleteAllBlocksPermanently
- code for mocks and public methods generated
* Server tests for files fixed on windows.
* Cypress tests for the registration of second user via invite link added.
* Added `baseUrl` in main `tsconfig.json` (required by cypress configuration).
* Cypress test fixed. Comments as well as log messages added.
* Log a message if testing API is enabled.
* Single cypress test for register/login actions.
* Revert changes to server.
* More convenient cypress commands:
- all API calls made as separate commands
- declarations for commands moved to separate global.d.ts file
- utility functions moved after test actions in 'Login actions' test
2021-11-22 16:59:01 +01:00
|
|
|
localStorage.setItem('welcomePageViewed', 'true')
|
2022-04-06 16:22:47 +02:00
|
|
|
localStorage.setItem('language', 'en')
|
[GH-42] Cypress tests for login actions (#1679)
* Testing API added to server:
- registered only if `enableTestingAPI` is set to `true` in the config file
- has only one route `test/reset`
- reset clears the tables in db for blocks, users, sessions
- functions `DeleteAllBlocks` and `DeleteAllUsers` added to `Store` interface
- new functions implemented for `SQLStore`
* Cypress tests (initial version) for login actions added:
- redirect to login page,
- register user,
- test for loading home page deleted,
- allow js in `tsconfig.json` for cypress tests.
* Cypress tests for login actions:
- check that main page with workspace is visible after registration,
- initial version of test for login of register user.
* Cypress tests for login actions:
- function for checking that workspace is available added,
- functions for login and logout added,
- test for password change added,
- session parameters added to server config for cypress testing.
* Switch Cypress tests to typescript.
* Use ids for inputs instead of placeholder text.
* Use cypress request for login without loading login page.
* Cypress custom command for login added.
* Cypress tests fixed:
- new cypress commands for server reset, register/login user
- single test for "create and delete board/card"
- fixes for `BoardPage` component useEffect callbacks
- npm script `runserver-test` doesn't use single user mode
* Deletion of all blocks changed:
- also deletes blocks from history
- public function renamed to DeleteAllBlocksPermanently
- code for mocks and public methods generated
* Server tests for files fixed on windows.
* Cypress tests for the registration of second user via invite link added.
* Added `baseUrl` in main `tsconfig.json` (required by cypress configuration).
* Cypress test fixed. Comments as well as log messages added.
* Log a message if testing API is enabled.
* Single cypress test for register/login actions.
* Revert changes to server.
* More convenient cypress commands:
- all API calls made as separate commands
- declarations for commands moved to separate global.d.ts file
- utility functions moved after test actions in 'Login actions' test
2021-11-22 16:59:01 +01:00
|
|
|
})
|
|
|
|
|
2021-12-10 05:01:41 +01:00
|
|
|
it('MM-T4274 Create an Empty Board', () => {
|
|
|
|
cy.visit('/')
|
|
|
|
|
|
|
|
cy.contains('+ Add board').should('exist').click()
|
|
|
|
|
|
|
|
// Tests for template selector
|
2022-02-02 09:38:57 +01:00
|
|
|
cy.contains('Use this template').should('exist')
|
2021-12-10 05:01:41 +01:00
|
|
|
|
|
|
|
// Some options are present
|
2022-02-02 19:52:38 +01:00
|
|
|
cy.contains('Meeting Agenda').should('exist')
|
2021-12-10 05:01:41 +01:00
|
|
|
cy.contains('Personal Goals').should('exist')
|
|
|
|
cy.contains('Project Tasks').should('exist')
|
|
|
|
|
|
|
|
// Create empty board
|
2022-02-02 09:38:57 +01:00
|
|
|
cy.contains('Create empty board').should('exist').click({force: true})
|
2021-12-10 05:01:41 +01:00
|
|
|
cy.get('.BoardComponent').should('exist')
|
2022-06-16 13:17:44 +02:00
|
|
|
cy.get('.Editable.title').invoke('attr', 'placeholder').should('contain', 'Untitled board')
|
2021-12-10 05:01:41 +01:00
|
|
|
|
|
|
|
// Change Title
|
|
|
|
cy.get('.Editable.title').
|
|
|
|
type('Testing').
|
|
|
|
type('{enter}').
|
|
|
|
should('have.value', 'Testing')
|
|
|
|
})
|
|
|
|
|
[GH-42] Cypress tests for login actions (#1679)
* Testing API added to server:
- registered only if `enableTestingAPI` is set to `true` in the config file
- has only one route `test/reset`
- reset clears the tables in db for blocks, users, sessions
- functions `DeleteAllBlocks` and `DeleteAllUsers` added to `Store` interface
- new functions implemented for `SQLStore`
* Cypress tests (initial version) for login actions added:
- redirect to login page,
- register user,
- test for loading home page deleted,
- allow js in `tsconfig.json` for cypress tests.
* Cypress tests for login actions:
- check that main page with workspace is visible after registration,
- initial version of test for login of register user.
* Cypress tests for login actions:
- function for checking that workspace is available added,
- functions for login and logout added,
- test for password change added,
- session parameters added to server config for cypress testing.
* Switch Cypress tests to typescript.
* Use ids for inputs instead of placeholder text.
* Use cypress request for login without loading login page.
* Cypress custom command for login added.
* Cypress tests fixed:
- new cypress commands for server reset, register/login user
- single test for "create and delete board/card"
- fixes for `BoardPage` component useEffect callbacks
- npm script `runserver-test` doesn't use single user mode
* Deletion of all blocks changed:
- also deletes blocks from history
- public function renamed to DeleteAllBlocksPermanently
- code for mocks and public methods generated
* Server tests for files fixed on windows.
* Cypress tests for the registration of second user via invite link added.
* Added `baseUrl` in main `tsconfig.json` (required by cypress configuration).
* Cypress test fixed. Comments as well as log messages added.
* Log a message if testing API is enabled.
* Single cypress test for register/login actions.
* Revert changes to server.
* More convenient cypress commands:
- all API calls made as separate commands
- declarations for commands moved to separate global.d.ts file
- utility functions moved after test actions in 'Login actions' test
2021-11-22 16:59:01 +01:00
|
|
|
it('Can create and delete a board and a card', () => {
|
2022-01-07 19:58:28 +01:00
|
|
|
// Visit a page and create new empty board
|
[GH-42] Cypress tests for login actions (#1679)
* Testing API added to server:
- registered only if `enableTestingAPI` is set to `true` in the config file
- has only one route `test/reset`
- reset clears the tables in db for blocks, users, sessions
- functions `DeleteAllBlocks` and `DeleteAllUsers` added to `Store` interface
- new functions implemented for `SQLStore`
* Cypress tests (initial version) for login actions added:
- redirect to login page,
- register user,
- test for loading home page deleted,
- allow js in `tsconfig.json` for cypress tests.
* Cypress tests for login actions:
- check that main page with workspace is visible after registration,
- initial version of test for login of register user.
* Cypress tests for login actions:
- function for checking that workspace is available added,
- functions for login and logout added,
- test for password change added,
- session parameters added to server config for cypress testing.
* Switch Cypress tests to typescript.
* Use ids for inputs instead of placeholder text.
* Use cypress request for login without loading login page.
* Cypress custom command for login added.
* Cypress tests fixed:
- new cypress commands for server reset, register/login user
- single test for "create and delete board/card"
- fixes for `BoardPage` component useEffect callbacks
- npm script `runserver-test` doesn't use single user mode
* Deletion of all blocks changed:
- also deletes blocks from history
- public function renamed to DeleteAllBlocksPermanently
- code for mocks and public methods generated
* Server tests for files fixed on windows.
* Cypress tests for the registration of second user via invite link added.
* Added `baseUrl` in main `tsconfig.json` (required by cypress configuration).
* Cypress test fixed. Comments as well as log messages added.
* Log a message if testing API is enabled.
* Single cypress test for register/login actions.
* Revert changes to server.
* More convenient cypress commands:
- all API calls made as separate commands
- declarations for commands moved to separate global.d.ts file
- utility functions moved after test actions in 'Login actions' test
2021-11-22 16:59:01 +01:00
|
|
|
cy.visit('/')
|
2022-02-02 09:38:57 +01:00
|
|
|
cy.uiCreateEmptyBoard()
|
[GH-42] Cypress tests for login actions (#1679)
* Testing API added to server:
- registered only if `enableTestingAPI` is set to `true` in the config file
- has only one route `test/reset`
- reset clears the tables in db for blocks, users, sessions
- functions `DeleteAllBlocks` and `DeleteAllUsers` added to `Store` interface
- new functions implemented for `SQLStore`
* Cypress tests (initial version) for login actions added:
- redirect to login page,
- register user,
- test for loading home page deleted,
- allow js in `tsconfig.json` for cypress tests.
* Cypress tests for login actions:
- check that main page with workspace is visible after registration,
- initial version of test for login of register user.
* Cypress tests for login actions:
- function for checking that workspace is available added,
- functions for login and logout added,
- test for password change added,
- session parameters added to server config for cypress testing.
* Switch Cypress tests to typescript.
* Use ids for inputs instead of placeholder text.
* Use cypress request for login without loading login page.
* Cypress custom command for login added.
* Cypress tests fixed:
- new cypress commands for server reset, register/login user
- single test for "create and delete board/card"
- fixes for `BoardPage` component useEffect callbacks
- npm script `runserver-test` doesn't use single user mode
* Deletion of all blocks changed:
- also deletes blocks from history
- public function renamed to DeleteAllBlocksPermanently
- code for mocks and public methods generated
* Server tests for files fixed on windows.
* Cypress tests for the registration of second user via invite link added.
* Added `baseUrl` in main `tsconfig.json` (required by cypress configuration).
* Cypress test fixed. Comments as well as log messages added.
* Log a message if testing API is enabled.
* Single cypress test for register/login actions.
* Revert changes to server.
* More convenient cypress commands:
- all API calls made as separate commands
- declarations for commands moved to separate global.d.ts file
- utility functions moved after test actions in 'Login actions' test
2021-11-22 16:59:01 +01:00
|
|
|
|
|
|
|
// Change board title
|
|
|
|
cy.log('**Change board title**')
|
|
|
|
cy.get('.Editable.title').
|
|
|
|
type(boardTitle).
|
|
|
|
type('{enter}').
|
|
|
|
should('have.value', boardTitle)
|
|
|
|
|
|
|
|
// Hide and show the sidebar
|
|
|
|
cy.log('**Hide and show the sidebar**')
|
|
|
|
cy.get('.sidebarSwitcher').click()
|
|
|
|
cy.get('.Sidebar .heading').should('not.exist')
|
|
|
|
cy.get('.Sidebar .show-button').click()
|
|
|
|
cy.get('.Sidebar .heading').should('exist')
|
|
|
|
|
|
|
|
// Rename board view
|
|
|
|
cy.log('**Rename board view**')
|
|
|
|
const boardViewTitle = `Test board (${timestamp})`
|
2022-02-28 12:28:16 +01:00
|
|
|
cy.get(".ViewHeader>.viewSelector>.Editable[title='Board view']").should('exist')
|
|
|
|
cy.get('.ViewHeader>.viewSelector>.Editable').
|
[GH-42] Cypress tests for login actions (#1679)
* Testing API added to server:
- registered only if `enableTestingAPI` is set to `true` in the config file
- has only one route `test/reset`
- reset clears the tables in db for blocks, users, sessions
- functions `DeleteAllBlocks` and `DeleteAllUsers` added to `Store` interface
- new functions implemented for `SQLStore`
* Cypress tests (initial version) for login actions added:
- redirect to login page,
- register user,
- test for loading home page deleted,
- allow js in `tsconfig.json` for cypress tests.
* Cypress tests for login actions:
- check that main page with workspace is visible after registration,
- initial version of test for login of register user.
* Cypress tests for login actions:
- function for checking that workspace is available added,
- functions for login and logout added,
- test for password change added,
- session parameters added to server config for cypress testing.
* Switch Cypress tests to typescript.
* Use ids for inputs instead of placeholder text.
* Use cypress request for login without loading login page.
* Cypress custom command for login added.
* Cypress tests fixed:
- new cypress commands for server reset, register/login user
- single test for "create and delete board/card"
- fixes for `BoardPage` component useEffect callbacks
- npm script `runserver-test` doesn't use single user mode
* Deletion of all blocks changed:
- also deletes blocks from history
- public function renamed to DeleteAllBlocksPermanently
- code for mocks and public methods generated
* Server tests for files fixed on windows.
* Cypress tests for the registration of second user via invite link added.
* Added `baseUrl` in main `tsconfig.json` (required by cypress configuration).
* Cypress test fixed. Comments as well as log messages added.
* Log a message if testing API is enabled.
* Single cypress test for register/login actions.
* Revert changes to server.
* More convenient cypress commands:
- all API calls made as separate commands
- declarations for commands moved to separate global.d.ts file
- utility functions moved after test actions in 'Login actions' test
2021-11-22 16:59:01 +01:00
|
|
|
clear().
|
|
|
|
type(boardViewTitle).
|
|
|
|
type('{esc}')
|
|
|
|
cy.get(`.ViewHeader .Editable[title='${boardViewTitle}']`).should('exist')
|
|
|
|
|
|
|
|
// Create card
|
|
|
|
cy.log('**Create card**')
|
|
|
|
cy.get('.ViewHeader').contains('New').click()
|
|
|
|
cy.get('.CardDetail').should('exist')
|
2022-05-02 09:54:11 +02:00
|
|
|
|
2022-04-13 06:46:08 +02:00
|
|
|
//Check title has focus when card is created
|
|
|
|
cy.log('**Check title has focus when card is created**')
|
|
|
|
cy.get('.CardDetail .EditableArea.title').
|
|
|
|
should('have.focus')
|
2022-05-02 09:54:11 +02:00
|
|
|
|
[GH-42] Cypress tests for login actions (#1679)
* Testing API added to server:
- registered only if `enableTestingAPI` is set to `true` in the config file
- has only one route `test/reset`
- reset clears the tables in db for blocks, users, sessions
- functions `DeleteAllBlocks` and `DeleteAllUsers` added to `Store` interface
- new functions implemented for `SQLStore`
* Cypress tests (initial version) for login actions added:
- redirect to login page,
- register user,
- test for loading home page deleted,
- allow js in `tsconfig.json` for cypress tests.
* Cypress tests for login actions:
- check that main page with workspace is visible after registration,
- initial version of test for login of register user.
* Cypress tests for login actions:
- function for checking that workspace is available added,
- functions for login and logout added,
- test for password change added,
- session parameters added to server config for cypress testing.
* Switch Cypress tests to typescript.
* Use ids for inputs instead of placeholder text.
* Use cypress request for login without loading login page.
* Cypress custom command for login added.
* Cypress tests fixed:
- new cypress commands for server reset, register/login user
- single test for "create and delete board/card"
- fixes for `BoardPage` component useEffect callbacks
- npm script `runserver-test` doesn't use single user mode
* Deletion of all blocks changed:
- also deletes blocks from history
- public function renamed to DeleteAllBlocksPermanently
- code for mocks and public methods generated
* Server tests for files fixed on windows.
* Cypress tests for the registration of second user via invite link added.
* Added `baseUrl` in main `tsconfig.json` (required by cypress configuration).
* Cypress test fixed. Comments as well as log messages added.
* Log a message if testing API is enabled.
* Single cypress test for register/login actions.
* Revert changes to server.
* More convenient cypress commands:
- all API calls made as separate commands
- declarations for commands moved to separate global.d.ts file
- utility functions moved after test actions in 'Login actions' test
2021-11-22 16:59:01 +01:00
|
|
|
// Change card title
|
|
|
|
cy.log('**Change card title**')
|
2021-11-25 21:10:39 +01:00
|
|
|
// eslint-disable-next-line cypress/no-unnecessary-waiting
|
[GH-42] Cypress tests for login actions (#1679)
* Testing API added to server:
- registered only if `enableTestingAPI` is set to `true` in the config file
- has only one route `test/reset`
- reset clears the tables in db for blocks, users, sessions
- functions `DeleteAllBlocks` and `DeleteAllUsers` added to `Store` interface
- new functions implemented for `SQLStore`
* Cypress tests (initial version) for login actions added:
- redirect to login page,
- register user,
- test for loading home page deleted,
- allow js in `tsconfig.json` for cypress tests.
* Cypress tests for login actions:
- check that main page with workspace is visible after registration,
- initial version of test for login of register user.
* Cypress tests for login actions:
- function for checking that workspace is available added,
- functions for login and logout added,
- test for password change added,
- session parameters added to server config for cypress testing.
* Switch Cypress tests to typescript.
* Use ids for inputs instead of placeholder text.
* Use cypress request for login without loading login page.
* Cypress custom command for login added.
* Cypress tests fixed:
- new cypress commands for server reset, register/login user
- single test for "create and delete board/card"
- fixes for `BoardPage` component useEffect callbacks
- npm script `runserver-test` doesn't use single user mode
* Deletion of all blocks changed:
- also deletes blocks from history
- public function renamed to DeleteAllBlocksPermanently
- code for mocks and public methods generated
* Server tests for files fixed on windows.
* Cypress tests for the registration of second user via invite link added.
* Added `baseUrl` in main `tsconfig.json` (required by cypress configuration).
* Cypress test fixed. Comments as well as log messages added.
* Log a message if testing API is enabled.
* Single cypress test for register/login actions.
* Revert changes to server.
* More convenient cypress commands:
- all API calls made as separate commands
- declarations for commands moved to separate global.d.ts file
- utility functions moved after test actions in 'Login actions' test
2021-11-22 16:59:01 +01:00
|
|
|
cy.get('.CardDetail .EditableArea.title').
|
2021-11-25 21:10:39 +01:00
|
|
|
click().
|
|
|
|
should('have.focus').
|
|
|
|
wait(1000).
|
[GH-42] Cypress tests for login actions (#1679)
* Testing API added to server:
- registered only if `enableTestingAPI` is set to `true` in the config file
- has only one route `test/reset`
- reset clears the tables in db for blocks, users, sessions
- functions `DeleteAllBlocks` and `DeleteAllUsers` added to `Store` interface
- new functions implemented for `SQLStore`
* Cypress tests (initial version) for login actions added:
- redirect to login page,
- register user,
- test for loading home page deleted,
- allow js in `tsconfig.json` for cypress tests.
* Cypress tests for login actions:
- check that main page with workspace is visible after registration,
- initial version of test for login of register user.
* Cypress tests for login actions:
- function for checking that workspace is available added,
- functions for login and logout added,
- test for password change added,
- session parameters added to server config for cypress testing.
* Switch Cypress tests to typescript.
* Use ids for inputs instead of placeholder text.
* Use cypress request for login without loading login page.
* Cypress custom command for login added.
* Cypress tests fixed:
- new cypress commands for server reset, register/login user
- single test for "create and delete board/card"
- fixes for `BoardPage` component useEffect callbacks
- npm script `runserver-test` doesn't use single user mode
* Deletion of all blocks changed:
- also deletes blocks from history
- public function renamed to DeleteAllBlocksPermanently
- code for mocks and public methods generated
* Server tests for files fixed on windows.
* Cypress tests for the registration of second user via invite link added.
* Added `baseUrl` in main `tsconfig.json` (required by cypress configuration).
* Cypress test fixed. Comments as well as log messages added.
* Log a message if testing API is enabled.
* Single cypress test for register/login actions.
* Revert changes to server.
* More convenient cypress commands:
- all API calls made as separate commands
- declarations for commands moved to separate global.d.ts file
- utility functions moved after test actions in 'Login actions' test
2021-11-22 16:59:01 +01:00
|
|
|
type(cardTitle).
|
|
|
|
should('have.value', cardTitle)
|
|
|
|
|
|
|
|
// Close card dialog
|
|
|
|
cy.log('**Close card dialog**')
|
2022-01-07 19:58:28 +01:00
|
|
|
cy.get('.Dialog Button[title=\'Close dialog\']').
|
|
|
|
should('be.visible').
|
|
|
|
click().
|
|
|
|
wait(500)
|
[GH-42] Cypress tests for login actions (#1679)
* Testing API added to server:
- registered only if `enableTestingAPI` is set to `true` in the config file
- has only one route `test/reset`
- reset clears the tables in db for blocks, users, sessions
- functions `DeleteAllBlocks` and `DeleteAllUsers` added to `Store` interface
- new functions implemented for `SQLStore`
* Cypress tests (initial version) for login actions added:
- redirect to login page,
- register user,
- test for loading home page deleted,
- allow js in `tsconfig.json` for cypress tests.
* Cypress tests for login actions:
- check that main page with workspace is visible after registration,
- initial version of test for login of register user.
* Cypress tests for login actions:
- function for checking that workspace is available added,
- functions for login and logout added,
- test for password change added,
- session parameters added to server config for cypress testing.
* Switch Cypress tests to typescript.
* Use ids for inputs instead of placeholder text.
* Use cypress request for login without loading login page.
* Cypress custom command for login added.
* Cypress tests fixed:
- new cypress commands for server reset, register/login user
- single test for "create and delete board/card"
- fixes for `BoardPage` component useEffect callbacks
- npm script `runserver-test` doesn't use single user mode
* Deletion of all blocks changed:
- also deletes blocks from history
- public function renamed to DeleteAllBlocksPermanently
- code for mocks and public methods generated
* Server tests for files fixed on windows.
* Cypress tests for the registration of second user via invite link added.
* Added `baseUrl` in main `tsconfig.json` (required by cypress configuration).
* Cypress test fixed. Comments as well as log messages added.
* Log a message if testing API is enabled.
* Single cypress test for register/login actions.
* Revert changes to server.
* More convenient cypress commands:
- all API calls made as separate commands
- declarations for commands moved to separate global.d.ts file
- utility functions moved after test actions in 'Login actions' test
2021-11-22 16:59:01 +01:00
|
|
|
|
|
|
|
// Create a card by clicking on the + button
|
|
|
|
cy.log('**Create a card by clicking on the + button**')
|
2022-02-02 09:38:57 +01:00
|
|
|
cy.get('.KanbanColumnHeader button .AddIcon').click()
|
[GH-42] Cypress tests for login actions (#1679)
* Testing API added to server:
- registered only if `enableTestingAPI` is set to `true` in the config file
- has only one route `test/reset`
- reset clears the tables in db for blocks, users, sessions
- functions `DeleteAllBlocks` and `DeleteAllUsers` added to `Store` interface
- new functions implemented for `SQLStore`
* Cypress tests (initial version) for login actions added:
- redirect to login page,
- register user,
- test for loading home page deleted,
- allow js in `tsconfig.json` for cypress tests.
* Cypress tests for login actions:
- check that main page with workspace is visible after registration,
- initial version of test for login of register user.
* Cypress tests for login actions:
- function for checking that workspace is available added,
- functions for login and logout added,
- test for password change added,
- session parameters added to server config for cypress testing.
* Switch Cypress tests to typescript.
* Use ids for inputs instead of placeholder text.
* Use cypress request for login without loading login page.
* Cypress custom command for login added.
* Cypress tests fixed:
- new cypress commands for server reset, register/login user
- single test for "create and delete board/card"
- fixes for `BoardPage` component useEffect callbacks
- npm script `runserver-test` doesn't use single user mode
* Deletion of all blocks changed:
- also deletes blocks from history
- public function renamed to DeleteAllBlocksPermanently
- code for mocks and public methods generated
* Server tests for files fixed on windows.
* Cypress tests for the registration of second user via invite link added.
* Added `baseUrl` in main `tsconfig.json` (required by cypress configuration).
* Cypress test fixed. Comments as well as log messages added.
* Log a message if testing API is enabled.
* Single cypress test for register/login actions.
* Revert changes to server.
* More convenient cypress commands:
- all API calls made as separate commands
- declarations for commands moved to separate global.d.ts file
- utility functions moved after test actions in 'Login actions' test
2021-11-22 16:59:01 +01:00
|
|
|
cy.get('.CardDetail').should('exist')
|
|
|
|
cy.get('.Dialog.dialog-back .wrapper').click({force: true})
|
|
|
|
|
|
|
|
// Create table view
|
|
|
|
cy.log('**Create table view**')
|
|
|
|
cy.get('.ViewHeader').get('.DropdownIcon').first().parent().click()
|
2022-03-29 22:45:20 +02:00
|
|
|
cy.get('.ViewHeader').contains('Add view').realHover()
|
[GH-42] Cypress tests for login actions (#1679)
* Testing API added to server:
- registered only if `enableTestingAPI` is set to `true` in the config file
- has only one route `test/reset`
- reset clears the tables in db for blocks, users, sessions
- functions `DeleteAllBlocks` and `DeleteAllUsers` added to `Store` interface
- new functions implemented for `SQLStore`
* Cypress tests (initial version) for login actions added:
- redirect to login page,
- register user,
- test for loading home page deleted,
- allow js in `tsconfig.json` for cypress tests.
* Cypress tests for login actions:
- check that main page with workspace is visible after registration,
- initial version of test for login of register user.
* Cypress tests for login actions:
- function for checking that workspace is available added,
- functions for login and logout added,
- test for password change added,
- session parameters added to server config for cypress testing.
* Switch Cypress tests to typescript.
* Use ids for inputs instead of placeholder text.
* Use cypress request for login without loading login page.
* Cypress custom command for login added.
* Cypress tests fixed:
- new cypress commands for server reset, register/login user
- single test for "create and delete board/card"
- fixes for `BoardPage` component useEffect callbacks
- npm script `runserver-test` doesn't use single user mode
* Deletion of all blocks changed:
- also deletes blocks from history
- public function renamed to DeleteAllBlocksPermanently
- code for mocks and public methods generated
* Server tests for files fixed on windows.
* Cypress tests for the registration of second user via invite link added.
* Added `baseUrl` in main `tsconfig.json` (required by cypress configuration).
* Cypress test fixed. Comments as well as log messages added.
* Log a message if testing API is enabled.
* Single cypress test for register/login actions.
* Revert changes to server.
* More convenient cypress commands:
- all API calls made as separate commands
- declarations for commands moved to separate global.d.ts file
- utility functions moved after test actions in 'Login actions' test
2021-11-22 16:59:01 +01:00
|
|
|
cy.get('.ViewHeader').
|
|
|
|
contains('Add view').
|
|
|
|
parent().
|
|
|
|
contains('Table').
|
|
|
|
click()
|
|
|
|
cy.get(".ViewHeader .Editable[title='Table view']").should('exist')
|
|
|
|
cy.get(`.TableRow [value='${cardTitle}']`).should('exist')
|
|
|
|
|
|
|
|
// Rename table view
|
|
|
|
cy.log('**Rename table view**')
|
|
|
|
const tableViewTitle = `Test table (${timestamp})`
|
|
|
|
cy.get(".ViewHeader .Editable[title='Table view']").
|
|
|
|
clear().
|
|
|
|
type(tableViewTitle).
|
|
|
|
type('{esc}')
|
|
|
|
cy.get(`.ViewHeader .Editable[title='${tableViewTitle}']`).should('exist')
|
|
|
|
|
|
|
|
// Sort the table
|
|
|
|
cy.log('**Sort the table**')
|
|
|
|
cy.get('.ViewHeader').contains('Sort').click()
|
|
|
|
cy.get('.ViewHeader').
|
|
|
|
contains('Sort').
|
|
|
|
parent().
|
|
|
|
contains('Name').
|
|
|
|
click()
|
|
|
|
|
|
|
|
// Delete board
|
|
|
|
cy.log('**Delete board**')
|
|
|
|
cy.get('.Sidebar .octo-sidebar-list').
|
|
|
|
contains(boardTitle).
|
2021-12-13 20:27:14 +01:00
|
|
|
parent().
|
2022-01-07 19:58:28 +01:00
|
|
|
find('.MenuWrapper').
|
2022-02-02 09:38:57 +01:00
|
|
|
find('button.IconButton').
|
[GH-42] Cypress tests for login actions (#1679)
* Testing API added to server:
- registered only if `enableTestingAPI` is set to `true` in the config file
- has only one route `test/reset`
- reset clears the tables in db for blocks, users, sessions
- functions `DeleteAllBlocks` and `DeleteAllUsers` added to `Store` interface
- new functions implemented for `SQLStore`
* Cypress tests (initial version) for login actions added:
- redirect to login page,
- register user,
- test for loading home page deleted,
- allow js in `tsconfig.json` for cypress tests.
* Cypress tests for login actions:
- check that main page with workspace is visible after registration,
- initial version of test for login of register user.
* Cypress tests for login actions:
- function for checking that workspace is available added,
- functions for login and logout added,
- test for password change added,
- session parameters added to server config for cypress testing.
* Switch Cypress tests to typescript.
* Use ids for inputs instead of placeholder text.
* Use cypress request for login without loading login page.
* Cypress custom command for login added.
* Cypress tests fixed:
- new cypress commands for server reset, register/login user
- single test for "create and delete board/card"
- fixes for `BoardPage` component useEffect callbacks
- npm script `runserver-test` doesn't use single user mode
* Deletion of all blocks changed:
- also deletes blocks from history
- public function renamed to DeleteAllBlocksPermanently
- code for mocks and public methods generated
* Server tests for files fixed on windows.
* Cypress tests for the registration of second user via invite link added.
* Added `baseUrl` in main `tsconfig.json` (required by cypress configuration).
* Cypress test fixed. Comments as well as log messages added.
* Log a message if testing API is enabled.
* Single cypress test for register/login actions.
* Revert changes to server.
* More convenient cypress commands:
- all API calls made as separate commands
- declarations for commands moved to separate global.d.ts file
- utility functions moved after test actions in 'Login actions' test
2021-11-22 16:59:01 +01:00
|
|
|
click({force: true})
|
|
|
|
cy.contains('Delete board').click({force: true})
|
|
|
|
cy.get('.DeleteBoardDialog button.danger').click({force: true})
|
|
|
|
cy.contains(boardTitle).should('not.exist')
|
|
|
|
})
|
2022-01-07 19:58:28 +01:00
|
|
|
|
|
|
|
it('MM-T4433 Scrolls the kanban board when dragging card to edge', () => {
|
|
|
|
// Visit a page and create new empty board
|
|
|
|
cy.visit('/')
|
2022-03-22 15:24:34 +01:00
|
|
|
cy.wait(500)
|
2022-02-02 09:38:57 +01:00
|
|
|
cy.uiCreateEmptyBoard()
|
2022-01-07 19:58:28 +01:00
|
|
|
|
|
|
|
// Create 10 empty groups
|
|
|
|
cy.log('**Create new empty groups**')
|
|
|
|
for (let i = 0; i < 10; i++) {
|
|
|
|
cy.contains('+ Add a group').scrollIntoView().should('be.visible').click()
|
|
|
|
cy.get('.KanbanColumnHeader .Editable[value=\'New group\']').should('have.length', i + 1)
|
|
|
|
}
|
|
|
|
|
|
|
|
// Create empty card in last group
|
|
|
|
cy.log('**Create new empty card in first group**')
|
|
|
|
cy.get('.octo-board-column').last().contains('+ New').scrollIntoView().click()
|
|
|
|
cy.get('.Dialog').should('exist')
|
|
|
|
cy.get('.Dialog Button[title=\'Close dialog\']').should('be.visible').click()
|
|
|
|
cy.get('.KanbanCard').scrollIntoView().should('exist')
|
|
|
|
|
|
|
|
// Drag card to right corner and expect scroll to occur
|
|
|
|
// eslint-disable-next-line cypress/no-unnecessary-waiting
|
|
|
|
cy.get('.Kanban').invoke('scrollLeft').should('not.equal', 0).wait(1000)
|
|
|
|
|
|
|
|
// wait necessary to let state change propagate
|
|
|
|
// eslint-disable-next-line cypress/no-unnecessary-waiting
|
|
|
|
cy.get('.KanbanCard').
|
|
|
|
trigger('dragstart').
|
|
|
|
wait(500)
|
|
|
|
|
|
|
|
// wait necessary to trigger scroll animation for some time
|
|
|
|
// eslint-disable-next-line cypress/no-unnecessary-waiting
|
|
|
|
cy.get('.Kanban').
|
|
|
|
trigger('dragover', {clientX: 400, clientY: Cypress.config().viewportHeight / 2}).
|
2022-05-02 09:54:11 +02:00
|
|
|
wait(4500).
|
2022-01-07 19:58:28 +01:00
|
|
|
trigger('dragend')
|
|
|
|
|
|
|
|
cy.get('.Kanban').invoke('scrollLeft').should('equal', 0)
|
|
|
|
})
|
[GH-42] Cypress tests for login actions (#1679)
* Testing API added to server:
- registered only if `enableTestingAPI` is set to `true` in the config file
- has only one route `test/reset`
- reset clears the tables in db for blocks, users, sessions
- functions `DeleteAllBlocks` and `DeleteAllUsers` added to `Store` interface
- new functions implemented for `SQLStore`
* Cypress tests (initial version) for login actions added:
- redirect to login page,
- register user,
- test for loading home page deleted,
- allow js in `tsconfig.json` for cypress tests.
* Cypress tests for login actions:
- check that main page with workspace is visible after registration,
- initial version of test for login of register user.
* Cypress tests for login actions:
- function for checking that workspace is available added,
- functions for login and logout added,
- test for password change added,
- session parameters added to server config for cypress testing.
* Switch Cypress tests to typescript.
* Use ids for inputs instead of placeholder text.
* Use cypress request for login without loading login page.
* Cypress custom command for login added.
* Cypress tests fixed:
- new cypress commands for server reset, register/login user
- single test for "create and delete board/card"
- fixes for `BoardPage` component useEffect callbacks
- npm script `runserver-test` doesn't use single user mode
* Deletion of all blocks changed:
- also deletes blocks from history
- public function renamed to DeleteAllBlocksPermanently
- code for mocks and public methods generated
* Server tests for files fixed on windows.
* Cypress tests for the registration of second user via invite link added.
* Added `baseUrl` in main `tsconfig.json` (required by cypress configuration).
* Cypress test fixed. Comments as well as log messages added.
* Log a message if testing API is enabled.
* Single cypress test for register/login actions.
* Revert changes to server.
* More convenient cypress commands:
- all API calls made as separate commands
- declarations for commands moved to separate global.d.ts file
- utility functions moved after test actions in 'Login actions' test
2021-11-22 16:59:01 +01:00
|
|
|
})
|