Skip to content

Commit 45a5b6f

Browse files
committed
e2e: migrate tests for DT2
1 parent e822dcb commit 45a5b6f

File tree

2 files changed

+19
-17
lines changed

2 files changed

+19
-17
lines changed

tests/end2end/cypress/integration/attribute_table-ghaction.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ describe('Attribute table', () => {
6161
.to.contain('OUTPUTFORMAT=JSON')
6262
})
6363

64-
cy.get('#attribute-layer-table-quartiers_shp_wrapper div.dataTables_scrollHead th').then(theaders => {
64+
cy.get('#attribute-layer-table-quartiers_shp_wrapper div.dt-scroll-head th').then(theaders => {
6565
const headers = [...theaders].map(t => t.innerText)
6666
const correct_column_order = ['', 'quartmno', 'libquart', 'photo', 'url', 'thumbnail'];
6767

@@ -82,7 +82,7 @@ describe('Attribute table', () => {
8282
.to.contain('OUTPUTFORMAT=JSON')
8383
})
8484

85-
cy.get('#attribute-layer-table-Les_quartiers_a_Montpellier_wrapper div.dataTables_scrollHead th').then(theaders => {
85+
cy.get('#attribute-layer-table-Les_quartiers_a_Montpellier_wrapper div.dt-scroll-head th').then(theaders => {
8686
const headers = [...theaders].map(t => t.innerText)
8787
const correct_column_order = ['', 'quartier', 'quartmno', 'libquart', 'thumbnail', 'url', 'photo'];
8888

tests/end2end/cypress/integration/filter_layer_data_by_polygon_for_groups-ghaction.js

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ describe('Filter layer data by polygon for groups', function () {
8585
res.headers['cache-control'] = 'no-store'
8686
})
8787
}).as('getFeature')
88+
89+
cy.intercept('/index.php/lizmap/datatables*').as('datatables')
8890
})
8991

9092
afterEach(function () {
@@ -146,22 +148,22 @@ describe('Filter layer data by polygon for groups', function () {
146148
cy.get('#button-attributeLayers').click()
147149

148150
cy.get('button[value="shop_bakery"].btn-open-attribute-layer').click({ force: true })
149-
cy.wait('@getFeature')
150-
cy.get('#attribute-layer-table-shop_bakery tbody tr').should('have.length', 0)
151+
cy.wait('@datatables')
152+
cy.get('#attribute-layer-table-shop_bakery tbody tr td.dt-empty').should('have.length', 1)
151153

152154
cy.get('#nav-tab-attribute-summary').click()
153155
cy.get('button[value="townhalls_EPSG2154"].btn-open-attribute-layer').click({ force: true })
154-
cy.wait('@getFeature')
155-
cy.get('#attribute-layer-table-townhalls_EPSG2154 tbody tr').should('have.length', 0)
156+
cy.wait('@datatables')
157+
cy.get('#attribute-layer-table-townhalls_EPSG2154 tbody tr td.dt-empty').should('have.length', 1)
156158

157159
cy.get('#nav-tab-attribute-summary').click()
158160
cy.get('button[value="shop_bakery_pg"].btn-open-attribute-layer').click({ force: true })
159-
cy.wait('@getFeature')
160-
cy.get('#attribute-layer-table-shop_bakery_pg tbody tr').should('have.length', 0)
161+
cy.wait('@datatables')
162+
cy.get('#attribute-layer-table-shop_bakery_pg tbody tr td.dt-empty').should('have.length', 1)
161163

162164
cy.get('#nav-tab-attribute-summary').click()
163165
cy.get('button[value="townhalls_pg"].btn-open-attribute-layer').click({ force: true })
164-
cy.wait('@getFeature')
166+
cy.wait('@datatables')
165167
cy.get('#attribute-layer-table-townhalls_pg tbody tr').should('have.length', 16)
166168

167169
// The user cannot edit the data, even for the layer townhalls_pg
@@ -239,22 +241,22 @@ describe('Filter layer data by polygon for groups', function () {
239241
cy.get('#button-attributeLayers').click()
240242

241243
cy.get('button[value="shop_bakery"].btn-open-attribute-layer').click({ force: true })
242-
cy.wait('@getFeature')
244+
cy.wait('@datatables')
243245
cy.get('#attribute-layer-table-shop_bakery tbody tr').should('have.length', 5)
244246

245247
cy.get('#nav-tab-attribute-summary').click()
246248
cy.get('button[value="townhalls_EPSG2154"].btn-open-attribute-layer').click({ force: true })
247-
cy.wait('@getFeature')
249+
cy.wait('@datatables')
248250
cy.get('#attribute-layer-table-townhalls_EPSG2154 tbody tr').should('have.length', 4)
249251

250252
cy.get('#nav-tab-attribute-summary').click()
251253
cy.get('button[value="shop_bakery_pg"].btn-open-attribute-layer').click({ force: true })
252-
cy.wait('@getFeature')
254+
cy.wait('@datatables')
253255
cy.get('#attribute-layer-table-shop_bakery_pg tbody tr').should('have.length', 4)
254256

255257
cy.get('#nav-tab-attribute-summary').click()
256258
cy.get('button[value="townhalls_pg"].btn-open-attribute-layer').click({ force: true })
257-
cy.wait('@getFeature')
259+
cy.wait('@datatables')
258260
cy.get('#attribute-layer-table-townhalls_pg tbody tr').should('have.length', 16)
259261

260262
// The user can only edit 5 features for the layer townhalls_pg (16 - 5 = 11 are hidden)
@@ -376,22 +378,22 @@ describe('Filter layer data by polygon for groups', function () {
376378
cy.get('#button-attributeLayers').click()
377379

378380
cy.get('button[value="shop_bakery"].btn-open-attribute-layer').click({ force: true })
379-
cy.wait('@getFeature')
381+
cy.wait('@datatables')
380382
cy.get('#attribute-layer-table-shop_bakery tbody tr').should('have.length', 25)
381383

382384
cy.get('#nav-tab-attribute-summary').click()
383385
cy.get('button[value="townhalls_EPSG2154"].btn-open-attribute-layer').click({ force: true })
384-
cy.wait('@getFeature')
386+
cy.wait('@datatables')
385387
cy.get('#attribute-layer-table-townhalls_EPSG2154 tbody tr').should('have.length', 17)
386388

387389
cy.get('#nav-tab-attribute-summary').click()
388390
cy.get('button[value="shop_bakery_pg"].btn-open-attribute-layer').click({ force: true })
389-
cy.wait('@getFeature')
391+
cy.wait('@datatables')
390392
cy.get('#attribute-layer-table-shop_bakery_pg tbody tr').should('have.length', 17)
391393

392394
cy.get('#nav-tab-attribute-summary').click()
393395
cy.get('button[value="townhalls_pg"].btn-open-attribute-layer').click({ force: true })
394-
cy.wait('@getFeature')
396+
cy.wait('@datatables')
395397
cy.get('#attribute-layer-table-townhalls_pg tbody tr').should('have.length', 16)
396398

397399
// The user can edit all features for the layer townhalls_pg

0 commit comments

Comments
 (0)