Use app logout

This commit is contained in:
Christian Cueni 2019-10-08 09:12:32 +02:00
parent e93dde272d
commit 31de68e3d0
5 changed files with 11 additions and 5 deletions

View File

@ -7,7 +7,7 @@ describe('Change Password Page', () => {
const validationOldWrongMsg = 'Die Eingabe ist falsch';
beforeEach(function () {
cy.logout();
// cy.clearCookies();
cy.visit('/me/profile');
cy.login('rahel.cueni', 'test');
});

View File

@ -40,8 +40,8 @@ describe('Solutions', () => {
cy.logout();
cy.login('rahel.cueni', 'test');
cy.visit('/module/lohn-und-budget');
cy.login('rahel.cueni', 'test');
// cy.get('[data-cy=solution]').should('exist');
cy.get('[data-cy=solution]').first()
.should('contain', 'anzeigen')

View File

@ -4,7 +4,8 @@ describe('Survey', () => {
cy.viewport('macbook-15');
cy.startGraphQLCapture();
cy.login('rahel.cueni', 'test');
cy.login('rahel.cueni', 'test', true);
cy.get('body').contains('Neues Wissen erwerben');
});
it('should display and fill out the survey', () => {

View File

@ -39,10 +39,15 @@ Cypress.Commands.add("login", (username, password, visitLogin=false) => {
cy.get('[data-cy=login-button]').click();
});
Cypress.Commands.add("logout", () => {
Cypress.Commands.add("clearCookies", () => {
cy.clearCookies();
});
Cypress.Commands.add("logout", () => {
cy.get('[data-cy=user-icon]').click();
cy.get('[data-cy=logout]').click();
});
Cypress.Commands.add('loginByCsrf', (username, password, csrftoken) => {
cy.request({
method: 'POST',

View File

@ -1,5 +1,5 @@
<template>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" data-cy="user-icon">
<path
d="M50,0A50.12,50.12,0,0,0,.07,46.65S0,48.23,0,50s.07,3.25.07,3.36A50,50,0,1,0,50,0ZM24.14,86V79.84A15.18,15.18,0,0,1,39.31,64.67H60.69A15.18,15.18,0,0,1,75.86,79.84V86a44.27,44.27,0,0,1-51.72,0Zm57.47-5V79.84A20.94,20.94,0,0,0,60.69,58.93H39.31A20.94,20.94,0,0,0,18.39,79.84v1.31a44.4,44.4,0,1,1,63.22-.06Z"/>
<path