test: refs #8484 await main content loaded #1318

Merged
alexm merged 54 commits from 8484-waitToDomContentLoadedInTests into dev 2025-02-27 06:19:45 +00:00
1 changed files with 20 additions and 43 deletions
Showing only changes of commit 1acfbfa3cb - Show all commits

View File

@ -28,28 +28,31 @@
// Imports Quasar Cypress AE predefined commands
// import { registerCommands } from '@quasar/quasar-app-extension-testing-e2e-cypress';
Cypress.Commands.add('waitUntil', { prevSubject: 'optional' }, require('./waitUntil'));
Cypress.Commands.add('resetDB', () => {
cy.exec('pnpm run resetDatabase');
});
Cypress.Commands.add('login', (user) => {
//cy.visit('/#/login');
cy.request({
method: 'POST',
url: '/api/accounts/login',
body: {
user: user,
password: 'nightmare',
},
}).then((response) => {
window.localStorage.setItem('token', response.body.token);
Cypress.Commands.add('login', (user = 'developer') => {
cy.session(['user-session', user], () => {
cy.request({
method: 'GET',
url: '/api/VnUsers/ShareToken',
headers: {
Authorization: window.localStorage.getItem('token'),
method: 'POST',
url: '/api/accounts/login',
body: {
user: user,
password: 'nightmare',
},
}).then(({ body }) => {
window.localStorage.setItem('tokenMultimedia', body.multimediaToken.id);
}).then((response) => {
window.localStorage.setItem('token', response.body.token);
cy.request({
method: 'GET',
url: '/api/VnUsers/ShareToken',
headers: {
Authorization: window.localStorage.getItem('token'),
},
}).then(({ body }) => {
window.localStorage.setItem('tokenMultimedia', body.multimediaToken.id);
});
});
});
});
@ -311,32 +314,6 @@ Cypress.Commands.add('clickButtonsDescriptor', (id) => {
.click();
});
Cypress.Commands.add('openActionDescriptor', (opt) => {
cy.openActionsDescriptor();
const listItem = '[role="menu"] .q-list .q-item';
cy.contains(listItem, opt).click();
1;
});
Cypress.Commands.add('clickButtonsDescriptor', (id) => {
cy.get(`.actions > .q-card__actions> .q-btn:nth-child(${id})`)
.invoke('removeAttr', 'target')
.click();
});
Cypress.Commands.add('openActionDescriptor', (opt) => {
cy.openActionsDescriptor();
const listItem = '[role="menu"] .q-list .q-item';
cy.contains(listItem, opt).click();
1;
});
Cypress.Commands.add('clickButtonsDescriptor', (id) => {
cy.get(`.actions > .q-card__actions> .q-btn:nth-child(${id})`)
.invoke('removeAttr', 'target')
.click();
});
Cypress.Commands.add('openUserPanel', () => {
cy.get(
'.column > .q-avatar > .q-avatar__content > .q-img > .q-img__container > .q-img__image',