You've already forked focalboard
mirror of
https://github.com/mattermost/focalboard.git
synced 2025-09-16 08:56:19 +02:00
cypress tests must logout before attempting to login again
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"serverRoot": "http://localhost:8088",
|
||||
"port": 8088,
|
||||
"serverRoot": "http://localhost:8000",
|
||||
"port": 8000,
|
||||
"dbtype": "sqlite3",
|
||||
"dbconfig": "./focalboard.db",
|
||||
"useSSL": false,
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"chromeWebSecurity": false,
|
||||
"baseUrl": "http://localhost:8088",
|
||||
"baseUrl": "http://localhost:8000",
|
||||
"testFiles": [
|
||||
"**/login*.ts",
|
||||
"**/create*.ts",
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"serverRoot": "http://localhost:8088",
|
||||
"port": 8088,
|
||||
"serverRoot": "http://localhost:8000",
|
||||
"port": 8000,
|
||||
"dbtype": "sqlite3",
|
||||
"dbconfig": "file::memory:?cache=shared&_busy_timeout=5000",
|
||||
"useSSL": false,
|
||||
|
@@ -58,10 +58,12 @@ describe('Login actions', () => {
|
||||
cy.get('button').contains('Change password').click()
|
||||
cy.get('.succeeded').click()
|
||||
workspaceIsAvailable()
|
||||
|
||||
logoutUser()
|
||||
|
||||
// Can log in user with new password
|
||||
cy.log('**Can log in user with new password**')
|
||||
loginUser(newPassword).then(() => resetPassword(newPassword))
|
||||
logoutUser()
|
||||
|
||||
// Can't register second user without invite link
|
||||
cy.log('**Can\'t register second user without invite link**')
|
||||
@@ -85,9 +87,7 @@ describe('Login actions', () => {
|
||||
|
||||
cy.get('a.shareUrl').invoke('attr', 'href').then((inviteLink) => {
|
||||
// Log out existing user
|
||||
cy.log('**Log out existing user**')
|
||||
cy.get('.Sidebar .SidebarUserMenu').click()
|
||||
cy.get('.menu-name').contains('Log out').click()
|
||||
logoutUser()
|
||||
|
||||
// Register a new user
|
||||
cy.log('**Register new user**')
|
||||
@@ -114,6 +114,13 @@ describe('Login actions', () => {
|
||||
return workspaceIsAvailable()
|
||||
}
|
||||
|
||||
const logoutUser = () => {
|
||||
cy.log('**Log out existing user**')
|
||||
cy.get('.SidebarUserMenu').click()
|
||||
cy.get('.menu-name').contains('Log out').click()
|
||||
cy.location('pathname').should('eq', '/login')
|
||||
}
|
||||
|
||||
const resetPassword = (oldPassword: string) => {
|
||||
cy.apiGetMe().then((userId) => cy.apiChangePassword(userId, oldPassword, password))
|
||||
}
|
||||
|
Reference in New Issue
Block a user