feat(console): MDC components (#6482)

mdc components

---------

Co-authored-by: Elio Bischof <[email protected]>
This commit is contained in:
Max Peintner
2023-10-26 08:29:06 +00:00
committed by GitHub
co-authored by Elio Bischof
parent cb7b50b513
commit b099a26a16
412 changed files with 2711 additions and 2698 deletions
+31
View File
@@ -0,0 +1,31 @@
export function authenticate(
loginUrl: string,
creds: {
password: any;
username: string;
},
onUsernameScreen: () => void,
onPasswordScreen: () => void,
onAuthenticated: () => void,
) {
onUsernameScreen ? onUsernameScreen() : null;
cy.get('#loginName').type(creds.username);
cy.get('#submit-button').click();
onPasswordScreen ? onPasswordScreen() : null;
cy.get('#password').type(creds.password);
cy.get('#submit-button').click();
cy.wait('@password').then((interception) => {
if (interception.response.body.indexOf(`${loginUrl}/mfa/prompt`) === -1) {
return;
}
cy.contains('button', 'skip').click();
});
cy.wait('@token');
onAuthenticated ? onAuthenticated() : null;
cy.wait(1000);
}