diff --git a/client/cypress/integration/email-verification.spec.js b/client/cypress/integration/email-verification.spec.js index 7f52d162..c916e6ad 100644 --- a/client/cypress/integration/email-verification.spec.js +++ b/client/cypress/integration/email-verification.spec.js @@ -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 // 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 // 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'); }); diff --git a/client/cypress/integration/home-page-logged-in.spec.js b/client/cypress/integration/home-page-logged-in.spec.js deleted file mode 100644 index 4b846114..00000000 --- a/client/cypress/integration/home-page-logged-in.spec.js +++ /dev/null @@ -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') - }) -}) diff --git a/client/cypress/integration/room-page.spec.js b/client/cypress/integration/room-page.spec.js index a8206451..afc1bb75 100644 --- a/client/cypress/integration/room-page.spec.js +++ b/client/cypress/integration/room-page.spec.js @@ -3,8 +3,8 @@ describe('The Room Page', () => { // todo: mock all the graphql queries and mutations cy.viewport('macbook-15'); + cy.apolloLogin('rahel.cueni', 'test'); cy.visit('/room/ein-historisches-festival'); - cy.login('rahel.cueni', 'test'); cy.get('[data-cy=add-room-entry-button]').click(); cy.get('.add-content-element:first-of-type').click(); diff --git a/client/cypress/integration/rooms-page.spec.js b/client/cypress/integration/rooms-page.spec.js index 99604cb4..73dcb0a9 100644 --- a/client/cypress/integration/rooms-page.spec.js +++ b/client/cypress/integration/rooms-page.spec.js @@ -1,16 +1,16 @@ describe('The Rooms Page', () => { // todo: mock all the graphql queries and mutations it('goes to the rooms page', () => { + cy.apolloLogin('nico.zickgraf', 'test'); cy.visit('/rooms'); - cy.login('nico.zickgraf', 'test'); cy.get('[data-cy=add-room]').should('exist'); }); it('add room should not exist for student', () => { + cy.apolloLogin('rahel.cueni', 'test'); cy.visit('/rooms'); - cy.login('rahel.cueni', 'test'); cy.get('[data-cy=add-room]').should('not.exist'); diff --git a/client/cypress/support/commands.js b/client/cypress/support/commands.js index f7b0595b..9fa9e1f2 100644 --- a/client/cypress/support/commands.js +++ b/client/cypress/support/commands.js @@ -122,7 +122,10 @@ Cypress.Commands.add('enterPassword', (password) => { }); 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 !== '') { cy.get('[data-cy="firstname-input"]').type(firstname);