fix: cypress

Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
pull/34178/head
John Molakvoæ 3 months ago
parent 4a509dfe8e
commit b1a47f79f3
No known key found for this signature in database
GPG Key ID: 60C25B8C072916CF

@ -23,7 +23,7 @@
<template>
<NcAppSettingsDialog :open.sync="isModalOpen"
:show-navigation="true"
:name="t('settings', 'User management settings')">
:name="t('settings', 'Account management settings')">
<NcAppSettingsSection id="visibility-settings"
:name="t('settings', 'Visibility')">
<NcCheckboxRadioSwitch type="switch"
@ -34,7 +34,7 @@
<NcCheckboxRadioSwitch type="switch"
data-test="showUserBackend"
:checked.sync="showUserBackend">
{{ t('settings', 'Show user backend') }}
{{ t('settings', 'Show account backend') }}
</NcCheckboxRadioSwitch>
<NcCheckboxRadioSwitch type="switch"
data-test="showStoragePath"
@ -54,7 +54,7 @@
data-test="sendWelcomeMail"
:checked.sync="sendWelcomeMail"
:disabled="loadingSendMail">
{{ t('settings', 'Send welcome email to new users') }}
{{ t('settings', 'Send welcome email to new accounts') }}
</NcCheckboxRadioSwitch>
</NcAppSettingsSection>

