Skip to content

Commit

Permalink
Merge pull request #810 from Amsterdam/release/v1.11.0
Browse files Browse the repository at this point in the history
Release/v1.11.0
  • Loading branch information
janjaap authored Apr 30, 2020
2 parents 4396035 + dd082d2 commit b9c9557
Show file tree
Hide file tree
Showing 203 changed files with 12,754 additions and 7,750 deletions.
4 changes: 0 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ COPY .gitignore \
babel.config.js \
/app/

# Install language packs
RUN npm install --unsafe-perm -g full-icu
ENV NODE_ICU_DATA="/usr/local/lib/node_modules/full-icu"

COPY package.json \
package-lock.json \
/app/
Expand Down
3 changes: 3 additions & 0 deletions cypress.env.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"signalId": ""
}
8 changes: 4 additions & 4 deletions cypress.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"baseUrl": "http://localhost:3001",
"waitForAnimations": true,
"animationsDistanceTreshold": 20,
"defaultCommandTimeOut": 5000,
"projectId": "b6phb4",
"requestTimeout": 15000,
"reponseTimeout": 15000
}
"responseTimeout": 15000,
"video": false
}
18 changes: 18 additions & 0 deletions cypress/fixtures/creatSignalForMap.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"location": {
"geometrie": {"type": "Point", "coordinates": [4.89089949, 52.37316397]},
"address": {
"openbare_ruimte": "Nieuwezijds Voorburgwal",
"huisnummer": "147",
"postcode": "1012RJ",
"woonplaats": "Amsterdam"
},
"stadsdeel": "A"
},
"category": {
"sub_category": "https://acc.api.data.amsterdam.nl/signals/v1/public/terms/categories/overlast-in-de-openbare-ruimte/sub_categories/overig-openbare-ruimte"
},
"reporter": {},
"incident_date_start": "2020-04-16T14:06:31+02:00",
"text": "Er staat een paard in de gang, ja ja een paard in de gang."
}
14 changes: 14 additions & 0 deletions cypress/fixtures/verkeerslicht.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"hoofdrubriek": [
[
"https://acc.api.data.amsterdam.nl/signals/v1/public/terms/categories/wegen-verkeer-straatmeubilair"
],
[0.8839280650199315]
],
"subrubriek": [
[
"https://acc.api.data.amsterdam.nl/signals/v1/public/terms/categories/wegen-verkeer-straatmeubilair/sub_categories/verkeerslicht"
],
[0.7701486592222567]
]
}
76 changes: 67 additions & 9 deletions cypress/integration/createSignalAfval.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@

import * as createSignal from '../support/commandsCreateSignal';
import { CREATE_SIGNAL } from '../support/selectorsCreateSignal';
import { SIGNAL_DETAILS } from '../support/selectorsSignalDetails';

