Fix more tests 🤪

This commit is contained in:
Christian Cueni 2020-02-27 15:39:13 +01:00
parent d91e0fbb37
commit 1d7ca9f612
5 changed files with 9 additions and 15 deletions

View File

@ -27,7 +27,7 @@ describe('Email Verifcation', () => {
// user should be logged in at that stage. As the cookie cannot be set at the right time // user should be logged in at that stage. As the cookie cannot be set at the right time
// we just check if the user gets redirected to the login page as we can't log her in // we just check if the user gets redirected to the login page as we can't log her in
cy.url().should('include', 'login?redirect=%2F'); cy.url().should('include', 'hello?redirect=%2F');
}); });
@ -112,7 +112,7 @@ describe('Email Verifcation', () => {
// user should be logged in at that stage. As the cookie cannot be set at the right time // user should be logged in at that stage. As the cookie cannot be set at the right time
// we just check if the user gets redirected to the coupon page as we can't log her in // we just check if the user gets redirected to the coupon page as we can't log her in
cy.url().should('include', 'login?redirect=%2Flicense-activation'); cy.url().should('include', 'hello?redirect=%2Flicense-activation');
}); });

View File

@ -1,9 +0,0 @@
describe('The Logged In Home Page', () => {
it('successfully loads', () => {
// todo: use graphql login
cy.visit('/');
cy.login('test', 'test');
cy.get('.block-title__title').should('contain', 'Inhalte')
})
})

View File

@ -3,8 +3,8 @@ describe('The Room Page', () => {
// todo: mock all the graphql queries and mutations // todo: mock all the graphql queries and mutations
cy.viewport('macbook-15'); cy.viewport('macbook-15');
cy.apolloLogin('rahel.cueni', 'test');
cy.visit('/room/ein-historisches-festival'); cy.visit('/room/ein-historisches-festival');
cy.login('rahel.cueni', 'test');
cy.get('[data-cy=add-room-entry-button]').click(); cy.get('[data-cy=add-room-entry-button]').click();
cy.get('.add-content-element:first-of-type').click(); cy.get('.add-content-element:first-of-type').click();

View File

@ -1,16 +1,16 @@
describe('The Rooms Page', () => { describe('The Rooms Page', () => {
// todo: mock all the graphql queries and mutations // todo: mock all the graphql queries and mutations
it('goes to the rooms page', () => { it('goes to the rooms page', () => {
cy.apolloLogin('nico.zickgraf', 'test');
cy.visit('/rooms'); cy.visit('/rooms');
cy.login('nico.zickgraf', 'test');
cy.get('[data-cy=add-room]').should('exist'); cy.get('[data-cy=add-room]').should('exist');
}); });
it('add room should not exist for student', () => { it('add room should not exist for student', () => {
cy.apolloLogin('rahel.cueni', 'test');
cy.visit('/rooms'); cy.visit('/rooms');
cy.login('rahel.cueni', 'test');
cy.get('[data-cy=add-room]').should('not.exist'); cy.get('[data-cy=add-room]').should('not.exist');

View File

@ -122,7 +122,10 @@ Cypress.Commands.add('enterPassword', (password) => {
}); });
Cypress.Commands.add('register', (prefix, firstname, lastname, street, city, postcode, password, passwordConfirmation) => { Cypress.Commands.add('register', (prefix, firstname, lastname, street, city, postcode, password, passwordConfirmation) => {
cy.get('[data-cy="prefix-selection"]').type(prefix);
let selection = prefix === 1 ? 'Herr' : 'Frau';
cy.get('[data-cy="prefix-selection"]').select(selection);
if (firstname !== '') { if (firstname !== '') {
cy.get('[data-cy="firstname-input"]').type(firstname); cy.get('[data-cy="firstname-input"]').type(firstname);