Skip to content

Commit

Permalink
fix: cypress
Browse files Browse the repository at this point in the history
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
  • Loading branch information
skjnldsv committed Feb 13, 2024
1 parent 40f2ab7 commit 64a5ec7
Show file tree
Hide file tree
Showing 40 changed files with 78 additions and 78 deletions.
6 changes: 3 additions & 3 deletions apps/settings/src/components/Users/UserSettingsDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand All @@ -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>

Expand Down
24 changes: 12 additions & 12 deletions cypress/e2e/login/login.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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`)
Expand All @@ -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`)
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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')
})

Expand Down
6 changes: 3 additions & 3 deletions cypress/e2e/settings/users.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down Expand Up @@ -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 })

Expand Down
14 changes: 7 additions & 7 deletions cypress/e2e/settings/users_columns.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 })
Expand Down Expand Up @@ -88,17 +88,17 @@ 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 })
cy.get('[data-test="showLastLogin"] input[type="checkbox"]').should('not.be.checked')
// 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')
Expand Down
8 changes: 4 additions & 4 deletions cypress/e2e/settings/users_disable.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions dist/1689-1689.js

Large diffs are not rendered by default.

File renamed without changes.
1 change: 1 addition & 0 deletions dist/1689-1689.js.map

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions dist/4673-4673.js

This file was deleted.

1 change: 0 additions & 1 deletion dist/4673-4673.js.map

This file was deleted.

4 changes: 2 additions & 2 deletions dist/core-login.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/core-login.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/dav-settings-personal-availability.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/dav-settings-personal-availability.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/federatedfilesharing-vue-settings-admin.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/federatedfilesharing-vue-settings-admin.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/files_sharing-files_sharing_tab.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/files_sharing-files_sharing_tab.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/files_sharing-personal-settings.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/files_sharing-personal-settings.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/settings-apps-view-7418.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/settings-apps-view-7418.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/settings-users-8351.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/settings-users-8351.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/settings-vue-settings-admin-basic-settings.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/settings-vue-settings-admin-basic-settings.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/settings-vue-settings-admin-security.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/settings-vue-settings-admin-security.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/settings-vue-settings-apps-users-management.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/settings-vue-settings-apps-users-management.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/settings-vue-settings-personal-info.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/settings-vue-settings-personal-info.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/settings-vue-settings-personal-security.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/settings-vue-settings-personal-security.js.map

Large diffs are not rendered by default.

Loading

0 comments on commit 64a5ec7

Please sign in to comment.