* Added functionality to enable 2FA for users.. * Do not use the obsolete ctor in tests * cleanup * Cleanup * Convert User view from overlay to infinite editor * Add support for having additional editors on top of the user (2fa) which overlay does not support * Add controllerAs syntax in the template * Remove unused dependencies * Adjustments to 2fa login view * organize elements * add translations * add a11y helpers * add autocompletion = one-time-code * change to controllerAs syntax * add callback to cancel 2fa and fix error where submit button was not reset when all other validations were * add a cancel/go back button to the 2fa view * replace header with something less obstrusive * move logout button to the footer in the new editor view * change 'edit profile' to an umb-box and move ng-if for password fields out to reduce amount of checks * Add umb-box to external login provider section * add umb-box to user history section * bug: fix bug where notificationsService would not allow new notifications if removeAll had been called * add styling and a11y to configureTwoFactor view - also ensure that the view reloads when changes happen in the custom user view to enable 2fa - ensure that view updates when disabling 2fa - add extra button to show options (disable) for each 2fa provider * add notification when 2fa is disabled * add data-element to support the intro tour also changed a minor selector in the cypress test * correct usage of umb-box with umb-box-content * do not use the .form class twice to prevent double box-shadow * make tranlastion for 2fa placeholder shorter * ensure that field with 2fa provider is always visible when more than 1 provider * move error state of 2fa field to token field * update translation of multiple 2fa providers * move CTA buttons to right side to follow general UI practices * rename options to disable * add disabled state * add helper folders to gitignore so you can work with plugins and custom code without committing it accidentally * move the disable functionality to its own infinite editor view * use properties from umb-control-group correctly * add 'track by' to repeater * make use of umb-control-group * remove unused functions * clean up translations * add Danish translations * copy translations to english * Only return enabled 2fa providers as expected Co-authored-by: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com>
107 lines
3.9 KiB
TypeScript
107 lines
3.9 KiB
TypeScript
/// <reference types="Cypress" />
|
|
|
|
context('Backoffice Tour', () => {
|
|
var timeout = 60000;
|
|
beforeEach(() => {
|
|
//arrange
|
|
cy.umbracoLogin(Cypress.env('username'), Cypress.env('password'));
|
|
resetTourData();
|
|
});
|
|
|
|
it('Backoffice introduction tour should run', () => {
|
|
//act
|
|
cy.umbracoGlobalHelp().should("be.visible");
|
|
cy.umbracoGlobalHelp().click();
|
|
runBackOfficeIntroTour(0, 'Start');
|
|
|
|
//assert
|
|
cy.get('[data-element="help-tours"]').should("be.visible");
|
|
cy.get('[data-element="help-tours"]').click();
|
|
getPercentage(17, timeout);
|
|
});
|
|
|
|
it('Backoffice introduction tour should run then rerun', () => {
|
|
//act
|
|
cy.umbracoGlobalHelp().should("be.visible");
|
|
cy.umbracoGlobalHelp().click();
|
|
runBackOfficeIntroTour(0, 'Start', timeout);
|
|
runBackOfficeIntroTour(17, 'Rerun', timeout);
|
|
|
|
//assert
|
|
cy.get('[data-element="help-tours"]').should("be.visible");
|
|
cy.get('[data-element="help-tours"]').click();
|
|
cy.umbracoGlobalHelp().should("be.visible");
|
|
getPercentage(17, timeout);
|
|
});
|
|
|
|
afterEach(() => {
|
|
//cleanup
|
|
resetTourData();
|
|
});
|
|
});
|
|
|
|
function getPercentage(percentage, timeout) {
|
|
cy.get('[data-element="help-tours"] .umb-progress-circle', { timeout: timeout }).get('[percentage]').contains(percentage + '%');
|
|
}
|
|
|
|
function resetTourData() {
|
|
var tourStatus =
|
|
{
|
|
"alias": "umbIntroIntroduction",
|
|
"completed": false,
|
|
"disabled": true
|
|
};
|
|
|
|
cy.getCookie('UMB-XSRF-TOKEN', { log: false }).then((token) => {
|
|
cy.request({
|
|
method: 'POST',
|
|
url: '/umbraco/backoffice/UmbracoApi/CurrentUser/PostSetUserTour',
|
|
followRedirect: false,
|
|
headers: {
|
|
ContentType: 'application/json',
|
|
'X-UMB-XSRF-TOKEN': token.value,
|
|
},
|
|
body: tourStatus,
|
|
}).then((resp) => {
|
|
return;
|
|
});
|
|
})
|
|
}
|
|
|
|
function runBackOfficeIntroTour(percentageComplete, buttonText, timeout) {
|
|
cy.get('[data-element="help-tours"]').should("be.visible");
|
|
cy.get('[data-element="help-tours"]').click();
|
|
cy.get('[data-element="help-tours"] .umb-progress-circle', { timeout: timeout }).get('[percentage]').contains(percentageComplete + '%', { timeout: timeout });
|
|
cy.get('[data-element="help-tours"]').click();
|
|
cy.get('[data-element="tour-umbIntroIntroduction"] .umb-button').should("be.visible");
|
|
cy.get('[data-element="tour-umbIntroIntroduction"] .umb-button').contains(buttonText);
|
|
cy.get('[data-element="tour-umbIntroIntroduction"] .umb-button').click();
|
|
//act
|
|
cy.get('.umb-tour-step', { timeout: timeout }).should('be.visible');
|
|
cy.get('.umb-tour-step__footer').should('be.visible');
|
|
cy.get('.umb-tour-step__counter').should('be.visible');
|
|
|
|
for (let i = 1; i < 8; i++) {
|
|
|
|
if(i == 4) {
|
|
continue
|
|
}
|
|
cy.get('.umb-tour-step__counter').contains(i + '/13');
|
|
cy.get('.umb-tour-step__footer .umb-button').should('be.visible').click();
|
|
}
|
|
cy.umbracoGlobalUser().click()
|
|
cy.get('.umb-tour-step__counter', { timeout: timeout }).contains('9/13');
|
|
cy.get('.umb-tour-step__footer .umb-button').should('be.visible').click();
|
|
cy.get('.umb-tour-step__counter', { timeout: timeout }).contains('10/13');
|
|
cy.get('[data-element~="overlay-user"] [data-element="button-overlayClose"]').should('be.visible').click();
|
|
cy.get('.umb-tour-step__counter', { timeout: timeout }).contains('11/13');
|
|
cy.umbracoGlobalHelp().click()
|
|
|
|
for (let i = 12; i <= 13; i++) {
|
|
cy.get('.umb-tour-step__counter', { timeout: timeout }).contains(i + '/13');
|
|
cy.get('.umb-tour-step__footer .umb-button').should('be.visible').click();
|
|
}
|
|
cy.get('.umb-tour-step__footer .umb-button').should('be.visible').click();
|
|
|
|
cy.umbracoGlobalHelp().should("be.visible");
|
|
} |