Skip to content

Commit 6b668ca

Browse files
committed
test(e2e): adapt tests to dump edits
1 parent 563392f commit 6b668ca

File tree

4 files changed

+31
-15
lines changed

4 files changed

+31
-15
lines changed

apps/datahub-e2e/src/e2e/datasetDetailPage.cy.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -368,9 +368,7 @@ describe('dataset pages', () => {
368368
.should('have.attr', 'ng-reflect-name', 'matCheck')
369369
})
370370

371-
it('PREVIEW SECTION : display & functions', () => {
372-
cy.visit('/dataset/04bcec79-5b25-4b16-b635-73115f7456e4')
373-
371+
function setTabAliases() {
374372
cy.get('datahub-record-metadata')
375373
.find('[id="preview"]')
376374
.first()
@@ -390,6 +388,11 @@ describe('dataset pages', () => {
390388
.children('div')
391389
.eq(2)
392390
.as('chartTab')
391+
}
392+
it('PREVIEW SECTION : display & functions', () => {
393+
cy.visit('/dataset/04bcec79-5b25-4b16-b635-73115f7456e4')
394+
395+
setTabAliases()
393396

394397
// it should display the tabs
395398
cy.get('@previewSection')
@@ -531,6 +534,8 @@ describe('dataset pages', () => {
531534
it('restricted access', () => {
532535
cy.visit('dataset/e27e7006-fdf9-4004-b6c5-af2a5a5c025c')
533536

537+
setTabAliases()
538+
534539
// MAP: should display the access restriction message for WMS and WFS
535540
cy.get('@mapTab').click()
536541
// WMS

apps/datahub-e2e/src/e2e/datasets.cy.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ describe('datasets', () => {
66

77
// aliases
88
cy.get('gn-ui-results-list-item').find('a').as('results')
9-
cy.get('@results').eq(2).as('sampleResult')
9+
cy.get('@results').eq(3).as('sampleResult')
1010
cy.get('@results')
1111
.then(($results) => $results.length)
1212
.as('resultsCount')
@@ -68,7 +68,7 @@ describe('datasets', () => {
6868
'https://geocat-dev.dev.bgdi.ch/geonetwork/srv/api/records/9e1ea778-d0ce-4b49-90b7-37bc0e448300/attachments/test.png'
6969
)
7070
cy.get('@results')
71-
.first()
71+
.eq(2)
7272
.find('gn-ui-thumbnail')
7373
.children('div')
7474
.invoke('attr', 'data-cy-is-placeholder')
@@ -212,12 +212,12 @@ describe('datasets', () => {
212212

213213
describe('filter by one option', () => {
214214
beforeEach(() => {
215-
cy.get('@options').eq(11).click()
215+
cy.get('@options').eq(10).click()
216216
cy.get('@resultsCount').then((resultsCount) => {
217217
cy.get('@results').should('have.length.below', resultsCount) // wait for results change
218218
})
219219
cy.get('@options')
220-
.eq(11)
220+
.eq(10)
221221
.then((option) => {
222222
const optionText = option.text().trim()
223223
const matches = /^(.*) \((\d+)\)$/.exec(optionText)
@@ -294,10 +294,14 @@ describe('datasets', () => {
294294
"Direction de l'Intégration des géodonnées (SPW - Secrétariat général - SPW Digital - Département de la Géomatique - Direction de l'Intégration des géodonnées) (9)",
295295
'DREAL (1)',
296296
"DREAL HdF (Direction Régionale de l'Environnement de l'Aménagement et du Logement des Hauts de France) (1)",
297+
'Fédération Départementale de la Chasse (1)',
298+
'Fédération Nationale de la Chasse (1)',
297299
'Géo2France (1)',
298300
"Helpdesk carto du SPW (SPW - Secrétariat général - SPW Digital - Département de la Géomatique - Direction de l'Intégration des géodonnées) (11)",
299301
'Métropole Européenne de Lille (2)',
302+
'Office France de la Biodiversité (1)',
300303
'Région Hauts-de-France (1)',
304+
'Réseau Ongulés sauvages OFB-FNC-FDC (1)',
301305
'Service public de Wallonie (SPW) (11)',
302306
"Société Publique de Gestion de l'Eau (SPGE) (1)",
303307
])
@@ -380,9 +384,9 @@ describe('datasets', () => {
380384
cy.get('@optionsLabel')
381385
.invoke('slice', 0, 3)
382386
.should('eql', [
387+
'Administrative units (1)',
383388
'Environmental monitoring facilities (2)',
384389
'Land use (1)',
385-
'Production and industrial facilities (1)',
386390
])
387391
})
388392
it('should not have duplicates', () => {

apps/datahub-e2e/src/e2e/header/filters.cy.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ describe('filters and sorts', () => {
4747
cy.get('@inlineFilter-service').should('not.be.checked')
4848
cy.get('@inlineFilter-reuse').should('not.be.checked')
4949
cy.url().should('not.contain', 'recordKind=')
50-
cy.get('[data-cy="resultsHitsFound"]').should('contain.text', '25 ')
50+
cy.get('[data-cy="resultsHitsFound"]').should('contain.text', '26 ')
5151
})
5252
})
5353

@@ -75,7 +75,14 @@ describe('filters and sorts', () => {
7575
cy.get('@inlineFilter-service').should('not.be.checked')
7676
cy.get('@inlineFilter-reuse').should('not.be.checked')
7777
cy.url().should('not.contain', 'recordKind=')
78-
cy.get('[data-cy="resultsHitsFound"]').should('contain.text', '25 ')
78+
cy.get('[data-cy="resultsHitsFound"]').should('contain.text', '26 ')
79+
80+
cy.get('@inlineFilter-reuse').check({ force: true })
81+
cy.get('@inlineFilter-reuse').should('be.checked')
82+
cy.get('@inlineFilter-all').should('not.be.checked')
83+
cy.get('@inlineFilter-dataset').should('not.be.checked')
84+
cy.get('@inlineFilter-service').should('not.be.checked')
85+
cy.get('[data-cy="resultsHitsFound"]').should('contain.text', '1 ')
7986
})
8087
})
8188

apps/datahub-e2e/src/e2e/organizations.cy.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,10 @@ describe('organizations', () => {
6666
})
6767
it('should display an actual logo', () => {
6868
cy.get('@organizations')
69-
.eq(11)
69+
.eq(2)
7070
.find('img')
7171
.should('have.attr', 'src')
72-
.and('contain', 'G%C3%A9o2France-4-3_decoupe.png')
72+
.and('contain', 'GN3.png')
7373
})
7474
it('should display navigation options', () => {
7575
cy.get('@pagination').should('be.visible')
@@ -133,7 +133,7 @@ describe('organizations', () => {
133133
it('should go to next page with arrow', () => {
134134
cy.then(() => {
135135
cy.get('@pagination').find('[data-cy=next-page]').click()
136-
cy.get('@organizations').should('have.length', 5)
136+
cy.get('@organizations').should('have.length', 9)
137137
})
138138
})
139139
it('should go back to the first page with arrow', () => {
@@ -166,8 +166,8 @@ describe('organizations', () => {
166166
})
167167
it('should display multiple results and refine search', () => {
168168
cy.get('@organisationsSearch').type('de')
169-
cy.get('@organizationsName').should('have.length', 11)
170-
cy.get('@organisationsResult').should('contain', '11')
169+
cy.get('@organizationsName').should('have.length', 12)
170+
cy.get('@organisationsResult').should('contain', '14')
171171
cy.get('@organisationsSearch').type(' Lille')
172172
cy.get('@organizationsName').should('have.length', 1)
173173
cy.get('@organisationsResult').should('contain', '1')

0 commit comments

Comments
 (0)