mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-22 17:42:57 +00:00
feat: improved e2e tests
This commit is contained in:
@@ -14,44 +14,49 @@
|
||||
*/
|
||||
|
||||
describe('canteen', function () {
|
||||
const dishUid = '86464b64-da1e-5578-a5c4-eec23457f596';
|
||||
beforeEach(function () {
|
||||
cy.intercept('POST', 'https://mobile.server.uni-frankfurt.de/search', {
|
||||
fixture: 'search/types/canteen/canteen-1.json',
|
||||
}).as('search');
|
||||
cy.intercept('POST', 'https://mobile.server.uni-frankfurt.de/search/multi', {
|
||||
fixture: 'search/types/dish/dish-1.json',
|
||||
cy.interceptSearch({
|
||||
extends: 'canteen/all',
|
||||
fixture: 'canteen/all',
|
||||
alias: 'search',
|
||||
});
|
||||
cy.interceptMultiSearch({
|
||||
extends: 'canteen/dishes',
|
||||
fixture: 'canteen/dishes',
|
||||
alias: 'dishes',
|
||||
});
|
||||
cy.interceptGet({
|
||||
uid: dishUid,
|
||||
fixture: 'canteen/canteen',
|
||||
alias: 'detail',
|
||||
});
|
||||
});
|
||||
|
||||
it('should not utilize the default price', function () {
|
||||
cy.visit('/data-detail/86464b64-da1e-5578-a5c4-eec23457f596');
|
||||
cy.visit(`/data-detail/${dishUid}`);
|
||||
cy.wait('@detail');
|
||||
cy.contains('4,40 €').should('not.exist');
|
||||
});
|
||||
|
||||
it('should have a student price', function () {
|
||||
cy.visit('/settings');
|
||||
cy.contains('stapps-settings-item', 'Gruppe').find('ion-select').should('be.visible').click();
|
||||
cy.get('ion-popover').contains('ion-item', 'Studierende').click();
|
||||
cy.wait(2000);
|
||||
cy.visit('/data-detail/86464b64-da1e-5578-a5c4-eec23457f596');
|
||||
cy.setSettings({profile: {group: 'student'}});
|
||||
cy.visit(`/data-detail/${dishUid}`);
|
||||
cy.wait('@detail');
|
||||
cy.contains('3,30 €').should('exist');
|
||||
});
|
||||
|
||||
it('should have an employee price', function () {
|
||||
cy.visit('/settings');
|
||||
cy.contains('stapps-settings-item', 'Gruppe').find('ion-select').should('be.visible').click();
|
||||
cy.get('ion-popover').contains('ion-item', 'Angestellte').click();
|
||||
cy.wait(2000);
|
||||
cy.visit('/data-detail/86464b64-da1e-5578-a5c4-eec23457f596');
|
||||
cy.contains('1,10 €').should('exist');
|
||||
cy.setSettings({profile: {group: 'employee'}});
|
||||
cy.visit(`/data-detail/${dishUid}`);
|
||||
cy.wait('@detail');
|
||||
cy.contains('2,20 €').should('exist');
|
||||
});
|
||||
|
||||
it('should have a guest price', function () {
|
||||
cy.visit('/settings');
|
||||
cy.contains('stapps-settings-item', 'Gruppe').find('ion-select').should('be.visible').click();
|
||||
cy.get('ion-popover').contains('ion-item', 'Gäste').click();
|
||||
cy.wait(2000);
|
||||
cy.visit('/data-detail/86464b64-da1e-5578-a5c4-eec23457f596');
|
||||
cy.contains('2,20 €').should('exist');
|
||||
cy.setSettings({profile: {group: 'guest'}});
|
||||
cy.visit(`/data-detail/${dishUid}`);
|
||||
cy.wait('@detail');
|
||||
cy.contains('1,10 €').should('exist');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user