mirror of
https://github.com/mattermost/focalboard.git
synced 2024-12-03 08:45:40 +02:00
update cypress tests
This commit is contained in:
parent
f66bed59a8
commit
1741f1f01d
@ -58,10 +58,12 @@ describe('Login actions', () => {
|
|||||||
cy.get('button').contains('Change password').click()
|
cy.get('button').contains('Change password').click()
|
||||||
cy.get('.succeeded').click()
|
cy.get('.succeeded').click()
|
||||||
workspaceIsAvailable()
|
workspaceIsAvailable()
|
||||||
|
logoutUser()
|
||||||
|
|
||||||
// Can log in user with new password
|
// Can log in user with new password
|
||||||
cy.log('**Can log in user with new password**')
|
cy.log('**Can log in user with new password**')
|
||||||
loginUser(newPassword).then(() => resetPassword(newPassword))
|
loginUser(newPassword).then(() => resetPassword(newPassword))
|
||||||
|
logoutUser()
|
||||||
|
|
||||||
// Can't register second user without invite link
|
// Can't register second user without invite link
|
||||||
cy.log('**Can\'t register second user without invite link**')
|
cy.log('**Can\'t register second user without invite link**')
|
||||||
@ -84,10 +86,7 @@ describe('Login actions', () => {
|
|||||||
cy.get('.Button').contains('Copied').should('exist')
|
cy.get('.Button').contains('Copied').should('exist')
|
||||||
|
|
||||||
cy.get('a.shareUrl').invoke('attr', 'href').then((inviteLink) => {
|
cy.get('a.shareUrl').invoke('attr', 'href').then((inviteLink) => {
|
||||||
// Log out existing user
|
logoutUser()
|
||||||
cy.log('**Log out existing user**')
|
|
||||||
cy.get('.Sidebar .SidebarUserMenu').click()
|
|
||||||
cy.get('.menu-name').contains('Log out').click()
|
|
||||||
|
|
||||||
// Register a new user
|
// Register a new user
|
||||||
cy.log('**Register new user**')
|
cy.log('**Register new user**')
|
||||||
@ -114,6 +113,13 @@ describe('Login actions', () => {
|
|||||||
return workspaceIsAvailable()
|
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) => {
|
const resetPassword = (oldPassword: string) => {
|
||||||
cy.apiGetMe().then((userId) => cy.apiChangePassword(userId, oldPassword, password))
|
cy.apiGetMe().then((userId) => cy.apiChangePassword(userId, oldPassword, password))
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user