@ -44,12 +44,12 @@ describe('Login', () => {
cy.logout()
})
it('log in with valid user and password', () => {
it('log in with valid account and password', () => {
// Given I visit the Home page
cy.visit('/')
// I see the login page
cy.get('form[name="login"]').should('be.visible')
// I log in with a valid user
// I log in with a valid account
cy.get('form[name="login"]').within(() => {
cy.get('input[name="user"]').type(user.userId)
cy.get('input[name="password"]').type(user.password)
@ -63,12 +63,12 @@ describe('Login', () => {
cy.url().should('match', /apps\/dashboard(\/|$)/)
})
it('try to log in with valid user and invalid password', () => {
it('try to log in with valid account and invalid password', () => {
// Given I visit the Home page
cy.visit('/')
// I see the login page
cy.get('form[name="login"]').should('be.visible')
// I log in with a valid user but invalid password
// I log in with a valid account but invalid password
cy.get('form[name="login"]').within(() => {
cy.get('input[name="user"]').type(user.userId)
cy.get('input[name="password"]').type(`${user.password}--wrong`)
@ -85,12 +85,12 @@ describe('Login', () => {
cy.get('input[name="password"]:invalid').should('exist')
})
it('try to log in with valid user and invalid password', () => {
it('try to log in with valid account and invalid password', () => {
// Given I visit the Home page
cy.visit('/')
// I see the login page
cy.get('form[name="login"]').should('be.visible')
// I log in with a valid user but invalid password
// I log in with a valid account but invalid password
cy.get('form[name="login"]').within(() => {
cy.get('input[name="user"]').type(user.userId)
cy.get('input[name="password"]').type(`${user.password}--wrong`)
@ -103,11 +103,11 @@ describe('Login', () => {
// Then I see that the current page is the Login page
cy.url().should('match', /\/login/)
// And I see that a wrong password message is shown
cy.get('form[name="login"]').then(($el) => expect($el.text()).to.match(/Wrong.+password/i).and.to.match(/Wrong.+username/))
cy.get('form[name="login"]').then(($el) => expect($el.text()).to.match(/Wrong.+password/i).and.to.match(/Wrong.+account/))
cy.get('input[name="password"]:invalid').should('exist')
})
it('try to log in with invalid user', () => {
it('try to log in with invalid account', () => {
// Given I visit the Home page
cy.visit('/')
// I see the login page
@ -125,11 +125,11 @@ describe('Login', () => {
// Then I see that the current page is the Login page
cy.url().should('match', /\/login/)
// And I see that a wrong password message is shown
cy.get('form[name="login"]').then(($el) => expect($el.text()).to.match(/Wrong.+password/i).and.to.match(/Wrong.+username/))
cy.get('form[name="login"]').then(($el) => expect($el.text()).to.match(/Wrong.+password/i).and.to.match(/Wrong.+account/))
cy.get('input[name="password"]:invalid').should('exist')
})
it('try to log in as disabled user', () => {
it('try to log in as disabled account', () => {
// Given I visit the Home page
cy.visit('/')
// I see the login page
@ -146,8 +146,8 @@ describe('Login', () => {
// Then I see that the current page is the Login page
cy.url().should('match', /\/login/)
// And I see that the disabled user message is shown
cy.get('form[name="login"]').then(($el) => expect($el.text()).to.match(/User.+disabled/i))
// And I see that the disabled account message is shown
cy.get('form[name="login"]').then(($el) => expect($el.text()).to.match(/Account.+disabled/i))
cy.get('input[name="password"]:invalid').should('exist')
})

@ -26,7 +26,7 @@ import { getUserListRow, handlePasswordConfirmation } from './usersUtils'
const admin = new User('admin', 'admin')
const john = new User('john', '123456')
describe('Settings: Create and delete users', function() {
describe('Settings: Create and delete accounts', function() {
beforeEach(function() {
cy.listUsers().then((users) => {
if ((users as string[]).includes(john.userId)) {
@ -124,8 +124,8 @@ describe('Settings: Create and delete users', function() {
.click({ force: true })
})
// The "Delete user" action in the actions menu is shown and clicked
cy.get('.action-item__popper .action').contains('Delete user').should('exist').click({ force: true })
// The "Delete account" action in the actions menu is shown and clicked
cy.get('.action-item__popper .action').contains('Delete account').should('exist').click({ force: true })
// And confirmation dialog accepted
cy.get('.oc-dialog button').contains(`Delete ${testUser.userId}`).click({ force: true })

@ -34,11 +34,11 @@ describe('Settings: Show and hide columns', function() {
beforeEach(function() {
// open the settings dialog
cy.get('.app-navigation-entry__settings').contains('User management settings').click()
cy.get('.app-navigation-entry__settings').contains('Account management settings').click()
// reset all visibility toggles
cy.get('.modal-container #settings-section_visibility-settings input[type="checkbox"]').uncheck({ force: true })
cy.contains('.modal-container', 'User management settings').within(() => {
cy.contains('.modal-container', 'Account management settings').within(() => {
// enable the last login toggle
cy.get('[data-test="showLastLogin"] input[type="checkbox"]').check({ force: true })
// close the settings dialog
@ -57,9 +57,9 @@ describe('Settings: Show and hide columns', function() {
})
// open the settings dialog
cy.get('.app-navigation-entry__settings').contains('User management settings').click()
cy.get('.app-navigation-entry__settings').contains('Account management settings').click()
cy.contains('.modal-container', 'User management settings').within(() => {
cy.contains('.modal-container', 'Account management settings').within(() => {
// enable the language toggle
cy.get('[data-test="showLanguages"] input[type="checkbox"]').should('not.be.checked')
cy.get('[data-test="showLanguages"] input[type="checkbox"]').check({ force: true })
@ -88,9 +88,9 @@ describe('Settings: Show and hide columns', function() {
})
// open the settings dialog
cy.get('.app-navigation-entry__settings').contains('User management settings').click()
cy.get('.app-navigation-entry__settings').contains('Account management settings').click()
cy.contains('.modal-container', 'User management settings').within(() => {
cy.contains('.modal-container', 'Account management settings').within(() => {
// disable the last login toggle
cy.get('[data-test="showLastLogin"] input[type="checkbox"]').should('be.checked')
cy.get('[data-test="showLastLogin"] input[type="checkbox"]').uncheck({ force: true })
@ -98,7 +98,7 @@ describe('Settings: Show and hide columns', function() {
// close the settings dialog
cy.get('button.modal-container__close').click()
})
cy.waitUntil(() => cy.contains('.modal-container', 'User management settings').should(el => assertNotExistOrNotVisible(el)))
cy.waitUntil(() => cy.contains('.modal-container', 'Account management settings').should(el => assertNotExistOrNotVisible(el)))
// see that the last login column is not in the header
cy.get('[data-cy-user-list-header-last-login]').should('not.exist')

@ -56,8 +56,8 @@ describe('Settings: Disable and enable users', function() {
cy.get('[data-cy-user-list-cell-actions] button.action-item__menutoggle').click({ scrollBehavior: 'center' })
})
// The "Disable user" action in the actions menu is shown and clicked
cy.get('.action-item__popper .action').contains('Disable user').should('exist').click()
// The "Disable account" action in the actions menu is shown and clicked
cy.get('.action-item__popper .action').contains('Disable account').should('exist').click()
// When clicked the section is not shown anymore
getUserListRow(testUser.userId).should('not.exist')
// But the disabled user section now exists
@ -85,8 +85,8 @@ describe('Settings: Disable and enable users', function() {
cy.get('[data-cy-user-list-cell-actions] button.action-item__menutoggle').click({ scrollBehavior: 'center' })
})
// The "Enable user" action in the actions menu is shown and clicked
cy.get('.action-item__popper .action').contains('Enable user').should('exist').click()
// The "Enable account" action in the actions menu is shown and clicked
cy.get('.action-item__popper .action').contains('Enable account').should('exist').click()
// When clicked the section is not shown anymore
cy.get('#disabled').should('not.exist')
// Make sure it is still gone after the reload reload

3
dist/6689-6689.js vendored

File diff suppressed because one or more lines are too long

3
dist/7057-7057.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save