-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
100 changed files
with
6,528 additions
and
9,444 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
FROM nginx:1.18.0-alpine | ||
CMD ["nginx", "-g", "daemon off;"] | ||
COPY ./dist /usr/share/nginx/html | ||
COPY ./env.copy.sh . | ||
RUN chmod 755 ./env.copy.sh | ||
ENTRYPOINT ["sh", "./env.copy.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { defineConfig } from 'cypress' | ||
|
||
export default defineConfig({ | ||
blockHosts: ['*fonts.googleapis.com', '*fonts.gstatic.com'], | ||
screenshotsFolder: 'tmp/cypress-screenshots/', | ||
video: false, | ||
videosFolder: 'tmp/cypress-videos/', | ||
viewportHeight: 768, | ||
viewportWidth: 1024, | ||
env: { | ||
dataServer: 'http://127.0.0.1:3001', | ||
}, | ||
e2e: { | ||
setupNodeEvents(on, config) { | ||
return require('./cypress/plugins/index.js')(on, config) | ||
}, | ||
baseUrl: 'http://localhost:4280', | ||
excludeSpecPattern: ['tsconfig.json'], | ||
}, | ||
}) |
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,208 @@ | ||
context('Statistics Dashboard', () => { | ||
|
||
const force = {force: true}; | ||
const host = 'http://localhost:4280'; | ||
const urlContentTier = '/data/contentTier'; | ||
const urlParamCTZero = 'content-tier-zero='; | ||
const urlParamCTZeroTrue = `?${urlParamCTZero}true`; | ||
|
||
describe('App General', () => { | ||
it('should show the feedback link (landing page / data page)', () => { | ||
cy.visit('/'); | ||
cy.get('[data-e2e=user-assistance]').should('have.length', 1); | ||
cy.visit(urlContentTier); | ||
cy.get('[data-e2e=user-assistance]').should('have.length', 1); | ||
}); | ||
}); | ||
|
||
describe('App Route History', () => { | ||
|
||
it('should keep filter controls synced with the url history', () => { | ||
const baseUrl = `${host}${urlContentTier}`; | ||
const selFilter = `.filters-header + .filters .filter`; | ||
const selFilterOpener = '.filter-opener'; | ||
const selFilterValueLabel = `${selFilter} .checkbox-label`; | ||
const selFilterRemove = '.rm-filter .checkbox-label'; | ||
|
||
cy.visit(urlContentTier); | ||
cy.location('href').should('equal', baseUrl); | ||
cy.get(selFilterRemove).should('not.exist'); | ||
|
||
// filter on country Belgium / confirm url & filter rm buttons updated | ||
|
||
cy.get(selFilterOpener).eq(1).click(force); | ||
cy.get(selFilterValueLabel).contains('Belgium').click(force); | ||
|
||
cy.location('href').should('equal', `${baseUrl}?country=Belgium`); | ||
cy.get(selFilterRemove).contains('Belgium').should('have.length', 1); | ||
|
||
// filter on Metadata Tier 0 / confirm url & filter rm buttons updated | ||
|
||
cy.get(selFilterRemove).contains('Tier 0').should('not.exist'); | ||
cy.get(selFilterOpener).eq(0).click(force); | ||
cy.get(selFilterValueLabel).contains('Tier 0').click(force); | ||
|
||
cy.location('href').should('equal', `${baseUrl}?metadataTier=0&country=Belgium`); | ||
cy.get(selFilterRemove).contains('Tier 0').should('have.length', 1); | ||
|
||
// filter on type IMAGE / confirm url & filter rm buttons updated | ||
|
||
cy.get(selFilterRemove).contains('IMAGE').should('not.exist'); | ||
cy.get(selFilterOpener).eq(5).click(force); | ||
cy.get(selFilterValueLabel).contains('IMAGE').click(force); | ||
|
||
cy.location('href').should('equal', `${baseUrl}?metadataTier=0&country=Belgium&type=IMAGE`); | ||
cy.get(selFilterRemove).contains('IMAGE').should('have.length', 1); | ||
|
||
|
||
// filter on inexistent dataset id / confirm url & filter rm buttons updated | ||
|
||
const selDatasetId = '.dataset-name'; | ||
|
||
cy.get(selFilterRemove).contains('dataset_not_found').should('not.exist'); | ||
cy.get(selDatasetId).type('dataset_not_found{enter}', force); | ||
cy.get(selFilterRemove).contains('dataset_not_found').should('have.length', 1); | ||
|
||
// History Checks | ||
|
||
// go back (remove dataset id) | ||
|
||
cy.go('back'); | ||
|
||
cy.get(selFilterRemove).contains('dataset_not_found').should('not.exist'); | ||
cy.get(selFilterRemove).contains('IMAGE').should('exist'); | ||
cy.get(selFilterRemove).contains('Tier 0').should('exist'); | ||
cy.get(selFilterRemove).contains('Belgium').should('exist'); | ||
|
||
|
||
// go back (remove image) | ||
|
||
cy.go('back'); | ||
|
||
cy.get(selFilterRemove).contains('IMAGE').should('not.exist'); | ||
cy.get(selFilterRemove).contains('Tier 0').should('exist'); | ||
cy.get(selFilterRemove).contains('Belgium').should('exist'); | ||
cy.location('href').should('equal', `${baseUrl}?metadataTier=0&country=Belgium`); | ||
|
||
// go back (remove Tier 0) | ||
cy.go('back'); | ||
|
||
cy.get(selFilterRemove).contains('Tier 0').should('not.exist'); | ||
cy.get(selFilterRemove).contains('Belgium').should('exist'); | ||
cy.location('href').should('equal', `${baseUrl}?country=Belgium`); | ||
|
||
// go back (remove Country) | ||
cy.go('back'); | ||
|
||
cy.get(selFilterRemove).should('not.exist'); | ||
cy.location('href').should('equal', baseUrl); | ||
|
||
// go forward (re-add Country) | ||
cy.go('forward'); | ||
|
||
cy.get(selFilterRemove).contains('Belgium').should('exist'); | ||
cy.get(selFilterRemove).contains('IMAGE').should('not.exist'); | ||
cy.location('href').should('equal', `${baseUrl}?country=Belgium`); | ||
|
||
// go forward (re-add Tier 0) | ||
|
||
cy.go('forward'); | ||
|
||
cy.get(selFilterRemove).contains('Belgium').should('exist'); | ||
cy.get(selFilterRemove).contains('Tier 0').should('exist'); | ||
cy.get(selFilterRemove).contains('IMAGE').should('not.exist'); | ||
cy.location('href').should('equal', `${baseUrl}?metadataTier=0&country=Belgium`); | ||
|
||
// go forward (re-add IMAGE) | ||
cy.go('forward'); | ||
|
||
cy.get(selFilterRemove).contains('Belgium').should('exist'); | ||
cy.get(selFilterRemove).contains('Tier 0').should('exist'); | ||
cy.get(selFilterRemove).contains('IMAGE').should('exist'); | ||
cy.location('href').should('equal', `${baseUrl}?metadataTier=0&country=Belgium&type=IMAGE`); | ||
}); | ||
}); | ||
|
||
describe('App Content Tier Zero', () => { | ||
const selCTZero = '#ctZero'; | ||
const selLinkDataContentTier = '[data-e2e=link-entry-ct]'; | ||
const selLinkHeader = '[data-e2e=link-home-header]'; | ||
|
||
const checkCTZeroChangesUrl = (): void => { | ||
cy.get(selCTZero).should('have.length', 1); | ||
cy.get(selCTZero).should('not.be.checked'); | ||
cy.url().should('not.contain', urlParamCTZero); | ||
|
||
cy.get(selCTZero).click(force); | ||
cy.get(selCTZero).should('be.checked'); | ||
cy.url().should('contain', urlParamCTZero); | ||
}; | ||
|
||
it('the url should reflect content-tier-zero visibility (landing page)', () => { | ||
cy.visit('/'); | ||
checkCTZeroChangesUrl(); | ||
}); | ||
|
||
it('the url should reflect content-tier-zero visibility (data page)', () => { | ||
cy.visit(urlContentTier); | ||
checkCTZeroChangesUrl(); | ||
}); | ||
|
||
it('the content-tier-zero should be remembered between pages (click test)', () => { | ||
cy.visit('/'); | ||
cy.get(selCTZero).click(force); | ||
cy.get(selCTZero).should('be.checked'); | ||
cy.url().should('contain', urlParamCTZero); | ||
|
||
const goBackAndForth = () => { | ||
cy.url().should('not.contain', '/data'); | ||
cy.get(selLinkDataContentTier).click(force); | ||
|
||
cy.get(selCTZero).should('be.checked'); | ||
cy.url().should('contain', urlParamCTZero); | ||
|
||
cy.get(selLinkHeader).click(force); | ||
|
||
cy.get(selCTZero).should('be.checked'); | ||
cy.url().should('contain', urlParamCTZero); | ||
}; | ||
goBackAndForth(); | ||
goBackAndForth(); | ||
}); | ||
|
||
it('the content-tier-zero should be remembered between pages (history test)', () => { | ||
|
||
cy.visit('/') | ||
const expectedHistory = ['/', `/${urlParamCTZeroTrue}`, `${urlContentTier}${urlParamCTZeroTrue}`, `${urlContentTier}`, '/']; | ||
|
||
cy.location('search').should('equal', ''); | ||
cy.location('pathname').should('equal', '/'); | ||
cy.location('href').should('equal', `${host}${expectedHistory[0]}`); | ||
|
||
cy.get(selCTZero).click(force); | ||
cy.location('href').should('equal', `${host}${expectedHistory[1]}`); | ||
|
||
cy.get(selLinkDataContentTier).click(force); | ||
cy.location('href').should('equal', `${host}${expectedHistory[2]}`); | ||
|
||
cy.get(selCTZero).click(force); | ||
cy.location('href').should('equal', `${host}${expectedHistory[3]}`); | ||
|
||
cy.get(selLinkHeader).click(force); | ||
cy.location('href').should('equal', `${host}${expectedHistory[4]}`); | ||
|
||
// browser back | ||
for(let i = 0; i < expectedHistory.length -1; i++) { | ||
const historyIndex = expectedHistory.length - (i + 1); | ||
cy.location('href').should('equal', `${host}${expectedHistory[historyIndex]}`); | ||
cy.go('back'); | ||
} | ||
|
||
// browser forward | ||
for(let i = 0; i < expectedHistory.length -1; i++) { | ||
cy.location('href').should('equal', `${host}${expectedHistory[i]}`); | ||
cy.go('forward'); | ||
} | ||
}); | ||
}); | ||
}); |
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.