From 00ba3b5f9db31e3a3ae1c300b4e751f243775dcb Mon Sep 17 00:00:00 2001 From: Bethany Dunfield Date: Wed, 10 Jan 2024 12:55:49 -0700 Subject: [PATCH] Cypress update tests (#136) * Initial commit - updating fixtures * Finish unskipping tests * Move some files around * rebuild css --- cypress/e2e/dataset-stubbed.cy.js | 45 +- cypress/e2e/search-stubbed.cy.js | 5 +- .../dataset/datasetResultsSorted.json | 158 +++ .../dataset/datasetSqlFilteredResults.json | 188 +++ .../fixtures/dataset/datasetSqlResults.json | 158 +++ cypress/fixtures/datasetSqlCount.json | 1 - cypress/fixtures/datasetSqlResults.json | 1058 ----------------- .../fixtures/facets/cityPlanningTheme.json | 12 +- cypress/fixtures/facets/economyKeyword.json | 12 +- cypress/fixtures/facets/economyUkKeyword.json | 12 +- cypress/fixtures/facets/goldFulltext.json | 12 +- cypress/fixtures/facets/ukKeyword.json | 12 +- cypress/fixtures/searchFacets.json | 274 +++-- cypress/support/commands.js | 83 +- 14 files changed, 777 insertions(+), 1253 deletions(-) create mode 100644 cypress/fixtures/dataset/datasetResultsSorted.json create mode 100644 cypress/fixtures/dataset/datasetSqlFilteredResults.json create mode 100644 cypress/fixtures/dataset/datasetSqlResults.json delete mode 100644 cypress/fixtures/datasetSqlCount.json delete mode 100644 cypress/fixtures/datasetSqlResults.json diff --git a/cypress/e2e/dataset-stubbed.cy.js b/cypress/e2e/dataset-stubbed.cy.js index 5095c0e..3563971 100644 --- a/cypress/e2e/dataset-stubbed.cy.js +++ b/cypress/e2e/dataset-stubbed.cy.js @@ -18,19 +18,20 @@ context('Dataset stubbed', () => { }) // add check to make sure message updates to correct amount of rows - it.skip('I can filter the each table individually', () => { - cy.get(`#resource_1234abcd .dc-datatable > .dc-table > :nth-child(2) .tr > :nth-child(3) input`).type('35.08'); - cy.get('.dc-tbody > :nth-child(3) > :nth-child(1)').should('contain', '57') + it('I can filter the each table individually', () => { + cy.get(`#resource_1234abcd .dc-datatable > thead > .tr > th:nth-child(3) input`).type('35.08'); + cy.wait(500); + cy.get('.dc-tbody > :nth-child(3) > :nth-child(1)').should('contain', '57'); cy.get(`#resource_1234abcd .data-table-results`).contains('1 - 20 of 26 rows') }) - it.skip('I can sort each table individually', () => { - cy.get(`#resource_1234abcd .dc-table > :nth-child(1) .tr > :nth-child(1)`).click() - cy.get(`#resource_1234abcd .dc-table .dc-tbody > :nth-child(1) > :nth-child(1)`).should('contain', '1') - cy.get(`#resource_1234abcd .dc-table > :nth-child(1) .tr > :nth-child(1)`).click() - cy.get(`#resource_1234abcd .dc-table .dc-tbody > :nth-child(1) > :nth-child(1)`).should('contain', '200') - cy.get(`#resource_1234abcd .dc-table > :nth-child(1) .tr > :nth-child(1)`).click() - cy.get(`#resource_1234abcd .dc-table .dc-tbody > :nth-child(1) > :nth-child(1)`).should('contain', '1') + it('I can sort each table individually', () => { + cy.get(`#resource_1234abcd .dc-datatable > thead > .tr > th:nth-child(1) .dc-sort > button`).click() + cy.get(`#resource_1234abcd .dc-tbody > :nth-child(1) > :nth-child(1)`).should('contain', '1') + cy.get(`#resource_1234abcd .dc-datatable > thead > .tr > th:nth-child(1) .dc-sort > button`).click() + cy.get(`#resource_1234abcd .dc-tbody > :nth-child(1) > :nth-child(1)`).should('contain', '200') + cy.get(`#resource_1234abcd .dc-datatable > thead > .tr > th:nth-child(1) .dc-sort > button`).click() + cy.get(`#resource_1234abcd .dc-tbody > :nth-child(1) > :nth-child(1)`).should('contain', '1') }) it('I see the tags.', () => { @@ -69,7 +70,7 @@ context('Dataset stubbed', () => { }) // Add check to make sure message updates correctly - it.skip('I can select the number of rows per page in each table.', () => { + it('I can select the number of rows per page in each table.', () => { cy.get(`#resource_1234abcd .-pageInfo`).should('contain', 'Page 1 of 10') cy.get(`#resource_1234abcd .page-size-select`).select('50') cy.get(`#resource_1234abcd .-pageInfo`, { timeout: 75000 }).should('contain', 'Page 1 of 4') @@ -97,7 +98,7 @@ context('Dataset stubbed', () => { cy.get(`#resource_1234abcd .dc-tbody > tr > :nth-child(1)`, { timeout: 40000 }).should('not.have.css', 'width', '217.5px') }) - it.skip('I can open and close Manage Columns', () => { + it('I can open and close Manage Columns', () => { cy.get(`#resource_1234abcd #dc-modal-manage_columns-open`).click() // cy.get('#react-aria-modal-dialog #dialog-title').should('contain', 'Display column') // Test close button in top right @@ -113,25 +114,25 @@ context('Dataset stubbed', () => { cy.get(`#dc-modal-manage_columns`).should('not.exist'); }) - it.skip('I can remove and add back data table columns on just one table', () => { - cy.get(`#resource_1234abcd .dc-table > :nth-child(1) .tr`, { timeout: 40000 }).children('.th').should('have.length', 3) - cy.get(`.dc-table > :nth-child(1) .tr .th`).should('contain', 'record_number') + it('I can remove and add back data table columns on just one table', () => { + cy.get(`#resource_1234abcd .dc-datatable > :nth-child(1) tr`, { timeout: 40000 }).children('th').should('have.length', 3) + cy.get(`.dc-datatable > :nth-child(1) tr th`).should('contain', 'record_number') cy.get(`#resource_1234abcd #dc-modal-manage_columns-open`).click() cy.get(`#dc-modal-manage_columns .dc-modal-body > :nth-child(1) label`).should('contain', 'record_number') cy.get(`#dc-modal-manage_columns .dc-modal-body > :nth-child(1) label`).click() cy.get(`#dc-modal-manage_columns-header-close`).click() - cy.get(`#resource_1234abcd .dc-table > :nth-child(1) .tr .th`).should('contain', 'date') - cy.get(`#resource_1234abcd .dc-table > :nth-child(1) .tr`, { timeout: 40000 }).children('.th').should('have.length', 2) + cy.get(`#resource_1234abcd .dc-datatable > :nth-child(1) tr th`).should('contain', 'date') + cy.get(`#resource_1234abcd .dc-datatable > :nth-child(1) tr`, { timeout: 40000 }).children('th').should('have.length', 2) cy.get(`#resource_1234abcd #dc-modal-manage_columns-open`).click() cy.get('#dc-modal-manage_columns .dc-modal-body > :nth-child(1) label').should('contain', 'record_number') cy.get('#dc-modal-manage_columns .dc-modal-body > :nth-child(1) label').click() cy.get('#dc-modal-manage_columns-header-close').click() - cy.get(`#resource_1234abcd .dc-table > :nth-child(1) .tr`, { timeout: 40000 }).children('.th').should('have.length', 3) - cy.get(`#resource_1234abcd .dc-table > :nth-child(1) .tr .th`, { timeout: 40000 }).should('contain', 'record_number') + cy.get(`#resource_1234abcd .dc-datatable > :nth-child(1) tr`, { timeout: 40000 }).children('th').should('have.length', 3) + cy.get(`#resource_1234abcd .dc-datatable > :nth-child(1) tr th`, { timeout: 40000 }).should('contain', 'record_number') }) - it.skip('I can reorder table columns on just one table', () => { - cy.get(`#resource_1234abcd .dc-table:first-of-type > :nth-child(1) > .tr > :nth-child(1)`, { timeout: 40000 }).should('contain', 'record_number') + it('I can reorder table columns on just one table', () => { + cy.get(`#resource_1234abcd .dc-datatable:first-of-type > :nth-child(1) > .tr > :nth-child(1)`, { timeout: 40000 }).should('contain', 'record_number') cy.get(`#resource_1234abcd #dc-modal-manage_columns-open`).click() cy.get(`#dc-modal-manage_columns .dc-modal-body > :nth-child(2)`) .trigger('dragstart') @@ -139,7 +140,7 @@ context('Dataset stubbed', () => { .trigger('dragover') .trigger('drop') cy.get(`#dc-modal-manage_columns-close`).click() - cy.get(`#resource_1234abcd .dc-table:first-of-type > :nth-child(1) > .tr > :nth-child(1)`, { timeout: 40000 }).should('contain', 'date') + cy.get(`#resource_1234abcd .dc-datatable:first-of-type > :nth-child(1) > .tr > :nth-child(1)`, { timeout: 40000 }).should('contain', 'date') }) }) diff --git a/cypress/e2e/search-stubbed.cy.js b/cypress/e2e/search-stubbed.cy.js index 80af66d..7a915d5 100644 --- a/cypress/e2e/search-stubbed.cy.js +++ b/cypress/e2e/search-stubbed.cy.js @@ -7,7 +7,7 @@ context('Search stubbed', () => { }); // FULLTEXT FILTER - it.skip('I can use the text input filter', () => { + it('I can use the text input filter', () => { cy.stubSearchResults('/search'); const placholder = 'Type your search term here'; const filteredFacets = [ @@ -72,7 +72,7 @@ context('Search stubbed', () => { }); // TAG FILTER - it.skip('I can use the tag filter', () => { + it('I can use the tag filter', () => { cy.stubSearchResults('/search'); cy.get('.dc-search-results-message').contains('10 datasets found'); cy.get(searchList).children().its('length').should('eq', 10); @@ -85,6 +85,7 @@ context('Search stubbed', () => { cy.findByText('Finance and Budgeting (3)').should('exist'); cy.findByRole('heading', {name: 'London Deprivation Index'}).should('exist'); cy.findByRole('heading', {name: 'US National Foreclosure Statistics January 2012'}).should('exist'); + cy.findByRole('button', {name: 'Show 9 more'}).click(); // Click united kingdom cy.wait(500) cy.findByText('United Kingdom (1)').click(); diff --git a/cypress/fixtures/dataset/datasetResultsSorted.json b/cypress/fixtures/dataset/datasetResultsSorted.json new file mode 100644 index 0000000..fbc1562 --- /dev/null +++ b/cypress/fixtures/dataset/datasetResultsSorted.json @@ -0,0 +1,158 @@ +{ + "count": 200, + "schema": { + "1234abcd": { + "fields": { + + "record_number":{ + "type":"text", + "description":"" + }, + "date":{ + "type":"text", + "description":"CMS Certification Number (CCN)" + }, + "price":{ + "type":"text", + "description":"Facility Name" + } + } + }, + "2a6924b6-f8bb-5c85-93d8-1744fa1e2093": { + "fields": { + + "record_number":{ + "type":"text", + "description":"" + }, + "date":{ + "type":"text", + "description":"CMS Certification Number (CCN)" + }, + "price":{ + "type":"text", + "description":"Facility Name" + } + } + }, + "18665dfe-b31e-5ccf-9325-97c9833c6804": { + "fields": { + + "record_number":{ + "type":"text", + "description":"" + }, + "date":{ + "type":"text", + "description":"CMS Certification Number (CCN)" + }, + "price":{ + "type":"text", + "description":"Facility Name" + } + } + } + }, + "results": [ + { + "record_number": "200", + "date": "1950-01-01", + "price": "34.73" + }, + { + "record_number": "199", + "date": "1950-02-01", + "price": "34.73" + }, + { + "record_number": "198", + "date": "1950-03-01", + "price": "34.73" + }, + { + "record_number": "197", + "date": "1950-04-01", + "price": "34.73" + }, + { + "record_number": "196", + "date": "1950-05-01", + "price": "34.73" + }, + { + "record_number": "195", + "date": "1950-06-01", + "price": "34.73" + }, + { + "record_number": "194", + "date": "1950-07-01", + "price": "34.73" + }, + { + "record_number": "193", + "date": "1950-08-01", + "price": "34.73" + }, + { + "record_number": "192", + "date": "1950-09-01", + "price": "34.73" + }, + { + "record_number": "191", + "date": "1950-10-01", + "price": "34.73" + }, + { + "record_number": "190", + "date": "1950-11-01", + "price": "34.73" + }, + { + "record_number": "189", + "date": "1950-12-01", + "price": "34.72" + }, + { + "record_number": "188", + "date": "1951-01-01", + "price": "34.72" + }, + { + "record_number": "187", + "date": "1951-02-01", + "price": "34.73" + }, + { + "record_number": "186", + "date": "1951-03-01", + "price": "34.73" + }, + { + "record_number": "185", + "date": "1951-04-01", + "price": "34.73" + }, + { + "record_number": "184", + "date": "1951-05-01", + "price": "34.73" + }, + { + "record_number": "183", + "date": "1951-06-01", + "price": "34.73" + }, + { + "record_number": "182", + "date": "1951-07-01", + "price": "34.72" + }, + { + "record_number": "181", + "date": "1951-08-01", + "price": "34.71" + } + ] +} \ No newline at end of file diff --git a/cypress/fixtures/dataset/datasetSqlFilteredResults.json b/cypress/fixtures/dataset/datasetSqlFilteredResults.json new file mode 100644 index 0000000..0d8c601 --- /dev/null +++ b/cypress/fixtures/dataset/datasetSqlFilteredResults.json @@ -0,0 +1,188 @@ +{ + "count": 26, + "schema": { + "1234abcd": { + "fields": { + + "record_number":{ + "type":"text", + "description":"" + }, + "date":{ + "type":"text", + "description":"CMS Certification Number (CCN)" + }, + "price":{ + "type":"text", + "description":"Facility Name" + } + } + }, + "2a6924b6-f8bb-5c85-93d8-1744fa1e2093": { + "fields": { + + "record_number":{ + "type":"text", + "description":"" + }, + "date":{ + "type":"text", + "description":"CMS Certification Number (CCN)" + }, + "price":{ + "type":"text", + "description":"Facility Name" + } + } + }, + "18665dfe-b31e-5ccf-9325-97c9833c6804": { + "fields": { + + "record_number":{ + "type":"text", + "description":"" + }, + "date":{ + "type":"text", + "description":"CMS Certification Number (CCN)" + }, + "price":{ + "type":"text", + "description":"Facility Name" + } + } + } + }, + "results": [ + { + "record_number": "53", + "date": "1954-05-01", + "price": "35.08" + }, + { + "record_number": "55", + "date": "1954-07-01", + "price": "35.08" + }, + { + "record_number": "57", + "date": "1954-09-01", + "price": "35.08" + }, + { + "record_number": "58", + "date": "1954-10-01", + "price": "35.08" + }, + { + "record_number": "98", + "date": "1958-02-01", + "price": "35.08" + }, + { + "record_number": "112", + "date": "1959-04-01", + "price": "35.08" + }, + { + "record_number": "135", + "date": "1961-03-01", + "price": "35.08" + }, + { + "record_number": "136", + "date": "1961-04-01", + "price": "35.08" + }, + { + "record_number": "148", + "date": "1962-04-01", + "price": "35.08" + }, + { + "record_number": "149", + "date": "1962-05-01", + "price": "35.08" + }, + { + "record_number": "156", + "date": "1962-12-01", + "price": "35.08" + }, + { + "record_number": "158", + "date": "1963-02-01", + "price": "35.08" + }, + { + "record_number": "161", + "date": "1963-05-01", + "price": "35.08" + }, + { + "record_number": "162", + "date": "1963-06-01", + "price": "35.08" + }, + { + "record_number": "165", + "date": "1963-09-01", + "price": "35.08" + }, + { + "record_number": "166", + "date": "1963-10-01", + "price": "35.08" + }, + { + "record_number": "167", + "date": "1963-11-01", + "price": "35.08" + }, + { + "record_number": "168", + "date": "1963-12-01", + "price": "35.08" + }, + { + "record_number": "169", + "date": "1964-01-01", + "price": "35.08" + }, + { + "record_number": "170", + "date": "1964-02-01", + "price": "35.08" + }, + { + "record_number": "171", + "date": "1964-03-01", + "price": "35.08" + }, + { + "record_number": "172", + "date": "1964-04-01", + "price": "35.08" + }, + { + "record_number": "173", + "date": "1964-05-01", + "price": "35.08" + }, + { + "record_number": "174", + "date": "1964-06-01", + "price": "35.08" + }, + { + "record_number": "175", + "date": "1964-07-01", + "price": "35.08" + }, + { + "record_number": "176", + "date": "1964-08-01", + "price": "35.08" + } + ] +} \ No newline at end of file diff --git a/cypress/fixtures/dataset/datasetSqlResults.json b/cypress/fixtures/dataset/datasetSqlResults.json new file mode 100644 index 0000000..68de8dc --- /dev/null +++ b/cypress/fixtures/dataset/datasetSqlResults.json @@ -0,0 +1,158 @@ +{ + "count": 200, + "schema": { + "1234abcd": { + "fields": { + + "record_number":{ + "type":"text", + "description":"" + }, + "date":{ + "type":"text", + "description":"CMS Certification Number (CCN)" + }, + "price":{ + "type":"text", + "description":"Facility Name" + } + } + }, + "2a6924b6-f8bb-5c85-93d8-1744fa1e2093": { + "fields": { + + "record_number":{ + "type":"text", + "description":"" + }, + "date":{ + "type":"text", + "description":"CMS Certification Number (CCN)" + }, + "price":{ + "type":"text", + "description":"Facility Name" + } + } + }, + "18665dfe-b31e-5ccf-9325-97c9833c6804": { + "fields": { + + "record_number":{ + "type":"text", + "description":"" + }, + "date":{ + "type":"text", + "description":"CMS Certification Number (CCN)" + }, + "price":{ + "type":"text", + "description":"Facility Name" + } + } + } + }, + "results": [ + { + "record_number": "1", + "date": "1950-01-01", + "price": "34.73" + }, + { + "record_number": "2", + "date": "1950-02-01", + "price": "34.73" + }, + { + "record_number": "3", + "date": "1950-03-01", + "price": "34.73" + }, + { + "record_number": "4", + "date": "1950-04-01", + "price": "34.73" + }, + { + "record_number": "5", + "date": "1950-05-01", + "price": "34.73" + }, + { + "record_number": "6", + "date": "1950-06-01", + "price": "34.73" + }, + { + "record_number": "7", + "date": "1950-07-01", + "price": "34.73" + }, + { + "record_number": "8", + "date": "1950-08-01", + "price": "34.73" + }, + { + "record_number": "9", + "date": "1950-09-01", + "price": "34.73" + }, + { + "record_number": "10", + "date": "1950-10-01", + "price": "34.73" + }, + { + "record_number": "11", + "date": "1950-11-01", + "price": "34.73" + }, + { + "record_number": "12", + "date": "1950-12-01", + "price": "34.72" + }, + { + "record_number": "13", + "date": "1951-01-01", + "price": "34.72" + }, + { + "record_number": "14", + "date": "1951-02-01", + "price": "34.73" + }, + { + "record_number": "15", + "date": "1951-03-01", + "price": "34.73" + }, + { + "record_number": "16", + "date": "1951-04-01", + "price": "34.73" + }, + { + "record_number": "17", + "date": "1951-05-01", + "price": "34.73" + }, + { + "record_number": "18", + "date": "1951-06-01", + "price": "34.73" + }, + { + "record_number": "19", + "date": "1951-07-01", + "price": "34.72" + }, + { + "record_number": "20", + "date": "1951-08-01", + "price": "34.71" + } + ] +} \ No newline at end of file diff --git a/cypress/fixtures/datasetSqlCount.json b/cypress/fixtures/datasetSqlCount.json deleted file mode 100644 index ad4667a..0000000 --- a/cypress/fixtures/datasetSqlCount.json +++ /dev/null @@ -1 +0,0 @@ -[{"expression":"200"}] \ No newline at end of file diff --git a/cypress/fixtures/datasetSqlResults.json b/cypress/fixtures/datasetSqlResults.json deleted file mode 100644 index c037fa7..0000000 --- a/cypress/fixtures/datasetSqlResults.json +++ /dev/null @@ -1,1058 +0,0 @@ -{ - "count": 200, - "schema": { - "1234abcd": { - "fields": { - - "record_number":{ - "type":"text", - "description":"" - }, - "date":{ - "type":"text", - "description":"CMS Certification Number (CCN)" - }, - "price":{ - "type":"text", - "description":"Facility Name" - } - } - }, - "2a6924b6-f8bb-5c85-93d8-1744fa1e2093": { - "fields": { - - "record_number":{ - "type":"text", - "description":"" - }, - "date":{ - "type":"text", - "description":"CMS Certification Number (CCN)" - }, - "price":{ - "type":"text", - "description":"Facility Name" - } - } - }, - "18665dfe-b31e-5ccf-9325-97c9833c6804": { - "fields": { - - "record_number":{ - "type":"text", - "description":"" - }, - "date":{ - "type":"text", - "description":"CMS Certification Number (CCN)" - }, - "price":{ - "type":"text", - "description":"Facility Name" - } - } - } - }, - "results": [ - { - "record_number": "1", - "date": "1950-01-01", - "price": "34.73" - }, - { - "record_number": "2", - "date": "1950-02-01", - "price": "34.73" - }, - { - "record_number": "3", - "date": "1950-03-01", - "price": "34.73" - }, - { - "record_number": "4", - "date": "1950-04-01", - "price": "34.73" - }, - { - "record_number": "5", - "date": "1950-05-01", - "price": "34.73" - }, - { - "record_number": "6", - "date": "1950-06-01", - "price": "34.73" - }, - { - "record_number": "7", - "date": "1950-07-01", - "price": "34.73" - }, - { - "record_number": "8", - "date": "1950-08-01", - "price": "34.73" - }, - { - "record_number": "9", - "date": "1950-09-01", - "price": "34.73" - }, - { - "record_number": "10", - "date": "1950-10-01", - "price": "34.73" - }, - { - "record_number": "11", - "date": "1950-11-01", - "price": "34.73" - }, - { - "record_number": "12", - "date": "1950-12-01", - "price": "34.72" - }, - { - "record_number": "13", - "date": "1951-01-01", - "price": "34.72" - }, - { - "record_number": "14", - "date": "1951-02-01", - "price": "34.73" - }, - { - "record_number": "15", - "date": "1951-03-01", - "price": "34.73" - }, - { - "record_number": "16", - "date": "1951-04-01", - "price": "34.73" - }, - { - "record_number": "17", - "date": "1951-05-01", - "price": "34.73" - }, - { - "record_number": "18", - "date": "1951-06-01", - "price": "34.73" - }, - { - "record_number": "19", - "date": "1951-07-01", - "price": "34.72" - }, - { - "record_number": "20", - "date": "1951-08-01", - "price": "34.71" - }, - { - "record_number": "21", - "date": "1951-09-01", - "price": "34.71" - }, - { - "record_number": "22", - "date": "1951-10-01", - "price": "34.71" - }, - { - "record_number": "23", - "date": "1951-11-01", - "price": "34.73" - }, - { - "record_number": "24", - "date": "1951-12-01", - "price": "34.66" - }, - { - "record_number": "25", - "date": "1952-01-01", - "price": "34.49" - }, - { - "record_number": "26", - "date": "1952-02-01", - "price": "34.49" - }, - { - "record_number": "27", - "date": "1952-03-01", - "price": "34.68" - }, - { - "record_number": "28", - "date": "1952-04-01", - "price": "34.82" - }, - { - "record_number": "29", - "date": "1952-05-01", - "price": "34.73" - }, - { - "record_number": "30", - "date": "1952-06-01", - "price": "34.53" - }, - { - "record_number": "31", - "date": "1952-07-01", - "price": "34.57" - }, - { - "record_number": "32", - "date": "1952-08-01", - "price": "34.58" - }, - { - "record_number": "33", - "date": "1952-09-01", - "price": "34.51" - }, - { - "record_number": "34", - "date": "1952-10-01", - "price": "34.63" - }, - { - "record_number": "35", - "date": "1952-11-01", - "price": "34.72" - }, - { - "record_number": "36", - "date": "1952-12-01", - "price": "34.79" - }, - { - "record_number": "37", - "date": "1953-01-01", - "price": "34.88" - }, - { - "record_number": "38", - "date": "1953-02-01", - "price": "34.95" - }, - { - "record_number": "39", - "date": "1953-03-01", - "price": "34.92" - }, - { - "record_number": "40", - "date": "1953-04-01", - "price": "34.93" - }, - { - "record_number": "41", - "date": "1953-05-01", - "price": "34.90" - }, - { - "record_number": "42", - "date": "1953-06-01", - "price": "34.89" - }, - { - "record_number": "43", - "date": "1953-07-01", - "price": "34.91" - }, - { - "record_number": "44", - "date": "1953-08-01", - "price": "34.91" - }, - { - "record_number": "45", - "date": "1953-09-01", - "price": "34.76" - }, - { - "record_number": "46", - "date": "1953-10-01", - "price": "34.79" - }, - { - "record_number": "47", - "date": "1953-11-01", - "price": "34.86" - }, - { - "record_number": "48", - "date": "1953-12-01", - "price": "34.85" - }, - { - "record_number": "49", - "date": "1954-01-01", - "price": "34.86" - }, - { - "record_number": "50", - "date": "1954-02-01", - "price": "34.88" - }, - { - "record_number": "51", - "date": "1954-03-01", - "price": "34.92" - }, - { - "record_number": "52", - "date": "1954-04-01", - "price": "35.04" - }, - { - "record_number": "53", - "date": "1954-05-01", - "price": "35.08" - }, - { - "record_number": "54", - "date": "1954-06-01", - "price": "35.07" - }, - { - "record_number": "55", - "date": "1954-07-01", - "price": "35.08" - }, - { - "record_number": "56", - "date": "1954-08-01", - "price": "35.05" - }, - { - "record_number": "57", - "date": "1954-09-01", - "price": "35.08" - }, - { - "record_number": "58", - "date": "1954-10-01", - "price": "35.08" - }, - { - "record_number": "59", - "date": "1954-11-01", - "price": "35.06" - }, - { - "record_number": "60", - "date": "1954-12-01", - "price": "35.04" - }, - { - "record_number": "61", - "date": "1955-01-01", - "price": "35.04" - }, - { - "record_number": "62", - "date": "1955-02-01", - "price": "35.05" - }, - { - "record_number": "63", - "date": "1955-03-01", - "price": "35.06" - }, - { - "record_number": "64", - "date": "1955-04-01", - "price": "35.05" - }, - { - "record_number": "65", - "date": "1955-05-01", - "price": "35.05" - }, - { - "record_number": "66", - "date": "1955-06-01", - "price": "35.04" - }, - { - "record_number": "67", - "date": "1955-07-01", - "price": "35.05" - }, - { - "record_number": "68", - "date": "1955-08-01", - "price": "35.03" - }, - { - "record_number": "69", - "date": "1955-09-01", - "price": "34.98" - }, - { - "record_number": "70", - "date": "1955-10-01", - "price": "34.98" - }, - { - "record_number": "71", - "date": "1955-11-01", - "price": "34.98" - }, - { - "record_number": "72", - "date": "1955-12-01", - "price": "34.97" - }, - { - "record_number": "73", - "date": "1956-01-01", - "price": "34.99" - }, - { - "record_number": "74", - "date": "1956-02-01", - "price": "34.99" - }, - { - "record_number": "75", - "date": "1956-03-01", - "price": "34.99" - }, - { - "record_number": "76", - "date": "1956-04-01", - "price": "34.98" - }, - { - "record_number": "77", - "date": "1956-05-01", - "price": "34.99" - }, - { - "record_number": "78", - "date": "1956-06-01", - "price": "34.98" - }, - { - "record_number": "79", - "date": "1956-07-01", - "price": "35.00" - }, - { - "record_number": "80", - "date": "1956-08-01", - "price": "35.02" - }, - { - "record_number": "81", - "date": "1956-09-01", - "price": "35.01" - }, - { - "record_number": "82", - "date": "1956-10-01", - "price": "35.02" - }, - { - "record_number": "83", - "date": "1956-11-01", - "price": "34.98" - }, - { - "record_number": "84", - "date": "1956-12-01", - "price": "34.90" - }, - { - "record_number": "85", - "date": "1957-01-01", - "price": "34.88" - }, - { - "record_number": "86", - "date": "1957-02-01", - "price": "34.89" - }, - { - "record_number": "87", - "date": "1957-03-01", - "price": "34.91" - }, - { - "record_number": "88", - "date": "1957-04-01", - "price": "34.92" - }, - { - "record_number": "89", - "date": "1957-05-01", - "price": "34.93" - }, - { - "record_number": "90", - "date": "1957-06-01", - "price": "34.99" - }, - { - "record_number": "91", - "date": "1957-07-01", - "price": "34.99" - }, - { - "record_number": "92", - "date": "1957-08-01", - "price": "34.97" - }, - { - "record_number": "93", - "date": "1957-09-01", - "price": "34.96" - }, - { - "record_number": "94", - "date": "1957-10-01", - "price": "34.97" - }, - { - "record_number": "95", - "date": "1957-11-01", - "price": "34.97" - }, - { - "record_number": "96", - "date": "1957-12-01", - "price": "34.99" - }, - { - "record_number": "97", - "date": "1958-01-01", - "price": "35.01" - }, - { - "record_number": "98", - "date": "1958-02-01", - "price": "35.08" - }, - { - "record_number": "99", - "date": "1958-03-01", - "price": "35.09" - }, - { - "record_number": "100", - "date": "1958-04-01", - "price": "35.10" - }, - { - "record_number": "101", - "date": "1958-05-01", - "price": "35.11" - }, - { - "record_number": "102", - "date": "1958-06-01", - "price": "35.10" - }, - { - "record_number": "103", - "date": "1958-07-01", - "price": "35.11" - }, - { - "record_number": "104", - "date": "1958-08-01", - "price": "35.10" - }, - { - "record_number": "105", - "date": "1958-09-01", - "price": "35.10" - }, - { - "record_number": "106", - "date": "1958-10-01", - "price": "35.11" - }, - { - "record_number": "107", - "date": "1958-11-01", - "price": "35.10" - }, - { - "record_number": "108", - "date": "1958-12-01", - "price": "35.09" - }, - { - "record_number": "109", - "date": "1959-01-01", - "price": "35.07" - }, - { - "record_number": "110", - "date": "1959-02-01", - "price": "35.06" - }, - { - "record_number": "111", - "date": "1959-03-01", - "price": "35.06" - }, - { - "record_number": "112", - "date": "1959-04-01", - "price": "35.08" - }, - { - "record_number": "113", - "date": "1959-05-01", - "price": "35.12" - }, - { - "record_number": "114", - "date": "1959-06-01", - "price": "35.12" - }, - { - "record_number": "115", - "date": "1959-07-01", - "price": "35.13" - }, - { - "record_number": "116", - "date": "1959-08-01", - "price": "35.12" - }, - { - "record_number": "117", - "date": "1959-09-01", - "price": "35.13" - }, - { - "record_number": "118", - "date": "1959-10-01", - "price": "35.10" - }, - { - "record_number": "119", - "date": "1959-11-01", - "price": "35.06" - }, - { - "record_number": "120", - "date": "1959-12-01", - "price": "35.05" - }, - { - "record_number": "121", - "date": "1960-01-01", - "price": "35.09" - }, - { - "record_number": "122", - "date": "1960-02-01", - "price": "35.09" - }, - { - "record_number": "123", - "date": "1960-03-01", - "price": "35.09" - }, - { - "record_number": "124", - "date": "1960-04-01", - "price": "35.11" - }, - { - "record_number": "125", - "date": "1960-05-01", - "price": "35.10" - }, - { - "record_number": "126", - "date": "1960-06-01", - "price": "35.09" - }, - { - "record_number": "127", - "date": "1960-07-01", - "price": "35.10" - }, - { - "record_number": "128", - "date": "1960-08-01", - "price": "35.13" - }, - { - "record_number": "129", - "date": "1960-09-01", - "price": "35.22" - }, - { - "record_number": "130", - "date": "1960-10-01", - "price": "35.78" - }, - { - "record_number": "131", - "date": "1960-11-01", - "price": "35.82" - }, - { - "record_number": "132", - "date": "1960-12-01", - "price": "35.54" - }, - { - "record_number": "133", - "date": "1961-01-01", - "price": "35.56" - }, - { - "record_number": "134", - "date": "1961-02-01", - "price": "35.17" - }, - { - "record_number": "135", - "date": "1961-03-01", - "price": "35.08" - }, - { - "record_number": "136", - "date": "1961-04-01", - "price": "35.08" - }, - { - "record_number": "137", - "date": "1961-05-01", - "price": "35.06" - }, - { - "record_number": "138", - "date": "1961-06-01", - "price": "35.07" - }, - { - "record_number": "139", - "date": "1961-07-01", - "price": "35.11" - }, - { - "record_number": "140", - "date": "1961-08-01", - "price": "35.16" - }, - { - "record_number": "141", - "date": "1961-09-01", - "price": "35.19" - }, - { - "record_number": "142", - "date": "1961-10-01", - "price": "35.19" - }, - { - "record_number": "143", - "date": "1961-11-01", - "price": "35.19" - }, - { - "record_number": "144", - "date": "1961-12-01", - "price": "35.15" - }, - { - "record_number": "145", - "date": "1962-01-01", - "price": "35.16" - }, - { - "record_number": "146", - "date": "1962-02-01", - "price": "35.13" - }, - { - "record_number": "147", - "date": "1962-03-01", - "price": "35.09" - }, - { - "record_number": "148", - "date": "1962-04-01", - "price": "35.08" - }, - { - "record_number": "149", - "date": "1962-05-01", - "price": "35.08" - }, - { - "record_number": "150", - "date": "1962-06-01", - "price": "35.10" - }, - { - "record_number": "151", - "date": "1962-07-01", - "price": "35.12" - }, - { - "record_number": "152", - "date": "1962-08-01", - "price": "35.12" - }, - { - "record_number": "153", - "date": "1962-09-01", - "price": "35.13" - }, - { - "record_number": "154", - "date": "1962-10-01", - "price": "35.14" - }, - { - "record_number": "155", - "date": "1962-11-01", - "price": "35.09" - }, - { - "record_number": "156", - "date": "1962-12-01", - "price": "35.08" - }, - { - "record_number": "157", - "date": "1963-01-01", - "price": "35.06" - }, - { - "record_number": "158", - "date": "1963-02-01", - "price": "35.08" - }, - { - "record_number": "159", - "date": "1963-03-01", - "price": "35.10" - }, - { - "record_number": "160", - "date": "1963-04-01", - "price": "35.10" - }, - { - "record_number": "161", - "date": "1963-05-01", - "price": "35.08" - }, - { - "record_number": "162", - "date": "1963-06-01", - "price": "35.08" - }, - { - "record_number": "163", - "date": "1963-07-01", - "price": "35.09" - }, - { - "record_number": "164", - "date": "1963-08-01", - "price": "35.10" - }, - { - "record_number": "165", - "date": "1963-09-01", - "price": "35.08" - }, - { - "record_number": "166", - "date": "1963-10-01", - "price": "35.08" - }, - { - "record_number": "167", - "date": "1963-11-01", - "price": "35.08" - }, - { - "record_number": "168", - "date": "1963-12-01", - "price": "35.08" - }, - { - "record_number": "169", - "date": "1964-01-01", - "price": "35.08" - }, - { - "record_number": "170", - "date": "1964-02-01", - "price": "35.08" - }, - { - "record_number": "171", - "date": "1964-03-01", - "price": "35.08" - }, - { - "record_number": "172", - "date": "1964-04-01", - "price": "35.08" - }, - { - "record_number": "173", - "date": "1964-05-01", - "price": "35.08" - }, - { - "record_number": "174", - "date": "1964-06-01", - "price": "35.08" - }, - { - "record_number": "175", - "date": "1964-07-01", - "price": "35.08" - }, - { - "record_number": "176", - "date": "1964-08-01", - "price": "35.08" - }, - { - "record_number": "177", - "date": "1964-09-01", - "price": "35.09" - }, - { - "record_number": "178", - "date": "1964-10-01", - "price": "35.11" - }, - { - "record_number": "179", - "date": "1964-11-01", - "price": "35.10" - }, - { - "record_number": "180", - "date": "1964-12-01", - "price": "35.12" - }, - { - "record_number": "181", - "date": "1965-01-01", - "price": "35.13" - }, - { - "record_number": "182", - "date": "1965-02-01", - "price": "35.14" - }, - { - "record_number": "183", - "date": "1965-03-01", - "price": "35.16" - }, - { - "record_number": "184", - "date": "1965-04-01", - "price": "35.14" - }, - { - "record_number": "185", - "date": "1965-05-01", - "price": "35.10" - }, - { - "record_number": "186", - "date": "1965-06-01", - "price": "35.10" - }, - { - "record_number": "187", - "date": "1965-07-01", - "price": "35.12" - }, - { - "record_number": "188", - "date": "1965-08-01", - "price": "35.15" - }, - { - "record_number": "189", - "date": "1965-09-01", - "price": "35.14" - }, - { - "record_number": "190", - "date": "1965-10-01", - "price": "35.11" - }, - { - "record_number": "191", - "date": "1965-11-01", - "price": "35.11" - }, - { - "record_number": "192", - "date": "1965-12-01", - "price": "35.13" - }, - { - "record_number": "193", - "date": "1966-01-01", - "price": "35.15" - }, - { - "record_number": "194", - "date": "1966-02-01", - "price": "35.17" - }, - { - "record_number": "195", - "date": "1966-03-01", - "price": "35.15" - }, - { - "record_number": "196", - "date": "1966-04-01", - "price": "35.13" - }, - { - "record_number": "197", - "date": "1966-05-01", - "price": "35.12" - }, - { - "record_number": "198", - "date": "1966-06-01", - "price": "35.15" - }, - { - "record_number": "199", - "date": "1966-07-01", - "price": "35.18" - }, - { - "record_number": "200", - "date": "1966-08-01", - "price": "35.18" - } - ] -} \ No newline at end of file diff --git a/cypress/fixtures/facets/cityPlanningTheme.json b/cypress/fixtures/facets/cityPlanningTheme.json index de60bf4..534fef4 100644 --- a/cypress/fixtures/facets/cityPlanningTheme.json +++ b/cypress/fixtures/facets/cityPlanningTheme.json @@ -1 +1,11 @@ -{"facets":[{"type":"theme","name":"Transportation","total":"1"},{"type":"theme","name":"City Planning","total":"3"},{"type":"theme","name":"Finance and Budgeting","total":"0"},{"type":"theme","name":"Public Safety","total":"0"},{"type":"theme","name":"Health Care","total":"0"},{"type":"keyword","name":"hello","total":"1"},{"type":"keyword","name":"goodbye","total":"1"},{"type":"keyword","name":"yep","total":"1"},{"type":"keyword","name":"blah","total":"1"},{"type":"keyword","name":"demographics","total":"0"},{"type":"keyword","name":"economy","total":"0"},{"type":"keyword","name":"spatial data","total":"0"},{"type":"keyword","name":"United Kingdom","total":"0"},{"type":"keyword","name":"crime","total":"0"},{"type":"keyword","name":"public safety","total":"0"},{"type":"keyword","name":"socioeconomic","total":"0"},{"type":"keyword","name":"workforce","total":"0"},{"type":"keyword","name":"health","total":"0"},{"type":"keyword","name":"election","total":"2"},{"type":"keyword","name":"politics","total":"1"},{"type":"keyword","name":"transparency","total":"1"},{"type":"keyword","name":"price","total":"0"},{"type":"keyword","name":"time-series","total":"0"},{"type":"keyword","name":"country-afghanistan","total":"1"},{"type":"publisher__name","name":"State Economic Council","total":"1"},{"type":"publisher__name","name":"Committee on International Affairs","total":"2"},{"type":"publisher__name","name":"Advisory Council for Infectious Disease","total":"0"}]} \ No newline at end of file +{ + "theme": { + "facets": [{"type":"theme","name":"Transportation","total":"1"},{"type":"theme","name":"City Planning","total":"3"},{"type":"theme","name":"Finance and Budgeting","total":"0"},{"type":"theme","name":"Public Safety","total":"0"},{"type":"theme","name":"Health Care","total":"0"},{"type":"keyword","name":"hello","total":"1"}] + }, + "keyword": { + "facets": [{"type":"keyword","name":"goodbye","total":"1"},{"type":"keyword","name":"yep","total":"1"},{"type":"keyword","name":"blah","total":"1"},{"type":"keyword","name":"demographics","total":"0"},{"type":"keyword","name":"economy","total":"0"},{"type":"keyword","name":"spatial data","total":"0"},{"type":"keyword","name":"United Kingdom","total":"0"},{"type":"keyword","name":"crime","total":"0"},{"type":"keyword","name":"public safety","total":"0"},{"type":"keyword","name":"socioeconomic","total":"0"},{"type":"keyword","name":"workforce","total":"0"},{"type":"keyword","name":"health","total":"0"},{"type":"keyword","name":"election","total":"2"},{"type":"keyword","name":"politics","total":"1"},{"type":"keyword","name":"transparency","total":"1"},{"type":"keyword","name":"price","total":"0"},{"type":"keyword","name":"time-series","total":"0"},{"type":"keyword","name":"country-afghanistan","total":"1"}] + }, + "publisher": { + "facets": [{"type":"publisher__name","name":"State Economic Council","total":"1"},{"type":"publisher__name","name":"Committee on International Affairs","total":"2"},{"type":"publisher__name","name":"Advisory Council for Infectious Disease","total":"0"}] + } +} \ No newline at end of file diff --git a/cypress/fixtures/facets/economyKeyword.json b/cypress/fixtures/facets/economyKeyword.json index 110d348..2b53c69 100644 --- a/cypress/fixtures/facets/economyKeyword.json +++ b/cypress/fixtures/facets/economyKeyword.json @@ -1 +1,11 @@ -{"facets":[{"type":"theme","name":"Transportation","total":"0"},{"type":"theme","name":"City Planning","total":"0"},{"type":"theme","name":"Finance and Budgeting","total":"3"},{"type":"theme","name":"Public Safety","total":"0"},{"type":"theme","name":"Health Care","total":"0"},{"type":"keyword","name":"hello","total":"0"},{"type":"keyword","name":"goodbye","total":"0"},{"type":"keyword","name":"yep","total":"0"},{"type":"keyword","name":"blah","total":"0"},{"type":"keyword","name":"demographics","total":"1"},{"type":"keyword","name":"economy","total":"3"},{"type":"keyword","name":"spatial data","total":"1"},{"type":"keyword","name":"United Kingdom","total":"1"},{"type":"keyword","name":"crime","total":"0"},{"type":"keyword","name":"public safety","total":"0"},{"type":"keyword","name":"socioeconomic","total":"0"},{"type":"keyword","name":"workforce","total":"0"},{"type":"keyword","name":"health","total":"0"},{"type":"keyword","name":"election","total":"0"},{"type":"keyword","name":"politics","total":"1"},{"type":"keyword","name":"transparency","total":"1"},{"type":"keyword","name":"price","total":"1"},{"type":"keyword","name":"time-series","total":"1"},{"type":"keyword","name":"country-afghanistan","total":"0"},{"type":"publisher__name","name":"State Economic Council","total":"2"},{"type":"publisher__name","name":"Committee on International Affairs","total":"1"},{"type":"publisher__name","name":"Advisory Council for Infectious Disease","total":"0"}]} \ No newline at end of file +{ + "theme": { + "facets": [{"type":"theme","name":"Transportation","total":"0"},{"type":"theme","name":"City Planning","total":"0"},{"type":"theme","name":"Finance and Budgeting","total":"3"},{"type":"theme","name":"Public Safety","total":"0"},{"type":"theme","name":"Health Care","total":"0"}] + }, + "keyword": { + "facets": [{"type":"keyword","name":"hello","total":"0"},{"type":"keyword","name":"goodbye","total":"0"},{"type":"keyword","name":"yep","total":"0"},{"type":"keyword","name":"blah","total":"0"},{"type":"keyword","name":"demographics","total":"1"},{"type":"keyword","name":"economy","total":"3"},{"type":"keyword","name":"spatial data","total":"1"},{"type":"keyword","name":"United Kingdom","total":"1"},{"type":"keyword","name":"crime","total":"0"},{"type":"keyword","name":"public safety","total":"0"},{"type":"keyword","name":"socioeconomic","total":"0"},{"type":"keyword","name":"workforce","total":"0"},{"type":"keyword","name":"health","total":"0"},{"type":"keyword","name":"election","total":"0"},{"type":"keyword","name":"politics","total":"1"},{"type":"keyword","name":"transparency","total":"1"},{"type":"keyword","name":"price","total":"1"},{"type":"keyword","name":"time-series","total":"1"},{"type":"keyword","name":"country-afghanistan","total":"0"}] + }, + "publisher": { + "facets": [{"type":"publisher__name","name":"State Economic Council","total":"2"},{"type":"publisher__name","name":"Committee on International Affairs","total":"1"},{"type":"publisher__name","name":"Advisory Council for Infectious Disease","total":"0"}] + } +} \ No newline at end of file diff --git a/cypress/fixtures/facets/economyUkKeyword.json b/cypress/fixtures/facets/economyUkKeyword.json index dc2f930..e0efcb3 100644 --- a/cypress/fixtures/facets/economyUkKeyword.json +++ b/cypress/fixtures/facets/economyUkKeyword.json @@ -1 +1,11 @@ -{"facets":[{"type":"theme","name":"Transportation","total":"0"},{"type":"theme","name":"City Planning","total":"0"},{"type":"theme","name":"Finance and Budgeting","total":"1"},{"type":"theme","name":"Public Safety","total":"0"},{"type":"theme","name":"Health Care","total":"0"},{"type":"keyword","name":"hello","total":"0"},{"type":"keyword","name":"goodbye","total":"0"},{"type":"keyword","name":"yep","total":"0"},{"type":"keyword","name":"blah","total":"0"},{"type":"keyword","name":"demographics","total":"1"},{"type":"keyword","name":"economy","total":"1"},{"type":"keyword","name":"spatial data","total":"1"},{"type":"keyword","name":"United Kingdom","total":"1"},{"type":"keyword","name":"crime","total":"0"},{"type":"keyword","name":"public safety","total":"0"},{"type":"keyword","name":"socioeconomic","total":"0"},{"type":"keyword","name":"workforce","total":"0"},{"type":"keyword","name":"health","total":"0"},{"type":"keyword","name":"election","total":"0"},{"type":"keyword","name":"politics","total":"0"},{"type":"keyword","name":"transparency","total":"0"},{"type":"keyword","name":"price","total":"0"},{"type":"keyword","name":"time-series","total":"0"},{"type":"keyword","name":"country-afghanistan","total":"0"},{"type":"publisher__name","name":"State Economic Council","total":"0"},{"type":"publisher__name","name":"Committee on International Affairs","total":"1"},{"type":"publisher__name","name":"Advisory Council for Infectious Disease","total":"0"}]} \ No newline at end of file +{ + "theme": { + "facets": [{"type":"theme","name":"Transportation","total":"0"},{"type":"theme","name":"City Planning","total":"0"},{"type":"theme","name":"Finance and Budgeting","total":"1"},{"type":"theme","name":"Public Safety","total":"0"},{"type":"theme","name":"Health Care","total":"0"}] + }, + "keyword": { + "facets": [{"type":"keyword","name":"hello","total":"0"},{"type":"keyword","name":"goodbye","total":"0"},{"type":"keyword","name":"yep","total":"0"},{"type":"keyword","name":"blah","total":"0"},{"type":"keyword","name":"demographics","total":"1"},{"type":"keyword","name":"economy","total":"1"},{"type":"keyword","name":"spatial data","total":"1"},{"type":"keyword","name":"United Kingdom","total":"1"},{"type":"keyword","name":"crime","total":"0"},{"type":"keyword","name":"public safety","total":"0"},{"type":"keyword","name":"socioeconomic","total":"0"},{"type":"keyword","name":"workforce","total":"0"},{"type":"keyword","name":"health","total":"0"},{"type":"keyword","name":"election","total":"0"},{"type":"keyword","name":"politics","total":"0"},{"type":"keyword","name":"transparency","total":"0"},{"type":"keyword","name":"price","total":"0"},{"type":"keyword","name":"time-series","total":"0"},{"type":"keyword","name":"country-afghanistan","total":"0"}] + }, + "publisher": { + "facets": [{"type":"publisher__name","name":"State Economic Council","total":"0"},{"type":"publisher__name","name":"Committee on International Affairs","total":"1"},{"type":"publisher__name","name":"Advisory Council for Infectious Disease","total":"0"}] + } +} \ No newline at end of file diff --git a/cypress/fixtures/facets/goldFulltext.json b/cypress/fixtures/facets/goldFulltext.json index cf6f36b..fbdaf89 100644 --- a/cypress/fixtures/facets/goldFulltext.json +++ b/cypress/fixtures/facets/goldFulltext.json @@ -1 +1,11 @@ -{"facets":[{"type":"theme","name":"Transportation","total":"0"},{"type":"theme","name":"City Planning","total":"0"},{"type":"theme","name":"Finance and Budgeting","total":"1"},{"type":"theme","name":"Public Safety","total":"0"},{"type":"theme","name":"Health Care","total":"0"},{"type":"keyword","name":"hello","total":"0"},{"type":"keyword","name":"goodbye","total":"0"},{"type":"keyword","name":"yep","total":"0"},{"type":"keyword","name":"blah","total":"0"},{"type":"keyword","name":"demographics","total":"0"},{"type":"keyword","name":"economy","total":"1"},{"type":"keyword","name":"spatial data","total":"0"},{"type":"keyword","name":"United Kingdom","total":"0"},{"type":"keyword","name":"crime","total":"0"},{"type":"keyword","name":"public safety","total":"0"},{"type":"keyword","name":"socioeconomic","total":"0"},{"type":"keyword","name":"workforce","total":"0"},{"type":"keyword","name":"health","total":"0"},{"type":"keyword","name":"election","total":"0"},{"type":"keyword","name":"politics","total":"0"},{"type":"keyword","name":"transparency","total":"0"},{"type":"keyword","name":"price","total":"1"},{"type":"keyword","name":"time-series","total":"1"},{"type":"keyword","name":"country-afghanistan","total":"0"},{"type":"publisher__name","name":"State Economic Council","total":"1"},{"type":"publisher__name","name":"Committee on International Affairs","total":"0"},{"type":"publisher__name","name":"Advisory Council for Infectious Disease","total":"0"}]} \ No newline at end of file +{ + "theme": { + "facets": [{"type":"theme","name":"Transportation","total":"0"},{"type":"theme","name":"City Planning","total":"0"},{"type":"theme","name":"Finance and Budgeting","total":"1"},{"type":"theme","name":"Public Safety","total":"0"},{"type":"theme","name":"Health Care","total":"0"}] + }, + "keyword": { + "facets": [{"type":"keyword","name":"hello","total":"0"},{"type":"keyword","name":"goodbye","total":"0"},{"type":"keyword","name":"yep","total":"0"},{"type":"keyword","name":"blah","total":"0"},{"type":"keyword","name":"demographics","total":"0"},{"type":"keyword","name":"economy","total":"1"},{"type":"keyword","name":"spatial data","total":"0"},{"type":"keyword","name":"United Kingdom","total":"0"},{"type":"keyword","name":"crime","total":"0"},{"type":"keyword","name":"public safety","total":"0"},{"type":"keyword","name":"socioeconomic","total":"0"},{"type":"keyword","name":"workforce","total":"0"},{"type":"keyword","name":"health","total":"0"},{"type":"keyword","name":"election","total":"0"},{"type":"keyword","name":"politics","total":"0"},{"type":"keyword","name":"transparency","total":"0"},{"type":"keyword","name":"price","total":"1"},{"type":"keyword","name":"time-series","total":"1"},{"type":"keyword","name":"country-afghanistan","total":"0"}] + }, + "publisher": { + "facets": [{"type":"publisher__name","name":"State Economic Council","total":"1"},{"type":"publisher__name","name":"Committee on International Affairs","total":"0"},{"type":"publisher__name","name":"Advisory Council for Infectious Disease","total":"0"}] + } +} \ No newline at end of file diff --git a/cypress/fixtures/facets/ukKeyword.json b/cypress/fixtures/facets/ukKeyword.json index dc2f930..e0efcb3 100644 --- a/cypress/fixtures/facets/ukKeyword.json +++ b/cypress/fixtures/facets/ukKeyword.json @@ -1 +1,11 @@ -{"facets":[{"type":"theme","name":"Transportation","total":"0"},{"type":"theme","name":"City Planning","total":"0"},{"type":"theme","name":"Finance and Budgeting","total":"1"},{"type":"theme","name":"Public Safety","total":"0"},{"type":"theme","name":"Health Care","total":"0"},{"type":"keyword","name":"hello","total":"0"},{"type":"keyword","name":"goodbye","total":"0"},{"type":"keyword","name":"yep","total":"0"},{"type":"keyword","name":"blah","total":"0"},{"type":"keyword","name":"demographics","total":"1"},{"type":"keyword","name":"economy","total":"1"},{"type":"keyword","name":"spatial data","total":"1"},{"type":"keyword","name":"United Kingdom","total":"1"},{"type":"keyword","name":"crime","total":"0"},{"type":"keyword","name":"public safety","total":"0"},{"type":"keyword","name":"socioeconomic","total":"0"},{"type":"keyword","name":"workforce","total":"0"},{"type":"keyword","name":"health","total":"0"},{"type":"keyword","name":"election","total":"0"},{"type":"keyword","name":"politics","total":"0"},{"type":"keyword","name":"transparency","total":"0"},{"type":"keyword","name":"price","total":"0"},{"type":"keyword","name":"time-series","total":"0"},{"type":"keyword","name":"country-afghanistan","total":"0"},{"type":"publisher__name","name":"State Economic Council","total":"0"},{"type":"publisher__name","name":"Committee on International Affairs","total":"1"},{"type":"publisher__name","name":"Advisory Council for Infectious Disease","total":"0"}]} \ No newline at end of file +{ + "theme": { + "facets": [{"type":"theme","name":"Transportation","total":"0"},{"type":"theme","name":"City Planning","total":"0"},{"type":"theme","name":"Finance and Budgeting","total":"1"},{"type":"theme","name":"Public Safety","total":"0"},{"type":"theme","name":"Health Care","total":"0"}] + }, + "keyword": { + "facets": [{"type":"keyword","name":"hello","total":"0"},{"type":"keyword","name":"goodbye","total":"0"},{"type":"keyword","name":"yep","total":"0"},{"type":"keyword","name":"blah","total":"0"},{"type":"keyword","name":"demographics","total":"1"},{"type":"keyword","name":"economy","total":"1"},{"type":"keyword","name":"spatial data","total":"1"},{"type":"keyword","name":"United Kingdom","total":"1"},{"type":"keyword","name":"crime","total":"0"},{"type":"keyword","name":"public safety","total":"0"},{"type":"keyword","name":"socioeconomic","total":"0"},{"type":"keyword","name":"workforce","total":"0"},{"type":"keyword","name":"health","total":"0"},{"type":"keyword","name":"election","total":"0"},{"type":"keyword","name":"politics","total":"0"},{"type":"keyword","name":"transparency","total":"0"},{"type":"keyword","name":"price","total":"0"},{"type":"keyword","name":"time-series","total":"0"},{"type":"keyword","name":"country-afghanistan","total":"0"}] + }, + "publisher": { + "facets": [{"type":"publisher__name","name":"State Economic Council","total":"0"},{"type":"publisher__name","name":"Committee on International Affairs","total":"1"},{"type":"publisher__name","name":"Advisory Council for Infectious Disease","total":"0"}] + } +} \ No newline at end of file diff --git a/cypress/fixtures/searchFacets.json b/cypress/fixtures/searchFacets.json index 69cf5c0..0921e23 100644 --- a/cypress/fixtures/searchFacets.json +++ b/cypress/fixtures/searchFacets.json @@ -1,134 +1,144 @@ { - "facets": [ - { - "type": "theme", - "name": "Transportation", - "total": "1" - }, - { - "type": "theme", - "name": "City Planning", - "total": "3" - }, - { - "type": "theme", - "name": "Finance and Budgeting", - "total": "3" - }, - { - "type": "theme", - "name": "Public Safety", - "total": "1" - }, - { - "type": "theme", - "name": "Health Care", - "total": "3" - }, - { - "type": "keyword", - "name": "bike-lanes", - "total": "1" - }, - { - "type": "keyword", - "name": "streets", - "total": "1" - }, - { - "type": "keyword", - "name": "infrastructure", - "total": "1" - }, - { - "type": "keyword", - "name": "foreclosures", - "total": "1" - }, - { - "type": "keyword", - "name": "economy", - "total": "3" - }, - { - "type": "keyword", - "name": "affordable-housing", - "total": "1" - }, - { - "type": "keyword", - "name": "housing-markets", - "total": "1" - }, - { - "type": "keyword", - "name": "crime", - "total": "1" - }, - { - "type": "keyword", - "name": "city", - "total": "1" - }, - { - "type": "keyword", - "name": "health", - "total": "3" - }, - { - "type": "keyword", - "name": "asthma", - "total": "1" - }, - { - "type": "keyword", - "name": "demographics", - "total": "1" - }, - { - "type": "keyword", - "name": "election", - "total": "2" - }, - { - "type": "keyword", - "name": "politics", - "total": "2" - }, - { - "type": "keyword", - "name": "transparency", - "total": "2" - }, - { - "type": "keyword", - "name": "price", - "total": "1" - }, - { - "type": "keyword", - "name": "time-series", - "total": "1" - }, - { - "type": "keyword", - "name": "country-afghanistan", - "total": "1" - }, - { - "type": "publisher__name", - "name": "State Economic Council", - "total": "5" - }, - { - "type": "publisher__name", - "name": "National Health Council", - "total": "3" - }, - { - "type": "publisher__name", - "name": "Committee on International Affairs", - "total": "2" - } - ] + "theme": { + "facets": [ + { + "type": "theme", + "name": "Transportation", + "total": "1" + }, + { + "type": "theme", + "name": "City Planning", + "total": "3" + }, + { + "type": "theme", + "name": "Finance and Budgeting", + "total": "3" + }, + { + "type": "theme", + "name": "Public Safety", + "total": "1" + }, + { + "type": "theme", + "name": "Health Care", + "total": "3" + } + ] + }, + "keyword": { + "facets": [ + { + "type": "keyword", + "name": "bike-lanes", + "total": "1" + }, + { + "type": "keyword", + "name": "streets", + "total": "1" + }, + { + "type": "keyword", + "name": "infrastructure", + "total": "1" + }, + { + "type": "keyword", + "name": "foreclosures", + "total": "1" + }, + { + "type": "keyword", + "name": "economy", + "total": "3" + }, + { + "type": "keyword", + "name": "affordable-housing", + "total": "1" + }, + { + "type": "keyword", + "name": "housing-markets", + "total": "1" + }, + { + "type": "keyword", + "name": "crime", + "total": "1" + }, + { + "type": "keyword", + "name": "city", + "total": "1" + }, + { + "type": "keyword", + "name": "health", + "total": "3" + }, + { + "type": "keyword", + "name": "asthma", + "total": "1" + }, + { + "type": "keyword", + "name": "demographics", + "total": "1" + }, + { + "type": "keyword", + "name": "election", + "total": "2" + }, + { + "type": "keyword", + "name": "politics", + "total": "2" + }, + { + "type": "keyword", + "name": "transparency", + "total": "2" + }, + { + "type": "keyword", + "name": "price", + "total": "1" + }, + { + "type": "keyword", + "name": "time-series", + "total": "1" + }, + { + "type": "keyword", + "name": "country-afghanistan", + "total": "1" + } + ] + }, + "publisher": { + "facets": [ + { + "type": "publisher__name", + "name": "State Economic Council", + "total": "5" + }, + { + "type": "publisher__name", + "name": "National Health Council", + "total": "3" + }, + { + "type": "publisher__name", + "name": "Committee on International Affairs", + "total": "2" + } + ] + } } diff --git a/cypress/support/commands.js b/cypress/support/commands.js index a3d2b25..c8759ea 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -1,4 +1,10 @@ import '@testing-library/cypress/add-commands'; +import searchFacets from '../fixtures/searchFacets.json'; +import searchTextFacets from '../fixtures/facets/goldFulltext.json'; +import economyKeywordFacets from "../fixtures/facets/economyKeyword.json"; +import economyUKKeywordFacets from "../fixtures/facets/economyUkKeyword.json"; +import cityPlanningFacets from "../fixtures/facets/cityPlanningTheme.json"; +import ukKeywordFacets from "../fixtures/facets/ukKeyword.json"; Cypress.Commands.add('stubDatastoreImportInfo', () => { cy.intercept(/.*\/datastore\/imports.*/, 'fx:datastoreImportInfo') @@ -9,46 +15,57 @@ Cypress.Commands.add('stubMetadata', () => { }); Cypress.Commands.add('stubDatatable', () => { - cy.fixture('datasetSqlCount').then((res) => { - cy.intercept(/.*\[SELECT%20COUNT\(\*\)%20FROM%20.*/, res) - cy.intercept(/.*\[SELECT%20COUNT\(\*\)%20FROM%20.*price.*/, () => ([{expression: "26"}])) - }) - cy.fixture('datasetSqlResults').then((res) => { - cy.intercept(/.*\/datastore\/query.*/, res) - }) + cy.intercept(/.*\/datastore\/query\/1234abcd\?.*35\.08.*/, { fixture: 'dataset/datasetSqlFilteredResults.json'}); + cy.intercept(/.*\/datastore\/query.*offset=0$/, { fixture: 'dataset/datasetSqlResults.json'}); + + cy.intercept(/.*\/datastore\/query.*offset=0.*&sorts.*asc$/, { fixture: 'dataset/datasetSqlResults.json'}); + cy.intercept(/.*\/datastore\/query.*offset=0.*&sorts.*desc$/, { fixture: 'dataset/datasetResultsSorted.json'}); }); Cypress.Commands.add('stubSearchResults', (path) => { // RESULTS - cy.fixture('searchResults').then((res) => { // DEFAULT URL - cy.intercept(/^(?=.*search\?fulltext=&page=1&page-size=10&sort=modified&sort_order=desc&facets=0).*$/, res).as('resultsDefault'); - cy.intercept(/^(?=.*fulltext=gold)(?=.*facets=0).*$/, { fixture: 'results/goldFulltext.json'}).as('resultsFulltext'); - cy.intercept(/^(?=.*fulltext=&page=1&page-size=10&sort=title)(?=.*facets=0).*$/, { fixture: 'results/titleSort.json'}).as('resultsSortTitle'); - cy.intercept(/^(?=.*&theme=City Planning)(?=.*facets=0).*$/, {fixture: 'results/cityPlanningTheme.json'}).as('resultsTheme'); - cy.intercept(/^(?=.*keyword=economy)(?=.*facets=0).*$/, {fixture: 'results/economyKeyword.json'}).as('resultsKeywordEconomy'); - cy.intercept(/^(?=.*keyword=economy,United Kingdom)(?=.*facets=0).*$/, { fixture: 'results/economyUkKeyword.json'}).as('resultsKeywordEconomyUK'); - cy.intercept(/^(?=.*keyword=United Kingdom)(?=.*facets=0).*$/, {fixture: 'results/ukKeyword.json'}).as('resultsKeywordUK'); - cy.intercept(/^(?=.*publisher__name=Advisory Council for Infectious Disease)(?=.*facets=0).*$/, {fixture: 'results/advisoryPublisher.json'}).as('resultsPubslisher'); - cy.intercept(/^(?=.*page-size=5)(?=.*facets=0).*$/, { fixture: 'results/pageSize.json'}).as('resultsPageSize'); - cy.intercept(/^(?=.*page=2&page-size=5)(?=.*facets=0).*$/, { fixture: 'results/page2.json'}).as('resultsPage2'); - }); + cy.intercept(/^(?=.*search\?fulltext=&page=1&page-size=10&sort=modified&sort-order=desc&facets=0).*$/, { fixture: 'searchResults.json'}); + cy.intercept(/^(?=.*fulltext=gold)(?=.*facets=0).*$/, { fixture: 'results/goldFulltext.json'}); + cy.intercept(/^(?=.*fulltext=&page=1&page-size=10&sort=title)(?=.*facets=0).*$/, { fixture: 'results/titleSort.json'}); + cy.intercept(/^(?=.*&theme=City%20Planning)(?=.*facets=0).*$/, {fixture: 'results/cityPlanningTheme.json'}); + cy.intercept(/^(?=.*keyword=economy)(?=.*facets=0).*$/, {fixture: 'results/economyKeyword.json'}); + cy.intercept(/^(?=.*keyword=economy,United%20Kingdom)(?=.*facets=0).*$/, { fixture: 'results/economyUkKeyword.json'}); + cy.intercept(/^(?=.*keyword=United%20Kingdom)(?=.*facets=0).*$/, {fixture: 'results/ukKeyword.json'}); + cy.intercept(/^(?=.*publisher__name=Advisory%20Council%20for%20Infectious%20Disease)(?=.*facets=0).*$/, {fixture: 'results/advisoryPublisher.json'}).as('resultsPubslisher'); + cy.intercept(/^(?=.*page-size=5)(?=.*facets=0).*$/, { fixture: 'results/pageSize.json'}); + cy.intercept(/^(?=.*page=2&page-size=5)(?=.*facets=0).*$/, { fixture: 'results/page2.json'}); // FACETS - cy.fixture('searchFacets').then((res) => { - // DEFAULT URL - cy.fixture('searchFacets.json').as('searchFacets') - cy.intercept(/^(?=.*search\/facets\?)(?=.*fulltext=&page=1&page-size=10&sort=modified&sort_order=desc).*$/, '@searchFacets').as('facetDefault'); - cy.intercept(/^(?=.*search\/facets\?)(?=.*fulltext=gold).*$/, {fixture: 'facets/goldFulltext.json'}).as('facetFulltext'); - cy.intercept(/^(?=.*search\/facets\?)(?=.*&sort=title).*$/, '@searchFacets').as('facetSortTitle'); - cy.intercept(/^(?=.*search\/facets\?)(?=.*theme=City Planning).*$/, {fixture: 'facets/cityPlanningTheme.json'}).as('facetTheme'); - cy.intercept('GET', /^(?=.*search\/facets\?)(?=.*keyword=economy&).*$/, {fixture: 'facets/economyKeyword.json'}).as('facetKeywordEconomy'); - cy.intercept('GET', /^(?=.*search\/facets\?)(?=.*keyword=economy,United Kingdom).*$/, {fixture: 'facets/economyUkKeyword.json'}).as('facetKeywordEconomyUK'); - cy.intercept('GET', /^(?=.*search\/facets\?)(?=.*keyword=United Kingdom).*$/, {fixture: 'facets/ukKeyword.json'}).as('facetKeywordUK'); - cy.intercept('GET', /^(?=.*search\/facets\?)(?=.*publisher__name=Advisory Council for Infectious Disease).*$/, {fixture: 'facets/advisoryPublisher.json'}).as('facetPublisher'); - cy.intercept('GET', /^(?=.*search\/facets\?)(?=.*page-size=5).*$/, '@searchFacets').as('facetPageSize'); - cy.intercept('GET', /^(?=.*search\/facets\?)(?=.*page=2&page-size=5).*$/, '@searchFacets').as('facetPage2'); - }) + cy.intercept(/^(?=.*search\?fulltext=&page=1&page-size=10&sort=modified&sort-order=desc&facets=theme).*$/, searchFacets.theme); + cy.intercept(/^(?=.*search\?fulltext=&page=1&page-size=10&sort=modified&sort-order=desc&facets=keyword).*$/, searchFacets.keyword); + cy.intercept(/^(?=.*search\?fulltext=&page=1&page-size=10&sort=modified&sort-order=desc&facets=publisher__name).*$/, searchFacets.publisher); + cy.intercept(/^(?=.*fulltext=gold)(?=.*facets=theme).*$/, searchTextFacets.theme); + cy.intercept(/^(?=.*fulltext=gold)(?=.*facets=keyword).*$/, searchTextFacets.keyword); + cy.intercept(/^(?=.*fulltext=gold)(?=.*facets=publisher).*$/, searchTextFacets.publisher); + cy.intercept(/^(?=.*fulltext=&page=1&page-size=10&sort=title)(?=.*facets=theme).*$/, searchFacets.theme); + cy.intercept(/^(?=.*fulltext=&page=1&page-size=10&sort=title)(?=.*facets=keyword).*$/, searchFacets.keyword); + cy.intercept(/^(?=.*fulltext=&page=1&page-size=10&sort=title)(?=.*facets=publisher__name).*$/, searchFacets.publisher); + cy.intercept(/^(?=.*&theme=City%20Planning)(?=.*facets=theme).*$/, cityPlanningFacets.theme); + cy.intercept(/^(?=.*&theme=City%20Planning)(?=.*facets=keyword).*$/, cityPlanningFacets.keyword); + cy.intercept(/^(?=.*&theme=City%20Planning)(?=.*facets=publisher).*$/, cityPlanningFacets.publisher); + cy.intercept('GET', /^(?=.*keyword=economy)(?=.*facets=theme).*$/, economyKeywordFacets.theme); + cy.intercept('GET', /^(?=.*keyword=economy)(?=.*facets=keyword).*$/, economyKeywordFacets.keyword); + cy.intercept('GET', /^(?=.*keyword=economy)(?=.*facets=publisher).*$/, economyKeywordFacets.publisher); + cy.intercept('GET', /^(?=.*keyword=economy,United%20Kingdom)(?=.*facets=theme).*$/, economyUKKeywordFacets.theme); + cy.intercept('GET', /^(?=.*keyword=economy,United%20Kingdom)(?=.*facets=keyword).*$/, economyUKKeywordFacets.keyword); + cy.intercept('GET', /^(?=.*keyword=economy,United%20Kingdom)(?=.*facets=publisher).*$/, economyUKKeywordFacets.publisher); + cy.intercept('GET', /^(?=.*keyword=United%20Kingdom)(?=.*facets=theme).*$/, ukKeywordFacets.theme); + cy.intercept('GET', /^(?=.*keyword=United%20Kingdom)(?=.*facets=keyword).*$/, ukKeywordFacets.keyword); + cy.intercept('GET', /^(?=.*keyword=United%20Kingdom)(?=.*facets=publisher).*$/, ukKeywordFacets.publisher); + cy.intercept('GET', /^(?=.*publisher__name=Advisory%20Council%20for%20Infectious%20Disease)(?=.*facets=.*).*$/, {fixture: 'facets/advisoryPublisher.json'}); + cy.intercept('GET', /^(?=.*page-size=5)(?=.*facets=theme).*$/, searchFacets.theme); + cy.intercept('GET', /^(?=.*page-size=5)(?=.*facets=keyword).*$/, searchFacets.keyword); + cy.intercept('GET', /^(?=.*page-size=5)(?=.*facets=publisher__name).*$/, searchFacets.publisher); + cy.intercept('GET', /^(?=.*page=2&page-size=5)(?=.*facets=theme).*$/, searchFacets.theme); + cy.intercept('GET', /^(?=.*page=2&page-size=5)(?=.*facets=keyword).*$/, searchFacets.keyword); + cy.intercept('GET', /^(?=.*page=2&page-size=5)(?=.*facets=publisher).*$/, searchFacets.publisher); + cy.visit(path) });