Skip to content

Commit

Permalink
e2e: Add more tests for WFS
Browse files Browse the repository at this point in the history
- assert bbox is present
-assert FEATUREID can be used w/o TYPENAME
  • Loading branch information
nboisteault committed Apr 8, 2022
1 parent 8f8e37e commit 8519f4f
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions tests/end2end/cypress/integration/requests-service-ghaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,21 +50,42 @@ describe('Request service', function () {
})
})

it('WFS GetFeature', function () {
it('WFS GetFeature TYPENAME', function () {
cy.request({
method: 'POST',
url: '/index.php/lizmap/service/?repository=testsrepository&project=selection',
qs: {
'SERVICE': 'WFS',
'VERSION': '1.0.0',
'REQUEST': 'GetFeature',
'TYPENAME': 'selection',
'TYPENAME': 'selection_polygon',
'OUTPUTFORMAT': 'GeoJSON',
},
}).then((resp) => {
expect(resp.status).to.eq(200)
expect(resp.headers['content-type']).to.contain('application/vnd.geo+json')
expect(resp.body).to.have.property('type', 'FeatureCollection')
expect(resp.body).to.have.property('bbox')
})
})

it('WFS GetFeature FEATUREID', function () {
cy.request({
method: 'POST',
url: '/index.php/lizmap/service/?repository=testsrepository&project=selection',
qs: {
'SERVICE': 'WFS',
'VERSION': '1.0.0',
'REQUEST': 'GetFeature',
'FEATUREID': 'selection_polygon.1',
'OUTPUTFORMAT': 'GeoJSON',
},
}).then((resp) => {
expect(resp.status).to.eq(200)
expect(resp.headers['content-type']).to.contain('application/vnd.geo+json')
expect(resp.body).to.have.property('type', 'FeatureCollection')
expect(resp.body).to.have.property('bbox')
expect(resp.body.features[0].id).to.equal('selection_polygon.1')
})
})

Expand Down

0 comments on commit 8519f4f

Please sign in to comment.