describe('Create signal afval', () => {
before(() => {
cy.server();
cy.defineGeoSearchRoutes();
cy.getAddressRoute('1035LA 43');
cy.getAddressRoute();

// Open Homepage
cy.visitFetch('incident/beschrijf');
Expand All @@ -23,9 +24,7 @@ describe('Create signal afval', () => {

// Select found item
createSignal.selectAddress('Sandwijk 43, 1035LA Amsterdam');
cy.wait('@lookup')
.wait('@location')
.wait('@geoSearchLocation');
cy.wait('@geoSearchLocation');
});

it('Should enter a description', () => {
Expand Down Expand Up @@ -76,24 +75,83 @@ describe('Create signal afval', () => {
// Check h1
cy.checkHeaderText('Controleer uw gegevens');

// Check if map is visible
cy.get(CREATE_SIGNAL.mapContainer).should('be.visible');
// Check if map and marker are visible
cy.get(CREATE_SIGNAL.mapStaticImage).should('be.visible');
cy.get(CREATE_SIGNAL.mapStaticMarker).should('be.visible');

cy.contains('Sandwijk 43, 1035LA Amsterdam');
cy.contains('Voor mijn deur ligt allemaal afval op de stoep, zouden jullie ervoor kunnen zorgen dat dit wordt opgeruimd?');
// Check mail and phonenumber
cy.contains('06-12345678').should('be.visible');
cy.contains('[email protected]').should('be.visible');

cy.clickButton('Verstuur');
});

it('Should show the last screen', () => {
cy.server();
cy.postSignalRoutePublic();


cy.clickButton('Verstuur');

cy.wait('@postSignalPublic');

// Check URL
cy.url().should('include', '/incident/bedankt');

// Check h1
cy.checkHeaderText('Bedankt!');

// Capture signal id
cy.get('.bedankt').first().then($signalLabel => {
// Get the signal id
const signalNumber = $signalLabel.text().match(/\d+/)[0];
cy.log(signalNumber);
// Set the signal id in variable for later use
Cypress.env('signalId', signalNumber);
});
});
});

// TODO capture signal id
describe('Check data created signal', () => {
before(() => {
localStorage.setItem('accessToken', 'TEST123');
cy.server();
cy.getManageSignalsRoutes();
cy.visitFetch('/manage/incidents/');
cy.wait('@getFilters');
cy.wait('@getCategories');
cy.wait('@getSignals');
cy.wait('@getUserInfo');
cy.log(Cypress.env('signalId'));
});

it('Should show the signal details', () => {
cy.get('[href*="/manage/incident/"]').contains(Cypress.env('signalId')).click();

cy.contains('Voor mijn deur ligt allemaal afval op de stoep, zouden jullie ervoor kunnen zorgen dat dit wordt opgeruimd?');

// Check if map and marker are visible
cy.get(CREATE_SIGNAL.mapStaticImage).should('be.visible');
cy.get(CREATE_SIGNAL.mapStaticMarker).should('be.visible');

cy.get(SIGNAL_DETAILS.stadsdeel).contains('Stadsdeel: ').and('contain', 'Noord').should('be.visible');
cy.get(SIGNAL_DETAILS.addressStreet).contains('Sandwijk').and('contain', '43').should('be.visible');
cy.get(SIGNAL_DETAILS.addressCity).contains('1035LA').and('contain', 'Amsterdam').should('be.visible');
cy.get(SIGNAL_DETAILS.email).contains('[email protected]').should('be.visible');
cy.get(SIGNAL_DETAILS.phoneNumber).contains('06-12345678').should('be.visible');

// Check if status is 'gemeld' with red coloured text
cy.get(SIGNAL_DETAILS.status).contains('Gemeld').should('be.visible').and($labels => {
expect($labels).to.have.css('color', 'rgb(236, 0, 0)');
});

// TODO should have a data-testid
// check urgency
cy.contains('Normaal').should('be.visible');
cy.contains('Veeg- / zwerfvuil').should('be.visible');

cy.get(SIGNAL_DETAILS.mainCategory).contains('Schoon').should('be.visible');
cy.get(SIGNAL_DETAILS.department).contains('STW').should('be.visible');
cy.get(SIGNAL_DETAILS.source).contains('online').should('be.visible');
});
});
25 changes: 14 additions & 11 deletions cypress/integration/createSignalAnimalsWaspFromManage.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,15 @@ describe('Create signal from incident management, animals', () => {
cy.openMenu();
cy.contains('Melden').click();
cy.checkHeaderText('Beschrijf uw melding');

// Use visitfetch to open url, this enables Cypress to intercept fetch protocol
cy.visitFetch('incident/beschrijf');
});

it('Should search for an address', () => {
cy.server();
cy.defineGeoSearchRoutes();
cy.getAddressRoute('1012GX 23');
cy.getAddressRoute();

// Check URL
cy.url().should('include', '/incident/beschrijf');
Expand All @@ -44,9 +47,7 @@ describe('Create signal from incident management, animals', () => {

// Select found item
createSignal.selectAddress('Oudekerksplein 23, 1012GX Amsterdam');
cy.wait('@lookup')
.wait('@location')
.wait('@geoSearchLocation');
cy.wait('@geoSearchLocation');
});

it('Should enter signal details', () => {
Expand Down Expand Up @@ -121,21 +122,23 @@ describe('Create signal from incident management, animals', () => {
// Check h1
cy.checkHeaderText('Controleer uw gegevens');

// Check if map is visible
cy.get(CREATE_SIGNAL.mapContainer).should('be.visible');
// Check if map and marker are visible
cy.get(CREATE_SIGNAL.mapStaticImage).should('be.visible');
cy.get(CREATE_SIGNAL.mapStaticMarker).should('be.visible');

// Check information provided by user
cy.contains('Oudekerksplein 23, 1012GX Amsterdam').should('be.visible');
cy.contains('Er is een wespennest bij de hoofdingang van de Oude kerk');
});

// Check marker on map
cy.get(CREATE_SIGNAL.imageAddressMarker).find("img").should('be.visible');
it('Should show the last screen', () => {
cy.server();
cy.postSignalRoutePrivate();

// Click on next
cy.clickButton('Verstuur');
});

it('Should show the last screen', () => {
cy.wait('@postSignalPrivate');

// Check URL
cy.url().should('include', '/incident/bedankt');

Expand Down
20 changes: 12 additions & 8 deletions cypress/integration/createSignalBotenWater.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ describe('Create signal boten',() => {
before(() => {
cy.server();
cy.defineGeoSearchRoutes();
cy.getAddressRoute('1096AC 7');
cy.getAddressRoute();

// Open Homepage
cy.visitFetch('incident/beschrijf');
Expand All @@ -23,9 +23,7 @@ describe('Create signal boten',() => {

// Select found item
createSignal.selectAddress('Korte Ouderkerkerdijk 7, 1096AC Amsterdam');
cy.wait('@lookup')
.wait('@location')
.wait('@geoSearchLocation');
cy.wait('@geoSearchLocation');
});

it('Should enter description and date', () => {
Expand Down Expand Up @@ -92,20 +90,26 @@ describe('Create signal boten',() => {
// Check h1
cy.checkHeaderText('Controleer uw gegevens');

// Check if map is visible
cy.get(CREATE_SIGNAL.mapContainer).should('be.visible');
// Check if map and marker are visible
cy.get(CREATE_SIGNAL.mapStaticImage).should('be.visible');
cy.get(CREATE_SIGNAL.mapStaticMarker).should('be.visible');

// Check information provided by user
cy.contains('Korte Ouderkerkerdijk 7, 1096AC Amsterdam').should('be.visible');
cy.contains('Een grote boot vaart al de hele dag hard door het water.').should('be.visible');
cy.contains('Amsterdam Boat Center').should('be.visible');
cy.contains('Bota Fogo').should('be.visible');
cy.contains('De boot voer richting Ouderkerk aan de Amstel').should('be.visible');

cy.clickButton('Verstuur');
});

it('Should show the last screen', () => {
cy.server();
cy.postSignalRoutePublic();

cy.clickButton('Verstuur');

cy.wait('@postSignalPublic');

// Check URL
cy.url().should('include', '/incident/bedankt');

Expand Down
20 changes: 12 additions & 8 deletions cypress/integration/createSignalContainer.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ describe('Create signal cointainer',() => {
before(() => {
cy.server();
cy.defineGeoSearchRoutes();
cy.getAddressRoute('1012AB 15');
cy.getAddressRoute();

// Open Homepage
cy.visitFetch('incident/beschrijf');
Expand All @@ -23,9 +23,7 @@ describe('Create signal cointainer',() => {

// Select found item
createSignal.selectAddress('Stationsplein 15, 1012AB Amsterdam');
cy.wait('@lookup')
.wait('@location')
.wait('@geoSearchLocation');
cy.wait('@geoSearchLocation');
});

it('Should enter description and date', () => {
Expand Down Expand Up @@ -87,19 +85,25 @@ describe('Create signal cointainer',() => {
// Check h1
cy.checkHeaderText('Controleer uw gegevens');

// Check if map is visible
cy.get(CREATE_SIGNAL.mapContainer).should('be.visible');
// Check if map and marker are visible
cy.get(CREATE_SIGNAL.mapStaticImage).should('be.visible');
cy.get(CREATE_SIGNAL.mapStaticMarker).should('be.visible');

// Check information provided by user
cy.contains('Stationsplein 15, 1012AB Amsterdam').should('be.visible');
cy.contains('De container voor de deur is kapot, de klep gaat niet open.').should('be.visible');
cy.contains('Een restafval container').should('be.visible');
cy.contains('Nummertje 666').should('be.visible');

cy.clickButton('Verstuur');
});

it('Should show the last screen', () => {
cy.server();
cy.postSignalRoutePublic();

cy.clickButton('Verstuur');

cy.wait('@postSignalPublic');

// Check URL
cy.url().should('include', '/incident/bedankt');

Expand Down
Loading

0 comments on commit b9c9557

Please sign in to comment.